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

Dynamically change node (or node label) colour #56

Closed
jlixfeld opened this issue Jan 17, 2017 · 4 comments
Closed

Dynamically change node (or node label) colour #56

jlixfeld opened this issue Jan 17, 2017 · 4 comments

Comments

@jlixfeld
Copy link

I'm looking to use NWM as a replacement for a commercial application called InterMapper. One of the handy features of InterMapper is that the server keeps track of 'packet loss' for a node. If the server detects a certain level and interval of packet loss, it changes the colour of the node itself to depict that the node is in trouble and to what degree of trouble it's in.

I'm wondering if NWM has the capability to dynamically change a node's (or perhaps a node's label) colour similar to how a change in link bandwidth causes the link colour to change.

@bhardgrove
Copy link

I use NWM to keep track of both packet loss and latency. I use a link with latency as the inbound value and packet loss as the outbound value. I can then use a scale and alarm based on packet loss percent.

I am using elasticsearch as a backend and had to write a datasource plugin to connect weathermaps to elasticsearch.

@jlixfeld
Copy link
Author

Interesting approach. So then the latency and loss links are really just pseudo links connected to a fake node that is essentially a placeholder for the latency and loss links? (My understanding is that a link must connect two nodes).

@howardjones
Copy link
Owner

To answer your original question though, you can do this with nodes too. You can add a maximum value, and assign a scale, and a target, just as with links. Nodes only have one colourable element though, instead of two arrows, so you have to pick which of the 'in' and 'out' values to use. Because it shares almost all the code with links, you do still need to specify an in and out target though.

@howardjones
Copy link
Owner

Also, with a little more trickery you can do things like have the icon change - either change colour, or change for a different image file.

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