Skip to content

Commit

Permalink
[change] Show element info on hover
Browse files Browse the repository at this point in the history
closes #130
  • Loading branch information
totallynotvaishnav committed Jun 13, 2022
1 parent 7139b21 commit f6a8bce
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/js/netjsongraph.render.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ class NetJSONGraphRender {
const commonOption = _this.utils.deepMergeObj(
{
// Show element's detail when hover
//
// tooltip: {
// confine: true,
// formatter: params => {
// if (params.componentSubType === "graph") {
// return params.dataType === "edge"
// ? _this.utils.linkInfo(params.data)
// : _this.utils.nodeInfo(params.data);
// } else if (params.componentSubType === "graphGL") {
// return _this.utils.nodeInfo(params.data);
// } else {
// return params.componentSubType === "lines"
// ? _this.utils.linkInfo(params.data.link)
// : _this.utils.nodeInfo(params.data.node);
// }
// }
// }

tooltip: {
confine: true,
formatter: (params) => {
if (params.componentSubType === "graph") {
return params.dataType === "edge"
? _this.utils.linkInfo(params.data)
: _this.utils.nodeInfo(params.data);
}
if (params.componentSubType === "graphGL") {
return _this.utils.nodeInfo(params.data);
}
return params.componentSubType === "lines"
? _this.utils.linkInfo(params.data.link)
: _this.utils.nodeInfo(params.data.node);
},
},
},
configs.echartsOption,
);
Expand Down

0 comments on commit f6a8bce

Please sign in to comment.