Make node.renderLabel available at node level
See original GitHub issueDescribe the bug I’d like to show the label information only when the user hovers over the nodes. Since there is already a renderLabel property on the nodes, I tried to change it in combination with onMouseOverNode and onMouseOutNode but unfortunately, the labels are not shown.
To Reproduce Steps to reproduce the behavior:
- Create a graph
- Add some node data, set renderLabel in the global node config to false
- Implement onMouseOverNode and onMouseOutNode (size is changed for reference)
onMouseOverNode = function(nodeId) {
const data = this.state.data;
data.nodes = data.nodes.map(node => {
if (node.id === nodeId) {
node.renderLabel = true;
node.size = 1000;
}
return node;
});
this.setState({ data });
};
onMouseOutNode = function(nodeId) {
const data = this.state.data;
data.nodes = data.nodes.map(node => {
if (node.id === nodeId) {
node.renderLabel = false;
node.size = 400;
}
return node;
});
this.setState({ data });
};
- See that the size is changed on hovering but the labels are not shown
Expected behavior The labels of the currently hovered node should be visible and the node size should be changed
Screenshots
Environment:
- OS: Win10 1803
- Browser: Chrome
- Version: 73.0.3683
- Node version: 11.13
- react-d3-graph version 2.0.1
- d3 version: d3-force 2.0.1
- react version: 16.4.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
react-d3-graph 0.3.0 | Docs
These properties can be defined in the graph payload at a node level. ... will be applied to the node if no color...
Read more >Universal abstract-level database for Node.js and browsers.
This is a convenience package that exports classic-level in Node.js and browser-level in ... If a key was not found, the relevant value...
Read more >Features and behavior - Storybook
Features and behavior ; showRoots, Boolean, Display the top-level nodes as a "root" in the sidebar ; collapsedRoots, Array, Set of root node...
Read more >Top-level await is available in Node.js modules - Stefan Judis
Node.js is a beautiful tool to write quick utility scripts. I use it in many of my build processes. Renaming files, downloading data, ......
Read more >Node.js 18 is now available!
New globally available browser-compatible APIs · Test runner module (experimental) · Toolchain and Compiler Upgrades · Build-time user-land ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
sorry for the delay i got busy with university 😃 i will dive back into it today or tommorow
Thank you very much, looking forward to have this feature. It would be also great to have the same behavior for links.