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

pathColorMap prop not working with keys that are not camelCased #42

Open
dkim67 opened this issue Sep 13, 2019 · 1 comment
Open

pathColorMap prop not working with keys that are not camelCased #42

dkim67 opened this issue Sep 13, 2019 · 1 comment

Comments

@dkim67
Copy link

dkim67 commented Sep 13, 2019

It seems if the path name values are not camelCased, it doesn't seem to render the corresponding color value.

const pathColorMap = {
Ate23 Z1: "#00008b"
Kile23 Zsd1: "#00008b"
Byte23 : "#00008b"
Ate24 21: "#00008b"
}

or

const pathColorMap = {
"Ate23 Z1": "#00008b"
"Kile23 Zsd1": "#00008b"
"Byte23" : "#00008b"
"Ate24 21": "#00008b"
}

The component does not seem to support either of these formats

@sartaj10
Copy link
Contributor

sartaj10 commented Jul 8, 2022

You need to make sure that the topology that you're passing contains a key "paths" which is an array of different paths available. Each element in the array is dict containing keys such as "ends", "steps" and "name". Here, "name" is important and if you set that correctly, this code should work fine

You can look at it here - https://github.com/esnet/react-network-diagrams/blob/master/packages/website/src/examples/paths/topo.json#L1921

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