d4 library

D4 is an ongoing project to port the D3 JavaScript library to the Dart language.

See one of:

  • d4_array - List manipulation, ordering, searching, summarizing, etc.
  • d4_color - Color spaces! RGB, HSL, Cubehelix, CIELAB, and more.
  • d4_dsv - A parser and formatter for delimiter-separated values, such as CSV and TSV.
  • d4_format - Format numbers for human consumption.
  • d4_geo - Geographic projections, spherical shapes and spherical trigonometry.
  • d4_interpolate - Interpolate numbers, colors, strings, lists, maps, whatever!
  • d4_path - Serialize Canvas path commands to SVG.
  • d4_polygon - Geometric operations for two-dimensional polygons.
  • d4_random - Generate random numbers from various distributions.
  • d4_scale - Encodings that map abstract data to visual representation.
  • d4_scale_chromatic - Sequential, diverging and categorical color scales.
  • d4_shape - Graphical primitives for visualization, such as lines and areas.
  • d4_time - A calculator for humanity’s peculiar conventions of time.
  • d4_time_format - Parse and format times, inspired by strptime and strftime.

Classes

Adder Adding numbers
Creates a full precision adder for IEEE 754 floating point numbers, setting its initial value to 0.
Arc Arcs
The arc generator produces a circular or annular sector, as in a pie or donut chart.
Area<T> Areas
The area generator produces an area defined by a topline and a baseline as in an area chart.
AreaRadial<T> Radial areas
A radial area generator is like the Cartesian area generator except the Area.x and Area.y accessors are replaced with angle and radius accessors.
Bin<T extends num?> Binning data
A bin generator for numerical data.
BinBy<T, R extends num?> Binning data
Equivalent do Bin, except that it allows for customized data processing and flexible binning based on specific attributes of the data elements.
Color
An abstract class representing a color in various color spaces.
Cubehelix
A color representation in the Cubehelix color space.
Curve Curves
Curves are typically not used directly, instead being passed to Line.curve and Area.curve. However, you can define your own curve implementation should none of the built-in curves satisfy your needs using the following interface; see the curveLinear source for an example implementation.
DsvFormat
A class for parsing and formatting Delimiter-Separated Values (DSV) data.
FormatLocale
Locale formats define how a value ​​should be formatted in a locale-specific way.
FormatSpecifier
Format specifiers define how a number should be formatted (see FormatLocale.format) and can be created and derived in a structured way.
GeoAlbersUsa
A U.S.-centric composite projection of three geoConicEqualArea projections.
GeoCircle
A geometry geographic generator for creating circles.
GeoConicProjection
Conic projections project the sphere onto a cone, and then unroll the cone onto the plane.
GeoGraticule
A geometry geographic generator for creating graticules.
GeoIdentity
The identity transform can be used to scale, translate and clip planar geometry.
GeoPath
A geometry geographic generator for creating paths.
GeoPathContext
Renders a path to a canvas using a subset of the CanvasRenderingContext2D API.
GeoProjection
Projections transform spherical polygonal geometry to planar polygonal geometry.
GeoProjectionMutator<T>
A projection wrapper to mutate as needed.
GeoRawTransform
Raw transforms are point transformation functions that are used to implement custom projections.
GeoRotation
A raw transform that represents a rotation about each spherical axis.
GeoStream
Streams have several function-properties that are called to transform an input geometry.
GeoTransform
Transforms are a generalization of projections.
GeoTransverseMercator
The transverse spherical Mercator projection.
Hcl
A color representation in the CIELChab color space.
Hsl
A color representation in the HSL color space.
Lab
A color representation in the CIELAB color space.
Line<T> Lines
The line generator produces a spline or polyline as in a line chart.
LineRadial<T> Radial lines
A radial line generator is like the Cartesian line generator except the Line.x and Line.y accessors are replaced with angle and radius accessors.
The link shape generates a smooth cubic Bézier curve from a source point to a target point.
LinkRadial<T> Radial links
A radial link generator is like the Cartesian link generator except the Link.x and Link.y accessors are replaced with angle and radius accessors.
Path
A path serializer that implements CanvasPathMethods.
Pie<T> Pies
The pie generator computes the necessary angles to represent a tabular dataset as a pie or donut chart; these angles can then be passed to an arc generator. (The pie generator does not produce a shape directly.)
Rgb
A color representation in the RGB color space.
Scale<X, Y>
A generic mapper from an input domain to an output range.
ScaleBand<X> Band scales
Band scales are like ordinal scales except the output range is continuous and numeric.
ScaleDiverging<Y> Diverging scales
Diverging scales are similar to linear scales, but the input domain and output range always have exactly three elements.
ScaleDivergingLog<Y> Diverging scales
A diverging scale with a logarithmic transform, analogous to ScaleLog.
ScaleDivergingPow<Y> Diverging scales
A diverging scale with an exponential transform, analogous to a ScalePow.
ScaleDivergingSymlog<Y> Diverging scales
A diverging scale with a logarithmic transform, analogous to a ScaleSymlog.
ScaleIdentity Linear scales
Identity scales are a special case of linear scales where the domain and range are identical.
ScaleLinear<Y> Linear scales
Linear scales map a continuous, quantitative input domain to a continuous output range using a linear transformation (translate and scale).
ScaleLog<Y> Log scales
Logarithmic (“log”) scales are like linear scales except that a logarithmic transform is applied to the input domain value before the output range value is computed.
ScaleOrdinal<X, Y> Ordinal scales
Unlike continuous scales, ordinal scales have a discrete domain and range.
ScalePoint<X> Point scales
Point scales are a variant of band scales with the bandwidth fixed to zero.
ScalePow<Y> Pow scales
Power (“pow”) scales are similar to linear scales, except an exponential transform is applied to the input domain value before the output range value is computed.
ScaleQuantile<Y> Quantile scales
Quantile scales map a sampled input domain to a discrete range.
ScaleQuantize<Y> Quantize scales
Quantize scales are similar to linear scales, except they use a discrete rather than continuous range.
ScaleRadial Linear scales
Radial scales are a variant of linear scales where the range is internally squared so that an input value corresponds linearly to the squared output value.
ScaleSequential<Y> Sequential scales
Sequential scales are similar to linear scales, but the input domain and output range always have exactly three elements.
ScaleSequentialLog<Y> Sequential scales
A sequential scale with a logarithmic transform, analogous to ScaleLog.
ScaleSequentialPow<Y> Sequential scales
A sequential scale with an exponential transform, analogous to a ScalePow.
ScaleSequentialQuantile<Y> Sequential scales
A sequential scale with a p-quantile transform, analogous to a ScaleQuantile.
ScaleSequentialSymlog<Y> Sequential scales
A sequential scale with a logarithmic transform, analogous to a ScaleSymlog.
ScaleSymlog<Y> Symlog scales
See A bi-symmetric log transformation for wide-range data by Webber for details. Unlike a ScaleLog, a symlog scale domain can include zero.
ScaleThreshold<X, Y> Threshold scales
Threshold scales are similar to quantize scales, except they allow you to map arbitrary subsets of the domain to discrete values in the range.
ScaleTime<Y> Time scales
Time scales are a variant of linear scales that have a temporal domain.
Stack<K, T> Stacks
Stacking converts lengths into contiguous position intervals.
Symbol Symbols
Symbols provide a categorical shape encoding as in a scatterplot.
SymbolAsterisk Symbols
The asterisk symbol type; intended for stroking.
SymbolCircle Symbols
The circle symbol type; intended for either filling or stroking.
SymbolCross Symbols
The Greek cross symbol type, with arms of equal length; intended for filling.
SymbolDiamond Symbols
The rhombus symbol type; intended for filling.
SymbolDiamond2 Symbols
The rotated square symbol type; intended for stroking.
SymbolPlus Symbols
The plus symbol type; intended for stroking.
SymbolSquare Symbols
The square symbol type; intended for filling.
SymbolSquare2 Symbols
The square2 symbol type; intended for stroking.
SymbolStar Symbols
The pentagonal star (pentagram) symbol type; intended for filling.
SymbolTimes Symbols
The X-shape symbol type; intended for stroking.
SymbolTriangle Symbols
The up-pointing triangle symbol type; intended for filling.
SymbolTriangle2 Symbols
The up-pointing triangle symbol type; intended for stroking.
SymbolType Symbols
Symbol types are typically not used directly, instead being passed to Symbol.type. However, you can define your own symbol type implementation should none of the built-in types satisfy your needs using the following interface.
SymbolWye Symbols
The Y-shape symbol type; intended for filling.
TimeFormatLocale
Time locale formats define how a date should be parsed and formatted in a locale-specific way.
TimeInterval
Time intervals provide a convenient and flexible API for date calculations based on conventional or custom units of time on top of DateTime.

