VivaGraphJS
VivaGraphJS copied to clipboard
[FEATURE] Please Add Arrow Head In Edge Configuration
I am aware of those examples showing arrow heads with some extra code. But it will be great to have a property in the edge configuration that allows us to add arrow heads on both the ends, one end or none (by default?).
Agreed. Will add an API for this.
Not directly related to this thread but I will ask it anyway. Is there a way to pass a config object at the time of node/link creation to customize individual node/link appearance like color, position, size and whatnot?
Thanks
Yep. Check this: "Basic graph operations" - you can pass any object (not necessary a string or a number) as a last argument for addNode()/addLink() methods.
Thanks for your response. My question was a bit different though. I am aware of the data attributes that associates an arbitrary object/data to each node and link. But if there are some graph configuration properties passed in that object, they wont be applied automatically. User has to apply config properties in a callback (correct me if I am wrong). Following example may explain my point.
addNode(id, data, config)
Now, if 'config' object is something like:
config = {
color: '#f00',
position: {x: 10, y:50}
}
Then it should be applied at the time of node initialization. Eventually we can document possible config properties for nodes and links. If my question seems valid and if this feature is not available yet in the library then we can move this discussion in a separate feature request.
i agree with @ibnesayeed to have arrow heads in the API, since directional vs bidirectional link is a common use.
@ibnesayeed you could pass arrow head at construction of placelink() function - if using SVG, you could use a
Thanks @gg4u. The feature request is still worth, though I am done with the project I was using it for.