One-dimensional label de-collision used wherever chart labels would overlap: axis ticks (drop overlapping labels) and trackball value rows (nudge them apart). Pure value math — no canvas, fully unit-testable.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
spread(
List< double> centers, double minGap, double lo, double hi) → List<double> -
Nudges
centersapart so adjacent labels keep at leastminGapbetween their centers, while staying within[lo, hi]. Preserves input order in the returned list; the result is the adjusted center for each input index. -
thin(
List< double> centers, List<double> widths, double minGap) → List<int> -
Returns the indices to keep so that drawn label boxes — each centered at
centers[i]with widthwidths[i]— do not overlap, leaving at leastminGapbetween neighboring boxes. Greedy left-to-right; the first label in position order is always kept.