Extensions

ScaleContinuousNumberExtension on ScaleContinuousBase<X, num>
Adds invert and rangeRound methods to continuous scales with numeric range.
ScaleDivergingNumberExtension on ScaleDiverging<num>
Adds rangeRound method to diverging scales with numeric range.
ScaleSequentialNumberExtension on ScaleSequential<num>
Adds rangeRound method to sequential scales with numeric range.

Constants

geoEqualEarthRaw → const GeoRawTransform
The raw Equal Earth projection, by Bojan Šavrič et al., 2018.
geoEquirectangularRaw → const GeoRawTransform
The raw equirectangular (plate carrée) projection.
geoMercatorRaw → const GeoRawTransform
The raw spherical Mercator projection.
geoNaturalEarth1Raw → const GeoRawTransform
The raw Natural Earth projection.
geoTransverseMercatorRaw → const GeoRawTransform
The raw transverse spherical Mercator projection.
symbols → const List<SymbolType> Symbols
Equivalent to symbolsFill.
symbolsFill → const List<SymbolType> Symbols
An list containing a set of symbol types designed for filling: SymbolCircle, SymbolCross, SymbolDiamond, SymbolSquare, SymbolStar, SymbolTriangle, and SymbolWye. Useful for a categorical shape encoding with an ordinal scale.
symbolsStroke → const List<SymbolType> Symbols
An list containing a set of symbol types designed for stroking: SymbolCircle, SymbolPlus, SymbolTimes, SymbolTriangle2, SymbolAsterisk, SymbolSquare2, and SymbolDiamond2. Useful for a categorical shape encoding with an ordinal scale.

Properties

