-
Notifications
You must be signed in to change notification settings - Fork 77
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
[gsoc22] Fix realtime data update example #141
Conversation
Currently, the hosted example doesn't make much sense as we have to set up the server locally. It would be nice if could host the server too. WDYT @nemesisdesign ? |
I prefer to keep it simple and add instructions on how to test this locally and find a way to avoid showing it in the examples we host on github pages, is this doable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make sure the instructions in the README are up to date and work?
https://github.com/openwisp/netjsongraph.js/tree/gsoc22#realtime-update
Yeah, we can return this example as a response when we start the server locally and remove it from gh-pages.
Will do. |
d283177
to
a9dd861
Compare
Here it is how it was done in the old version: We shouldn't hardcode a specific property for this, we have to look into a way to allow setting colors depending on a property which could be anything. It's something like this doable? const nodeColors = {
default: 'black',
gateway: 'orange'
}
const linkColors = {
up: 'green',
down: 'red'
}
new NetJSONGraph({
prepareData: data => {
data.nodes.map(node => {
node.color = nodeColors[node.properties.gateway];
});
data.links.map(link => {
link.color = linkColors[node.status];
})
}
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I open the examples locally, I see the real time link, if I click on it, I see Cannot GET /examples/netjson-updateData.html
. Is this intended?
Can you disable the hover effect when hovering on nodes and links?
Can you get rid of that legend and have the nodes all of the same color?
Can you change the title to "Live update example"?
|
||
``` | ||
npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example here I would add:
cd examples/realtime_update
Yeah, that example is not useful anymore. I forgot to remove the example from the index page.
I thought of handling this in #113 |
Yeah makes sense. I will implement something similar. |
9af8155
to
3bae229
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@totallynotvaishnav you forgot this:
Can you change the title to "Live update example"?
@@ -5,7 +5,7 @@ | |||
"main": "index.js", | |||
"scripts": { | |||
"test": "echo \"Error: no test specified\" && exit 1", | |||
"start": "node index.js" | |||
"dev": "node index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't change this here unless we also update the README, why are you doing this schange?
af25e00
to
9e2f2be
Compare
closes #140