lempiy / flutter_graphite

Flutter widget to draw interactive direct graphs (flowcharts) of any complexity in a tile rectangular manner.
MIT License
166 stars 32 forks source link

Double-headed edges #4

Closed Dragemil closed 1 year ago

Dragemil commented 3 years ago

Is there an easy way to maybe pass a flag to the graph, that if you had an edge x -> y and an edge y -> x it would be drawn as single double-headed edge, rather than two edges?

Also, is there a possibility to label edges with text?

Or do I have to provide whole EdgePaintBuilder/EdgePathBuilder, which seems rather complicated?

lempiy commented 3 years ago

@Dragemil
For <-> sounds reasonable. It's not to hard to implement via some kind of edges "merge", but currently not available. About labels on edges: Because widget is built on top of custom painter, it's hard to implement this feature - you need to handle edges size and graph orientation properly to centralise your text and avoid overlaps. I have React.js version of this lib which uses SVG rendering. This version has edge labels implemented by some other guy, but I'm not satisfied with the result. If you want to make your contribution, please do so. I had plan for version 1.0.0 with new type of matrix (with 2 cells per 1 object instead of 1), but for now I don't have time to work on this.

hareendranmg commented 3 years ago

Hi @Dragemil, Did you able to label edges with text?

Dragemil commented 3 years ago

Sorry, unfortunately I didn't need the labaled edges in the end.