sankey_flutter 0.0.3
sankey_flutter: ^0.0.3 copied to clipboard
Flutter package for interactive Sankey diagrams with gradient links, node selection, and d3-sankey layout algorithm.
Changelog #
All notable changes to the sankey_flutter package will be documented in this file.
0.0.3 - 2025-12-29 #
✨ New Features #
- Gradient link rendering - Links now use
LinearGradientshaders for smooth color transitions between source and target nodes - Texture overlay - Added
showTextureparameter for subtle texture patterns on links, enhancing visual depth - Node selection callback - New
onNodeSelected(SankeyNode?)callback provides the full node object on tap - Display label fallback -
SankeyNode.displayLabelgetter returns label or falls back toid.toString()
🛠 Enhancements #
- HSL-based selection borders - Selected nodes display contrasting borders using intelligent HSL color manipulation
- Clearer field names - Renamed node position fields from
x0/x1/y0/y1toleft/right/top/bottom - Efficient hit testing - Added
SankeyNode.contains(Offset)method for cleaner tap detection - Subtle node borders - Unselected nodes show subtle white borders for better visual definition
- Repaint fix -
shouldRepaintnow correctly triggers forselectedNodeId,showLabels, andshowTexturechanges - Responsive example - Example app uses
LayoutBuilderto adapt to screen size
⚠️ Breaking Changes #
- Removed deprecated
onNodeTap(int?)callback — useonNodeSelected(SankeyNode?)instead
🔧 Internal #
- Migrated deprecated
withOpacity()calls towithAlpha() - Type safety -
SankeyLink.sourceandSankeyLink.targetare now strongly typed asSankeyNode - Consistent naming - Renamed
Sankeylayout bounds fromx0/y0/x1/y1toleftBound/topBound/rightBound/bottomBound - Widget tests - Added comprehensive tests for
SankeyDiagramWidget, node detection, and color mapping
Contributor: @jheyne — gradient rendering implementation
0.0.2 - 2025-04-16 #
✨ New Features #
- Label toggle - Added
showLabelsboolean parameter toInteractiveSankeyPainterto show/hide node labels - Exposed
showLabelsthroughbuildInteractiveSankeyPainter()andSankeyDiagramWidget
🛠 Enhancements #
- Label rendering respects the
showLabelsflag during painting - Improved flexibility for minimal or uncluttered diagram visuals
Contributor: @pese-git — showLabels feature
0.0.1 - 2025-04-01 #
🎉 Initial Release #
- Fully featured Sankey layout engine adapted from d3-sankey
- Customizable node width, padding, and alignment
- Interactive node selection with tap detection
- Test fixture parity with d3's energy.json example
Contributors #
A huge thank you to our community contributors:
| Contributor | Contribution |
|---|---|
| @jheyne | Gradient link rendering, texture overlay, HSL selection borders |
| @pese-git | showLabels toggle feature |