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 2020/05/15 16:57:44 UTC

[GitHub] [incubator-echarts] plainheart commented on a change in pull request #12367: fix(tree): the symbols of image type do not display at the first rendering. close #12279.

plainheart commented on a change in pull request #12367:
URL: https://github.com/apache/incubator-echarts/pull/12367#discussion_r425930387



##########
File path: src/chart/tree/TreeView.js
##########
@@ -379,9 +379,8 @@ function updateNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope)
         // Fix #12279.
         // if the type of symbol is image,
         // update symbol's data immediately but not wait until the next update rendering.
-        var symbolType = symbolEl._symbolType;
-        symbolType.indexOf('image://') === 0 
-            && symbolEl.updateData(data, dataIndex, seriesScope);
+        var symbolType = symbolEl.getSymbolPath().type;
+        symbolType === 'image' && symbolEl.updateData(data, dataIndex, seriesScope);

Review comment:
       I'm thinking which scheme will be better here?
   
   Before
   ```js
   var symbolType = symbolEl._symbolType; // easy to get, but it is private, can I access it here?
   symbolType.indexOf('image://') === 0 && symbolEl.updateData(data, dataIndex, seriesScope);
   ```
   Now
   ```js
   var symbolType = symbolEl.getSymbolPath().type;
   symbolType === 'image' && symbolEl.updateData(data, dataIndex, seriesScope);
   ```




----------------------------------------------------------------
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