VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

[FEATURE] Please Add Arrow Head In Edge Configuration

Open ibnesayeed opened this issue 12 years ago • 7 comments
trafficstars

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?).

ibnesayeed avatar Feb 25 '13 21:02 ibnesayeed

Agreed. Will add an API for this.

anvaka avatar Mar 02 '13 05:03 anvaka

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

ibnesayeed avatar Mar 02 '13 06:03 ibnesayeed

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.

anvaka avatar Mar 05 '13 07:03 anvaka

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.

ibnesayeed avatar Mar 05 '13 14:03 ibnesayeed

i agree with @ibnesayeed to have arrow heads in the API, since directional vs bidirectional link is a common use.

arikan avatar Apr 12 '13 15:04 arikan

@ibnesayeed you could pass arrow head at construction of placelink() function - if using SVG, you could use a tag instead of line and use markers to place arrows.

gg4u avatar Apr 29 '17 09:04 gg4u

Thanks @gg4u. The feature request is still worth, though I am done with the project I was using it for.

ibnesayeed avatar Apr 29 '17 12:04 ibnesayeed