@sophistry/charts 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +32 -2
- package/dist/3d/bar-chart3d.d.ts +55 -0
- package/dist/3d/definitions.d.ts +37 -0
- package/dist/3d/definitions.js +14 -0
- package/dist/3d/forward.d.ts +64 -0
- package/dist/3d/index.d.ts +30 -0
- package/dist/3d/index.js +1 -0
- package/dist/3d/quiver3d.d.ts +52 -0
- package/dist/3d/scatter3d.d.ts +44 -0
- package/dist/3d/stem3d.d.ts +45 -0
- package/dist/3d/surface-grid3d.d.ts +33 -0
- package/dist/3d/tri-surface3d.d.ts +45 -0
- package/dist/3d/voxels3d.d.ts +25 -0
- package/dist/3d/wireframe3d.d.ts +30 -0
- package/dist/band.d.ts +20 -0
- package/dist/bars/bar-chart.d.ts +143 -0
- package/dist/bars/bar-labels.d.ts +116 -0
- package/dist/bars/bars.d.ts +223 -0
- package/dist/bars/bullet.d.ts +157 -0
- package/dist/bars/candlestick.d.ts +97 -0
- package/dist/bars/funnel.d.ts +90 -0
- package/dist/bars/histogram.d.ts +108 -0
- package/dist/bars/index.d.ts +22 -0
- package/dist/bars/race.d.ts +28 -0
- package/dist/bars/rules.d.ts +121 -0
- package/dist/bars/shared.d.ts +41 -0
- package/dist/bars/transforms.d.ts +249 -0
- package/dist/bars/waterfall.d.ts +106 -0
- package/dist/batch.d.ts +142 -0
- package/dist/channels-_Xf-p6Lx.js +56 -0
- package/dist/chart.d.ts +87 -0
- package/dist/color-norm.d.ts +90 -0
- package/dist/context.d.ts +111 -0
- package/dist/curves/density.d.ts +125 -0
- package/dist/curves/ecdf.d.ts +72 -0
- package/dist/curves/fill-between.d.ts +100 -0
- package/dist/curves/index.d.ts +15 -0
- package/dist/curves/line-plot.d.ts +104 -0
- package/dist/curves/regression.d.ts +124 -0
- package/dist/curves/shared.d.ts +52 -0
- package/dist/curves/stack-plot.d.ts +140 -0
- package/dist/curves/stairs.d.ts +170 -0
- package/dist/data/channels.d.ts +170 -0
- package/dist/end-space.d.ts +81 -0
- package/dist/entries/definitions.d.ts +20 -0
- package/dist/entries/definitions.js +6 -0
- package/dist/frame/band-axis.d.ts +42 -0
- package/dist/frame/coords.d.ts +111 -0
- package/dist/frame/fit.d.ts +170 -0
- package/dist/frame/format.d.ts +40 -0
- package/dist/frame/guide-metrics.d.ts +36 -0
- package/dist/frame/guides.d.ts +67 -0
- package/dist/frame/keys.d.ts +96 -0
- package/dist/frame/layout.d.ts +145 -0
- package/dist/frame/registry.d.ts +31 -0
- package/dist/frame/reports.d.ts +53 -0
- package/dist/frame/secondary-axes.d.ts +73 -0
- package/dist/frame/secondary.d.ts +56 -0
- package/dist/frame/tooltip-overlay.d.ts +64 -0
- package/dist/frame/types.d.ts +658 -0
- package/dist/grids/barbs.d.ts +51 -0
- package/dist/grids/cell-rects.d.ts +37 -0
- package/dist/grids/cells.d.ts +130 -0
- package/dist/grids/contour-f.d.ts +80 -0
- package/dist/grids/contour-shared.d.ts +53 -0
- package/dist/grids/contour.d.ts +84 -0
- package/dist/grids/dendrogram.d.ts +104 -0
- package/dist/grids/heatmap.d.ts +163 -0
- package/dist/grids/hex-bin.d.ts +93 -0
- package/dist/grids/hist2d.d.ts +107 -0
- package/dist/grids/imshow.d.ts +84 -0
- package/dist/grids/index.d.ts +26 -0
- package/dist/grids/pcolormesh.d.ts +90 -0
- package/dist/grids/ramp-cells.d.ts +66 -0
- package/dist/grids/tri-contour.d.ts +120 -0
- package/dist/grids/tri-shared.d.ts +61 -0
- package/dist/grids/tripcolor.d.ts +73 -0
- package/dist/guides/colorbar.d.ts +110 -0
- package/dist/guides/index.d.ts +11 -0
- package/dist/guides/legend.d.ts +118 -0
- package/dist/guides/nodes.d.ts +13 -0
- package/dist/guides/size-legend.d.ts +233 -0
- package/dist/hierarchy/breadcrumbs.d.ts +133 -0
- package/dist/hierarchy/circle-pack.d.ts +72 -0
- package/dist/hierarchy/drill.d.ts +245 -0
- package/dist/hierarchy/frame.d.ts +67 -0
- package/dist/hierarchy/icicle.d.ts +76 -0
- package/dist/hierarchy/index.d.ts +20 -0
- package/dist/hierarchy/labels.d.ts +24 -0
- package/dist/hierarchy/mosaic.d.ts +130 -0
- package/dist/hierarchy/own-tooltip.d.ts +12 -0
- package/dist/hierarchy/props.d.ts +13 -0
- package/dist/hierarchy/sankey.d.ts +132 -0
- package/dist/hierarchy/shared.d.ts +247 -0
- package/dist/hierarchy/sunburst.d.ts +74 -0
- package/dist/hierarchy/tree.d.ts +124 -0
- package/dist/hierarchy/treemap.d.ts +76 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +5 -0
- package/dist/item-tooltip.d.ts +33 -0
- package/dist/join.d.ts +223 -0
- package/dist/math/3d/bar3d.d.ts +27 -0
- package/dist/math/3d/quiver3d.d.ts +26 -0
- package/dist/math/3d/scatter3d.d.ts +15 -0
- package/dist/math/3d/stem3d.d.ts +22 -0
- package/dist/math/3d/surfaceGrid3d.d.ts +33 -0
- package/dist/math/3d/trisurface.d.ts +11 -0
- package/dist/math/3d/voxels.d.ts +17 -0
- package/dist/math/aggregate.d.ts +68 -0
- package/dist/math/bar.d.ts +31 -0
- package/dist/math/barLabels.d.ts +83 -0
- package/dist/math/barbs.d.ts +36 -0
- package/dist/math/boxplot.d.ts +36 -0
- package/dist/math/breadcrumbs.d.ts +128 -0
- package/dist/math/bubble.d.ts +38 -0
- package/dist/math/bullet.d.ts +110 -0
- package/dist/math/chord.d.ts +103 -0
- package/dist/math/cluster.d.ts +88 -0
- package/dist/math/contour.d.ts +48 -0
- package/dist/math/contourf.d.ts +50 -0
- package/dist/math/dodge.d.ts +36 -0
- package/dist/math/ecdf.d.ts +41 -0
- package/dist/math/errorbar.d.ts +27 -0
- package/dist/math/eventplot.d.ts +26 -0
- package/dist/math/facet.d.ts +90 -0
- package/dist/math/fillBetween.d.ts +28 -0
- package/dist/math/gauge.d.ts +71 -0
- package/dist/math/hexbin.d.ts +20 -0
- package/dist/math/hierarchy.d.ts +179 -0
- package/dist/math/hierarchyJoin.d.ts +59 -0
- package/dist/math/histogram.d.ts +36 -0
- package/dist/math/histogram2d.d.ts +44 -0
- package/dist/math/imshow.d.ts +26 -0
- package/dist/math/index.d.ts +139 -0
- package/dist/math/index.js +3 -0
- package/dist/math/jitter.d.ts +16 -0
- package/dist/math/join.d.ts +135 -0
- package/dist/math/keyframes.d.ts +127 -0
- package/dist/math/legend.d.ts +120 -0
- package/dist/math/line.d.ts +53 -0
- package/dist/math/morph.d.ts +81 -0
- package/dist/math/mosaic.d.ts +119 -0
- package/dist/math/ordinal.d.ts +79 -0
- package/dist/math/parallel.d.ts +38 -0
- package/dist/math/pcolormesh.d.ts +22 -0
- package/dist/math/pie.d.ts +105 -0
- package/dist/math/polarArea.d.ts +34 -0
- package/dist/math/radar.d.ts +110 -0
- package/dist/math/range.d.ts +98 -0
- package/dist/math/regression.d.ts +109 -0
- package/dist/math/reveal.d.ts +63 -0
- package/dist/math/sankey.d.ts +154 -0
- package/dist/math/scatter.d.ts +14 -0
- package/dist/math/shared/binning.d.ts +23 -0
- package/dist/math/shared/gridCells.d.ts +41 -0
- package/dist/math/shared/gridExtent.d.ts +5 -0
- package/dist/math/shared/pairs.d.ts +2 -0
- package/dist/math/shared/polar.d.ts +23 -0
- package/dist/math/stack.d.ts +69 -0
- package/dist/math/stackplot.d.ts +35 -0
- package/dist/math/stairs.d.ts +17 -0
- package/dist/math/stem.d.ts +21 -0
- package/dist/math/symbol.d.ts +25 -0
- package/dist/math/tree.d.ts +117 -0
- package/dist/math/tricontour.d.ts +76 -0
- package/dist/math/violin.d.ts +99 -0
- package/dist/math/waffle.d.ts +48 -0
- package/dist/math/waterfall.d.ts +28 -0
- package/dist/math-CSHNpGej.js +3648 -0
- package/dist/mix.d.ts +24 -0
- package/dist/multiview/brush.d.ts +165 -0
- package/dist/multiview/chart-group.d.ts +265 -0
- package/dist/multiview/chart-link.d.ts +188 -0
- package/dist/multiview/chart-zoom.d.ts +144 -0
- package/dist/multiview/facet.d.ts +238 -0
- package/dist/multiview/group-guides.d.ts +99 -0
- package/dist/multiview/index.d.ts +17 -0
- package/dist/multiview/joint-plot.d.ts +114 -0
- package/dist/multiview/pair-plot.d.ts +153 -0
- package/dist/multiview/panels.d.ts +22 -0
- package/dist/multiview/parallel-coordinates.d.ts +109 -0
- package/dist/points/event-plot.d.ts +67 -0
- package/dist/points/index.d.ts +19 -0
- package/dist/points/labels.d.ts +70 -0
- package/dist/points/links.d.ts +123 -0
- package/dist/points/rects.d.ts +80 -0
- package/dist/points/rug.d.ts +72 -0
- package/dist/points/scatter.d.ts +169 -0
- package/dist/points/segment-marks.d.ts +39 -0
- package/dist/points/shared.d.ts +34 -0
- package/dist/points/stem.d.ts +75 -0
- package/dist/points/strip.d.ts +145 -0
- package/dist/points/symbol-marker.d.ts +33 -0
- package/dist/points/ticks.d.ts +102 -0
- package/dist/props.d.ts +126 -0
- package/dist/radial/chord.d.ts +148 -0
- package/dist/radial/gauge.d.ts +126 -0
- package/dist/radial/index.d.ts +15 -0
- package/dist/radial/pie-chart.d.ts +143 -0
- package/dist/radial/polar-area-chart.d.ts +135 -0
- package/dist/radial/radar-chart.d.ts +176 -0
- package/dist/radial/radial-bar-chart.d.ts +116 -0
- package/dist/radial/shared.d.ts +78 -0
- package/dist/radial/waffle.d.ts +130 -0
- package/dist/raster.d.ts +43 -0
- package/dist/series.d.ts +71 -0
- package/dist/src-CwGo1bes.js +19221 -0
- package/dist/stagger.d.ts +54 -0
- package/dist/statistics/box-plot.d.ts +151 -0
- package/dist/statistics/error-bar.d.ts +148 -0
- package/dist/statistics/groups.d.ts +140 -0
- package/dist/statistics/index.d.ts +7 -0
- package/dist/statistics/violin-plot.d.ts +143 -0
- package/dist/text-width.d.ts +9 -0
- package/dist/tooltip.d.ts +276 -0
- package/dist/util.d.ts +33 -0
- package/dist/voxels-9lJ2TZS4.js +235 -0
- package/dist/wireframe3d-D157GZAq.js +345 -0
- package/package.json +86 -3
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a keyed mark draws each end of its transition when a fitted axis
|
|
3
|
+
* changes kind between them (band ↔ continuous). Internal.
|
|
4
|
+
*/
|
|
5
|
+
import type { CoordinateSystem } from "@sophistry/core";
|
|
6
|
+
import type { BandScale, Point } from "@sophistry/core/geometry";
|
|
7
|
+
import type { ChartEnds, ChartFrame } from "./frame/types.js";
|
|
8
|
+
import type { JoinEnd, JoinFrame } from "./join.js";
|
|
9
|
+
import type { AreaPoint } from "./math/morph.js";
|
|
10
|
+
/**
|
|
11
|
+
* What a mark's geometry maps through: a plot's `coordsToPoint`, {@link SCENE_UNITS},
|
|
12
|
+
* or mid-swap one of {@link EndSpace.morph}'s mixed-unit mappings.
|
|
13
|
+
*/
|
|
14
|
+
export interface Mapper extends Pick<CoordinateSystem, "coordsToPoint"> {
|
|
15
|
+
/** Which coordinates `coordsToPoint` takes already in scene units (the swapping axes, mid-swap); the rest it maps from data units. */
|
|
16
|
+
scene?: {
|
|
17
|
+
x: boolean;
|
|
18
|
+
y: boolean;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** A mapping for geometry already in scene units: `coordsToPoint` returns its point as given. */
|
|
22
|
+
export declare const SCENE_UNITS: Mapper;
|
|
23
|
+
/** Area runs through `coords`, for a mid-swap area morph; runs reversed by the mapping are turned around so the morph still blends per x. */
|
|
24
|
+
export declare function sceneAreaRuns(runs: readonly (readonly AreaPoint[])[], coords: Mapper): AreaPoint[][];
|
|
25
|
+
/** Where a mark draws each end of its keyed transition: see {@link endSpace}. */
|
|
26
|
+
export interface EndSpace {
|
|
27
|
+
/** The plot at each end while a fitted axis changes kind (see {@link ChartEnds}); undefined otherwise. */
|
|
28
|
+
ends: ChartEnds | undefined;
|
|
29
|
+
/** The coordinates a datum of `end` maps through: that end's plot mid-swap, else the mark's own. */
|
|
30
|
+
coords(end: JoinEnd): CoordinateSystem;
|
|
31
|
+
/** A band axis's scale at `end`: that end's mid-swap, else the chart's now. */
|
|
32
|
+
band(end: JoinEnd, axis: "x" | "y"): BandScale | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* A key in both ends, in scene units at update progress `u`, from `a` (its
|
|
35
|
+
* `data` datum) to `b` (its `to` datum). Mid-swap, the swapping axis blends
|
|
36
|
+
* in scene units between the two ends' plots. Exact at `u` 0 and 1.
|
|
37
|
+
*/
|
|
38
|
+
point(a: Point, b: Point, u: number): Point;
|
|
39
|
+
/** Whether a kind swap runs; marks building their own geometry then build each end through its own `coords` and blend in scene units. */
|
|
40
|
+
swapping: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* A per-datum mark's anchor on one key's frame, in scene units. `anchor`
|
|
43
|
+
* reads one end's state as a data-unit point. Mid-swap, a key in both ends
|
|
44
|
+
* blends between its two ends' anchors; any other maps through its own end.
|
|
45
|
+
*/
|
|
46
|
+
place<S>(frame: JoinFrame<S>, anchor: (state: S, end: JoinEnd) => Point): Point;
|
|
47
|
+
/**
|
|
48
|
+
* A per-datum mark's own geometry on one key's frame: `build` maps one
|
|
49
|
+
* end's state through given coordinates. Mid-swap, a key in both ends
|
|
50
|
+
* builds each end through its own plot and `blend`s them in scene units.
|
|
51
|
+
*/
|
|
52
|
+
shape<S, G>(frame: JoinFrame<S>, build: (state: S, end: JoinEnd, coords: CoordinateSystem) => G | null, blend: (a: G, b: G, u: number) => G): G | null;
|
|
53
|
+
/**
|
|
54
|
+
* A grouped mark's shape for a group in both ends at update progress `u`.
|
|
55
|
+
* Without a swap, `morph` blends in data units and `build` maps through the
|
|
56
|
+
* mark's coordinates. Mid-swap, only the swapping axis blends in scene
|
|
57
|
+
* units (via `scene`), so an axis that keeps its kind (log, sqrt) morphs
|
|
58
|
+
* exactly as without a swap. Exact at `u` 0 and 1.
|
|
59
|
+
*/
|
|
60
|
+
morph<S, G>(a: S, b: S, u: number, spec: {
|
|
61
|
+
scene: (state: S, coords: Mapper, end: JoinEnd) => S;
|
|
62
|
+
morph: (a: S, b: S, u: number) => S;
|
|
63
|
+
build: (state: S, coords: Mapper, end: JoinEnd) => G;
|
|
64
|
+
}): G;
|
|
65
|
+
/** Where the axes are drawn at `end`, in data units: that end's own mid-swap, else the chart's; outside a chart, the crossing. */
|
|
66
|
+
axesAt(end: JoinEnd): {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Plumbing for a keyed mark in a {@link Chart} whose fitted axis changes
|
|
73
|
+
* kind between the ends (a bar chart's categories becoming a number line).
|
|
74
|
+
* Keys in both ends move from where end A draws them to where end B does,
|
|
75
|
+
* leaving keys draw through end A, entering keys through end B, so nothing
|
|
76
|
+
* jumps when the plot switches axes. Without a swap every method is the
|
|
77
|
+
* plain path. Call in each `update` with the frame and coordinates it read.
|
|
78
|
+
*
|
|
79
|
+
* @param coords - The coordinates the mark otherwise draws through.
|
|
80
|
+
*/
|
|
81
|
+
export declare function endSpace(frame: ChartFrame | null, coords: CoordinateSystem): EndSpace;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@sophistry/charts/definitions`: every definition the package's main
|
|
3
|
+
* entry exports, keyed by export name. What `@sophistry/codegen` reads
|
|
4
|
+
* to generate the framework bindings' chart components (`export const
|
|
5
|
+
* Scatter = wrap(scatter);`).
|
|
6
|
+
*
|
|
7
|
+
* Collected from the main entry's exports, so a definition is picked up as
|
|
8
|
+
* soon as it is exported from `@sophistry/charts`. Kept off the main
|
|
9
|
+
* entry: reading the whole module namespace would defeat tree shaking.
|
|
10
|
+
*
|
|
11
|
+
* @module @sophistry/charts/definitions
|
|
12
|
+
*/
|
|
13
|
+
import * as entry from "../index.js";
|
|
14
|
+
/**
|
|
15
|
+
* Every definition `@sophistry/charts` exports, by export name
|
|
16
|
+
* (`{ chart, scatter, ... }`).
|
|
17
|
+
*
|
|
18
|
+
* @category Charts
|
|
19
|
+
*/
|
|
20
|
+
export declare const definitions: import("@sophistry/core/definitions").DefinitionExports<typeof entry>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A chart's categorical axis: the line the bands stand on, and a name under
|
|
3
|
+
* (or beside) each band. Internal to the frame (and a group's guides); not
|
|
4
|
+
* exported from the package entry.
|
|
5
|
+
*/
|
|
6
|
+
import type { AxisOptions, CoordinateSystem } from "@sophistry/core";
|
|
7
|
+
import type { BandKey, BandScale } from "@sophistry/core/geometry";
|
|
8
|
+
import type { MergedAxisOptions } from "./fit.js";
|
|
9
|
+
/**
|
|
10
|
+
* Props for {@link bandAxis}.
|
|
11
|
+
*
|
|
12
|
+
* @category Extending
|
|
13
|
+
*/
|
|
14
|
+
export interface BandAxisProps {
|
|
15
|
+
band: BandScale;
|
|
16
|
+
/** A category name's opacity, 0..1 (a keyed transition fading it in or out). @default 1 */
|
|
17
|
+
weight?: (key: BandKey) => number;
|
|
18
|
+
options: MergedAxisOptions;
|
|
19
|
+
/** An outline around each name; see `LabelProps.halo`. */
|
|
20
|
+
halo?: AxisOptions["numberHalo"];
|
|
21
|
+
coords: CoordinateSystem;
|
|
22
|
+
along: "x" | "y";
|
|
23
|
+
/** The other axis's value the line sits at, in data units. */
|
|
24
|
+
at: number;
|
|
25
|
+
/** Where the line sits across the plot in scene units, in place of `at` (mid-swap). */
|
|
26
|
+
across?: number;
|
|
27
|
+
/** On the top or right edge: names face outward (up, right). */
|
|
28
|
+
far?: boolean;
|
|
29
|
+
/** The whole axis's opacity, 0..1 (a kind swap's cross-fade). @default 1 */
|
|
30
|
+
opacity?: number;
|
|
31
|
+
progress: number;
|
|
32
|
+
zIndex?: number;
|
|
33
|
+
visible?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A categorical axis: the line the bands stand on, and a name under (or
|
|
37
|
+
* beside) each band, faded by `weight` and by where the band sits in a
|
|
38
|
+
* zoomed window.
|
|
39
|
+
*
|
|
40
|
+
* @category Extending
|
|
41
|
+
*/
|
|
42
|
+
export declare const bandAxis: import("@sophistry/core").Definition<BandAxisProps, import("@sophistry/core/internal").CompositeNode<BandAxisProps>, keyof BandAxisProps>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `chart`'s coordinate systems: the plot through its primary and
|
|
3
|
+
* secondary axes, the ghost and end mappings of an axis changing kind, and
|
|
4
|
+
* where the axes stand.
|
|
5
|
+
*
|
|
6
|
+
* {@link createChartCoords} is made once per chart; its function runs on
|
|
7
|
+
* every update and returns the same coordinate system objects while their
|
|
8
|
+
* mapping is unchanged (they are immutable, so a new one means the mapping
|
|
9
|
+
* moved).
|
|
10
|
+
*/
|
|
11
|
+
import type { CoordinateSystem, XAxisPosition, YAxisPosition } from "@sophistry/core";
|
|
12
|
+
import type { Bounds, Point, Range } from "@sophistry/core/geometry";
|
|
13
|
+
import type { JoinStages, StageWindow } from "../math/join.js";
|
|
14
|
+
import type { AxisEnds, MergedAxisOptions, ResolvedAxis } from "./fit.js";
|
|
15
|
+
import type { SecondaryFlags } from "./secondary.js";
|
|
16
|
+
import type { ChartEnd, ChartEnds } from "./types.js";
|
|
17
|
+
/** A kind's crossing on an axis: a band axis's first slot, a continuous one's zero (or nearest end). */
|
|
18
|
+
export declare const crossingOf: (axis: ResolvedAxis) => number;
|
|
19
|
+
/** What one update of the chart's coordinates reads. */
|
|
20
|
+
export interface ChartCoordsInput {
|
|
21
|
+
xOptions: MergedAxisOptions;
|
|
22
|
+
yOptions: MergedAxisOptions;
|
|
23
|
+
x: {
|
|
24
|
+
axis: ResolvedAxis;
|
|
25
|
+
range: Range;
|
|
26
|
+
};
|
|
27
|
+
y: {
|
|
28
|
+
axis: ResolvedAxis;
|
|
29
|
+
range: Range;
|
|
30
|
+
};
|
|
31
|
+
x2: {
|
|
32
|
+
axis: ResolvedAxis;
|
|
33
|
+
range: Range;
|
|
34
|
+
options: MergedAxisOptions;
|
|
35
|
+
};
|
|
36
|
+
y2: {
|
|
37
|
+
axis: ResolvedAxis;
|
|
38
|
+
range: Range;
|
|
39
|
+
options: MergedAxisOptions;
|
|
40
|
+
};
|
|
41
|
+
/** The primary axes' fitted ends (steady while the blend moves). */
|
|
42
|
+
xEnds: AxisEnds | undefined;
|
|
43
|
+
yEnds: AxisEnds | undefined;
|
|
44
|
+
/** The other end of an axis changing kind mid-swap. */
|
|
45
|
+
xGhost: ResolvedAxis | undefined;
|
|
46
|
+
yGhost: ResolvedAxis | undefined;
|
|
47
|
+
axisBands: {
|
|
48
|
+
x: boolean;
|
|
49
|
+
y: boolean;
|
|
50
|
+
};
|
|
51
|
+
xPosition: XAxisPosition;
|
|
52
|
+
yPosition: YAxisPosition;
|
|
53
|
+
plotWidth: number;
|
|
54
|
+
plotHeight: number;
|
|
55
|
+
center: Point;
|
|
56
|
+
stage(pick: (stages: JoinStages) => StageWindow): number;
|
|
57
|
+
}
|
|
58
|
+
/** A chart's coordinate systems on one update. */
|
|
59
|
+
export interface ChartCoords {
|
|
60
|
+
/** The plot through the primary axes. */
|
|
61
|
+
coords: CoordinateSystem;
|
|
62
|
+
/** y through `y2`. */
|
|
63
|
+
coords2: CoordinateSystem;
|
|
64
|
+
/** x through `x2`. */
|
|
65
|
+
coords3: CoordinateSystem;
|
|
66
|
+
/** Both secondary axes. */
|
|
67
|
+
coords4: CoordinateSystem;
|
|
68
|
+
/** The plot through a kind-swapping x axis's ghost. */
|
|
69
|
+
ghostX: CoordinateSystem;
|
|
70
|
+
/** The plot through a kind-swapping y axis's ghost. */
|
|
71
|
+
ghostY: CoordinateSystem;
|
|
72
|
+
/** Where a kind-swapping axis's ghost stands across the other axis, in data units. */
|
|
73
|
+
ghostAt(axis: "x" | "y", ghost: ResolvedAxis): number;
|
|
74
|
+
/** Which fitted axes change kind across the keyed transition, if any. */
|
|
75
|
+
kindSwap: {
|
|
76
|
+
x: boolean;
|
|
77
|
+
y: boolean;
|
|
78
|
+
} | undefined;
|
|
79
|
+
/** The ends a context's layers see (see {@link ChartEnds}). */
|
|
80
|
+
endsThrough(flags: SecondaryFlags): ChartEnds | undefined;
|
|
81
|
+
/** The primary context's ends, with their mappings even when no axis swaps. */
|
|
82
|
+
primaryEnds: {
|
|
83
|
+
ends: ChartEnds | undefined;
|
|
84
|
+
from: ChartEnd;
|
|
85
|
+
to: ChartEnd;
|
|
86
|
+
};
|
|
87
|
+
/** Mid-swap, where the axes stand at each end blended in scene units. */
|
|
88
|
+
swapOrigin: (Point & {
|
|
89
|
+
x2: boolean;
|
|
90
|
+
y2: boolean;
|
|
91
|
+
}) | undefined;
|
|
92
|
+
/** Where each axis is drawn, in data units. */
|
|
93
|
+
axesAt: {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
};
|
|
97
|
+
/** The y value the x axis runs along. */
|
|
98
|
+
xAxisAt: number;
|
|
99
|
+
/** The x value the y axis stands at. */
|
|
100
|
+
yAxisAt: number;
|
|
101
|
+
/** Where the axes are drawn, in scene units. */
|
|
102
|
+
origin: Point;
|
|
103
|
+
/** Where the axes' titles hang from. */
|
|
104
|
+
titlesAt: Point;
|
|
105
|
+
area: Bounds;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The chart's coordinate systems and where its axes stand. Make one per
|
|
109
|
+
* chart in `setup`; call the result in every update.
|
|
110
|
+
*/
|
|
111
|
+
export declare function createChartCoords(): (input: ChartCoordsInput) => ChartCoords;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fitting one axis of a `chart` to its layers' reports: resolving,
|
|
3
|
+
* comparing, and transitioning axes, and {@link createAxisFit}, made once
|
|
4
|
+
* per axis (`x`, `y`, `x2`, `y2`) in the chart's `setup`.
|
|
5
|
+
*
|
|
6
|
+
* Each step is a function of the chart's current inputs with a last-value
|
|
7
|
+
* cache, so a step whose inputs
|
|
8
|
+
* kept their identity returns its last result (and a result equal by value
|
|
9
|
+
* to the last keeps the last one's identity, so the coordinate systems and
|
|
10
|
+
* guides downstream see nothing new).
|
|
11
|
+
*/
|
|
12
|
+
import type { BandKey, BandScale, Range, RangeTransition, ScaleSpec, TimeZone } from "@sophistry/core/geometry";
|
|
13
|
+
import type { JoinStages, StageWindow } from "../math/join.js";
|
|
14
|
+
import type { AxisExtent, ChartLayerExtent, ChartXAxisOptions, ChartYAxisOptions, LayerTransition } from "./types.js";
|
|
15
|
+
/** One axis's options once `axis` and `xAxis`/`yAxis` are merged. */
|
|
16
|
+
export type MergedAxisOptions = ChartXAxisOptions | ChartYAxisOptions;
|
|
17
|
+
/** A range as given: fixed, or a transition between two. */
|
|
18
|
+
export type GivenRange = Range | RangeTransition | undefined;
|
|
19
|
+
/** How far a stage of the frame's keyed transition has got (0 without one). */
|
|
20
|
+
export type StageAt = (pick: (stages: JoinStages) => StageWindow) => number;
|
|
21
|
+
/** An axis as the plot maps through it: a band scale, or a continuous scale's range. */
|
|
22
|
+
export type ResolvedAxis = {
|
|
23
|
+
kind: "band";
|
|
24
|
+
band: BandScale;
|
|
25
|
+
range: Range;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "continuous";
|
|
28
|
+
scale: ScaleSpec;
|
|
29
|
+
range: Range;
|
|
30
|
+
base?: number;
|
|
31
|
+
timeZone?: TimeZone;
|
|
32
|
+
};
|
|
33
|
+
/** Whether an axis's scale is plain linear (the default). */
|
|
34
|
+
export declare function linearScale(scale: ScaleSpec | "band" | undefined): boolean;
|
|
35
|
+
export declare function resolveAxis(options: MergedAxisOptions, fixed: Range | undefined, reports: readonly AxisExtent[], vertical: boolean): ResolvedAxis;
|
|
36
|
+
/** A secondary axis when no layer maps through it (and the stand-in for a band one). */
|
|
37
|
+
export declare const NO_SECONDARY_AXIS: ResolvedAxis;
|
|
38
|
+
/** Both ends of an axis fitted for a keyed transition. */
|
|
39
|
+
export interface AxisEnds {
|
|
40
|
+
from: ResolvedAxis;
|
|
41
|
+
to: ResolvedAxis;
|
|
42
|
+
}
|
|
43
|
+
/** How an axis changes over a keyed transition (see `rescaleKind`). */
|
|
44
|
+
export type RescaleChange = "none" | "expand" | "contract" | "shift";
|
|
45
|
+
/** A fitted axis's own transition while a keyed one runs. */
|
|
46
|
+
export type FittedTransition = {
|
|
47
|
+
kind: "continuous";
|
|
48
|
+
range: RangeTransition;
|
|
49
|
+
} | {
|
|
50
|
+
kind: "band";
|
|
51
|
+
band: BandScale;
|
|
52
|
+
from: BandScale;
|
|
53
|
+
to: BandScale;
|
|
54
|
+
} | AxisSwap;
|
|
55
|
+
/**
|
|
56
|
+
* A fitted axis that changes kind over a keyed transition (band ↔
|
|
57
|
+
* continuous): the two axes cross-fade over the update stage, the plot
|
|
58
|
+
* mapping through the near end's axis until its midpoint.
|
|
59
|
+
*/
|
|
60
|
+
export interface AxisSwap {
|
|
61
|
+
kind: "swap";
|
|
62
|
+
from: ResolvedAxis;
|
|
63
|
+
to: ResolvedAxis;
|
|
64
|
+
u: number;
|
|
65
|
+
}
|
|
66
|
+
export declare function sameAxis(a: ResolvedAxis, b: ResolvedAxis): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* How long an axis's range is in its own units: bands on a band axis, the
|
|
69
|
+
* logarithm's span on a log axis, the plain difference otherwise.
|
|
70
|
+
*/
|
|
71
|
+
export declare function axisSpan(axis: ResolvedAxis): number;
|
|
72
|
+
/** {@link sameAxis}, and for a band axis every category in the same place (a blended or slotted band moves them). */
|
|
73
|
+
export declare function samePlacement(a: ResolvedAxis, b: ResolvedAxis): boolean;
|
|
74
|
+
/** Two optional axes placing everything alike. */
|
|
75
|
+
export declare function sameOptionalPlacement(a: ResolvedAxis | undefined, b: ResolvedAxis | undefined): boolean;
|
|
76
|
+
export declare function sameRangeEnds(a: {
|
|
77
|
+
from: Range;
|
|
78
|
+
to: Range;
|
|
79
|
+
} | undefined, b: {
|
|
80
|
+
from: Range;
|
|
81
|
+
to: Range;
|
|
82
|
+
} | undefined): boolean;
|
|
83
|
+
export declare function sameEnds(a: AxisEnds | undefined, b: AxisEnds | undefined): boolean;
|
|
84
|
+
/** How an axis's fitted range (or category count) changes between the ends. */
|
|
85
|
+
export declare function endsKind(ends: AxisEnds | undefined): RescaleChange;
|
|
86
|
+
/** A fixed range as shown now: itself, or a transition's blend. */
|
|
87
|
+
export declare function shownRange(range: GivenRange, options: MergedAxisOptions): Range | undefined;
|
|
88
|
+
/** Both ends of an axis fitted during a keyed transition; undefined when nothing transitions or the range is given. */
|
|
89
|
+
export declare function fittedEnds(transitioning: boolean, options: MergedAxisOptions, given: GivenRange, list: readonly ChartLayerExtent[], pick: (report: ChartLayerExtent) => AxisExtent | undefined, pickTo: (transition: LayerTransition) => AxisExtent | undefined, vertical: boolean): AxisEnds | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* The axis the plot maps through now: mid-swap the near end's, on a fitted
|
|
92
|
+
* transition its blend, else resolved from `extents`. A band axis's `slot`
|
|
93
|
+
* applies last.
|
|
94
|
+
*/
|
|
95
|
+
export declare function axisNow(options: MergedAxisOptions, given: GivenRange, fit: FittedTransition | undefined, extents: readonly AxisExtent[], vertical: boolean, resolve?: typeof resolveAxis): ResolvedAxis;
|
|
96
|
+
/** A category's strength on a band axis mid-transition: leaving ones fade with the exits, new ones with the enters. */
|
|
97
|
+
export declare function bandWeight(fit: FittedTransition | undefined, stage: StageAt): ((key: BandKey) => number) | undefined;
|
|
98
|
+
/** An axis changing kind through a keyed transition, as its guides draw it. */
|
|
99
|
+
export interface AxisSwapView {
|
|
100
|
+
/** The opacity of the axis mapped through now. */
|
|
101
|
+
fade: number;
|
|
102
|
+
/** The other end, drawn at the rest; undefined outside the update stage. */
|
|
103
|
+
ghost: ResolvedAxis | undefined;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* An axis changing kind through a keyed transition: `fade` is the opacity of
|
|
107
|
+
* the axis mapped through now, `ghost` the other end drawn at the rest. Make
|
|
108
|
+
* one per axis; the ghost keeps its identity while it places alike.
|
|
109
|
+
*/
|
|
110
|
+
export declare function createAxisSwap(): (fit: FittedTransition | undefined) => AxisSwapView;
|
|
111
|
+
/** A secondary axis's range aligned with its primary's ticks, or fitted on its own when no alignment fits. */
|
|
112
|
+
export declare function alignedToPrimary(range: Range, list: readonly AxisExtent[], mine: MergedAxisOptions, primary: MergedAxisOptions): Range;
|
|
113
|
+
/** What one update of an axis's fit reads. Every field keeps its identity while unchanged. */
|
|
114
|
+
export interface AxisFitInput {
|
|
115
|
+
options: MergedAxisOptions;
|
|
116
|
+
/** The range given for the axis, if any. */
|
|
117
|
+
given: GivenRange;
|
|
118
|
+
/** The reports the axis is fitted to (blends held out). */
|
|
119
|
+
reports: readonly ChartLayerExtent[];
|
|
120
|
+
/** Whether a keyed transition runs (steady while its blend moves). */
|
|
121
|
+
transitioning: boolean;
|
|
122
|
+
/** A secondary axis's state (see `secondaryFit`). */
|
|
123
|
+
secondary?: {
|
|
124
|
+
has: boolean;
|
|
125
|
+
aligns: boolean;
|
|
126
|
+
alignedEnds: {
|
|
127
|
+
from: Range;
|
|
128
|
+
to: Range;
|
|
129
|
+
} | undefined;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** One axis as drawn on one update. */
|
|
133
|
+
export interface PlacedAxis {
|
|
134
|
+
/** The fitted axis's own transition while a keyed one runs. */
|
|
135
|
+
fitted: FittedTransition | undefined;
|
|
136
|
+
/** The range as given, or the fitted transition while one runs: what the number line is given. */
|
|
137
|
+
given: GivenRange;
|
|
138
|
+
/** The axis the plot maps through now (identity kept while it places alike). */
|
|
139
|
+
axis: ResolvedAxis;
|
|
140
|
+
/** Its range (identity kept while equal). */
|
|
141
|
+
range: Range;
|
|
142
|
+
}
|
|
143
|
+
/** What {@link createAxisFit} fits an axis from. */
|
|
144
|
+
export interface AxisFitDeps {
|
|
145
|
+
/** A report's extent on this axis. */
|
|
146
|
+
pick(report: ChartLayerExtent): AxisExtent | undefined;
|
|
147
|
+
/** A transitioning report's far end's extent on this axis. */
|
|
148
|
+
pickTo(transition: LayerTransition): AxisExtent | undefined;
|
|
149
|
+
/** The extents the axis is fitted to at rest; every report's `pick` by default. */
|
|
150
|
+
extents?: (reports: readonly ChartLayerExtent[]) => AxisExtent[];
|
|
151
|
+
vertical: boolean;
|
|
152
|
+
/** A secondary axis: continuous only, ranged by `alignedEnds` with `alignTicks`. */
|
|
153
|
+
secondary?: boolean;
|
|
154
|
+
}
|
|
155
|
+
/** One axis's fit; see {@link createAxisFit}. */
|
|
156
|
+
export interface AxisFit {
|
|
157
|
+
/** Both ends during a keyed transition (steady while the blend moves); identity kept while equal. */
|
|
158
|
+
ends(input: AxisFitInput): AxisEnds | undefined;
|
|
159
|
+
/** How the axis rescales between the ends. */
|
|
160
|
+
change(input: AxisFitInput): RescaleChange;
|
|
161
|
+
/** The axis as drawn now. `primaryGiven` is the primary's given range, for a secondary axis. */
|
|
162
|
+
place(input: AxisFitInput, stage: StageAt, primaryGiven?: GivenRange): PlacedAxis;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* One axis's fit, in two steps around the frame's transition stages:
|
|
166
|
+
* `ends` and `change` read only steady inputs and feed the stages;
|
|
167
|
+
* `place(stage)` gives the axis as drawn each update, compared by placement
|
|
168
|
+
* so unchanged frames keep every identity. Make one per axis in `setup`.
|
|
169
|
+
*/
|
|
170
|
+
export declare function createAxisFit(deps: AxisFitDeps): AxisFit;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** How a `chart` writes a channel's value in a tooltip (`frame.format`). */
|
|
2
|
+
import type { BandKey, TimeZone } from "@sophistry/core/geometry";
|
|
3
|
+
import type { OrdinalColorScale } from "../math/ordinal.js";
|
|
4
|
+
import type { MergedAxisOptions, ResolvedAxis } from "./fit.js";
|
|
5
|
+
import type { SecondaryFlags } from "./secondary.js";
|
|
6
|
+
import type { ChartColorOptions, ChartFormatChannel, ChartSizeLegendOptions } from "./types.js";
|
|
7
|
+
/** A formatter of one channel's values. */
|
|
8
|
+
export type ValueFormat = (value: number | BandKey) => string;
|
|
9
|
+
/**
|
|
10
|
+
* How an axis writes a value in a tooltip: a band axis a category's name, a
|
|
11
|
+
* continuous one through its `tickFormat` at its current range (a full date,
|
|
12
|
+
* by default, on a time axis).
|
|
13
|
+
*/
|
|
14
|
+
export declare function axisValueFormat(options: MergedAxisOptions, axis: ResolvedAxis): ValueFormat;
|
|
15
|
+
/** A moment written in full on `timeZone`'s clock, to the precision it carries: the day, then the minute or the second. */
|
|
16
|
+
export declare function dateText(value: number, timeZone: TimeZone): string;
|
|
17
|
+
/** An axis whose values a chart formats. */
|
|
18
|
+
export interface FormatAxis {
|
|
19
|
+
options: MergedAxisOptions;
|
|
20
|
+
axis: ResolvedAxis;
|
|
21
|
+
}
|
|
22
|
+
/** What a chart's formats read on one update. */
|
|
23
|
+
export interface ChartFormatsInput {
|
|
24
|
+
x: FormatAxis;
|
|
25
|
+
y: FormatAxis;
|
|
26
|
+
x2: FormatAxis;
|
|
27
|
+
y2: FormatAxis;
|
|
28
|
+
color: ChartColorOptions | undefined;
|
|
29
|
+
colorScale: OrdinalColorScale;
|
|
30
|
+
sizeOptions: ChartSizeLegendOptions;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The formatters a chart's contexts write values with, by secondary flags.
|
|
34
|
+
* Make one per chart; each update passes its axes, and a formatter is built
|
|
35
|
+
* lazily (when a tooltip asks) and kept while its axis keeps its identity.
|
|
36
|
+
*
|
|
37
|
+
* @returns `(input) => (flags) => format`: `format(channel)` for the context
|
|
38
|
+
* through `flags`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createChartFormats(): (input: ChartFormatsInput) => (flags: SecondaryFlags) => (channel: ChartFormatChannel) => ValueFormat;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Sizes and gaps for a chart's guides, shared by `chart` and a group's guides so they match. */
|
|
2
|
+
/** An axis title's font size when none is given. */
|
|
3
|
+
export declare const AXIS_LABEL_FONT_SIZE = 0.34;
|
|
4
|
+
/** The gap between an axis's numbers and its title. */
|
|
5
|
+
export declare const AXIS_LABEL_GAP = 0.22;
|
|
6
|
+
/** The title's font size when none is given. */
|
|
7
|
+
export declare const TITLE_FONT_SIZE = 0.42;
|
|
8
|
+
/** The gap under the title. */
|
|
9
|
+
export declare const TITLE_GAP = 0.35;
|
|
10
|
+
/** The gap between the plotting area and a legend beside or above it. */
|
|
11
|
+
export declare const LEGEND_GAP = 0.35;
|
|
12
|
+
/** The gap between the colour legend and the size key under (or beside) it. */
|
|
13
|
+
export declare const KEYS_GAP = 0.25;
|
|
14
|
+
/** The colour bar's thickness. */
|
|
15
|
+
export declare const COLORBAR_THICKNESS = 0.22;
|
|
16
|
+
/**
|
|
17
|
+
* Half a line of text at `fontSize` (a line is `1.2` of it): from a line's
|
|
18
|
+
* edge to its middle, as a rotated title stands off the edge it reads along.
|
|
19
|
+
*/
|
|
20
|
+
export declare function halfLine(fontSize: number): number;
|
|
21
|
+
/** A key's laid-out size, and how present it is (0 at a transition end with no legend), scaling the gap before it. */
|
|
22
|
+
export interface KeyExtent {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
presence: number;
|
|
26
|
+
}
|
|
27
|
+
/** A key's size at each end of a keyed transition (`to` only when the ends differ). */
|
|
28
|
+
export interface KeyEnds {
|
|
29
|
+
from: KeyExtent;
|
|
30
|
+
to: KeyExtent | undefined;
|
|
31
|
+
}
|
|
32
|
+
/** Two laid-out boxes of the same size (or both none). */
|
|
33
|
+
export declare function sameKeyExtent(a: KeyExtent | undefined, b: KeyExtent | undefined): boolean;
|
|
34
|
+
export declare function sameKeyEnds(a: KeyEnds | undefined, b: KeyEnds | undefined): boolean;
|
|
35
|
+
/** A key's size now: its own end's, or blended between the ends by the update stage's progress `u`. */
|
|
36
|
+
export declare function keyExtentNow(ends: KeyEnds | undefined, u: () => number): KeyExtent | undefined;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `chart` draws around its layers: the grid, zero lines, axes
|
|
3
|
+
* (number lines and band axes, with a kind swap's ghost), titles, the colour
|
|
4
|
+
* bar, the legend and the size keys.
|
|
5
|
+
*
|
|
6
|
+
* {@link createChartGuides} is made once per chart; its function runs in
|
|
7
|
+
* every chart update, keeps each guide's node by role (writing props into
|
|
8
|
+
* it rather than rebuilding it) and returns the nodes in paint order.
|
|
9
|
+
*/
|
|
10
|
+
import type { CompositeContext, SceneNode } from "@sophistry/core";
|
|
11
|
+
import type { Range } from "@sophistry/core/geometry";
|
|
12
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
13
|
+
import type { JoinStages, StageWindow } from "../math/join.js";
|
|
14
|
+
import type { ChartCoords } from "./coords.js";
|
|
15
|
+
import type { AxisEnds, AxisSwapView, FittedTransition, GivenRange, MergedAxisOptions, ResolvedAxis } from "./fit.js";
|
|
16
|
+
import type { ChartKeys } from "./keys.js";
|
|
17
|
+
import type { ChartLayout } from "./layout.js";
|
|
18
|
+
import type { ChartLayerExtent, ChartProps } from "./types.js";
|
|
19
|
+
/** One primary axis as the guides draw it. */
|
|
20
|
+
export interface GuideAxis {
|
|
21
|
+
options: MergedAxisOptions;
|
|
22
|
+
axis: ResolvedAxis;
|
|
23
|
+
range: Range;
|
|
24
|
+
given: GivenRange;
|
|
25
|
+
fitted: FittedTransition | undefined;
|
|
26
|
+
ends: AxisEnds | undefined;
|
|
27
|
+
/** A kind swap's cross-fade (see `createAxisSwap`). */
|
|
28
|
+
swap: AxisSwapView;
|
|
29
|
+
}
|
|
30
|
+
/** One secondary axis as the guides draw it. */
|
|
31
|
+
export interface GuideSecondaryAxis {
|
|
32
|
+
has: boolean;
|
|
33
|
+
options: MergedAxisOptions;
|
|
34
|
+
given: GivenRange;
|
|
35
|
+
range: Range;
|
|
36
|
+
}
|
|
37
|
+
/** The frame state the guides draw from on one update. */
|
|
38
|
+
export interface GuideFrame {
|
|
39
|
+
props: Readonly<ChartProps>;
|
|
40
|
+
theme: Theme;
|
|
41
|
+
reports: readonly ChartLayerExtent[];
|
|
42
|
+
x: GuideAxis;
|
|
43
|
+
y: GuideAxis;
|
|
44
|
+
x2: GuideSecondaryAxis;
|
|
45
|
+
y2: GuideSecondaryAxis;
|
|
46
|
+
axisZeros: {
|
|
47
|
+
xSpans: boolean;
|
|
48
|
+
ySpans: boolean;
|
|
49
|
+
xFrom: boolean;
|
|
50
|
+
yFrom: boolean;
|
|
51
|
+
};
|
|
52
|
+
axisBands: {
|
|
53
|
+
x: boolean;
|
|
54
|
+
y: boolean;
|
|
55
|
+
};
|
|
56
|
+
stage(pick: (stages: JoinStages) => StageWindow): number;
|
|
57
|
+
layout: ChartLayout;
|
|
58
|
+
keys: ChartKeys;
|
|
59
|
+
coords: ChartCoords;
|
|
60
|
+
frameProgress: number;
|
|
61
|
+
legendProgress: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The frame's guides. Make one per chart in `setup`; call the result in
|
|
65
|
+
* every update with the chart's context and frame state.
|
|
66
|
+
*/
|
|
67
|
+
export declare function createChartGuides(): (ctx: CompositeContext<ChartProps>, frame: GuideFrame) => SceneNode[];
|