geoAzimuthalEqualAreaRaw GeoRawTransform
The raw azimuthal equal-area projection.
final
geoAzimuthalEquidistantRaw GeoRawTransform
The raw azimuthal equidistant projection.
final
geoClipAntimeridian GeoStream Function(GeoStream)
A clipping function which transforms a stream such that geometries (lines or polygons) that cross the antimeridian line are cut in two, one on each side.
final
geoGnomonicRaw GeoRawTransform
The raw gnomonic projection.
final
geoOrthographicRaw GeoRawTransform
The raw orthographic projection.
final
geoStereographicRaw GeoRawTransform
The raw stereographic projection.
final
schemeAccent List<String> Categorical schemes
An list of eight categorical colors represented as RGB hexadecimal strings.
final
schemeBlues List<List<String>?> Sequential schemes
The “Blues” discrete sequential color scheme of size k in 3–9.
final
schemeBrBG List<List<String>?> Diverging schemes
The “BrBG” discrete diverging color scheme of size k in 3–11.
final
schemeBuGn List<List<String>?> Sequential schemes
The “BuGn” discrete sequential color scheme of size k in 3–9.
final
schemeBuPu List<List<String>?> Sequential schemes
The “BuPu” discrete sequential color scheme of size k in 3–9.
final
schemeCategory10 List<String> Categorical schemes
An list of ten categorical colors represented as RGB hexadecimal strings.
final
schemeDark2 List<String> Categorical schemes
An list of eight categorical colors represented as RGB hexadecimal strings.
final
schemeGnBu List<List<String>?> Sequential schemes
The “GnBu” discrete sequential color scheme of size k in 3–9.
final
schemeGreens List<List<String>?> Sequential schemes
The “Greens” discrete sequential color scheme of size k in 3–9.
final
schemeGreys List<List<String>?> Sequential schemes
The “Greys” discrete sequential color scheme of size k in 3–9.
final
schemeOranges List<List<String>?> Sequential schemes
The “Oranges” discrete sequential color scheme of size k in 3–9.
final
schemeOrRd List<List<String>?> Sequential schemes
The “OrRd” discrete sequential color scheme of size k in 3–9.
final
schemePaired List<String> Categorical schemes
An list of twelve categorical colors represented as RGB hexadecimal strings.
final
schemePastel1 List<String> Categorical schemes
An list of nine categorical colors represented as RGB hexadecimal strings.
final
schemePastel2 List<String> Categorical schemes
An list of eight categorical colors represented as RGB hexadecimal strings.
final
schemePiYG List<List<String>?> Diverging schemes
The “PiYG” discrete diverging color scheme of size k in 3–11.
final
schemePRGn List<List<String>?> Diverging schemes
The “PRGn” discrete diverging color scheme of size k in 3–11.
final
schemePuBu List<List<String>?> Sequential schemes
The “PuBu” discrete sequential color scheme of size k in 3–9.
final
schemePuBuGn List<List<String>?> Sequential schemes
The “PuBuGn” discrete sequential color scheme of size k in 3–9.
final
schemePuOr List<List<String>?> Diverging schemes
The “PuOr” discrete diverging color scheme of size k in 3–11.
final
schemePuRd List<List<String>?> Sequential schemes
The “PuRd” discrete sequential color scheme of size k in 3–9.
final
schemePurples List<List<String>?> Sequential schemes
The “Purples” discrete sequential color scheme of size k in 3–9.
final
schemeRdBu List<List<String>?> Diverging schemes
The “RdBu” discrete diverging color scheme of size k in 3–11.
final
schemeRdGy List<List<String>?> Diverging schemes
The “RdGy” discrete diverging color scheme of size k in 3–11.
final
schemeRdPu List<List<String>?> Sequential schemes
The “RdPu” discrete sequential color scheme of size k in 3–9.
final
schemeRdYlBu List<List<String>?> Diverging schemes
The “RdYlBu” discrete diverging color scheme of size k in 3–11.
final
schemeRdYlGn List<List<String>?> Diverging schemes
The “RdYlGn” discrete diverging color scheme of size k in 3–11.
final
schemeReds List<List<String>?> Sequential schemes
The “Reds” discrete sequential color scheme of size k in 3–9.
final
schemeSet1 List<String> Categorical schemes
An list of nine categorical colors represented as RGB hexadecimal strings.
final
schemeSet2 List<String> Categorical schemes
An list of eight categorical colors represented as RGB hexadecimal strings.
final
schemeSet3 List<String> Categorical schemes
An list of twelve categorical colors represented as RGB hexadecimal strings.
final
schemeSpectral List<List<String>?> Diverging schemes
The “Spectral” discrete diverging color scheme of size k in 3–11.
final
schemeTableau10 List<String> Categorical schemes
An list of ten categorical colors authored by Tableau as part of Tableau 10 represented as RGB hexadecimal strings.
final
schemeYlGn List<List<String>?> Sequential schemes
The “YlGn” discrete sequential color scheme of size k in 3–9.
final
schemeYlGnBu List<List<String>?> Sequential schemes
The “YlGnBu” discrete sequential color scheme of size k in 3–9.
final
schemeYlOrBr List<List<String>?> Sequential schemes
The “YlOrBr” discrete sequential color scheme of size k in 3–9.
final
schemeYlOrRd List<List<String>?> Sequential schemes
The “YlOrRd” discrete sequential color scheme of size k in 3–9.
final
timeDay TimeInterval
Days (e.g., February 7, 2012 at 12:00 AM); typically 24 hours. Days in local time may range from 23 to 25 hours due to daylight saving.
final
timeDays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeDay.range.
final
timeFriday TimeInterval
Friday-based weeks (e.g., February 10, 2012 at 12:00 AM).
final
timeFridays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeFridays.range.
final
timeHour TimeInterval
Hours (e.g., 01:00 AM); 60 minutes. Note that advancing time by one hour in local time can return the same hour or skip an hour due to daylight saving.
final
timeHours List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeHour.range.
final
timeMillisecond → _TimeMillisecond
Milliseconds; the shortest available time unit.
final
timeMilliseconds List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeMillisecond.range.
final
timeMinute TimeInterval
Minutes (e.g., 01:02:00 AM); 60 seconds. Note that DateTime class ignores leap seconds.
final
timeMinutes List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeMinute.range.
final
timeMonday TimeInterval
Monday-based weeks (e.g., February 6, 2012 at 12:00 AM).
final
timeMondays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeMondays.range.
final
timeMonth TimeInterval
Months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
final
timeMonths List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeMonth.range.
final
timeSaturday TimeInterval
Saturday-based weeks (e.g., February 11, 2012 at 12:00 AM).
final
timeSaturdays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeSaturdays.range.
final
timeSecond TimeInterval
Seconds in local time (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
final
timeSeconds List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeSecond.range.
final
timeSunday TimeInterval
Sunday-based weeks (e.g., February 5, 2012 at 12:00 AM).
final
timeSundays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeSundays.range.
final
timeThursday TimeInterval
Thursday-based weeks (e.g., February 9, 2012 at 12:00 AM).
final
timeThursdays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeThursdays.range.
final
timeTuesday TimeInterval
Tuesday-based weeks (e.g., February 7, 2012 at 12:00 AM).
final
timeTuesdays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeTuesdays.range.
final
timeWednesday TimeInterval
Wednesday-based weeks (e.g., February 8, 2012 at 12:00 AM).
final
timeWednesdays List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeWednesdays.range.
final
timeWeek TimeInterval
Alias for timeSunday; 7 days and typically 168 hours. Weeks in local time may range from 167 to 169 hours due to daylight saving.
final
timeWeeks List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeWeeks.range.
final
timeYear → _TimeYear
Years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
final
timeYears List<DateTime> Function(DateTime start, DateTime stop, [num step = 1])
Alias for timeYear.range.
final

Functions

ascending(Object? a, Object? b) num Sorting data
Returns -1 if a is less than b, or 1 if a is greater than b, or 0.
autoType(Map<String, String> row) Map<String, Object?>
Given an map representing a parsed row, infers the types of values on the map and coerces them accordingly, returning the mutated map.
bisectCenter<T>(List<T> list, T x, {int lo = 0, int? hi, num comparator(T, T) = ascending, num delta(T, T)?}) int Bisecting data
Similar to bisectLeft, but returns the index of the value closest to x in the given listaccording to the specified delta function.
bisectLeft<T>(List<T> list, T x, {int lo = 0, int? hi, num comparator(T, T) = ascending}) int Bisecting data
Returns the insertion point for x in list to maintain sorted order according to the specified comparator.
bisectRight<T>(List<T> list, T x, {int lo = 0, int? hi, num comparator(T, T) = ascending}) int Bisecting data
Similar to bisectLeft, but returns an insertion point which comes after (to the right of) any existing entries of x in list.
blur(List<double> data, num radius) List<double> Blurring data
Blurs an list of data in-place by applying three iterations of a moving average transform, for a fast approximation of a gaussian kernel of the given radius, a non-negative number, and returns the list.
blur2(({List<double> data, int? height, int width}) data, int rx, [int? ry]) → ({List<double> data, int? height, int width}) Blurring data
Blurs a matrix of the given width and height in-place, by applying an horizontal blur of radius rx and a vertical blur or radius ry (which defaults to rx).
blurImage(({List<double> data, int? height, int width}) data, int rx, [int? ry]) → ({List<double> data, int? height, int width}) Blurring data
Blurs an ImageData structure in-place, blurring each of the RGBA layers independently by applying an horizontal blur of radius rx and a vertical blur or radius ry (which defaults to rx). Returns the blurred ImageData.
count(Iterable<num?> iterable) int Summarizing data
Returns the count of values in the iterable.
countBy<T>(Iterable<T> iterable, num? accessor(T)) int? Summarizing data
Returns the count of values yielded by the accessor function applied to each element in the iterable.
cross<T>(Iterable<Iterable<T>> iterables) List<List<T>> Transforming data
Returns the Cartesian product of the specified iterables.
crossWith<T, R>(Iterable<Iterable<T>> iterables, R reducer(List<T>)) List<R> Transforming data
Returns the Cartesian product of the specified iterables, applying the specified reducer function to each combination of elements.
csvFormat(Iterable<Map<String, Object?>> rows, [Iterable<String>? columns]) String
Equivalent to DsvFormat.format with a delimiter of ",".
csvFormatBody(Iterable<Map<String, Object?>> rows, [Iterable<String>? columns]) String
Equivalent to DsvFormat.formatBody with a delimiter of ",".
csvFormatRow(Iterable<Object?> row) String
Equivalent to DsvFormat.formatRow with a delimiter of ",".
csvFormatRows(Iterable<Iterable<Object?>> rows) String
Equivalent to DsvFormat.formatRows with a delimiter of ",".
csvFormatValue(Object? value) String
Equivalent to DsvFormat.formatValue with a delimiter of ",".
csvParse(String data) → (List<Map<String, String>>, {List<String> columns})
Equivalent to DsvFormat.parse using "," as delimiter.
csvParseRows(String data) List<List<String>>
Equivalent to DsvFormat.parseRows with a delimiter of ",".
csvParseRowsWith<R>(String data, R? conversion(List<String>, int)) List<R>
Equivalent to DsvFormat.parseRowsWith with a delimiter of ",".
csvParseWith<R>(String data, R? conversion(Map<String, String>, int, List<String>)) → (List<R>, {List<String> columns})
Equivalent to DsvFormat.parseWith with a delimiter of ",".
cumsum(Iterable<num?> iterable) List<num?> Summarizing data
Returns the cumsum of all values in the iterable.
cumsumBy<T>(Iterable<T> iterable, num? accessor(T)) List<num> Summarizing data
Returns the cumsum of all values yielded by the accessor function applied to each element in the iterable, as a list of the same length.
curveBasis(Path context) Curve Curves
Produces a cubic basis spline using the specified control points.
curveBasisClosed(Path context) Curve Curves
Produces a closed cubic basis spline using the specified control points.
curveBasisOpen(Path context) Curve Curves
Produces a cubic basis spline using the specified control points.
curveBumpX(Path context) Curve Curves
Produces a Bézier curve between each pair of points, with horizontal tangents at each point.
curveBumpY(Path context) Curve Curves
Produces a Bézier curve between each pair of points, with vertical tangents at each point.
curveBundle(Path context) Curve Curves
Produces a straightened cubic basis spline using the specified control points, with the spline straightened according to the curve’s beta (see curveBundleBeta), which defaults to 0.85.
curveBundleBeta(num beta) CurveFactory Curves
Returns a bundle curve with the specified beta in the range [0, 1], representing the bundle strength.
curveCardinal(Path context) Curve Curves
Produces a cubic cardinal spline using the specified control points, with one-sided differences used for the first and last piece.
curveCardinalClosed(Path context) Curve Curves
Produces a closed cubic cardinal spline using the specified control points. When a line segment ends, the first three control points are repeated, producing a closed loop.
curveCardinalClosedTension(num tension) CurveFactory Curves
Equivalent to curveCardinalTension, but returns a curveCardinalClosed.
curveCardinalOpen(Path context) Curve Curves
Produces a cubic cardinal spline using the specified control points.
curveCardinalOpenTension(num tension) CurveFactory Curves
Equivalent to curveCardinalTension, but returns a curveCardinalOpen.
curveCardinalTension(num tension) → CurveCardinal Function(Path) Curves
Returns a cardinal curve with the specified tension in the range [0, 1].
curveCatmullRom(Path context) Curve Curves
Produces a cubic Catmull–Rom spline using the specified control points and the parameter alpha (see curveCatmullRomAlpha), which defaults to 0.5, as proposed by Yuksel et al. in On the Parameterization of Catmull–Rom Curves, with one-sided differences used for the first and last piece.
curveCatmullRomAlpha(num alpha) CurveFactory Curves
Returns a cubic Catmull–Rom curve with the specified alpha in the range [0, 1].
curveCatmullRomClosed(Path context) Curve Curves
Produces a closed cubic Catmull–Rom spline using the specified control points and the parameter alpha (see curveCatmullRomClosedAlpha), which defaults to 0.5, as proposed by Yuksel et al.
curveCatmullRomClosedAlpha(num alpha) CurveFactory Curves
Equivalent to curveCatmullRomAlpha, but returns a curveCatmullRomClosed.
curveCatmullRomOpen(Path context) Curve Curves
Produces a cubic Catmull–Rom spline using the specified control points and the parameter alpha (see curveCatmullRomClosedAlpha), which defaults to 0.5, as proposed by Yuksel et al.
curveCatmullRomOpenAlpha(num alpha) CurveFactory Curves
Equivalent to curveCatmullRomAlpha, but returns a curveCatmullRomOpen.
curveLinear(Path context) Curve Curves
Produces a polyline through the specified points.
curveLinearClosed(Path context) Curve Curves
Produces a closed polyline through the specified points by repeating the first point when the line segment ends.
curveMonotoneX(Path context) Curve Curves
Produces a cubic spline that preserves monotonicity in y, assuming monotonicity in x, as proposed by Steffen in A simple method for monotonic interpolation in one dimension: “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations.
curveMonotoneY(Path context) Curve Curves
Produces a cubic spline that preserves monotonicity in x, assuming monotonicity in y, as proposed by Steffen in A simple method for monotonic interpolation in one dimension: “a smooth curve with continuous first-order derivatives that passes through any given set of data points without spurious oscillations.
curveNatural(Path context) Curve Curves
Produces a natural cubic spline with the second derivative of the spline set to zero at the endpoints.
curveStep(Path context) Curve Curves
Produces a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines.
curveStepAfter(Path context) Curve Curves
Produces a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines.
curveStepBefore(Path context) Curve Curves
Produces a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines.
descending(Object? a, Object? b) num Sorting data
Returns -1 if a is greater than b, or 1 if a is less than b, or 0.
deviation(Iterable<num?> iterable) num? Summarizing data
Returns the standard deviation, defined as the square root of the bias-corrected variance, of all values in the iterable.
deviationBy<T>(Iterable<T> iterable, num? accessor(T)) num? Summarizing data
Returns the standard deviation, defined as the square root of the bias-corrected variance, of all values yielded by the accessor function applied to each element in the iterable.
difference<T>(Iterable<T> iterable, Iterable<Iterable<Object?>> others) Set<T> Set operations
Returns a new set containing every value in iterable that is not in any of the others iterables.
disjoint<T>(Iterable<Object?> a, Iterable<Object?> b) bool Set operations
Returns true if a and b are disjoint: if a and b contain no shared value.
extent<T extends Comparable?>(Iterable<T> iterable) → (T?, T?) Summarizing data
Returns the minimum and maximum values in the iterable.
extentBy<T, R extends Comparable?>(Iterable<T> iterable, R accessor(T)) → (R?, R?) Summarizing data
Returns the minimum and maximum values yielded by the accessor function applied to each element in the iterable.
fcumsum(Iterable<num?> iterable) Float64List Adding numbers
Returns a full precision cumulative sum of all values in the iterable.
fcumsumBy<T>(Iterable<T> iterable, num? accessor(T)) Float64List Adding numbers
Returns a full precision cumulative sum of all values yielded by the accessor function applied to each element in the iterable.
filter<T>(Iterable<T> iterable, bool test(T)) List<T> Transforming data
Returns a new list containing the values from iterable, in order, for which the given test function returns true.
format(String specifier) String Function(Object?)
An alias for FormatLocale.format on the default locale (see formatDefaultLocale).
formatDefaultLocale({String? decimal, String? thousands, List<int>? grouping, List<String>? currency, List<String>? numerals, String? percent, String? minus, String? nan}) FormatLocale
Equivalent to FormatLocale.new, except it also redefines format and formatPrefix to the new locale’s FormatLocale.format and FormatLocale.formatPrefix.
formatDefaultLocaleFromJson(Map<String, dynamic> definition) FormatLocale
Equivalent to formatDefaultLocale, but it accepts a JSON definition object instead of individual arguments.
formatPrefix(String specifier, num value) String Function(num)
An alias for FormatLocale.formatPrefix on the default locale (see formatDefaultLocale).
fsum(Iterable<num?> iterable) double Adding numbers
Returns a full precision summation of all values in the iterable.
fsumBy<T>(Iterable<T> iterable, num? accessor(T)) double Adding numbers
Returns a full precision summation of all values yielded by the accessor function applied to each element in the iterable.
geoAlbers() GeoProjection
The Albers’ equal area-conic projection.
geoArea(Map object) double
Returns the spherical area of the specified GeoJSON object in steradians.
geoAzimuthalEqualArea() GeoProjection
The azimuthal equal-area projection.
geoAzimuthalEquidistant() GeoProjection
The azimuthal equidistant projection.
geoBounds(Map object) List<List<num>>
Returns the spherical bounding box for the specified GeoJSON object.
geoCentroid(Map object) List<double>
Returns the spherical centroid of the specified GeoJSON object.
geoClipCircle(double angle) GeoStream Function(GeoStream)
Generates a clipping function which transforms a stream such that geometries are bounded by a small circle of radius angle around the GeoProjection.center.
geoClipRectangle(num x0, num y0, num x1, num y1) GeoStream Function(GeoStream)
Generates a clipping function which transforms a stream such that geometries are bounded by a rectangle of coordinates [[x0, y0], [x1, y1]].
geoConicConformal() GeoConicProjection
The conic conformal projection.
geoConicConformalRaw(List<double> y) GeoRawTransform
The raw conic conformal projection.
geoConicEqualArea() GeoConicProjection
The Albers’ equal-area conic projection.
geoConicEqualAreaRaw(List<double> y) GeoRawTransform
The raw Albers’ equal-area conic projection.
geoConicEquidistant() GeoConicProjection
The conic equidistant projection.
geoConicEquidistantRaw(List<double> y) GeoRawTransform
The raw conic equidistant projection.
geoContains(Map? object, List<num> point) bool
Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point.
geoDistance(List<num> a, List<num> b) double
Returns the great-arc distance in radians between the two points a and b.
geoEqualEarth() GeoProjection
The Equal Earth projection, by Bojan Šavrič et al., 2018.
geoEquirectangular() GeoProjection
The equirectangular (plate carrée) projection.
geoGnomonic() GeoProjection
The gnomonic projection.
geoGraticule10() Map
A convenience method for directly generating the default 10° global graticule as a GeoJSON MultiLineString geometry object.
geoInterpolate(List<double> a, List<double> b) List<double> Function(double)
Returns an interpolator function given two points a and b.
geoLength(Map object) double
Returns the great-arc length of the specified GeoJSON object in radians.
geoMercator() GeoProjection
The spherical Mercator projection.
geoNaturalEarth1() GeoProjection
The Natural Earth projection is a pseudocylindrical projection designed by Tom Patterson.
geoOrthographic() GeoProjection
The orthographic projection.
geoParseObject(Object object) Map<String?, dynamic>
Returns a deep copy of the GeoJSON object with the most precise types for the structure by traversing and rebuilding on the way back.
geoParseString(String object) Map<String?, dynamic>
Equivalent to geoParseObject except it accepts the GeoJSON object as string.
geoParseUtf8(Uint8List object) Map<String?, dynamic>
Equivalent to geoParseObject except it accepts the GeoJSON object as utf8.
geoStereographic() GeoProjection
The stereographic projection.
greatest<T>(Iterable<T> iterable, [num comparator(T, T) = ascending]) → T? Summarizing data
Returns the greatest of all values in the iterable according to the specified comparator.
greatestBy<T, R>(Iterable<T> iterable, R accessor(T), [num comparator(R, R) = ascending]) → T? Summarizing data
Returns the element with the greatest of all values yielded by the accessor function applied to each element in the iterable according to the specified comparator.
greatestIndex<T>(Iterable<T> iterable, [num comparator(T, T) = ascending]) int Summarizing data
Returns the index of the greatest of all values in the iterable according to the specified comparator.
greatestIndexBy<T, R>(Iterable<T> iterable, R accessor(T), [num comparator(R, R) = ascending]) int Summarizing data
Returns the index of the element with the greatest of all values yielded by the accessor function applied to each element in the iterable according to the specified comparator.
group<T, K>(Iterable<T> iterable, K key(T)) Map<K, List<T>> Grouping data
Groups the specified iterable of values into an Map from key to list of value.
groupSort<T, K>(Iterable<T> iterable, K key(T), [num valueComparator(List<T>, List<T>) = ascending, num keyComparator(K, K) = ascending]) List<K> Grouping data
Groups the specified iterable of elements according to the specified key function, sorts the groups according to the specified valueComparator for values and keyComparator for keys, and then returns a list of keys in sorted order.
index<T, K>(Iterable<T> iterable, K key(T)) Map<K, List<T>> Grouping data
Equivalent to group but returns a unique value per compound key instead of an list, throwing if the key is not unique.
interpolate(Object? a, Object? b) Object? Function(num) Value interpolation
Returns an interpolator between the two arbitrary values a and b.
interpolateBasis(List<num> values) num Function(num) Value interpolation
Returns a uniform nonrational B-spline interpolator through the specified list of values, which must be numbers.
interpolateBasisClosed(List<num> values) num Function(num) Value interpolation
Returns a uniform nonrational B-spline interpolator through the specified list of values, which must be numbers.
interpolateBlues(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “Blues” sequential color scheme represented as an RGB string.
interpolateBrBG(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “BrBG” diverging color scheme represented as an RGB string.
interpolateBuGn(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “BuGn” sequential color scheme represented as an RGB string.
interpolateBuPu(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “BuPu” sequential color scheme represented as an RGB string.
interpolateCividis(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “cividis” color vision deficiency-optimized color scheme designed by Nuñez, Anderton, and Renslow, represented as an RGB string.
interpolateCool(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from Niccoli’s perceptual rainbow, represented as an RGB string.
interpolateCubehelix(Object? a, Object? b) String Function(num) Color interpolation
Returns an Cubehelix color space interpolator between the two colors a and b with a default gamma of 1.
interpolateCubehelixDefault(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from Green’s default Cubehelix represented as an RGB string.
interpolateCubehelixGamma(num gamma) String Function(num) Function(Object?, Object?) Color interpolation
Returns a new Cubehelix color space interpolator factory using the specified gamma.
interpolateCubehelixGammaLong(num gamma) String Function(num) Function(Object?, Object?) Color interpolation
Like interpolateCubehelixGamma, but does not use the shortest path between hues.
interpolateCubehelixLong(Object? a, Object? b) String Function(num) Color interpolation
Like interpolateCubehelixGammaLong, but does not use the shortest path between hues.
interpolateDate(DateTime a, DateTime b) DateTime Function(num) Value interpolation
Returns an interpolator between the two dates a and b.
interpolateDiscrete(List<Object?> values) Object? Function(num) Value interpolation
Returns a discrete interpolator for the given list of values.
interpolateGnBu(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “GnBu” sequential color scheme represented as an RGB string.
interpolateGreens(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the "Greens" sequential color scheme represented as an RGB string.
interpolateGreys(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the "Greys" sequential color scheme represented as an RGB string.
interpolateHcl(Object? a, Object? b) String Function(num) Color interpolation
Returns a CIELChab color space interpolator between the two colors a and b.
interpolateHclLong(Object? a, Object? b) String Function(num) Color interpolation
Like interpolateHcl, but does not use the shortest path between hues.
interpolateHsl(Object? a, Object? b) String Function(num) Color interpolation
Returns an HSL color space interpolator between the two colors a and b.
interpolateHslLong(Object? a, Object? b) String Function(num) Color interpolation
Like interpolateHsl, but does not use the shortest path between hues.
interpolateHue(num a, num b) num Function(num) Color interpolation
Returns an interpolator between the two hue angles a and b.
interpolateInferno(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “inferno” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, represented as an RGB string.
interpolateLab(Object? a, Object? b) String Function(num) Color interpolation
Returns a CIELAB color space interpolator between the two colors a and b.
interpolateList<T>(List<T> a, List<T> b) List<Object?> Function(num) Value interpolation
Returns an interpolator between the two lists a and b.
interpolateMagma(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “magma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, represented as an RGB string.
interpolateMap<K, V>(Map<K, V> a, Map<K, V> b) Map<K, Object?> Function(num) Value interpolation
Returns an interpolator between the two objects a and b.
interpolateNumber(num a, num b) num Function(num) Value interpolation
Returns an interpolator between the two numbers a and b.
interpolateNumberList<T extends num>(List<T> a, List<T> b) List<T> Function(num) Value interpolation
Returns an interpolator between the two list of numbers a and b.
interpolateOranges(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the "Oranges" sequential color scheme represented as an RGB string.
interpolateOrRd(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “OrRd” sequential color scheme represented as an RGB string.
interpolatePiYG(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “PiYG” diverging color scheme represented as an RGB string.
interpolatePlasma(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “plasma” perceptually-uniform color scheme designed by van der Walt and Smith for matplotlib, represented as an RGB string.
interpolatePRGn(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “PRGn” diverging color scheme represented as an RGB string.
interpolatePuBu(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “PuBu” sequential color scheme represented as an RGB string.
interpolatePuBuGn(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “PuBuGn” sequential color scheme represented as an RGB string.
interpolatePuOr(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “PuOr” diverging color scheme represented as an RGB string.
interpolatePuRd(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “PuRd” sequential color scheme represented as an RGB string.
interpolatePurples(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the "Purples" sequential color scheme represented as an RGB string.
interpolateRainbow(num t) String Cyclical schemes
Given a number t in the range [0,1], returns the corresponding color from interpolateWarm scale from [0.0, 0.5] followed by the interpolateCool scale from [0.5, 1.0], thus implementing the cyclical less-angry rainbow color scheme.
interpolateRdBu(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “RdBu” diverging color scheme represented as an RGB string.
interpolateRdGy(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “RdGy” diverging color scheme represented as an RGB string.
interpolateRdPu(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “RdPu” sequential color scheme represented as an RGB string.
interpolateRdYlBu(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “RdYlBu” diverging color scheme represented as an RGB string.
interpolateRdYlGn(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “RdYlGn” diverging color scheme represented as an RGB string.
interpolateReds(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the "Reds" sequential color scheme represented as an RGB string.
interpolateRgb(Object? a, Object? b) String Function(num) Color interpolation
Returns an RGB color space interpolator between the two colors a and b with a default gamma of 1.
interpolateRgbBasis(List<Object?> colors) String Function(num) Color interpolation
Returns a uniform nonrational B-spline interpolator through the specified list of colors, which are converted to RGB color space.
interpolateRgbBasisClosed(List<Object?> colors) String Function(num) Color interpolation
Returns a uniform nonrational B-spline interpolator through the specified list of colors, which are converted to RGB color space.
interpolateRgbGamma(num y) String Function(num) Function(Object?, Object?) Color interpolation
Returns a new RGB color space interpolator factory using the specified gamma.
interpolateRound(num a, num b) int Function(num) Value interpolation
Returns an interpolator between the two numbers a and b; the interpolator is similar to interpolateNumber, except it will round the resulting value to the nearest integer.
interpolateSinebow(num t) String Cyclical schemes
Given a number t in the range [0,1], returns the corresponding color from the “sinebow” color scheme by Jim Bumgardner and Charlie Loyd.
interpolateSpectral(num t) String Diverging schemes
Given a number t in the range [0,1], returns the corresponding color from the “Spectral” diverging color scheme represented as an RGB string.
interpolateString(String a, String b) String Function(num) Value interpolation
Returns an interpolator between the two strings a and b.
interpolateTurbo(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “turbo” color scheme by Anton Mikhailov.
interpolateViridis(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “viridis” perceptually-uniform color scheme designed by van der Walt, Smith and Firing for matplotlib, represented as an RGB string.
interpolateWarm(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from a 180° rotation of Niccoli’s perceptual rainbow, represented as an RGB string.
interpolateYlGn(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “YlGn” sequential color scheme represented as an RGB string.
interpolateYlGnBu(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “YlGnBu” sequential color scheme represented as an RGB string.
interpolateYlOrBr(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “YlOrBr” sequential color scheme represented as an RGB string.
interpolateYlOrRd(num t) String Sequential schemes
Given a number t in the range [0,1], returns the corresponding color from the “YlOrRd” sequential color scheme represented as an RGB string.
interpolateZoom(View a, View b) → ZoomInterpolator Zoom interpolation
Returns an interpolator between the two views a and b of a two-dimensional plane, based on “Smooth and efficient zooming and panning” by Jarke J. van Wijk and Wim A.A. Nuij.
interpolateZoomRho(num rho) → ZoomInterpolator Function(View, View) Zoom interpolation
Returns a new zoom interpolator using the specified curvature rho.
intersection<T>(Iterable<T> iterable, Iterable<Iterable<Object?>> others) Set<T> Set operations
Returns a new set containing every (distinct) value that appears in all of the given iterables.
least<T>(Iterable<T> iterable, [num comparator(T, T) = ascending]) → T? Summarizing data
Returns the least of all values in the iterable according to the specified comparator.
leastBy<T, R>(Iterable<T> iterable, R accessor(T), [num comparator(R, R) = ascending]) → T? Summarizing data
Returns the element with the least of all values yielded by the accessor function applied to each element in the iterable according to the specified comparator.
leastIndex<T>(Iterable<T> iterable, [num comparator(T, T) = ascending]) int Summarizing data
Returns the index of the least of all values in the iterable according to the specified comparator.
leastIndexBy<T, R>(Iterable<T> iterable, R accessor(T), [num comparator(R, R) = ascending]) int Summarizing data
Returns the index of the element with the least of all values yielded by the accessor function applied to each element in the iterable according to the specified comparator.
map<T, R>(Iterable<T> iterable, R mapper(T)) List<R> Transforming data
Returns a new list containing the mapped values from iterable, in order, as defined by given mapper function.
max<T extends Comparable?>(Iterable<T> iterable) → T? Summarizing data
Returns the maximum of all values in the iterable.
maxBy<T, R extends Comparable?>(Iterable<T> iterable, R accessor(T)) → R? Summarizing data
Returns the maximum of all values yielded by the accessor function applied to each element in the iterable.
maxIndex<T extends Comparable?>(Iterable<T> iterable) int Summarizing data
Returns the index of the maximum of all values in the iterable.
maxIndexBy<T, R extends Comparable?>(Iterable<T> iterable, R accessor(T)) int Summarizing data
Returns the index of the maximum of all values yielded by the accessor function applied to each element in the iterable.
mean(Iterable<num?> iterable) num? Summarizing data
Returns the mean of all values in the iterable.
meanBy<T>(Iterable<T> iterable, num? accessor(T)) num? Summarizing data
Returns the mean of all values yielded by the accessor function applied to each element in the iterable.
median(Iterable<num?> iterable) num? Summarizing data
Returns the median of all values in the iterable using the R-7 method.
medianBy<T>(Iterable<T> iterable, num? accessor(T)) num? Summarizing data
Returns the median of all values yielded by the accessor function applied to each element in the iterable using the R-7 method.
medianIndex(Iterable<num?> values) int? Summarizing data
Similar to median, but returns the index of the value to the left of the median.
medianIndexBy<T>(Iterable<T> values, num? accessor(T)) int? Summarizing data
Similar to medianBy, but returns the index of the element that yields the value to the left of the median.
merge<T>(Iterable<Iterable<T>> iterables) List<T> Transforming data
Merges the specified iterable of iterables into a single list.
min<T extends Comparable?>(Iterable<T> iterable) → T? Summarizing data
Returns the minimum of all values in the iterable.
minBy<T, R extends Comparable?>(Iterable<T> iterable, R accessor(T)) → R? Summarizing data
Returns the minimum of all values yielded by the accessor function applied to each element in the iterable.
minIndex<T extends Comparable?>(Iterable<T> iterable) int Summarizing data
Returns the index of the minimum of all values in the iterable.
minIndexBy<T, R extends Comparable?>(Iterable<T> iterable, R accessor(T)) int Summarizing data
Returns the index of the minimum of all values yielded by the accessor function applied to each element in the iterable.
mode<T>(Iterable<T> iterable) → T? Summarizing data
Returns the mode of all values in the iterable, i.e., the value which appears the most often.
modeBy<T, R>(Iterable<T> iterable, R accessor(T)) → R? Summarizing data
Returns the mode of all values yielded by the accessor function applied to each element in the iterable, i.e., the value which appears the most often.
nice(num start, num stop, num count) → (num, num) Ticks
Returns a new interval [niceStart, niceStop] covering the given interval [start, stop] and where niceStart and niceStop are guaranteed to align with the corresponding tickStep.
pairs<T>(Iterable<T> iterable) List<(T, T)> Transforming data
Returns a list of pairs from consecutive values of the provided iterable.
pairsWith<T, R>(Iterable<T> iterable, R reducer(T, T)) List<R> Transforming data
Returns a list of values yielded by the reducer function applied to each pair of consecutive elements from the provided iterable.
permute<T>(Iterable<T> iterable, Iterable<int> keys) List<T?> Sorting data
Returns a permutation of the specified iterable using the keys.
permuteMap<K, V>(Map<K, V> map, Iterable<K> keys) List<V?> Sorting data
Returns a permutation of the specified map using the keys.
piecewise<T>(List<T> values, [Object? Function(num) interpolatorFactory(T, T) = interpolate]) Object? Function(num) Value interpolation
Returns a piecewise interpolator, composing interpolators for each adjacent pair of values.
pointRadial(num angle, num radius) List<num> Symbols
Returns the point [x, y] for the given angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise, and the given radius.
polygonArea(List<List<num>> polygon) num
Returns the signed area of the specified polygon.
polygonCentroid(List<List<num>> polygon) List<num>
Returns the centroid of the specified polygon.
polygonContains(List<List<num>> polygon, List<num> point) bool
Returns true if and only if the specified point is inside the specified polygon.
polygonHull(List<List<num>> points) List<List<num>>?
Returns the convex hull of the specified points using Andrew’s monotone chain algorithm.
polygonLength(List<List<num>> polygon) num
Returns the length of the perimeter of the specified polygon.
precisionFixed(num step) num
Returns a suggested decimal precision for fixed point notation given the specified numeric step value.
precisionPrefix(num step, num value) num
Returns a suggested decimal precision for use with FormatLocale.formatPrefix given the specified numeric step and reference value.
precisionRound(num step, num max) num
Returns a suggested decimal precision for format types that round to significant digits given the specified numeric step and max values.
quantile(Iterable<num?> iterable, num p) num? Summarizing data
Returns the p-quantile of all values in the iterable, where p is a number in the range [0, 1].
quantileBy<T>(Iterable<T> iterable, num p, num? accessor(T)) num? Summarizing data
Returns the p-quantile of all values yielded by the accessor function applied to each element in the iterable, where p is a number in the range [0, 1].
quantileIndex(Iterable<num?> iterable, num p) int? Summarizing data
Similar to quantile, but returns the index to the left of p.
quantileIndexBy<T>(Iterable<T> values, num p, num? accessor(T)) int? Summarizing data
Similar to quantileBy, but returns the index to the left of p.
quantileSorted(Iterable<num?> values, num p) num? Summarizing data
Similar to quantile, but expects the input to be sorted.
quantileSortedBy<T>(Iterable<T> values, num p, num? accessor(T)) num? Summarizing data
Similar to quantileBy, but expects the input to be sorted. In contrast with quantileBy, the accessor is only called on the elements needed to compute the quantile.
quantize<T>(T interpolator(num), int n) List<T> Value interpolation
Returns n uniformly-spaced samples from the specified interpolator, where n is an integer greater than one.
quickselect<T extends List<E>, E>(T elements, num k, {num left = 0, num right = double.infinity, int compare(E, E) = ascendingDefined}) → T Sorting data
See mourner/quickselect.
randomBates(num n) num Function()
Returns a function for generating random numbers with a Bates distribution with n independent variables.
randomBatesSource(num source()) num Function() Function(num)
Returns a randomBates function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomBernoulli(num p) int Function()
Returns a function for generating either 1 or 0 according to a Bernoulli distribution with 1 being returned with success probability p and 0 with failure probability q = 1 - p.
randomBernoulliSource(num source()) int Function() Function(num)
Returns a randomBernoulli function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomBeta(num alpha, num beta) num Function()
Returns a function for generating random numbers with a beta distribution with alpha and beta shape parameters, which must both be positive.
randomBetaSource(num source()) num Function() Function(num, num)
Returns a randomBeta function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomBinomial(num n, num p) num Function()
Returns a function for generating random numbers with a binomial distribution with n the number of trials and p the probability of success in each trial.
randomBinomialSource(num source()) num Function() Function(num, num)
Returns a randomBinomial function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomCauchy([num a = 0, num b = 1]) num Function()
Returns a function for generating random numbers with a Cauchy distribution.
randomCauchySource(num source()) num Function() Function([num, num])
Returns a randomCauchy function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomExponential(num lambda) num Function()
Returns a function for generating random numbers with an exponential distribution with the rate lambda; equivalent to time between events in a Poisson process with a mean of 1 / lambda.
randomExponentialSource(num source()) num Function() Function(num)
Returns a randomExponential function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomGamma(num k, [num theta = 1]) num Function()
Returns a function for generating random numbers with a gamma distribution with k the shape parameter and theta the scale parameter.
randomGammaSource(num source()) num Function() Function(num, [num])
Returns a randomGamma function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomGeometric(num p) num Function()
Returns a function for generating numbers with a geometric distribution with success probability p.
randomGeometricSource(num source()) num Function() Function(num)
Returns a randomGeometric function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomInt({num min = 0, required num max}) int Function()
Returns a function for generating random integers with a uniform distribution.
randomIntSource(num source()) int Function() Function({required num max, num min})
Returns a randomInt function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomIrwinHall(num n) num Function()
Returns a function for generating random numbers with an Irwin–Hall distribution with n independent variables.
randomIrwinHallSource(num source()) num Function() Function(num)
Returns a randomIrwinHall function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomLcg([num? seed]) num Function()
Returns a linear congruential generator; this function can be called repeatedly to obtain pseudorandom values well-distributed on the interval [0,1) and with a long period (up to 1 billion numbers), similar to Random.nextDouble.
randomLogistic([num a = 0, num b = 1]) num Function()
Returns a function for generating random numbers with a logistic distribution.
randomLogisticSource(num source()) num Function() Function([num, num])
Returns a randomLogistic function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomLogNormal([num mu = 0, num sigma = 1]) num Function()
Returns a function for generating random numbers with a log-normal distribution.
randomLogNormalSource(num source()) num Function() Function([num, num])
Returns a randomLogNormal function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomNormal([num mu = 0, num sigma = 1]) num Function()
Returns a function for generating random numbers with a normal (Gaussian) distribution.
randomNormalSource(num source()) num Function() Function([num, num])
Returns a randomNormal function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomPareto(num alpha) num Function()
Returns a function for generating random numbers with a Pareto distribution with the shape alpha.
randomParetoSource(num source()) num Function() Function(num)
Returns a randomPareto function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomPoisson(num lambda) num Function()
Returns a function for generating random numbers with a Poisson distribution with mean lambda.
randomPoissonSource(num source()) num Function() Function(num)
Returns a randomPoisson function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomUniform({num min = 0, num max = 1}) num Function()
Returns a function for generating random numbers with a uniform distribution.
randomUniformSource(num source()) num Function() Function({num max, num min})
Returns a randomUniform function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
randomWeibull(num k, [num a = 0, num b = 1]) num Function()
Returns a function for generating random numbers with one of the generalized extreme value distributions, depending on k:
randomWeibullSource(num source()) num Function() Function(num, [num, num])
Returns a randomWeibull function but where the given random number generator source is used as the source of randomness instead of Random.nextDouble.
range({num start = 0, required num stop, num step = 1}) List<num> Ticks
Returns an list containing an arithmetic progression, similar to the Python built-in range.
rank<T>(Iterable<T> iterable, [num comparator(T, T) = ascending]) List<num> Summarizing data
Returns an list with the rank of each value in the iterable, i.e., the zero-based index of the value when the iterable is sorted.
rankBy<T, R>(Iterable<T> iterable, R accessor(T), [num comparator(R, R) = ascending]) List<num> Summarizing data
Returns an list with the rank of each element in the iterable, i.e., the zero-based index of the element when the iterable is sorted based on the values yielded by the accessor function.
reverse<T>(Iterable<T> iterable) List<T> Sorting data
Returns an list containing the values in the given iterable in reverse order.
rollup<T, R, K>(Iterable<T> iterable, R reduce(List<T>), K key(T)) Map<K, R> Grouping data
Groups and reduces the specified iterable of values into an Map from key to value.
rollupSort<T, R, K>(Iterable<T> iterable, R reduce(List<T>), K key(T), [num valueComparator(R, R) = ascending, num keyComparator(K, K) = ascending]) List<K> Grouping data
Groups and reduces the specified iterable of elements according to the specified key function, sorts the reduced groups according to the specified valueComparator for values and keyComparator for keys, and then returns a list of keys in sorted order.
shuffle<T>(List<T> list, [int start = 0, int? stop]) List<T> Sorting data
Randomizes the order of the specified list in-place using the Fisher–Yates shuffle and returns the list.
shuffler<T>(num random()) List<T> Function(List<T>, [int, int?]) Sorting data
Returns a shuffle function given the specified random source. For example, using randomLcg:
sort<T>(Iterable<T> iterable, [num comparator(T, T) = ascending]) List<T> Sorting data
Returns an list containing the values in the given iterable in the sorted order defined by the given comparator.
sortBy<T, R>(Iterable<T> iterable, R accessor(T), [num comparator(R, R) = ascending]) List<T> Sorting data
Returns a list containing the elements of the given iterable in the sorted order defined by the values yielded by the given accessor function.
stackOffsetDiverging(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Positive values are stacked above zero, negative values are stacked below zero, and zero values are stacked at zero.
stackOffsetExpand(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Applies a zero baseline and normalizes the values for each point such that the topline is always one.
stackOffsetNone(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Applies a zero baseline.
stackOffsetSilhouette(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Shifts the baseline down such that the center of the streamgraph is always at zero.
stackOffsetWiggle(List<List<List<num>>> series, List<int> order) → void Stack offsets Stacks
Shifts the baseline so as to minimize the weighted wiggle of layers.
stackOrderAppearance(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the earliest series (according to the maximum value) is at the bottom.
stackOrderAscending(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the smallest series (according to the sum of values) is at the bottom.
stackOrderDescending(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the largest series (according to the sum of values) is at the bottom.
stackOrderInsideOut(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns a series order such that the earliest series (according to the maximum value) are on the inside and the later series are on the outside.
stackOrderNone(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns the given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor (see Stack.keys).
stackOrderReverse(List<List<List<num>>> series) List<int> Stack orders Stacks
Returns the reverse of the given series order [n - 1, n - 2, … 0] where n is the number of elements in series. Thus, the stack order is given by the reverse of the key accessor (see Stack.keys).
subset<T>(Iterable<Object?> a, Iterable<Object?> b) bool Set operations
Returns true if a is a subset of b: if every value in the given iterable a is also in the given iterable b.
sum(Iterable<num?> iterable) num Summarizing data
Returns the sum of all values in the iterable.
sumBy<T>(Iterable<T> iterable, num? accessor(T)) num Summarizing data
Returns the sum of all values yielded by the accessor function applied to each element in the iterable.
superset<T>(Iterable<Object?> a, Iterable<Object?> b) bool Set operations
Returns true if a is a superset of b: if every value in the given iterable b is also in the given iterable a.
thresholdFreedmanDiaconis<T>(Iterable<num?> values, num min, num max) int Binning data
Returns the number of bins according to the Freedman–Diaconis rule; the input values must be numbers.
thresholdScott<T>(Iterable<num?> values, num min, num max) int Binning data
Returns the number of bins according to Scott’s normal reference rule; the input values must be numbers.
thresholdSturges(Iterable<num?> values, [num? min, num? max]) int Binning data
Returns the number of bins according to Sturges’ formula; the input values must be numbers.
tickFormat(num start, num stop, num count, [String? specifier]) String Function(num) Linear scales
Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values, as determined by tickStep.
tickIncrement(num start, num stop, num count) num Ticks
Like tickStep, except requires that start is always less than or equal to stop, and if the tick step for the given start, stop and count would be less than one, returns the negative inverse tick step instead.
ticks(num start, num stop, num count) List<num> Ticks
Returns an list of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive).
tickStep(num start, num stop, num count) num Ticks
Returns the difference between adjacent tick values if the same arguments were passed to ticks: a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5.
timeFormat(String specifier) String Function(DateTime)
An alias for TimeFormatLocale.format on the default locale.
timeFormatDefaultLocale({required String dateTime, required String date, required String time, required List<String> periods, required List<String> days, required List<String> shortDays, required List<String> months, required List<String> shortMonths}) TimeFormatLocale
Equivalent to TimeFormatLocale.new, except it also redefines timeFormat and timeParse to the new locale’s TimeFormatLocale.format and TimeFormatLocale.parse.
timeFormatDefaultLocaleFromJson(Map<String, dynamic> definition) TimeFormatLocale
Equivalent to timeFormatDefaultLocale, but it accepts a JSON definition object instead of individual arguments
timeParse(String specifier, {bool isUtc = false}) DateTime? Function(String)
An alias for TimeFormatLocale.parse on the default locale.
timeRange(DateTime start, DateTime stop, TimeInterval interval) List<DateTime>
Equivalent to timeTicks, but takes a time interval instead of count.
timeTickInterval(DateTime start, DateTime stop, num count) TimeInterval?
Returns the time interval that would be used by timeTicks given the same arguments.
timeTicks(DateTime start, DateTime stop, num count) List<DateTime>
Returns an list of approximately count dates at regular intervals between start and stop (inclusive).
transpose<T>(Iterable<Iterable<T>> matrix) List<List<T>> Transforming data
Returns a list of lists, where the ith list contains the ith element from each of the iterables in the matrix.
tsvFormat(Iterable<Map<String, Object?>> rows, [Iterable<String>? columns]) String
Equivalent to DsvFormat.format with a delimiter of "\t".
tsvFormatBody(Iterable<Map<String, Object?>> rows, [Iterable<String>? columns]) String
Equivalent to DsvFormat.formatBody with a delimiter of "\t".
tsvFormatRow(Iterable<Object?> row) String
Equivalent to DsvFormat.formatRow with a delimiter of "\t".
tsvFormatRows(Iterable<Iterable<Object?>> rows) String
Equivalent to DsvFormat.formatRows with a delimiter of "\t".
tsvFormatValue(Object? value) String
Equivalent to DsvFormat.formatValue with a delimiter of "\t".
tsvParse(String data) → (List<Map<String, String>>, {List<String> columns})
Equivalent to DsvFormat.parse using "\t" as delimiter.
tsvParseRows(String data) List<List<String>>
Equivalent to DsvFormat.parseRows with a delimiter of "\t".
tsvParseRowsWith<R>(String data, R? conversion(List<String>, int)) List<R>
Equivalent to DsvFormat.parseRowsWith with a delimiter of "\t".
tsvParseWith<R>(String data, R? conversion(Map<String, String>, int, List<String>)) → (List<R>, {List<String> columns})
Equivalent to DsvFormat.parseWith with a delimiter of "\t".
union<T>(Iterable<Iterable<T>> iterables) Set<T> Set operations
Returns a new set containing every (distinct) value that appears in any of the given iterables.
variance(Iterable<num?> iterable) num? Summarizing data
Returns an unbiased estimator of the population variance of all values in the iterable using Welford’s algorithm.
varianceBy<T>(Iterable<T> iterable, num? accessor(T)) num? Summarizing data
Returns an unbiased estimator of the population variance of all values yielded by the accessor function applied to each element in the iterable using Welford’s algorithm.

Typedefs

CurveFactory = Curve Function(Path context) Curves
The definition of a curve factory: given a context, returns a curve.