PHP Classes

File: vendors/gentelella/vendors/echarts/src/chart/sankey/sankeyVisual.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/gentelella/vendors/echarts/src/chart/sankey/sankeyVisual.js   Download  
File: vendors/gentelella/vendors/echarts/src/chart/sankey/sankeyVisual.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: 1,318 bytes
 

Contents

Class file image Download
define(function (require) { var VisualMapping = require('../../visual/VisualMapping'); return function (ecModel, payload) { ecModel.eachSeriesByType('sankey', function (seriesModel) { var graph = seriesModel.getGraph(); var nodes = graph.nodes; nodes.sort(function (a, b) { return a.getLayout().value - b.getLayout().value; }); var minValue = nodes[0].getLayout().value; var maxValue = nodes[nodes.length - 1].getLayout().value; nodes.forEach(function (node) { var mapping = new VisualMapping({ type: 'color', mappingMethod: 'linear', dataExtent: [minValue, maxValue], visual: seriesModel.get('color') }); var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); node.setVisual('color', mapValueToColor); // If set itemStyle.normal.color var itemModel = node.getModel(); var customColor = itemModel.get('itemStyle.normal.color'); if (customColor != null) { node.setVisual('color', customColor); } }); }) ; }; });