-
Notifications
You must be signed in to change notification settings - Fork 184
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
how to add a label for every node ? #16
Comments
As you can see in https://github.com/fkling/JSNetworkX/wiki/Drawing-graphs, you can set the labels with the
For different sizes, have a look at the Getting started tutorial, it shows an example and provides more information about drawing: http://felix-kling.de/JSNetworkX/getting_started.html#drawing |
Thank you for reply my question ,I read the wiki ,but could not find how to use Lables option,would you like give me a sample ? |
|
OK, I see , thank you very much !!! |
But this don't work: |
@adev-test : No, |
For anyone reading this thread and wondering why @fkling 's suggestion isn't working - the option is |
@WilHall: 👍 That's what I get for using inconsistent option names. Corrected example: var G = jsnx.Graph();
G.add_node(1, {label: 'foo'});
G.add_node(2, {label: 'bar'});
G.add_node(3, {label: 'baz'});
G.add_edges_from([[1,2],[2,3]]);
jsnx.draw(G, {
element: '#demo-canvas',
with_labels: true,
labels: 'label'
}); |
|
Hi ,I want to add a string on every node, but with_labels just add the node's name in the circle ,how to make a label beside the circle ? and I also want to set different size for every circle , thank you very much .
The text was updated successfully, but these errors were encountered: