You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/05/13 06:06:20 UTC

[GitHub] [echarts] pissang commented on a change in pull request #14930: fix(treemap): error when running setOption twice with diff data

pissang commented on a change in pull request #14930:
URL: https://github.com/apache/echarts/pull/14930#discussion_r631587830



##########
File path: src/chart/treemap/TreemapSeries.ts
##########
@@ -370,7 +370,7 @@ class TreemapSeriesModel extends SeriesModel<TreemapSeriesOption> {
         function beforeLink(nodeData: List) {
             nodeData.wrapMethod('getItemModel', function (model, idx) {
                 const node = tree.getNodeByDataIndex(idx);
-                const levelModel = levelModels[node.depth];
+                const levelModel = levelModels[node ? node.depth : undefined];

Review comment:
       It's more clear to write as:
   ```
   const levelModel = node ? levelModels[node.depth] : null;
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org