mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-04-04 17:52:01 +02:00
Start again
This commit is contained in:
14
vendors/echarts/src/model/mixin/areaStyle.js
vendored
Normal file
14
vendors/echarts/src/model/mixin/areaStyle.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
define(function (require) {
|
||||
return {
|
||||
getAreaStyle: require('./makeStyleMapper')(
|
||||
[
|
||||
['fill', 'color'],
|
||||
['shadowBlur'],
|
||||
['shadowOffsetX'],
|
||||
['shadowOffsetY'],
|
||||
['opacity'],
|
||||
['shadowColor']
|
||||
]
|
||||
)
|
||||
};
|
||||
});
|
||||
15
vendors/echarts/src/model/mixin/boxLayout.js
vendored
Normal file
15
vendors/echarts/src/model/mixin/boxLayout.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
define(function (require) {
|
||||
|
||||
return {
|
||||
getBoxLayoutParams: function () {
|
||||
return {
|
||||
left: this.get('left'),
|
||||
top: this.get('top'),
|
||||
right: this.get('right'),
|
||||
bottom: this.get('bottom'),
|
||||
width: this.get('width'),
|
||||
height: this.get('height')
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
16
vendors/echarts/src/model/mixin/itemStyle.js
vendored
Normal file
16
vendors/echarts/src/model/mixin/itemStyle.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
define(function (require) {
|
||||
return {
|
||||
getItemStyle: require('./makeStyleMapper')(
|
||||
[
|
||||
['fill', 'color'],
|
||||
['stroke', 'borderColor'],
|
||||
['lineWidth', 'borderWidth'],
|
||||
['opacity'],
|
||||
['shadowBlur'],
|
||||
['shadowOffsetX'],
|
||||
['shadowOffsetY'],
|
||||
['shadowColor']
|
||||
]
|
||||
)
|
||||
};
|
||||
});
|
||||
27
vendors/echarts/src/model/mixin/lineStyle.js
vendored
Normal file
27
vendors/echarts/src/model/mixin/lineStyle.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
define(function (require) {
|
||||
var getLineStyle = require('./makeStyleMapper')(
|
||||
[
|
||||
['lineWidth', 'width'],
|
||||
['stroke', 'color'],
|
||||
['opacity'],
|
||||
['shadowBlur'],
|
||||
['shadowOffsetX'],
|
||||
['shadowOffsetY'],
|
||||
['shadowColor']
|
||||
]
|
||||
);
|
||||
return {
|
||||
getLineStyle: function (excludes) {
|
||||
var style = getLineStyle.call(this, excludes);
|
||||
var lineDash = this.getLineDash();
|
||||
lineDash && (style.lineDash = lineDash);
|
||||
return style;
|
||||
},
|
||||
|
||||
getLineDash: function () {
|
||||
var lineType = this.get('type');
|
||||
return (lineType === 'solid' || lineType == null) ? null
|
||||
: (lineType === 'dashed' ? [5, 5] : [1, 1]);
|
||||
}
|
||||
};
|
||||
});
|
||||
28
vendors/echarts/src/model/mixin/makeStyleMapper.js
vendored
Normal file
28
vendors/echarts/src/model/mixin/makeStyleMapper.js
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// TODO Parse shadow style
|
||||
// TODO Only shallow path support
|
||||
define(function (require) {
|
||||
var zrUtil = require('zrender/core/util');
|
||||
|
||||
return function (properties) {
|
||||
// Normalize
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
if (!properties[i][1]) {
|
||||
properties[i][1] = properties[i][0];
|
||||
}
|
||||
}
|
||||
return function (excludes) {
|
||||
var style = {};
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var propName = properties[i][1];
|
||||
if (excludes && zrUtil.indexOf(excludes, propName) >= 0) {
|
||||
continue;
|
||||
}
|
||||
var val = this.getShallow(propName);
|
||||
if (val != null) {
|
||||
style[properties[i][0]] = val;
|
||||
}
|
||||
}
|
||||
return style;
|
||||
};
|
||||
};
|
||||
});
|
||||
52
vendors/echarts/src/model/mixin/textStyle.js
vendored
Normal file
52
vendors/echarts/src/model/mixin/textStyle.js
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
define(function (require) {
|
||||
|
||||
var textContain = require('zrender/contain/text');
|
||||
|
||||
function getShallow(model, path) {
|
||||
return model && model.getShallow(path);
|
||||
}
|
||||
|
||||
return {
|
||||
/**
|
||||
* Get color property or get color from option.textStyle.color
|
||||
* @return {string}
|
||||
*/
|
||||
getTextColor: function () {
|
||||
var ecModel = this.ecModel;
|
||||
return this.getShallow('color')
|
||||
|| (ecModel && ecModel.get('textStyle.color'));
|
||||
},
|
||||
|
||||
/**
|
||||
* Create font string from fontStyle, fontWeight, fontSize, fontFamily
|
||||
* @return {string}
|
||||
*/
|
||||
getFont: function () {
|
||||
var ecModel = this.ecModel;
|
||||
var gTextStyleModel = ecModel && ecModel.getModel('textStyle');
|
||||
return [
|
||||
// FIXME in node-canvas fontWeight is before fontStyle
|
||||
this.getShallow('fontStyle') || getShallow(gTextStyleModel, 'fontStyle'),
|
||||
this.getShallow('fontWeight') || getShallow(gTextStyleModel, 'fontWeight'),
|
||||
(this.getShallow('fontSize') || getShallow(gTextStyleModel, 'fontSize') || 12) + 'px',
|
||||
this.getShallow('fontFamily') || getShallow(gTextStyleModel, 'fontFamily') || 'sans-serif'
|
||||
].join(' ');
|
||||
},
|
||||
|
||||
getTextRect: function (text) {
|
||||
var textStyle = this.get('textStyle') || {};
|
||||
return textContain.getBoundingRect(
|
||||
text,
|
||||
this.getFont(),
|
||||
textStyle.align,
|
||||
textStyle.baseline
|
||||
);
|
||||
},
|
||||
|
||||
ellipsis: function (text, containerWidth, options) {
|
||||
return textContain.ellipsis(
|
||||
text, this.getFont(), containerWidth, options
|
||||
);
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user