100pah commented on a change in pull request #10084: Update sankey diagram with
levels setting, reducing code size and so on.
URL:
https://github.com/apache/incubator-echarts/pull/10084#discussion_r264219797
##########
File path: src/chart/sankey/SankeySeries.js
##########
@@ -25,26 +25,55 @@
import SeriesModel from '../../model/Series';
import createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge';
import {encodeHTML} from '../../util/format';
+import Model from '../../model/Model';
var SankeySeries = SeriesModel.extend({
type: 'series.sankey',
layoutInfo: null,
+ levelModels: null,
+
/**
* Init a graph data structure from data in option series
*
* @param {Object} option the object used to config echarts view
* @return {module:echarts/data/List} storage initial data
*/
- getInitialData: function (option) {
+ getInitialData: function (option, ecModel) {
var links = option.edges || option.links;
var nodes = option.data || option.nodes;
+ var levels = option.levels;
+ var levelModels = this.levelModels = {};
+
+ for (var i = 0; i < levels.length; i++) {
Review comment:
If `option.levels` is `undefined`, error here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]