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

Node/Edge level options #25

Closed
bpellens opened this issue Jan 16, 2017 · 4 comments
Closed

Node/Edge level options #25

bpellens opened this issue Jan 16, 2017 · 4 comments

Comments

@bpellens
Copy link

Hello,

I really like your angular 2 components so far. I do have a quick question if I may. Is it possible to independent options to the nodes or the edges. When going through the code I can only see option set at the network level. What I want to achieve is different stylings (e.g. colors) for different types of nodes.

Thank you for the feedback,

Kind Regards,

Bram

@seveves
Copy link
Owner

seveves commented Jan 16, 2017

I'm very busy at the moment but this is related to #23. The TypeScript definitions are not up to date and incomplete. I hope I can fix this by updating to the new vis typings. Maybe next weekend. Till then you can try to create your nodes as 'any' types and cast it to VisNode before adding to the dataset.
let myColorNode = { id: 'someId', label: 'someLabel', color: 'someColor' }; networkData.nodes.add(myColorNode as VisNode); // networkData is of type VisNetworkData

@bpellens
Copy link
Author

Thank you very much for the feedback. It is working perfectly! I am closing this question then.

@krystlih
Copy link

Does this work for VisEdges as well?

@seveves
Copy link
Owner

seveves commented Feb 17, 2017

Sure ... should be quite similar

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

3 participants