You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2019/05/28 09:01:55 UTC

[incubator-echarts] branch master updated: fix: bug when graph data is number typed. Fix #10485

This is an automated email from the ASF dual-hosted git repository.

ovilia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/master by this push:
     new 01a78a3  fix: bug when graph data is number typed. Fix #10485
01a78a3 is described below

commit 01a78a38fdedc335652ae5015de01568be12db39
Author: Ovilia <zw...@gmail.com>
AuthorDate: Mon May 27 17:25:02 2019 +0800

    fix: bug when graph data is number typed. Fix #10485
---
 src/data/Graph.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/data/Graph.js b/src/data/Graph.js
index 310a2fc..d86ab0c 100644
--- a/src/data/Graph.js
+++ b/src/data/Graph.js
@@ -101,7 +101,7 @@ graphProto.isDirected = function () {
  * @param {number} [dataIndex]
  */
 graphProto.addNode = function (id, dataIndex) {
-    id = id || ('' + dataIndex);
+    id = id == null ? ('' + dataIndex) : ('' + id);
 
     var nodesMap = this._nodesMap;
 


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