any_sparklines 3.0.1
any_sparklines: ^3.0.1 copied to clipboard
Feature-rich and highly optimized sparklines for Flutter
3.0.1 #
- Added a configurable
epsthreshold to pie layout and data-bounds computations. - Fixed lint warnings for unbraced
ifstatements.
3.0.0 #
-
Breaking: unit-aware visual lengths
ThicknessData.size,ThicknessOverride.size, marker radius, and chart/data-point border radius now useILengthValue.- Added
Px,Vw,Vh,Dx, andDy; viewport units follow CSS percentage semantics (Vw(1)is 1%). - Added deferred cross-unit interpolation and support for custom length implementations through
ILengthContext.
-
Breaking: simplified layouts
- Removed
RelativeDimension,RelativeLayout.relativeTo, andIChartLayout.transformScalar(). ChartTransformno longer accepts anIChartLayout; it resolves lengths from its dimensions and path matrix.- Layouts now transform plot coordinates only; each visual value owns its sizing policy.
- Pie auto-bounds are derived from data geometry and no longer include visual thickness, borders, corners, or markers.
- Removed
-
LineData
- Added
LineData.scatter(points: ...)for marker-only x/y plots without connected lines or area fills. - Added
ScatterLineData; scatter rendering is selected throughlineTypeand can be changed withcopyWith(lineType: ...). - Single-point line and scatter data now render their point marker.
- Added
-
Breaking: custom line types
ILineTypeDatanow requiresdrawLineandminPointsso renderers can determine whether and when to draw connected geometry.
-
DataPoint and DataPointPipeline
- Added
DataPoint.zas an interpolated third dimension that does not affect layout bounds. - Added direct
Object?point keys for selecting pipeline transformations; keys retain the source value att <= 0and adopt the destination value afterward during interpolation. - Removed
IDataPointMetaand replacedDataPointMetawith the value-basedDataPointKey, retaining itsid, stringkey, andlabelfields. - Added
rescaleZ()with shared automatic bounds, optional clamping, and target-midpoint handling for equal z values. - Added
scatterZ()with optional key/predicate filtering and z-interpolatedStylesInterval/ExtentsIntervalmetadata. - Added optional
groupingSteptostack(). When provided, nearby x values are grouped into rounded buckets of that size; the default remains exact x matching. - Added optional z ordering to
sort().
- Added
-
Visual lengths
- Added
VminandVmaxfor percentages of the shorter and longer logical viewport dimensions.
- Added
-
Chart insets and point fitting
- Added reusable
ChartInsetswith optionalleft,top,right, andbottomILengthValues for global widget padding and local per-chart padding. - Added
ChartInsets.all(),ChartInsets.horizontal(), andChartInsets.vertical()convenience constructors. - Added
CircleDataPointStyle.extentfor a symmetric point extent matching the circle radius. ChartInsetsimplementsIDataPointExtentand can be stored inDataPoint.datafor automatic, position-aware visual overflow fitting around(x, fy).- Global padding, local padding, and point overflow are combined once from the preliminary transform without changing source data or layout bounds.
- Charts sharing a layout receive one aligned inset transform; over-constrained axes collapse to the weighted position between their opposing insets.
- Added reusable
-
Seat maps
- Added
SeatKeywith an optional database/display label and value identity based on area, row, and column. - Added
SeatSelectorwith OR-set label, row, column, and nullable-area filters plus OR-of-AND tag groups. - Added deferred
SeatsBuilderactions for fluent row and column geometry with labels, horizontal and vertical gaps, skipped slots, z values, tags, areas, and point metadata. - Added nestable
record()/repeat()blocks and reusablesaveRecord()action templates for replaying seat-layout sequences duringbuild(). - Added
saveState(),saveOnlyState(), andrestoreState()for deferred gap, area, tag, and data snapshots. - Added
ISeatLabelBuilder, defaultNullLabels, and exact-consumptionListLabelswith end-of-build validation. - Added
DataPointPipeline.seats()for fixed style and optional extent decoration using selectors, predicates, and exact seat keys.
- Added
-
Breaking: custom chart data
- Replaced
ChartPaddingwithChartInsetswithout a compatibility alias. IDataPointExtentnow extendsIDataPointDataso custom extents can be stored directly in point metadata.ISparklinesDatanow implementsIterable<DataPoint>and requirespaddingandsupportsPointExtents.BetweenLineDataiterates itsfrompoints followed by itstopoints but disables point-extent fitting.
- Replaced
Migration #
| 2.x | 3.0 |
|---|---|
ThicknessData(size: 2) |
ThicknessData(size: Px(2)) |
CircleDataPointStyle(radius: 4, ...) |
CircleDataPointStyle(radius: Px(4), ...) |
borderRadius: 4 |
borderRadius: Px(4) |
relativeTo: RelativeDimension.width with a scalar 0.1 |
Remove relativeTo; use Dx(0.1) on that visual property |
relativeTo: RelativeDimension.height with a scalar 0.1 |
Remove relativeTo; use Dy(0.1) on that visual property |
Custom IChartLayout.transformScalar() |
Remove it; custom units implement ILengthValue.resolve() |
ChartTransform(layout: layout, dimensions: d, pathTransform: m) |
ChartTransform(dimensions: d, pathTransform: m) |
2.2.6 #
- Improved
pubspec.yaml - Fixed lint warnings
2.2.5 #
- DataPointPipeline
- stack({ offset?, spacing? }) — Added
offsetto set the initial stacked base for eachx(default 0.0).
- stack({ offset?, spacing? }) — Added
2.2.4 #
- DataPointPipeline
- sort({ x?, y?, fy? }) — Sort input by x, y, and/or fy. Each flag:
true= ascending,false= descending. If all null, sorts by x ascending. - aggregate({ function?, window? }) — Aggregate
dyover a window ending at each point.DataAggregation:sum,avg,min,max,median,std.window: null = cumulative from start, N = last N elements. Updatesdyandfyper point.
- sort({ x?, y?, fy? }) — Sort input by x, y, and/or fy. Each flag:
2.2.3 #
- rescale — Rescale now transforms full intervals
[y..fy]from source to target bounds; bothyandfyare mapped, anddyis set tofy - y. Non-finitecurrentMin/currentMaxare derived from input interval bounds.
2.2.2 #
- Added
rescaletoDataPointPipeline
2.2.1 #
- Added
trailingSpacingandspacingDegtoDataPointPipeline
2.2.0 #
- Made the radius and thickness properties in
PieDatauniform by default, consistent withLineDataandBarData- Use
RelativeLayout(.., relativeTo: RelativeDimension.width)to make them relative again
- Use
2.1.4 #
- Fixed
CircleArcBuilderfor angles >= 2 * pi
2.1.3 #
- Fixed
LayoutDatamin/max assert
2.1.2 #
- Fixed drawing DataPoints in
CircleDataPointRenderer
2.1.1 #
- Added ChartFlip —
none,vertically,horizontally,both. Flip charts around axes; available on all chart data types viaISparklinesData.flip.
2.1.0 #
- Renaming
- LineChart.points => line
- PieChart.points => pies
- Added
IDataPointBorderandDataPointBorder - Refactoring
2.0.0 #
DataPoint- added
IDataPointDataDataPointMetaThresholdPoints
- migrated everything to
DataPoint.data
- added
DataPointPipeline- refactored
- tests
1.1.0 #
DataPoint- added
dx - removed
getYorDy
- added
DataPointPipeline- fixes and tests
PieData- renamed
spacetodx - added
padAngle
- renamed
1.0.0 #
- Initial release
