Marker color isn't set for individually colored links
See original GitHub issueDescribe the bug When setting link colors in the graph data for directed graphs, the marker/arrowhead’s color stays the color that was defined in the global graph config. This also happens when link colors aren’t explicitly set in the graph config.
To Reproduce Steps to reproduce the behavior:
- Go to the sandbox
- Tick the
directed
box - In the
link.color
box, set the color to anything that isn’t the default#d3d3d3
- The links themselves should now be colored, but the markers/arrowheads stay gray
Expected behavior Markers should update to use the color of the link they’re attached to.
Screenshots
With no link color set in the graph config:
With link color set to #0000ff
in the graph config:
Environment:
- OS: Windows 10
- Browser: firefox
- Version: 70.0
- Node version: 12.13.0
- react-d3-graph version: 2.3.0
- d3 version: 5.12.0
- react version: 16.11.0
Additional context The code used to create the graph in the above screenshots is available
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Excel 2013: Unable to work with the graph markers
Is there some way to change the markers independently? Obviously I want to customize the colors of each data set independent of the...
Read more >How to Change Marker Colors in Google Maps
To edit the marker color, click or tap on the marker icon. When you do that, you can change both the color of...
Read more >How to set individual color for marker in Jqplot - Stack Overflow
I'm not sure you can specify multiple colors for a single serie. Either you can divide your serie into several series (ex. 4...
Read more >How can I change the color of multiple markers on the map at ...
I'm afraid it isn't possible to change the colour of multiple markers at the same time if you are using individual styles.
Read more >Help! Individual marker colors will not change in scatter chart
Visualizations>Format Visual>Markers>Colors>Show All and then change the color for the individual value/marker. I do that now and absolutely nothing happens ...
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
I’ve recently revisited my project to make a few improvements, so this is great timing. My current thoughts are that it might be easier to render and cache markers when individual links are rendered, then build a defs containing the cached markers that are needed in the graph. That way, each individual link can ensure the specific marker they need is rendered, and only markers which are actually being used in the graph would be rendered.
I’m still a little unsure about how to pull off the defs building part, but I’ll put up a pull request if I have an a-ha moment. I’m very much a web development novice, and while I’m starting to appreciate the elegance of the renderer code, I’d be lying if I said it didn’t leave me a little confused. 😄
Hey @zofbanach, I don’t have the time to look into this one at the moment. PRs are always welcome 🙂