interactive_graphs 0.2.2
interactive_graphs: ^0.2.2 copied to clipboard
Interactive directed graph viewer for Flutter: hierarchical and force-directed layouts, pan and zoom, styled and labelled edges, anchors, selection, hover and node drag.
0.2.2 #
- A live web demo of the example app, linked as the package homepage: https://mikeb2k.github.io/flutter_interactive_graphs_package/
0.2.1 #
- README: the demo GIF and screenshots show on pub.dev too.
0.2.0 #
- Breaking:
GraphViewerController.contentOffset/updateContentOffset(Offset)are replaced bycontentInsets/updateContentInsets(EdgeInsets): the room overlay UI takes at each edge of the viewer.centerGraphnow fits the graph into the room that is left instead of only shifting it. MigrateupdateContentOffset(Offset(0, top - bottom))toupdateContentInsets(EdgeInsets.only(top: top, bottom: bottom)). GraphViewerController.centerOn(graphPoint, scale:, animated:)puts a graph point in the middle of that room.- Fixed:
centerGraphcenters the node bounds, so a graph whose outer nodes differ in size no longer ends up off center. - Performance:
HierarchicalLayoutis linear in the edges that skip levels. A random graph of 5000 nodes and 7500 edges went from about 8 s to well under 100 ms. - Performance: edges and nodes paint into layers of their own, so pan and zoom repaint neither
and node selection or hover leaves the edges alone; with an
edgeBuilderonly the edges that moved or changed state rebuild;updateContentInsetsrebuilds nothing. GraphViewerController.backgroundLayoutThresholddefaults to 200 (was 400), and only one background layout runs at a time: a newer request stops its isolate and is laid out instead. In atestWidgetstest a background layout only finishes insidetester.runAsync; pass a higher threshold to keep such graphs on the UI isolate.GraphViewerConfig.rebuildNodesOnLayout(defaulttrue): turn it off when thenodeBuilderreads neither the node's position nor its size, and a node is built once instead of after every layout pass.- Performance: a change to one node (
moveNode, a new neighbor) no longer rebuilds the hosts of all the other nodes. EdgePainting.linegives the (dashed) line of an edge andEdgePainting.painttakes it back asline;EdgeLineandStyledEdgeuse it to keep the line of an edge that didn't change, which makes dragging a node among many edge widgets about seven times cheaper.- Accessibility: with a
selectionMode, a node tells assistive technology whether it is selected. It joins the semantics of the node's own widget (label, tap action) and replaces none of them.
0.1.0 #
First release: a Flutter port of Kuiver.
- Immutable
GraphwithGraphBuilder, edge classification, strongly connected components, cycle checks and topological order. HierarchicalLayout,ForceDirectedLayoutand customLayoutConfig.customlayouts; large layouts run on a background isolate.GraphViewerandGraphViewerController: measured nodes, animated layout changes, fit to content, pinch / trackpad / scroll zoom and pan, animated camera.- Edges: straight, curved, self loop, orthogonal and right-angle shapes, labels, custom arrow
painters, parallel edge fan-out, per-edge widgets (
StyledEdge,EdgeLine) or a batched painter. - Anchors (
GraphAnchor,GraphEdge.withAnchors), node and edge selection and hover, node drag with relayout policies. - Follows the app's Material theme:
GraphThemeDatais aThemeExtensionderived from theColorSchemeandTextTheme(GraphThemeData.fromTheme), overridable per app (theme extension) or per subtree (GraphTheme).EdgeLabelStyle.fontSizedefaults to the theme's label size. HierarchicalLayout.runpollscheckCancelledlike the force-directed layout.CurvedEdgePathandSelfLoopEdgePathshare the sealedQuadraticEdgePathbase.GraphThemeData.labelTextStyle(12 px by default) andlabelBorderColor(transparent for none) are non-nullable, socopyWithreaches them.GraphViewerConfig.animateLayoutturns layout animation off;layoutSpringandenterDuration(defaultDuration.zero) are non-nullable, socopyWithreaches every field.
