PHP Classes

File: vendors/gentelella/vendors/echarts/src/preprocessor/helper/compatStyle.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/gentelella/vendors/echarts/src/preprocessor/helper/compatStyle.js   Download  
File: vendors/gentelella/vendors/echarts/src/preprocessor/helper/compatStyle.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 2,826 bytes
 

Contents

Class file image Download
define(function (require) { var zrUtil = require('zrender/core/util'); var POSSIBLE_STYLES = [ 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine' ]; function compatItemStyle(opt) { var itemStyleOpt = opt && opt.itemStyle; if (itemStyleOpt) { zrUtil.each(POSSIBLE_STYLES, function (styleName) { var normalItemStyleOpt = itemStyleOpt.normal; var emphasisItemStyleOpt = itemStyleOpt.emphasis; if (normalItemStyleOpt && normalItemStyleOpt[styleName]) { opt[styleName] = opt[styleName] || {}; if (!opt[styleName].normal) { opt[styleName].normal = normalItemStyleOpt[styleName]; } else { zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]); } normalItemStyleOpt[styleName] = null; } if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) { opt[styleName] = opt[styleName] || {}; if (!opt[styleName].emphasis) { opt[styleName].emphasis = emphasisItemStyleOpt[styleName]; } else { zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]); } emphasisItemStyleOpt[styleName] = null; } }); } } return function (seriesOpt) { if (!seriesOpt) { return; } compatItemStyle(seriesOpt); compatItemStyle(seriesOpt.markPoint); compatItemStyle(seriesOpt.markLine); var data = seriesOpt.data; if (data) { for (var i = 0; i < data.length; i++) { compatItemStyle(data[i]); } // mark point data var markPoint = seriesOpt.markPoint; if (markPoint && markPoint.data) { var mpData = markPoint.data; for (var i = 0; i < mpData.length; i++) { compatItemStyle(mpData[i]); } } // mark line data var markLine = seriesOpt.markLine; if (markLine && markLine.data) { var mlData = markLine.data; for (var i = 0; i < mlData.length; i++) { if (zrUtil.isArray(mlData[i])) { compatItemStyle(mlData[i][0]); compatItemStyle(mlData[i][1]); } else { compatItemStyle(mlData[i]); } } } } }; });