org_chart 5.1.0
org_chart: ^5.1.0 copied to clipboard
A flutter orgranizational chart with drag and drop, zoom and pan, search, collapse, expand, and easy customizations!
5.1.0 #
- Add
edgeStyleProviderfor per-edge styling across org charts and genograms. - Add widget-based edge labels via
edgeLabelBuilderandEdgeLabelConfig. - Example: tap to highlight horizontal relations and fade unrelated edges/nodes.
- Genogram: render marriage decorators (e.g., divorce slash).
- Genogram: optional
spouseSpacingand marriage labels anchored to marriage point. - Genogram: configurable
marriageAnchorDistance.
5.0.4 #
- Genogram: adjust couple generation to avoid parent-child arrow oddities when spouse has ancestors.
- Example: refresh sample family names and remove duplicate siblings.
5.0.2 #
- Orgchart fix drawing parental arrows when parents are not married (mother arow was missing)
5.0.1 #
- fix: missing setState in genogram calculatePosition method
5.0.0 #
- Stable
5.0.0-alpha.5 #
Performance Improvements #
-
Optimized node level calculations - Added caching mechanism for
getLevel()calls- 400x performance improvement (15ms vs 5000ms for 100k calls)
- Cache automatically invalidated on node modifications
-
Implemented parent-child index mapping - O(1) lookups for
getSubNodes()- 60x performance improvement (22ms vs 1000ms for 10k calls)
- Index automatically rebuilt on node modifications
-
Added spatial indexing with QuadTree - Optimized overlap detection
- 80x performance improvement (24ms vs 2000ms for 1k calls in 2500 nodes)
- Reduced complexity from O(n) to O(log n) for spatial queries
-
Fixed edge painter efficiency - Optimized
shouldRepaintlogic- Only repaints when actual properties change
- Smoother animations and reduced CPU usage
Added #
- QuadTree implementation for spatial indexing (
lib/src/common/quadtree.dart) - Performance test suite to benchmark optimizations
Internal Changes #
- Modified
NodeQueryMixinto include caching and indexing capabilities - Updated
OrgChartControllerto manage cache lifecycle - Enhanced both
OrgChartEdgePainterandGenogramEdgePainterwith proper repaint conditions
Additional Performance Improvements #
- Implemented drag operation debouncing
- Reduced frequency of expensive overlap calculations during drag
- Maintains smooth visual feedback while improving performance
- Configurable debounce delay (default: 16ms for 60fps)
Testing #
- Added comprehensive test suite covering:
- Core components (Node, QuadTree)
- Controllers (OrgChartController with all operations)
- Widgets (OrgChart rendering and interactions)
- Performance optimizations verification
- Created test documentation and unified test runner
- Performance benchmarks included to verify optimization gains
Code Quality #
- Removed magic numbers throughout codebase
- Created separate constant classes for each component:
OrgChartConstantsfor org chart specific valuesGenogramConstantsfor genogram specific valuesBaseGraphConstantsfor shared functionalityQuadTreeConstantsfor spatial indexing
- Improved maintainability and consistency
5.0.0-alpha.4 #
....
5.0.0-alpha.3 #
Added #
addItemsmethod to the BaseController, allowing batch addition of nodes.clearItemsmethod to the BaseController, allowing clearing of all nodes in the chart.
Changed #
- Reimplemented
addItemsuch that bothaddItemandaddItemsreplace the node if the node being added has the same ID as the one originally in the list. - Updated the
toSettermethod, now you return a new instance that replaces the old one, instead of modifying the old one in place, allowing you to use final instances with copyWith. - Updated the naming convention of
ActionOnNodeRemovalto better reflect the purpose:unlink→unlinkDescendantsconnectToParent→connectDescendantsToParentremove→removeDescendants
5.0.0-alpha.2 #
Added #
- Export functionality for charts - ability to export as PDF or image
- Additional node styling options for better visualization (genogram)
Improved #
- Performance optimizations for large charts with many nodes
- More intuitive zoom and pan controls with configurable settings
- Better handling of node visibility and centering
- Refined user interface for chart manipulation
Fixed #
- Resolved edge rendering issues in complex hierarchies
- Fixed positioning calculation for nodes with specific relationship patterns
- Improved node centering when some nodes are hidden
- Addressed bugs related to node dragging and dropping
Bumped custom_interactive_viewer to version 0.0.6.
5.0.0-alpha.1 #
Initial genogram implementation.
4.2.1 #
Fixed #
- Fix, the context menu was being rendered offsetted.
- The node is checked for being hidden when centerNode method is used.
Added #
- CustomInteractiveViewer now in focus on tap, allowing for the direct use of keyboard arrows, instead of needing to navigate to the graph using tab or arrow keys.
- Added invertArrowDirection flag to the OrgChart widget.
- Fix bugs in the example, and update with new changes.
Check CustomInteractiveViewer version 0.0.4 for more details.
4.2.0 #
Added #
- Implemented a CustomInteractiveViewer to replace the default one. Benefits include:
- Fixed centering issues when zooming in/out and panning.
- A new InteractiveViewerController allowing more control over the zoom and pan (and a new rotational 🔥) behavior in the graph.
- fling behavior 😁
- Fixed a bug in the
getSizemethod of theOrgChartController. All nodes were checked, even hidden nodes, returning the wrong size. Which also caused issues in centering the graph. - Traverse the graph using keyboard arrows. zoom in and out using + & -
4.1.0 #
Added #
- Recursive node removal functionality.
- Holding the Ctrl key changes trackpad scroll behavior to "scaling in".
Fixed #
- Resolved an issue where
removeItemwithActionOnNodeRemoval.connectToParentincorrectly behaved likeActionOnNodeRemoval.unlink.
Thanks to @fabionuno for implementing all of these features and fixes!
4.0.0 #
Added #
-
Dashed arrow styles:
- Introduced
arrowStyleto theOrgChartwidget with optionsSolidGraphArrowandDashedGraphArrow.
- Introduced
-
Graph centering:
- Graph now centers on initialization and orientation change.
- Can be disabled during orientation change using the new
centerparameter inswitchOrientation. - The
orientationsetter is now deprecated. calculatePositionalso accepts thecenterparameter (defaults totrue).- New
centerChart()method added to controller.
-
Zoom control:
- Exposed
minScaleandmaxScalein theOrgChartwidget.
- Exposed
-
Drag behavior:
- Prevents dragging nodes into negative positions.
- Fixed node index changing unnecessarily when starting to drag a node.
Fixed #
- Boundary issues where nodes could be placed out of view and become unclickable or undraggable.
Removed #
- Removed
onTapandonDoubleTapfrom theOrgChartwidget due to delayed callbacks. UseGestureDetectorin the builder method instead.
Updated #
- Example project improvements.
3.1.0 #
Added #
-
switchOrientationmethod on the controller to toggle orientation. -
Automatic position recalculation when setting
controller.orientation. -
Spacing improvements:
- Replaced
offsetwithspacingandrunSpacingbased on current orientation.
- Replaced
-
Tree rendering:
- Multiple roots now display side-by-side (or vertically) depending on orientation.
-
Visual polish:
- Line radius added to leaf nodes.
-
Node removal improvements:
- Added
idSetterto controller for subnode reattachment. - New
actionparameter inremoveItemwith options:ActionOnNodeRemoval.unlinkActionOnNodeRemoval.linkToParent
- Added
3.0.0 #
Changed #
- Major internal cleanup.
- Fixed arrow-spacing calculation.
- Added
cornerRadiusto customize arrow curves. - Added
leveltoNodeBuilderDetailsto indicate depth in tree. - Added
isTargetSubnodetoonDropto detect drops on subnodes. - Updated and restyled example.
- Removed deprecated
Graphclass andgraphparameter fromOrgChart. - Automatic UI updates after
calculatePosition— no more need to callsetState. - Only the first tree is shown if multiple roots exist.
2.2.0 #
2.1.0 #
2.0.0 #
Changed #
- Removed the need to manually map data types to
Node— done internally now. - Builder method now receives a
NodeBuilderDetailsobject containing:datahideNodesnodesHiddenbeingDraggedisOverlapped
- Added customizable animation curve and duration when resetting positions.
- Added documentation and internal tweaks.