react-d3-graph
react-d3-graph copied to clipboard
How to style the svg component?
Describe the solution you'd like Arbitrary CSS style of the SVG component. For instance, setting the background-color or border. Currently, only width and height are possible, maybe we could set the full SVG style in the config?
Describe your use case Want to set a background-color and border for the canvas and I'm able to do it in the browser by changing the style directly in the source code.
Describe alternatives you've considered I might try and add this feature myself if you point me in the right direction.
Hi @henri-edinb ,
You could style a container div without having to style the graph for most props, example here : codesandbox.
Is this a good enough solution or do you need more customization?
yeah i tried that, but sometimes it doesn't work very well because the svg component is smaller than the container.. i proposed a simple solution in issue #429 but I'm not sure that the solution is that simple, if it's more complex I guess its not really worth it to spend much time on it cause this div solution seems to work for most cases. thanks!