1
0
mirror of https://gitlab.com/JKANetwork/CheckServer.git synced 2026-04-04 17:52:01 +02:00

Start again

This commit is contained in:
2020-10-04 17:14:00 +02:00
parent c0d3912413
commit 091f119048
4382 changed files with 1762543 additions and 9606 deletions

View File

@@ -0,0 +1,14 @@
define(function (require) {
return {
getAreaStyle: require('./makeStyleMapper')(
[
['fill', 'color'],
['shadowBlur'],
['shadowOffsetX'],
['shadowOffsetY'],
['opacity'],
['shadowColor']
]
)
};
});

View 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')
};
}
};
});

View File

@@ -0,0 +1,16 @@
define(function (require) {
return {
getItemStyle: require('./makeStyleMapper')(
[
['fill', 'color'],
['stroke', 'borderColor'],
['lineWidth', 'borderWidth'],
['opacity'],
['shadowBlur'],
['shadowOffsetX'],
['shadowOffsetY'],
['shadowColor']
]
)
};
});

View 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]);
}
};
});

View 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;
};
};
});

View 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
);
}
};
});