GraphShape icon indicating copy to clipboard operation
GraphShape copied to clipboard

Customizable labels on the edges

Open gplesz opened this issue 1 year ago • 2 comments

I need a graph where I can write different information on the edges. How would it be better to go?

A similar solution would be good as AttachableEdgeLabelControl for GraphX.

Thank you in advance for all your help!

gplesz avatar Jul 13 '22 13:07 gplesz

Hello @gplesz,

And sorry for the delay. If you need some data attached to the edge then I would say it depends on the nature of data you need to attach. Of course if data are more related to your model then it means that data can be attached to the graph data structure itself. For that you may consider using a graph which edges use something like TaggedEdge<TVertex, TData>. TData will be the payload of the data you need to attach to your edges. Of course TaggedEdge is a generic implementation for which the additional data is named Tag (can be meaningless in your scenario, it's up to you). BTW you can create your own class/struct that inherits Edge one (or totally defined your own) that will fit your needs.

Then you will be free to use that additional data in some WPF or any GUI application with a dedicated WPF behavior stuff like that.

I hope it will help you!

KeRNeLith avatar Sep 05 '22 19:09 KeRNeLith

Hello @KeRNeLith,

Thank you so much for your reply! I didn't know it until now, thanks for the tip, I'll look at taggedEdge type and then I'll see.

gplesz avatar Sep 09 '22 11:09 gplesz