strathausen / dracula

JavaScript layout and representation of connected graphs.
https://www.graphdracula.net
MIT License
834 stars 132 forks source link

Custom styling of nodes doesn't work #48

Closed Lewiky closed 6 years ago

Lewiky commented 6 years ago

In the documentation, it's apparently possible to be able to add styling to a node like so:

g.addEdge('id35', 'apple', { style: { stroke: '#bfa', fill: '#56f', label: 'Label' } });

However, doing this in practice doesn't work.

Looking through the source, I can see the node.style gets stored, however in the renderer it is never considered, the colour is still chosen randomly by Raphael and the custom labels aren't applied.

julien-riel commented 6 years ago

if you use the cdn, use version 1.1.1

https://cdnjs.cloudflare.com/ajax/libs/graphdracula/1.1.1/dracula.min.js

strathausen commented 6 years ago

In my latest commits, I reverted the behavior to be as it once was. So your code should work now @Lewiky can you check? Thanks a lot!