@graphysdk/react-renderer 1.9.0-beta.1793879014563 → 1.9.0-beta.1793882432228
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/dist/editable.cjs +1 -1
- package/dist/editable.css +1 -1
- package/dist/editable.d.ts +365 -4
- package/dist/editable.mjs +2974 -2894
- package/dist/history-chords-BorFTpAl.cjs +2 -0
- package/dist/{history-chords-BPORQs1S.js → history-chords-CimEnXtI.js} +1924 -1905
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -2
- package/dist/index.mjs +504 -471
- package/package.json +4 -4
- package/dist/history-chords-BmN7fYlj.cjs +0 -2
package/dist/editable.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { AxisKey } from '@graphysdk/viz-engine';
|
|
2
|
+
import { BoxSize } from '@graphysdk/viz-engine';
|
|
3
|
+
import { CartesianCoordSystem } from '@graphysdk/viz-engine';
|
|
4
|
+
import { ColorScheme } from '@graphysdk/viz-engine';
|
|
2
5
|
import { Command } from '@graphysdk/viz-engine';
|
|
3
6
|
import { CommandContext } from '@graphysdk/viz-engine';
|
|
4
7
|
import { ComponentType } from 'react';
|
|
@@ -13,31 +16,41 @@ import { FormattedAxis } from '@graphysdk/viz-engine';
|
|
|
13
16
|
import { FormattedHeadline } from '@graphysdk/viz-engine';
|
|
14
17
|
import { FormattedLegend } from '@graphysdk/viz-engine';
|
|
15
18
|
import { FormattingLocale } from '@graphysdk/viz-engine';
|
|
19
|
+
import { GeomName } from '@graphysdk/viz-engine';
|
|
20
|
+
import { GeomStyleReaders } from '@graphysdk/viz-engine';
|
|
16
21
|
import { GraphLayout } from '@graphysdk/viz-engine';
|
|
17
22
|
import { GraphyBadgeVariant } from '@graphysdk/viz-engine';
|
|
18
23
|
import { HeadlineMeasurer } from '@graphysdk/viz-engine';
|
|
24
|
+
import { HoverHit } from '@graphysdk/viz-engine';
|
|
19
25
|
import { IntroStaggerOrder } from '@graphysdk/viz-engine';
|
|
20
26
|
import { JSX } from 'react/jsx-runtime';
|
|
27
|
+
import { LayerIntroPlan } from '@graphysdk/viz-engine';
|
|
21
28
|
import { LegendPosition } from '@graphysdk/viz-engine';
|
|
22
29
|
import { LineType } from '@graphysdk/viz-engine';
|
|
23
30
|
import { MainAxis } from '@graphysdk/viz-engine';
|
|
24
31
|
import { Observation } from '@graphysdk/viz-engine';
|
|
25
32
|
import { ObservationsTarget } from '@graphysdk/viz-engine';
|
|
33
|
+
import { PolarCoordSystem } from '@graphysdk/viz-engine';
|
|
26
34
|
import { PositionAdjustment } from '@graphysdk/viz-engine';
|
|
27
35
|
import { ReactElement } from 'react';
|
|
28
36
|
import { ReactNode } from 'react';
|
|
29
37
|
import { Rect } from '@graphysdk/viz-engine';
|
|
38
|
+
import { RenderHitTester } from '@graphysdk/viz-engine';
|
|
30
39
|
import { ResolvedHeadlineSize } from '@graphysdk/viz-engine';
|
|
31
40
|
import { ResolvedObservationAnchorSpec } from '@graphysdk/viz-engine';
|
|
32
41
|
import { ResolvedPaint } from '@graphysdk/viz-engine';
|
|
33
42
|
import { Scene } from '@graphysdk/viz-engine';
|
|
34
43
|
import { SceneLayer } from '@graphysdk/viz-engine';
|
|
44
|
+
import { SceneLayerFor } from '@graphysdk/viz-engine';
|
|
35
45
|
import { SourceContent } from '@graphysdk/viz-engine';
|
|
46
|
+
import { StyleImageSymbol } from '@graphysdk/viz-engine';
|
|
36
47
|
import { StylePointSymbol } from '@graphysdk/viz-engine';
|
|
48
|
+
import { StyleReadersForLayer } from '@graphysdk/viz-engine';
|
|
37
49
|
import { TextContent } from '@graphysdk/viz-engine';
|
|
38
50
|
import { TextMeasurer } from '@graphysdk/viz-engine';
|
|
39
51
|
import { TextStyle } from '@graphysdk/viz-engine';
|
|
40
52
|
import { TooltipContent } from '@graphysdk/viz-engine';
|
|
53
|
+
import { XYPoint } from '@graphysdk/viz-engine';
|
|
41
54
|
|
|
42
55
|
/** The pin an annotate menu writes against, resolved from the selected observation. */
|
|
43
56
|
export declare interface AnnotateAnchor {
|
|
@@ -296,6 +309,11 @@ export declare interface ControlTooltipProps {
|
|
|
296
309
|
children: ReactElement;
|
|
297
310
|
}
|
|
298
311
|
|
|
312
|
+
declare type CoordKind = CoordSystem['type'];
|
|
313
|
+
|
|
314
|
+
/** Maps a coord-kind discriminator to the corresponding `CoordSystem` member. */
|
|
315
|
+
declare type CoordSystemFor<C extends CoordKind> = C extends 'cartesian' ? CartesianCoordSystem : C extends 'polar' ? PolarCoordSystem : never;
|
|
316
|
+
|
|
299
317
|
/** A hex picker behind a trigger, for a color none of the swatches offer. */
|
|
300
318
|
export declare const CustomColor: ({ value, onChange, onCommit, popupAttributes, variant, }: CustomColorControlProps) => JSX.Element;
|
|
301
319
|
|
|
@@ -921,7 +939,7 @@ declare const EDITOR_EN_GB: {
|
|
|
921
939
|
readonly star: "Star";
|
|
922
940
|
readonly wye: "Wye";
|
|
923
941
|
};
|
|
924
|
-
readonly custom: "Custom";
|
|
942
|
+
readonly custom: "Custom shape";
|
|
925
943
|
readonly oversized: "This image is too large. Choose one under 512 KB.";
|
|
926
944
|
readonly undecodable: "This file could not be read as an image.";
|
|
927
945
|
};
|
|
@@ -1635,6 +1653,52 @@ declare interface EditorSurfaceSlotProps {
|
|
|
1635
1653
|
animateTransitions: boolean;
|
|
1636
1654
|
}
|
|
1637
1655
|
|
|
1656
|
+
/** Round marks of one size, which the outline grows from their edge. */
|
|
1657
|
+
declare interface EditOutlineDots {
|
|
1658
|
+
kind: 'dots';
|
|
1659
|
+
/** Each dot's center, in panel pixels. */
|
|
1660
|
+
centers: readonly XYPoint[];
|
|
1661
|
+
/** The diameter every dot covers, its border included, in pixels. */
|
|
1662
|
+
size: number;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
/** A filled region, which the outline grows from its edge. */
|
|
1666
|
+
declare interface EditOutlineRegion extends MorphingEditOutlineShape {
|
|
1667
|
+
kind: 'region';
|
|
1668
|
+
/** `'evenodd'` punches a subpath inside another out of it, as a ring's hole. */
|
|
1669
|
+
fillRule?: 'nonzero' | 'evenodd';
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/** One shape edit mode outlines. It carries no paint: the editor draws the outline round it in its own look. */
|
|
1673
|
+
declare type EditOutlineShape = EditOutlineRegion | EditOutlineStroke | EditOutlineDots;
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* The input a geom's {@link GeomRenderContract.getEditOutlineShapes} receives: the observations to outline as a
|
|
1677
|
+
* layer, and what their shapes are placed and sized by.
|
|
1678
|
+
*/
|
|
1679
|
+
declare interface EditOutlineShapesInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> {
|
|
1680
|
+
/** The outlined observations. */
|
|
1681
|
+
layer: SceneLayerOf<G>;
|
|
1682
|
+
/** The full layer `layer` was taken from — for context the subset can't see, like a stack's silhouette. */
|
|
1683
|
+
sourceLayer: SceneLayerOf<G>;
|
|
1684
|
+
coordSystem: CoordSystemFor<C>;
|
|
1685
|
+
/** The panel's pixel rect. Shapes are placed in its local `0…width` / `0…height`. */
|
|
1686
|
+
panelRect: GraphLayout['panel'];
|
|
1687
|
+
/** Cascade readers for this layer, for the sizes a shape matches: a line's width, a point's size. */
|
|
1688
|
+
styleReaders: StyleReadersOf<G>;
|
|
1689
|
+
/** Whether the chart animates transitions, for a shape to copy where the geom's paint springs. */
|
|
1690
|
+
animateTransitions: boolean;
|
|
1691
|
+
/** The outlined layer's renderer's {@link GeomRenderContract.symbols}, so a point outline traces only what it draws. */
|
|
1692
|
+
symbols?: readonly PointSymbolName[];
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
/** A stroke, which the outline grows from either side of its thickness. */
|
|
1696
|
+
declare interface EditOutlineStroke extends MorphingEditOutlineShape {
|
|
1697
|
+
kind: 'stroke';
|
|
1698
|
+
/** The thickness the stroke is drawn at, in pixels. */
|
|
1699
|
+
width: number;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1638
1702
|
/**
|
|
1639
1703
|
* The chart's text and its size: what the header and footer show, and how large everything is drawn.
|
|
1640
1704
|
*
|
|
@@ -1745,13 +1809,15 @@ declare const EN_GB: {
|
|
|
1745
1809
|
};
|
|
1746
1810
|
|
|
1747
1811
|
/** A labeled file picker. A host can swap it for its own upload control. */
|
|
1748
|
-
export declare const FileInput: ({ label, accept, onFile, disabled, id }: FileInputControlProps) => JSX.Element;
|
|
1812
|
+
export declare const FileInput: ({ label, accept, onFile, disabled, id, variant }: FileInputControlProps) => JSX.Element;
|
|
1749
1813
|
|
|
1750
1814
|
/** A file the host picks. The section decides what to do with it. */
|
|
1751
1815
|
export declare interface FileInputControlProps extends ControlBaseProps {
|
|
1752
1816
|
label: string;
|
|
1753
1817
|
accept: string;
|
|
1754
1818
|
onFile: (file: File) => void;
|
|
1819
|
+
/** `default` is a button showing the label. `chip` is the icon alone, named by a tooltip, for the end of a row of options. */
|
|
1820
|
+
variant?: 'default' | 'chip';
|
|
1755
1821
|
}
|
|
1756
1822
|
|
|
1757
1823
|
/**
|
|
@@ -1786,6 +1852,186 @@ export declare interface GeomEditMenuActions {
|
|
|
1786
1852
|
/** A component is the style menu, the shape hosts already pass; the pair names each action. */
|
|
1787
1853
|
export declare type GeomEditMenuEntry = ObservationsEditMenu | GeomEditMenuActions;
|
|
1788
1854
|
|
|
1855
|
+
/** The input a geom's {@link GeomRenderContract.hitTest} factory receives: the render input plus the panel. */
|
|
1856
|
+
declare type GeomHitTestInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> = GeomRenderInput<G, C> & {
|
|
1857
|
+
/**
|
|
1858
|
+
* The panel's size in pixels: the data rectangle geoms paint into, already inset from axes and chrome, so marks are
|
|
1859
|
+
* placed in local `0…width` / `0…height`.
|
|
1860
|
+
*/
|
|
1861
|
+
panelSize: BoxSize;
|
|
1862
|
+
};
|
|
1863
|
+
|
|
1864
|
+
/** Page-relative cursor coordinates the push-path tooltip anchors to. */
|
|
1865
|
+
declare interface GeomHoverCursor {
|
|
1866
|
+
clientX: number;
|
|
1867
|
+
clientY: number;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* Pushes a hovered observation key into the central hover, or clears this layer's hover with `null`.
|
|
1872
|
+
* A non-null key requires a `cursor` — a live geom takes the pointer events the cursor-follow
|
|
1873
|
+
* tooltip would otherwise read, so the anchor can only come from the geom's own handler. Consumed by
|
|
1874
|
+
* {@link LiveGeomApi.pushHover} and returned by `useGeomHover`.
|
|
1875
|
+
*/
|
|
1876
|
+
declare interface GeomHoverPush {
|
|
1877
|
+
(key: string, cursor: GeomHoverCursor): void;
|
|
1878
|
+
(key: null): void;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* The props of a geom's {@link GeomRenderContract.LayerProvider}: always the full layer, whichever subset a paint
|
|
1883
|
+
* inside it receives.
|
|
1884
|
+
*/
|
|
1885
|
+
declare interface GeomLayerProviderProps<G extends GeomName | string = string, C extends CoordKind = CoordKind> extends GeomRenderInputBase {
|
|
1886
|
+
layer: SceneLayerOf<G>;
|
|
1887
|
+
coordSystem: CoordSystemFor<C>;
|
|
1888
|
+
/** The panel's size in pixels, which changes on every resize frame. */
|
|
1889
|
+
panelSize: BoxSize;
|
|
1890
|
+
children: ReactNode;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
/** A live geom's paint function — receives the guaranteed wiring on `input.live`. */
|
|
1894
|
+
declare type GeomLiveRenderFn<G extends GeomName | string = string, C extends CoordKind = CoordKind> = (input: GeomLiveRenderInput<G, C>) => ReactNode;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* The input a live render (`{ fn, options: { live: true } }`) receives: the standard render
|
|
1898
|
+
* input plus a guaranteed {@link LiveGeomApi}.
|
|
1899
|
+
*/
|
|
1900
|
+
declare interface GeomLiveRenderInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> extends GeomRenderInput<G, C> {
|
|
1901
|
+
live: LiveGeomApi;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* A geom's `render`: either a plain paint function, or a live one paired with `options`, so a geom
|
|
1906
|
+
* that owns its pointer events declares `{ fn, options: { live: true } }` without a second render
|
|
1907
|
+
* entry point.
|
|
1908
|
+
*/
|
|
1909
|
+
declare type GeomRender<G extends GeomName | string = string, C extends CoordKind = CoordKind> = GeomRenderFn<G, C> | {
|
|
1910
|
+
fn: GeomLiveRenderFn<G, C>;
|
|
1911
|
+
options: GeomRenderOptions;
|
|
1912
|
+
};
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* The render side of a geom: everything a single `(geom, coord)` composition needs to render and
|
|
1916
|
+
* respond to hover. Generic over the geom name and coord kind, so a built-in renderer parameterised
|
|
1917
|
+
* as `GeomRenderContract<'bar', 'cartesian'>` receives param-narrowed inputs (`SceneLayerFor<'bar'>`,
|
|
1918
|
+
* `CartesianCoordSystem`), while the default `<string, CoordKind>` instantiation is the base/custom
|
|
1919
|
+
* contract a plugin author writes against. The geom's name, highlight strategy, and `params` type are
|
|
1920
|
+
* NOT restated here — they are read off the compile definition this contract is bound to (see
|
|
1921
|
+
* {@link defineGeomRenderer}). This is the single declaration of a geom's render contract; the built-in
|
|
1922
|
+
* narrow form below and the base/custom form (`geom-renderer.ts`) are both instantiations of it.
|
|
1923
|
+
*/
|
|
1924
|
+
declare interface GeomRenderContract<G extends GeomName | string = string, C extends CoordKind = CoordKind> {
|
|
1925
|
+
/** The coord system this contract paints under. A geom may bind one contract per coord. */
|
|
1926
|
+
coord: C;
|
|
1927
|
+
swatchShape?: SwatchShape;
|
|
1928
|
+
/**
|
|
1929
|
+
* The hover-guide mode this `(geom, coord)` draws when it is the hovered layer (a
|
|
1930
|
+
* {@link HoverGuideMode}). Omit it — or contribute `null` — to draw no guide (the geom's mark is its
|
|
1931
|
+
* own highlight). A declared mode the composition can't realize draws nothing: a polar bar's `'band'`
|
|
1932
|
+
* fills a wedge, but a pie/donut (no category band) resolves to an empty one. `resolveHoverGuideMode`
|
|
1933
|
+
* reads the hovered layer's mode to pick the one guide the chart draws.
|
|
1934
|
+
*/
|
|
1935
|
+
guideMode?: HoverGuideMode | null;
|
|
1936
|
+
/**
|
|
1937
|
+
* Where a geom `overpaint` lands. `'layer'`, the default, lays it over everything each hook draws.
|
|
1938
|
+
* `'manual'` leaves it to the geom, which wraps its main shapes in `GeomOverpaint` itself so what it draws
|
|
1939
|
+
* before or after them stays clear (a boxplot's whiskers and medians). A manual geom with no wrapper draws
|
|
1940
|
+
* no overpaint.
|
|
1941
|
+
*/
|
|
1942
|
+
overpaintPlacement?: OverpaintPlacement;
|
|
1943
|
+
/**
|
|
1944
|
+
* Every point symbol the paint draws, built-in shapes and glyph names, in the order Point shape offers them. A list
|
|
1945
|
+
* also says the paint draws the host's glyphs and uploaded images, as `SymbolFigure` does; any other symbol is drawn
|
|
1946
|
+
* as the first listed. The edit outline traces the listed built-in shapes. Omit it or leave it empty for a circle
|
|
1947
|
+
* alone.
|
|
1948
|
+
*/
|
|
1949
|
+
symbols?: readonly PointSymbolName[];
|
|
1950
|
+
/**
|
|
1951
|
+
* Wraps a layer's {@link render}, {@link renderHighlight} and {@link renderHover} in one component, so a value they
|
|
1952
|
+
* share is computed once a layer and reaches them through its own context. It receives the panel, so a paint that
|
|
1953
|
+
* reads only the value it derives re-renders when that value changes, not on every resize.
|
|
1954
|
+
* {@link getEditOutlineShapes} runs outside it.
|
|
1955
|
+
*/
|
|
1956
|
+
LayerProvider?: (props: GeomLayerProviderProps<G, C>) => ReactNode;
|
|
1957
|
+
/**
|
|
1958
|
+
* The geom's paint. A plain function paints with the other geoms; the `{ fn, options: { live: true } }`
|
|
1959
|
+
* form paints above the central capture layer for a live or drag-driven geom that owns its pointer events
|
|
1960
|
+
* (force-directed), with the wiring on `input.live`.
|
|
1961
|
+
*/
|
|
1962
|
+
render: GeomRender<G, C>;
|
|
1963
|
+
/**
|
|
1964
|
+
* Optional repaint of the matched subset for the highlight overlay. Omit it and the highlight layer
|
|
1965
|
+
* falls back to {@link render}. A geom overrides it when the plain column-grouped render would
|
|
1966
|
+
* misrepresent a matched subset — a bar repaints each matched observation as an isolated stack segment
|
|
1967
|
+
* (from its compiled stack role), so a lone mid-stack match keeps its square-edged silhouette and
|
|
1968
|
+
* single-width border instead of regrouping into a standalone rounded bar.
|
|
1969
|
+
*/
|
|
1970
|
+
renderHighlight?: (input: HighlightRenderInput<G, C>) => ReactNode;
|
|
1971
|
+
/** Paints the hovered observation. Omit it for a geom with no hover paint. */
|
|
1972
|
+
renderHover?: (input: HoverRenderInput<G, C>) => ReactNode;
|
|
1973
|
+
/** Paints this layer's related observations when another layer is hovered. Omit it for a geom with none. */
|
|
1974
|
+
renderHoverCompanions?: (input: HoverCompanionsRenderInput<G, C>) => ReactNode;
|
|
1975
|
+
/**
|
|
1976
|
+
* Editing only: the shapes edit mode outlines for the observations in `layer`, as data in panel pixels.
|
|
1977
|
+
* A region is what they cover, one path where there are many, with rounded corners traced into it; a line is
|
|
1978
|
+
* a stroke at the width it is drawn; round marks are dots at their size. Omit it and the editor outlines each
|
|
1979
|
+
* observation's bounding box.
|
|
1980
|
+
*/
|
|
1981
|
+
getEditOutlineShapes?: (input: EditOutlineShapesInput<G, C>) => readonly EditOutlineShape[];
|
|
1982
|
+
/**
|
|
1983
|
+
* Render-side spatial query for a `'renderHitTest'` layer whose geometry is precomputed into the
|
|
1984
|
+
* scene (sankey ribbons, treemap tiles, voronoi cells). A
|
|
1985
|
+
* **factory**: given the render input it returns the per-cursor {@link RenderHitTester};
|
|
1986
|
+
* the renderer memoizes the factory on `layer.data` and the panel's size, so the read runs once
|
|
1987
|
+
* per data or panel-size change and the per-move query allocates nothing. The author writes no hook;
|
|
1988
|
+
* the renderer registers the tester on its behalf. The cursor arrives in panel-local `[0,1]` with a
|
|
1989
|
+
* top-left origin — the frame the geom paints in. Returns the declared identity key of the observation
|
|
1990
|
+
* under the cursor, or `null` for a miss.
|
|
1991
|
+
*/
|
|
1992
|
+
hitTest?: (input: GeomHitTestInput<G, C>) => RenderHitTester;
|
|
1993
|
+
/** Panel-space anchor for a matched observation; required when the def highlights via overlay-anchor. */
|
|
1994
|
+
getOverlayAnchor?: (input: OverlayAnchorInput<G, C>) => OverlayAnchor | null;
|
|
1995
|
+
/**
|
|
1996
|
+
* The rect an observation is painted in, in panel `[0, 1]` with a top-left origin, where annotations
|
|
1997
|
+
* anchored to it land. Omit it where the geom paints the box its position variables span.
|
|
1998
|
+
*/
|
|
1999
|
+
getObservationRect?: (input: ObservationRectInput<G, C>) => Rect | null;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
/** A geom's panel-SVG paint function — the plain `render` form. */
|
|
2003
|
+
declare type GeomRenderFn<G extends GeomName | string = string, C extends CoordKind = CoordKind> = (input: GeomRenderInput<G, C>) => ReactNode;
|
|
2004
|
+
|
|
2005
|
+
declare interface GeomRenderInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> extends GeomRenderInputBase {
|
|
2006
|
+
layer: SceneLayerOf<G>;
|
|
2007
|
+
coordSystem: CoordSystemFor<C>;
|
|
2008
|
+
animateTransitions: boolean;
|
|
2009
|
+
formattingLocale: FormattingLocale;
|
|
2010
|
+
intro?: LayerIntroPlan | null;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
/**
|
|
2014
|
+
* The cascade paint context every geom render handler receives. Visual readers such as `getColor`
|
|
2015
|
+
* see the data tier only; plugin paint should read {@link GeomRenderInputBase.styleReaders} so tokens,
|
|
2016
|
+
* overrides, and the built-in default reach the mark.
|
|
2017
|
+
*/
|
|
2018
|
+
declare interface GeomRenderInputBase {
|
|
2019
|
+
/** The provider's color scheme — pass to `createStyleResolver` when a plugin needs readers beyond this layer. */
|
|
2020
|
+
colorScheme: ColorScheme;
|
|
2021
|
+
/** Cascade readers for this layer: override → data → default, resolved for {@link GeomRenderInputBase.colorScheme}. */
|
|
2022
|
+
styleReaders: GeomStyleReaders;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
/** Options for the object form of `render`. */
|
|
2026
|
+
declare interface GeomRenderOptions {
|
|
2027
|
+
/**
|
|
2028
|
+
* Paint this render above the central capture layer rather than with the other geoms, for a live or
|
|
2029
|
+
* drag-driven geom that must own its pointer events (force-directed). It still paints in the panel SVG, in
|
|
2030
|
+
* the same units as every other geom. The renderer then supplies {@link GeomLiveRenderInput.live}.
|
|
2031
|
+
*/
|
|
2032
|
+
live: true;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
1789
2035
|
declare interface GlyphDefinition {
|
|
1790
2036
|
name: string;
|
|
1791
2037
|
definition: GlyphShape;
|
|
@@ -1913,6 +2159,8 @@ declare interface GraphHandle {
|
|
|
1913
2159
|
canFormatDataLabelsAsPercentages: (layer: SceneLayer, coordType: CoordSystem['type']) => boolean;
|
|
1914
2160
|
/** Glyphs mounted with this graph. A panel reads these from the handle it targets. */
|
|
1915
2161
|
getGlyphs: () => readonly GlyphDefinition[];
|
|
2162
|
+
/** What the point renderer under these coords draws, per the plugins the graph was built with. */
|
|
2163
|
+
getPointSymbols: (coordType: CoordSystem['type']) => GeomRenderContract['symbols'];
|
|
1916
2164
|
}
|
|
1917
2165
|
|
|
1918
2166
|
/** The mode a chart runs in, which `GraphRenderer` takes as a prop and every row of `MODE_RULES` is keyed by. */
|
|
@@ -2087,6 +2335,47 @@ declare interface HeadlineSlotProps {
|
|
|
2087
2335
|
inDonutHole?: boolean;
|
|
2088
2336
|
}
|
|
2089
2337
|
|
|
2338
|
+
/**
|
|
2339
|
+
* The input a geom's {@link GeomRenderContract.renderHighlight} receives: the matched-subset layer plus
|
|
2340
|
+
* the full source layer (context the subset can't see, like a stack's silhouette). A superset of
|
|
2341
|
+
* {@link GeomRenderInput}, so a geom that doesn't override `renderHighlight` still paints through the
|
|
2342
|
+
* plain `render`.
|
|
2343
|
+
*/
|
|
2344
|
+
declare interface HighlightRenderInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> extends GeomRenderInput<G, C> {
|
|
2345
|
+
/** The full layer `layer` was filtered from — for context the subset can't see, like a stack's silhouette. */
|
|
2346
|
+
sourceLayer: SceneLayerOf<G>;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
declare interface HoverCompanionsRenderInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> extends GeomRenderInputBase {
|
|
2350
|
+
layer: SceneLayerOf<G>;
|
|
2351
|
+
coordSystem: CoordSystemFor<C>;
|
|
2352
|
+
primary: HoverHit;
|
|
2353
|
+
related: HoverHit[];
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
* The shape of positional guide the `HoverGuide` draws for a hovered observation, contributed per
|
|
2358
|
+
* `(geom, coord)` renderer via `guideMode`:
|
|
2359
|
+
*
|
|
2360
|
+
* - `'band'` — a rectangle over the hovered category's band on the main axis (bars).
|
|
2361
|
+
* - `'crosshair'` — a rule at the hovered value: a straight line under cartesian, a center-to-edge spoke
|
|
2362
|
+
* under polar (line and area).
|
|
2363
|
+
*
|
|
2364
|
+
* A renderer that omits `guideMode` draws no guide (scatter points). A declared `'band'` still draws
|
|
2365
|
+
* nothing where the composition has no category band — a pie/donut resolves to an empty wedge. The chart
|
|
2366
|
+
* draws the guide of whichever layer the cursor resolves to, so a combo shows a band over a hovered bar
|
|
2367
|
+
* and a crosshair over a hovered line; see `resolveHoverGuideMode`.
|
|
2368
|
+
*/
|
|
2369
|
+
declare type HoverGuideMode = 'crosshair' | 'band';
|
|
2370
|
+
|
|
2371
|
+
declare interface HoverRenderInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> extends GeomRenderInputBase {
|
|
2372
|
+
layer: SceneLayerOf<G>;
|
|
2373
|
+
coordSystem: CoordSystemFor<C>;
|
|
2374
|
+
primary: HoverHit;
|
|
2375
|
+
group: HoverHit[];
|
|
2376
|
+
related: HoverHit[];
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2090
2379
|
declare type I18nLocale = keyof typeof dictionaries;
|
|
2091
2380
|
|
|
2092
2381
|
declare type I18nRuntimeOverrides = RuntimeOverrides<GraphPhrases>;
|
|
@@ -2161,6 +2450,20 @@ declare interface ListProps {
|
|
|
2161
2450
|
children: ReactNode;
|
|
2162
2451
|
}
|
|
2163
2452
|
|
|
2453
|
+
/**
|
|
2454
|
+
* The wiring handed to a live render via {@link GeomLiveRenderInput.live}. The geom
|
|
2455
|
+
* writes only its simulation, marks, and drag handlers; the renderer owns the push wiring.
|
|
2456
|
+
*/
|
|
2457
|
+
declare interface LiveGeomApi {
|
|
2458
|
+
/** Feeds the hovered observation's identity key into the unified hover store — the push path. */
|
|
2459
|
+
pushHover: GeomHoverPush;
|
|
2460
|
+
/**
|
|
2461
|
+
* A pointer's client coordinates in the panel's units, whatever the graph's on-screen scale, so a drag
|
|
2462
|
+
* moves a mark to the pointer. `null` before the panel mounts.
|
|
2463
|
+
*/
|
|
2464
|
+
readPanelPoint: (cursor: GeomHoverCursor) => PanelPoint | null;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2164
2467
|
declare type LocaleShape = {
|
|
2165
2468
|
dir?: TextDirection;
|
|
2166
2469
|
} & Dictionary<typeof EN_GB>;
|
|
@@ -2180,6 +2483,15 @@ declare type LooseValue<T> = T extends (...args: infer A) => infer R ? (...args:
|
|
|
2180
2483
|
/** Which column of the data feeds each of the chart's aesthetics. */
|
|
2181
2484
|
export declare const MappingSection: ({ title, layout }: OverridableSectionProps) => JSX.Element | null;
|
|
2182
2485
|
|
|
2486
|
+
declare interface MorphingEditOutlineShape {
|
|
2487
|
+
/** SVG path data in panel pixels. */
|
|
2488
|
+
pathData: string;
|
|
2489
|
+
/** Identifies the shape across renders, such as a line's group, so a morph starts from where it was. */
|
|
2490
|
+
key?: string;
|
|
2491
|
+
/** Whether a change of shape morphs to the new one, as the geom's paint does. Snaps when omitted. */
|
|
2492
|
+
animateTransitions?: boolean;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2183
2495
|
/**
|
|
2184
2496
|
* A number typed, scrubbed or stepped into a field.
|
|
2185
2497
|
*
|
|
@@ -2216,9 +2528,35 @@ export declare interface NumberFieldControlProps extends ContinuousControlProps<
|
|
|
2216
2528
|
*/
|
|
2217
2529
|
export declare const NumberFormatSection: ({ title, layout, preview }: OverridableSectionProps) => JSX.Element | null;
|
|
2218
2530
|
|
|
2531
|
+
declare interface ObservationRectInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> {
|
|
2532
|
+
layer: SceneLayerOf<G>;
|
|
2533
|
+
coordSystem: CoordSystemFor<C>;
|
|
2534
|
+
observation: Observation;
|
|
2535
|
+
panelRect: GraphLayout['panel'];
|
|
2536
|
+
styleReaders: StyleReadersOf<G>;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2219
2539
|
/** The rows the overlay menu draws under its title for a selection of observations. */
|
|
2220
2540
|
export declare type ObservationsEditMenu = ComponentType<ResolvedObservations> & EditMenuRows<ObservationsTarget>;
|
|
2221
2541
|
|
|
2542
|
+
/**
|
|
2543
|
+
* Anchor point in normalized [0,1] coord-space where a highlight overlay marker
|
|
2544
|
+
* should be painted for one observation. Renderer turns [0,1] into pixels.
|
|
2545
|
+
*/
|
|
2546
|
+
declare interface OverlayAnchor {
|
|
2547
|
+
x: number;
|
|
2548
|
+
y: number;
|
|
2549
|
+
}
|
|
2550
|
+
|
|
2551
|
+
declare interface OverlayAnchorInput<G extends GeomName | string = string, C extends CoordKind = CoordKind> {
|
|
2552
|
+
layer: SceneLayerOf<G>;
|
|
2553
|
+
coordSystem: CoordSystemFor<C>;
|
|
2554
|
+
observation: Observation;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
/** Where a geom `overpaint` lands: over everything a hook draws, or where the geom wraps it itself. */
|
|
2558
|
+
declare type OverpaintPlacement = 'layer' | 'manual';
|
|
2559
|
+
|
|
2222
2560
|
/**
|
|
2223
2561
|
* What a host may override per section, spread by every section onto its `Section`, so the same
|
|
2224
2562
|
* section can be mounted at two layouts without being forked to get them.
|
|
@@ -2248,6 +2586,12 @@ declare interface PanelExpansion {
|
|
|
2248
2586
|
collapseAllSections: () => void;
|
|
2249
2587
|
}
|
|
2250
2588
|
|
|
2589
|
+
/** A point in the panel's own units, the space a geom's `render` paints in. */
|
|
2590
|
+
declare interface PanelPoint {
|
|
2591
|
+
x: number;
|
|
2592
|
+
y: number;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2251
2595
|
declare interface PanelProps extends Omit<PanelRootProps, 'children'> {
|
|
2252
2596
|
/**
|
|
2253
2597
|
* Replaces the sections entirely. A panel is a convenience over composing them by hand, so the
|
|
@@ -2296,6 +2640,9 @@ export declare const PointEditMenu: {
|
|
|
2296
2640
|
*/
|
|
2297
2641
|
export declare const PointSection: ({ title, layout, preview }: OverridableSectionProps) => JSX.Element | null;
|
|
2298
2642
|
|
|
2643
|
+
/** A point symbol a renderer can list by name: a built-in shape or a registered glyph's name. */
|
|
2644
|
+
declare type PointSymbolName = Exclude<StylePointSymbol, StyleImageSymbol>;
|
|
2645
|
+
|
|
2299
2646
|
/** How big a hole a round chart has, and where its sweep begins. */
|
|
2300
2647
|
export declare const PolarSection: ({ title, layout, preview }: OverridableSectionProps) => JSX.Element | null;
|
|
2301
2648
|
|
|
@@ -2328,9 +2675,10 @@ export declare interface RadioGridControlProps extends ContinuousControlProps<st
|
|
|
2328
2675
|
* `tile` (default) captions each icon; `swatch` drops the caption for a dense grid of pure
|
|
2329
2676
|
* pictures — color chips a name would only clutter — naming each in a tooltip and through `aria-label` instead;
|
|
2330
2677
|
* `icon` drops the tile too, names each in a tooltip and thickens the checked stroke for a 24-unit viewBox;
|
|
2331
|
-
* `track` sets the pictures on a toggle group's sunken track, the checked one raised, each named through `aria-label
|
|
2678
|
+
* `track` sets the pictures on a toggle group's sunken track, the checked one raised, each named through `aria-label`;
|
|
2679
|
+
* `chip` packs them as a color row packs its chips, the checked one sunken and ringed, each named in a tooltip.
|
|
2332
2680
|
*/
|
|
2333
|
-
itemLayout?: 'tile' | 'swatch' | 'icon' | 'track';
|
|
2681
|
+
itemLayout?: 'tile' | 'swatch' | 'icon' | 'track' | 'chip';
|
|
2334
2682
|
}
|
|
2335
2683
|
|
|
2336
2684
|
/** A choice in a `RadioGrid`, which can sit somewhere other than its turn in the arrow keys' order. */
|
|
@@ -2376,6 +2724,13 @@ declare type RuntimeOverrides<Phrases> = {
|
|
|
2376
2724
|
[Key in DotNotation<Phrases>]?: OverridePhrase<Phrases, Key>;
|
|
2377
2725
|
};
|
|
2378
2726
|
|
|
2727
|
+
/**
|
|
2728
|
+
* The compiled layer a renderer's handlers receive. A built-in renderer keyed to a `GeomName` gets
|
|
2729
|
+
* its param-narrowed `SceneLayerFor<G>`; a custom renderer (`G = string`) is downstream of
|
|
2730
|
+
* serialization, never sees the plugins array, and reads the base {@link SceneLayer} dynamically.
|
|
2731
|
+
*/
|
|
2732
|
+
declare type SceneLayerOf<G extends GeomName | string> = G extends GeomName ? SceneLayerFor<G> : SceneLayer;
|
|
2733
|
+
|
|
2379
2734
|
/**
|
|
2380
2735
|
* One block of a panel: a heading, and the settings under it. Defaults to `fixed`, so a section that
|
|
2381
2736
|
* forgot to declare a layout shows its controls rather than hiding them.
|
|
@@ -2500,6 +2855,12 @@ declare interface SourceStyle {
|
|
|
2500
2855
|
link: TextStyle;
|
|
2501
2856
|
}
|
|
2502
2857
|
|
|
2858
|
+
/**
|
|
2859
|
+
* The style readers a handler that cannot call `useGeomStyleReader` receives: a built-in geom's own, whose
|
|
2860
|
+
* builtin-backed properties resolve NonNullable, and the shared readers for a custom geom.
|
|
2861
|
+
*/
|
|
2862
|
+
declare type StyleReadersOf<G extends GeomName | string> = G extends GeomName ? StyleReadersForLayer<SceneLayerFor<G>> : GeomStyleReaders;
|
|
2863
|
+
|
|
2503
2864
|
/**
|
|
2504
2865
|
* Whether the chart shows its subtitle, and what it says.
|
|
2505
2866
|
*
|