itemStyle.js 731 B

12345678910111213141516
  1. var makeStyleMapper = require("./makeStyleMapper");
  2. var getItemStyle = makeStyleMapper([['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['textPosition'], ['textAlign']]);
  3. var _default = {
  4. getItemStyle: function (excludes, includes) {
  5. var style = getItemStyle(this, excludes, includes);
  6. var lineDash = this.getBorderLineDash();
  7. lineDash && (style.lineDash = lineDash);
  8. return style;
  9. },
  10. getBorderLineDash: function () {
  11. var lineType = this.get('borderType');
  12. return lineType === 'solid' || lineType == null ? null : lineType === 'dashed' ? [5, 5] : [1, 1];
  13. }
  14. };
  15. module.exports = _default;