Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to add formatting to the node name as well (such a going to a new line, add Padding , colors. etc.)? #11

Open
aamirkhancr7 opened this issue Mar 29, 2020 · 5 comments

Comments

@aamirkhancr7
Copy link

chartData: {
nodes: [
{name: 'Node A',},
{name: 'Node B'},
{name: 'Node C'},
{name: 'Node D'},
{name: 'Node E'},
],
...
},

@kevinwarne
Copy link
Contributor

You can read about sankey config options on this table.

There you will say that the node object can have color, labelWrapLength, padding, .. props. Hope this helps!

@aamirkhancr7
Copy link
Author

Hi, just checked out the documentation. There isn't an option to change the font-color and the background for the label alone. Setting the color propery changes the background instead.
chartData: {
nodes: [
{name: 'Node A', color: '#fbbb00'},
{name: 'Node B'}
],
...
},

@kevinwarne
Copy link
Contributor

If you want to change all of the node label colors you can do this with CSS.

.d2b-sankey-node text {
    fill: red;
}

https://codesandbox.io/s/d2b-sankey-default-demo-co01x

@aamirkhancr7
Copy link
Author

Just tried this.. But this seems to change the font color rather than the background color of the label

@kevinwarne
Copy link
Contributor

Unfortunately the label is done using an svg text element. And svg text element don't have a background component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants