提交 358bda1c 编写于 作者: P pah100

colorA S L -> colorAlpha Saturation Lightness

上级 90c27ac8
......@@ -83,18 +83,18 @@ define(function(require) {
itemStyle: {
normal: {
color: null, // 各异 如不需,可设为'none'
colorA: null, // 默认不设置 如不需,可设为'none'
colorS: null, // 默认不设置 如不需,可设为'none'
colorAlpha: null, // 默认不设置 如不需,可设为'none'
colorSaturation: null, // 默认不设置 如不需,可设为'none'
borderWidth: 0,
gapWidth: 0,
borderColor: '#fff',
borderColorS: null // 如果设置,则borderColor的设置无效,而是取当前节点计算出的颜色,再经由borderColorS处理。
borderColorSaturation: null // 如果设置,则borderColor的设置无效,而是取当前节点计算出的颜色,再经由borderColorSaturation处理。
},
emphasis: {}
},
color: 'none', // 为数组,表示同一level的color 选取列表。默认空,在level[0].color中取系统color列表。
colorA: null, // 为数组,表示同一level的color alpha 选取范围。
colorS: null, // 为数组,表示同一level的color alpha 选取范围。
colorAlpha: null, // 为数组,表示同一level的color alpha 选取范围。
colorSaturation: null, // 为数组,表示同一level的color alpha 选取范围。
colorMappingBy: 'index', // 'value' or 'index' or 'id'.
visibleMin: 10, // If area less than this threshold (unit: pixel^2), node will not be rendered.
// Only works when sort is 'asc' or 'desc'.
......
......@@ -55,12 +55,12 @@ define(function (require) {
// calculate border color
var borderColor = nodeItemStyleModel.get('borderColor');
var borderColorS = nodeItemStyleModel.get('borderColorS');
var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');
var thisNodeColor;
if (borderColorS != null) {
if (borderColorSaturation != null) {
// For performance, do not always execute 'calculateColor'.
thisNodeColor = calculateColor(visuals, node);
borderColor = calculateBorderColor(borderColorS, thisNodeColor);
borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);
}
node.setVisual('borderColor', borderColor);
......@@ -97,7 +97,7 @@ define(function (require) {
) {
var visuals = zrUtil.extend({}, designatedVisual);
zrUtil.each(['color', 'colorA', 'colorS'], function (visualName) {
zrUtil.each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {
// Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel
var val = nodeItemStyleModel.get(visualName, true); // Ignore parent
val == null && levelItemStyle && (val = levelItemStyle[visualName]);
......@@ -114,22 +114,22 @@ define(function (require) {
var color = getValueVisualDefine(visuals, 'color');
if (color) {
var colorA = getValueVisualDefine(visuals, 'colorA');
var colorS = getValueVisualDefine(visuals, 'colorS');
if (colorS) {
color = zrColor.modifyHSL(color, null, null, colorS);
var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');
var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');
if (colorSaturation) {
color = zrColor.modifyHSL(color, null, null, colorSaturation);
}
if (colorA) {
color = zrColor.modifyAlpha(color, colorA);
if (colorAlpha) {
color = zrColor.modifyAlpha(color, colorAlpha);
}
return color;
}
}
function calculateBorderColor(borderColorS, thisNodeColor) {
function calculateBorderColor(borderColorSaturation, thisNodeColor) {
return thisNodeColor != null
? zrColor.modifyHSL(thisNodeColor, null, null, borderColorS)
? zrColor.modifyHSL(thisNodeColor, null, null, borderColorSaturation)
: null;
}
......@@ -152,8 +152,8 @@ define(function (require) {
visuals.color != null
&& visuals.color !== 'none'
&& (
getRangeVisual(nodeModel, 'colorA')
|| getRangeVisual(nodeModel, 'colorS')
getRangeVisual(nodeModel, 'colorAlpha')
|| getRangeVisual(nodeModel, 'colorSaturation')
)
);
......
......@@ -50,10 +50,10 @@ define(function(require) {
categories: null, // 描述 category 数据。如:['some1', 'some2', 'some3'],设置后,min max失效。
dimension: null,
inRange: null, // 'color', 'colorH', 'colorS', 'colorL', 'colorA',
inRange: null, // 'color', 'colorH', 'colorSaturation', 'colorLightness', 'colorAlpha',
// 'symbol', 'symbolSize'
outOfRange: null, // 'color', 'colorH', 'colorS', 'colorL', 'colorA',
outOfRange: null, // 'color', 'colorH', 'colorSaturation', 'colorLightness', 'colorAlpha',
// 'symbol', 'symbolSize'
orient: 'vertical', // 布局方式,默认为垂直布局,可选为:
......@@ -378,7 +378,7 @@ define(function(require) {
var itemSize = this.itemSize;
var visuals = controller[state];
// Set inactive color for controller if no other color attr (like colorA) specified.
// Set inactive color for controller if no other color attr (like colorAlpha) specified.
if (!visuals) {
visuals = controller[state] = {
color: isCategory ? inactiveColor : [inactiveColor]
......
......@@ -21,7 +21,7 @@ define(function(require) {
itemHeight: 14, // 值域图形高度,线性渐变垂直布局高度为该值 * 10
itemSymbol: 'roundRect',
splitList: null, // 值顺序:由高到低, item can be:
// {min, max, value, color, colorS, colorA, symbol, symbolSize}
// {min, max, value, color, colorSaturation, colorAlpha, symbol, symbolSize}
selectedMode: 'multiple',
itemGap: 10 // 各个item之间的间隔,单位px,默认为10,
// 横向布局时为水平间隔,纵向布局时为纵向间隔
......
......@@ -131,15 +131,15 @@ define(function (require) {
}
},
colorS: makePartialColorVisualHandler(function (color, value) {
colorSaturation: makePartialColorVisualHandler(function (color, value) {
return zrColor.modifyHSL(color, null, value);
}),
colorL: makePartialColorVisualHandler(function (color, value) {
colorLightness: makePartialColorVisualHandler(function (color, value) {
return zrColor.modifyHSL(color, null, null, value);
}),
colorA: makePartialColorVisualHandler(function (color, value) {
colorAlpha: makePartialColorVisualHandler(function (color, value) {
return zrColor.modifyAlpha(color, value);
}),
......@@ -400,7 +400,7 @@ define(function (require) {
};
/**
* 'color', 'colorS', 'colorA', ... are in the same visualCluster named 'color'.
* 'color', 'colorSaturation', 'colorAlpha', ... are in the same visualCluster named 'color'.
* Other visuals are in the cluster named as the same as theirselves.
*
* @public
......@@ -432,11 +432,11 @@ define(function (require) {
};
/**
* Give order to visual types, considering colorS, colorA depends on color.
* Give order to visual types, considering colorSaturation, colorAlpha depends on color.
*
* @public
* @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorS: ...}
* IF Array, like: ['color', 'symbol', 'colorS']
* @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}
* IF Array, like: ['color', 'symbol', 'colorSaturation']
* @return {Array.<string>} Sorted visual types.
*/
VisualMapping.prepareVisualTypes = function (visualTypes) {
......@@ -455,7 +455,7 @@ define(function (require) {
}
visualTypes.sort(function (type1, type2) {
// color should be front of colorS, colorA, ...
// color should be front of colorSaturation, colorAlpha, ...
// symbol and symbolSize do not matter.
return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0)
? 1 : -1;
......
......@@ -30,17 +30,17 @@ define(function (require) {
inactive: ['rgba(0,0,0,0)']
},
colorS: {
colorSaturation: {
active: [0.3, 1],
inactive: [0, 0]
},
colorL: {
colorLightness: {
active: [0.9, 0.5],
inactive: [0, 0]
},
colorA: {
colorAlpha: {
active: [0.3, 1],
inactive: [0, 0]
},
......
......@@ -182,7 +182,7 @@
color: '#fff'
},
inRange: {
colorL: [1, .5]
colorLightness: [1, .5]
},
outOfRange: {
color: ['rgba(255,255,255,.2)']
......
......@@ -66,7 +66,7 @@
option1.dataRange.max = 250;
option2.dataRange.inRange = {
colorL: [1, 0.5]
colorLightness: [1, 0.5]
};
option2.dataRange.outOfRange = {
color: ['rgba(255,255,255,.2)']
......
......@@ -91,7 +91,7 @@
color: ['rgb(20,1,0)']
},
outOfRange: {
colorA: [0.3, 1]
colorAlpha: [0.3, 1]
}
}
],
......
......@@ -138,7 +138,7 @@
text: ['', ''],
backgroundColor: '#eee',
visualSelected: {
type: 'colorS'
type: 'colorSaturation'
}
},
{
......@@ -152,7 +152,7 @@
text: ['', ''],
backgroundColor: '#eee',
visualSelected: {
type: 'colorL'
type: 'colorLightness'
}
},
{
......@@ -165,7 +165,7 @@
text: ['', ''],
backgroundColor: '#eee',
visualSelected: {
type: 'colorA'
type: 'colorAlpha'
}
}
],
......
......@@ -134,7 +134,7 @@
dimension: 'dim3',
backgroundColor: '#eee',
visualSelected: {
type: 'colorS'
type: 'colorSaturation'
}
},
{
......@@ -147,7 +147,7 @@
dimension: 'dim3',
backgroundColor: '#eee',
visualSelected: {
type: 'colorL'
type: 'colorLightness'
}
},
{
......@@ -159,7 +159,7 @@
dimension: 'dim3',
backgroundColor: '#eee',
visualSelected: {
type: 'colorA'
type: 'colorAlpha'
}
}
],
......
......@@ -142,7 +142,7 @@
inverse: true,
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorS'
inRange: 'colorSaturation'
},
{
x: 'right',
......@@ -155,7 +155,7 @@
selectedMode: 'multiple',
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorL'
inRange: 'colorLightness'
},
{
y: 40,
......@@ -167,7 +167,7 @@
selectedMode: 'multiple',
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorA'
inRange: 'colorAlpha'
},
{
x: 'center',
......@@ -180,7 +180,7 @@
selectedMode: 'multiple',
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorA'
inRange: 'colorAlpha'
}
],
series: [
......
......@@ -138,7 +138,7 @@
inverse: true,
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorS'
inRange: 'colorSaturation'
},
{
x: 'right',
......@@ -150,7 +150,7 @@
selectedMode: 'multiple',
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorL'
inRange: 'colorLightness'
},
{
y: 40,
......@@ -161,7 +161,7 @@
selectedMode: 'multiple',
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorA'
inRange: 'colorAlpha'
},
{
x: 'center',
......@@ -173,7 +173,7 @@
selectedMode: 'multiple',
dimension: 'dim3',
backgroundColor: '#eee',
inRange: 'colorA'
inRange: 'colorAlpha'
}
],
series: [
......
......@@ -62,7 +62,7 @@
dataRange: {
max: 100,
inRange: {
colorS: [1, 0.3]
colorSaturation: [1, 0.3]
}
},
animationDurationUpdate: 1500,
......
......@@ -119,11 +119,11 @@
}
},
{
colorS: [0.35, 0.5],
colorSaturation: [0.35, 0.5],
itemStyle: {
normal: {
gapWidth: 1,
borderColorS: 0.6
borderColorSaturation: 0.6
}
}
}
......
......@@ -220,7 +220,7 @@
}
},
{
colorA: mode === 2
colorAlpha: mode === 2
? [0.5, 1] : null,
itemStyle: {
normal: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册