@voila.dev/chart 4.0.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/README.md +85 -0
- package/dist/brush/brush-layer.d.ts +16 -0
- package/dist/brush/brush-layer.d.ts.map +1 -0
- package/dist/brush/brush-layer.js +137 -0
- package/dist/brush/brush-layer.js.map +7 -0
- package/dist/brush/index.d.ts +10 -0
- package/dist/brush/index.d.ts.map +1 -0
- package/dist/brush/index.js +8 -0
- package/dist/brush/index.js.map +7 -0
- package/dist/canvas/canvas-renderer.d.ts +11 -0
- package/dist/canvas/canvas-renderer.d.ts.map +1 -0
- package/dist/canvas/canvas-renderer.js +49 -0
- package/dist/canvas/canvas-renderer.js.map +7 -0
- package/dist/canvas/index.d.ts +2 -0
- package/dist/canvas/index.d.ts.map +1 -0
- package/dist/canvas/index.js +5 -0
- package/dist/canvas/index.js.map +7 -0
- package/dist/canvas/paint-scene.d.ts +4 -0
- package/dist/canvas/paint-scene.d.ts.map +1 -0
- package/dist/canvas/paint-scene.js +130 -0
- package/dist/canvas/paint-scene.js.map +7 -0
- package/dist/canvas/resolve-color.d.ts +18 -0
- package/dist/canvas/resolve-color.d.ts.map +1 -0
- package/dist/canvas/resolve-color.js +52 -0
- package/dist/canvas/resolve-color.js.map +7 -0
- package/dist/contour/density.d.ts +20 -0
- package/dist/contour/density.d.ts.map +1 -0
- package/dist/contour/density.js +59 -0
- package/dist/contour/density.js.map +7 -0
- package/dist/contour/index.d.ts +2 -0
- package/dist/contour/index.d.ts.map +1 -0
- package/dist/contour/index.js +5 -0
- package/dist/contour/index.js.map +7 -0
- package/dist/core/channel.d.ts +11 -0
- package/dist/core/channel.d.ts.map +1 -0
- package/dist/core/channel.js +44 -0
- package/dist/core/channel.js.map +7 -0
- package/dist/core/compile.d.ts +22 -0
- package/dist/core/compile.d.ts.map +1 -0
- package/dist/core/compile.js +295 -0
- package/dist/core/compile.js.map +7 -0
- package/dist/core/define-chart.d.ts +96 -0
- package/dist/core/define-chart.d.ts.map +1 -0
- package/dist/core/define-chart.js +7 -0
- package/dist/core/define-chart.js.map +7 -0
- package/dist/core/facet.d.ts +7 -0
- package/dist/core/facet.d.ts.map +1 -0
- package/dist/core/facet.js +134 -0
- package/dist/core/facet.js.map +7 -0
- package/dist/core/format.d.ts +37 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +108 -0
- package/dist/core/format.js.map +7 -0
- package/dist/core/guides/axes.d.ts +25 -0
- package/dist/core/guides/axes.d.ts.map +1 -0
- package/dist/core/guides/axes.js +204 -0
- package/dist/core/guides/axes.js.map +7 -0
- package/dist/core/marks/area.d.ts +23 -0
- package/dist/core/marks/area.d.ts.map +1 -0
- package/dist/core/marks/area.js +187 -0
- package/dist/core/marks/area.js.map +7 -0
- package/dist/core/marks/bar.d.ts +26 -0
- package/dist/core/marks/bar.d.ts.map +1 -0
- package/dist/core/marks/bar.js +200 -0
- package/dist/core/marks/bar.js.map +7 -0
- package/dist/core/marks/cell.d.ts +16 -0
- package/dist/core/marks/cell.d.ts.map +1 -0
- package/dist/core/marks/cell.js +98 -0
- package/dist/core/marks/cell.js.map +7 -0
- package/dist/core/marks/dot.d.ts +17 -0
- package/dist/core/marks/dot.d.ts.map +1 -0
- package/dist/core/marks/dot.js +125 -0
- package/dist/core/marks/dot.js.map +7 -0
- package/dist/core/marks/funnel-layout.d.ts +37 -0
- package/dist/core/marks/funnel-layout.d.ts.map +1 -0
- package/dist/core/marks/funnel-layout.js +61 -0
- package/dist/core/marks/funnel-layout.js.map +7 -0
- package/dist/core/marks/funnel.d.ts +19 -0
- package/dist/core/marks/funnel.d.ts.map +1 -0
- package/dist/core/marks/funnel.js +143 -0
- package/dist/core/marks/funnel.js.map +7 -0
- package/dist/core/marks/line.d.ts +17 -0
- package/dist/core/marks/line.d.ts.map +1 -0
- package/dist/core/marks/line.js +150 -0
- package/dist/core/marks/line.js.map +7 -0
- package/dist/core/marks/polar.d.ts +61 -0
- package/dist/core/marks/polar.d.ts.map +1 -0
- package/dist/core/marks/polar.js +436 -0
- package/dist/core/marks/polar.js.map +7 -0
- package/dist/core/marks/rect.d.ts +22 -0
- package/dist/core/marks/rect.d.ts.map +1 -0
- package/dist/core/marks/rect.js +119 -0
- package/dist/core/marks/rect.js.map +7 -0
- package/dist/core/marks/rule.d.ts +17 -0
- package/dist/core/marks/rule.d.ts.map +1 -0
- package/dist/core/marks/rule.js +73 -0
- package/dist/core/marks/rule.js.map +7 -0
- package/dist/core/marks/shared.d.ts +41 -0
- package/dist/core/marks/shared.d.ts.map +1 -0
- package/dist/core/marks/shared.js +74 -0
- package/dist/core/marks/shared.js.map +7 -0
- package/dist/core/marks/stack.d.ts +13 -0
- package/dist/core/marks/stack.d.ts.map +1 -0
- package/dist/core/marks/stack.js +28 -0
- package/dist/core/marks/stack.js.map +7 -0
- package/dist/core/marks/stats/difference.d.ts +20 -0
- package/dist/core/marks/stats/difference.d.ts.map +1 -0
- package/dist/core/marks/stats/difference.js +168 -0
- package/dist/core/marks/stats/difference.js.map +7 -0
- package/dist/core/marks/stats/distribution.d.ts +41 -0
- package/dist/core/marks/stats/distribution.d.ts.map +1 -0
- package/dist/core/marks/stats/distribution.js +354 -0
- package/dist/core/marks/stats/distribution.js.map +7 -0
- package/dist/core/marks/stats/dodge.d.ts +16 -0
- package/dist/core/marks/stats/dodge.d.ts.map +1 -0
- package/dist/core/marks/stats/dodge.js +104 -0
- package/dist/core/marks/stats/dodge.js.map +7 -0
- package/dist/core/marks/stats/hexbin.d.ts +26 -0
- package/dist/core/marks/stats/hexbin.d.ts.map +1 -0
- package/dist/core/marks/stats/hexbin.js +113 -0
- package/dist/core/marks/stats/hexbin.js.map +7 -0
- package/dist/core/marks/stats/histogram.d.ts +27 -0
- package/dist/core/marks/stats/histogram.d.ts.map +1 -0
- package/dist/core/marks/stats/histogram.js +70 -0
- package/dist/core/marks/stats/histogram.js.map +7 -0
- package/dist/core/marks/stats/regression.d.ts +13 -0
- package/dist/core/marks/stats/regression.d.ts.map +1 -0
- package/dist/core/marks/stats/regression.js +80 -0
- package/dist/core/marks/stats/regression.js.map +7 -0
- package/dist/core/marks/stats/statistics.d.ts +34 -0
- package/dist/core/marks/stats/statistics.d.ts.map +1 -0
- package/dist/core/marks/stats/statistics.js +111 -0
- package/dist/core/marks/stats/statistics.js.map +7 -0
- package/dist/core/marks/stats/waffle.d.ts +18 -0
- package/dist/core/marks/stats/waffle.d.ts.map +1 -0
- package/dist/core/marks/stats/waffle.js +117 -0
- package/dist/core/marks/stats/waffle.js.map +7 -0
- package/dist/core/marks/text.d.ts +19 -0
- package/dist/core/marks/text.d.ts.map +1 -0
- package/dist/core/marks/text.js +60 -0
- package/dist/core/marks/text.js.map +7 -0
- package/dist/core/motion/tween.d.ts +6 -0
- package/dist/core/motion/tween.d.ts.map +1 -0
- package/dist/core/motion/tween.js +98 -0
- package/dist/core/motion/tween.js.map +7 -0
- package/dist/core/nearest.d.ts +25 -0
- package/dist/core/nearest.d.ts.map +1 -0
- package/dist/core/nearest.js +151 -0
- package/dist/core/nearest.js.map +7 -0
- package/dist/core/paths.d.ts +65 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +192 -0
- package/dist/core/paths.js.map +7 -0
- package/dist/core/scales/color.d.ts +11 -0
- package/dist/core/scales/color.d.ts.map +1 -0
- package/dist/core/scales/color.js +35 -0
- package/dist/core/scales/color.js.map +7 -0
- package/dist/core/scales/continuous.d.ts +18 -0
- package/dist/core/scales/continuous.d.ts.map +1 -0
- package/dist/core/scales/continuous.js +82 -0
- package/dist/core/scales/continuous.js.map +7 -0
- package/dist/core/scales/discrete.d.ts +22 -0
- package/dist/core/scales/discrete.d.ts.map +1 -0
- package/dist/core/scales/discrete.js +103 -0
- package/dist/core/scales/discrete.js.map +7 -0
- package/dist/core/scales/resolve.d.ts +18 -0
- package/dist/core/scales/resolve.d.ts.map +1 -0
- package/dist/core/scales/resolve.js +112 -0
- package/dist/core/scales/resolve.js.map +7 -0
- package/dist/core/scales/time.d.ts +4 -0
- package/dist/core/scales/time.d.ts.map +1 -0
- package/dist/core/scales/time.js +140 -0
- package/dist/core/scales/time.js.map +7 -0
- package/dist/core/text.d.ts +3 -0
- package/dist/core/text.d.ts.map +1 -0
- package/dist/core/text.js +29 -0
- package/dist/core/text.js.map +7 -0
- package/dist/core/theme.d.ts +8 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/core/theme.js +21 -0
- package/dist/core/theme.js.map +7 -0
- package/dist/core/ticks.d.ts +27 -0
- package/dist/core/ticks.d.ts.map +1 -0
- package/dist/core/ticks.js +76 -0
- package/dist/core/ticks.js.map +7 -0
- package/dist/core/types.d.ts +305 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +1 -0
- package/dist/core/types.js.map +7 -0
- package/dist/force/force.d.ts +30 -0
- package/dist/force/force.d.ts.map +1 -0
- package/dist/force/force.js +143 -0
- package/dist/force/force.js.map +7 -0
- package/dist/force/index.d.ts +2 -0
- package/dist/force/index.d.ts.map +1 -0
- package/dist/force/index.js +7 -0
- package/dist/force/index.js.map +7 -0
- package/dist/geo/geo.d.ts +59 -0
- package/dist/geo/geo.d.ts.map +1 -0
- package/dist/geo/geo.js +231 -0
- package/dist/geo/geo.js.map +7 -0
- package/dist/geo/index.d.ts +2 -0
- package/dist/geo/index.d.ts.map +1 -0
- package/dist/geo/index.js +13 -0
- package/dist/geo/index.js.map +7 -0
- package/dist/hierarchy/hierarchy.d.ts +24 -0
- package/dist/hierarchy/hierarchy.d.ts.map +1 -0
- package/dist/hierarchy/hierarchy.js +279 -0
- package/dist/hierarchy/hierarchy.js.map +7 -0
- package/dist/hierarchy/index.d.ts +2 -0
- package/dist/hierarchy/index.d.ts.map +1 -0
- package/dist/hierarchy/index.js +11 -0
- package/dist/hierarchy/index.js.map +7 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +7 -0
- package/dist/react/brush-contract.d.ts +23 -0
- package/dist/react/brush-contract.d.ts.map +1 -0
- package/dist/react/brush-contract.js +7 -0
- package/dist/react/brush-contract.js.map +7 -0
- package/dist/react/chart-data-table.d.ts +18 -0
- package/dist/react/chart-data-table.d.ts.map +1 -0
- package/dist/react/chart-data-table.js +55 -0
- package/dist/react/chart-data-table.js.map +7 -0
- package/dist/react/chart-legend.d.ts +17 -0
- package/dist/react/chart-legend.d.ts.map +1 -0
- package/dist/react/chart-legend.js +126 -0
- package/dist/react/chart-legend.js.map +7 -0
- package/dist/react/chart-tooltip.d.ts +18 -0
- package/dist/react/chart-tooltip.d.ts.map +1 -0
- package/dist/react/chart-tooltip.js +95 -0
- package/dist/react/chart-tooltip.js.map +7 -0
- package/dist/react/chart.d.ts +45 -0
- package/dist/react/chart.d.ts.map +1 -0
- package/dist/react/chart.js +383 -0
- package/dist/react/chart.js.map +7 -0
- package/dist/react/focus-overlay.d.ts +14 -0
- package/dist/react/focus-overlay.d.ts.map +1 -0
- package/dist/react/focus-overlay.js +147 -0
- package/dist/react/focus-overlay.js.map +7 -0
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +11 -0
- package/dist/react/index.js.map +7 -0
- package/dist/react/messages.d.ts +16 -0
- package/dist/react/messages.d.ts.map +1 -0
- package/dist/react/messages.js +33 -0
- package/dist/react/messages.js.map +7 -0
- package/dist/react/renderer.d.ts +14 -0
- package/dist/react/renderer.d.ts.map +1 -0
- package/dist/react/renderer.js +1 -0
- package/dist/react/renderer.js.map +7 -0
- package/dist/react/sr-only.d.ts +4 -0
- package/dist/react/sr-only.d.ts.map +1 -0
- package/dist/react/sr-only.js +15 -0
- package/dist/react/sr-only.js.map +7 -0
- package/dist/react/svg-renderer.d.ts +4 -0
- package/dist/react/svg-renderer.d.ts.map +1 -0
- package/dist/react/svg-renderer.js +20 -0
- package/dist/react/svg-renderer.js.map +7 -0
- package/dist/react/svg-scene.d.ts +8 -0
- package/dist/react/svg-scene.d.ts.map +1 -0
- package/dist/react/svg-scene.js +121 -0
- package/dist/react/svg-scene.js.map +7 -0
- package/dist/react/use-animated-scene.d.ts +10 -0
- package/dist/react/use-animated-scene.d.ts.map +1 -0
- package/dist/react/use-animated-scene.js +41 -0
- package/dist/react/use-animated-scene.js.map +7 -0
- package/dist/react/use-chart-focus.d.ts +29 -0
- package/dist/react/use-chart-focus.d.ts.map +1 -0
- package/dist/react/use-chart-focus.js +180 -0
- package/dist/react/use-chart-focus.js.map +7 -0
- package/dist/react/use-chart-width.d.ts +12 -0
- package/dist/react/use-chart-width.d.ts.map +1 -0
- package/dist/react/use-chart-width.js +23 -0
- package/dist/react/use-chart-width.js.map +7 -0
- package/dist/react/use-chart-zoom.d.ts +13 -0
- package/dist/react/use-chart-zoom.d.ts.map +1 -0
- package/dist/react/use-chart-zoom.js +52 -0
- package/dist/react/use-chart-zoom.js.map +7 -0
- package/dist/react/use-text-measurer.d.ts +8 -0
- package/dist/react/use-text-measurer.d.ts.map +1 -0
- package/dist/react/use-text-measurer.js +44 -0
- package/dist/react/use-text-measurer.js.map +7 -0
- package/dist/sankey/index.d.ts +2 -0
- package/dist/sankey/index.d.ts.map +1 -0
- package/dist/sankey/index.js +7 -0
- package/dist/sankey/index.js.map +7 -0
- package/dist/sankey/sankey.d.ts +29 -0
- package/dist/sankey/sankey.d.ts.map +1 -0
- package/dist/sankey/sankey.js +127 -0
- package/dist/sankey/sankey.js.map +7 -0
- package/dist/voronoi/index.d.ts +2 -0
- package/dist/voronoi/index.d.ts.map +1 -0
- package/dist/voronoi/index.js +5 -0
- package/dist/voronoi/index.js.map +7 -0
- package/dist/voronoi/voronoi.d.ts +16 -0
- package/dist/voronoi/voronoi.d.ts.map +1 -0
- package/dist/voronoi/voronoi.js +62 -0
- package/dist/voronoi/voronoi.js.map +7 -0
- package/package.json +74 -0
- package/src/brush/brush-layer.tsx +174 -0
- package/src/brush/index.ts +14 -0
- package/src/canvas/canvas-renderer.tsx +56 -0
- package/src/canvas/index.ts +1 -0
- package/src/canvas/paint-scene.ts +152 -0
- package/src/canvas/resolve-color.ts +65 -0
- package/src/contour/density.ts +90 -0
- package/src/contour/index.ts +1 -0
- package/src/core/channel.ts +53 -0
- package/src/core/compile.ts +436 -0
- package/src/core/define-chart.ts +128 -0
- package/src/core/facet.ts +189 -0
- package/src/core/format.ts +163 -0
- package/src/core/guides/axes.ts +283 -0
- package/src/core/marks/area.ts +238 -0
- package/src/core/marks/bar.ts +278 -0
- package/src/core/marks/cell.ts +123 -0
- package/src/core/marks/dot.ts +157 -0
- package/src/core/marks/funnel-layout.ts +113 -0
- package/src/core/marks/funnel.ts +172 -0
- package/src/core/marks/line.ts +206 -0
- package/src/core/marks/polar.ts +568 -0
- package/src/core/marks/rect.ts +156 -0
- package/src/core/marks/rule.ts +104 -0
- package/src/core/marks/shared.ts +134 -0
- package/src/core/marks/stack.ts +42 -0
- package/src/core/marks/stats/difference.ts +205 -0
- package/src/core/marks/stats/distribution.ts +425 -0
- package/src/core/marks/stats/dodge.ts +136 -0
- package/src/core/marks/stats/hexbin.ts +152 -0
- package/src/core/marks/stats/histogram.ts +108 -0
- package/src/core/marks/stats/regression.ts +108 -0
- package/src/core/marks/stats/statistics.ts +153 -0
- package/src/core/marks/stats/waffle.ts +141 -0
- package/src/core/marks/text.ts +97 -0
- package/src/core/motion/tween.ts +131 -0
- package/src/core/nearest.ts +223 -0
- package/src/core/paths.ts +323 -0
- package/src/core/scales/color.ts +51 -0
- package/src/core/scales/continuous.ts +111 -0
- package/src/core/scales/discrete.ts +156 -0
- package/src/core/scales/resolve.ts +158 -0
- package/src/core/scales/time.ts +180 -0
- package/src/core/text.ts +42 -0
- package/src/core/theme.ts +26 -0
- package/src/core/ticks.ts +118 -0
- package/src/core/types.ts +358 -0
- package/src/force/force.ts +200 -0
- package/src/force/index.ts +6 -0
- package/src/geo/geo.ts +346 -0
- package/src/geo/index.ts +10 -0
- package/src/hierarchy/hierarchy.ts +377 -0
- package/src/hierarchy/index.ts +6 -0
- package/src/index.ts +70 -0
- package/src/react/brush-contract.ts +35 -0
- package/src/react/chart-data-table.tsx +98 -0
- package/src/react/chart-legend.tsx +130 -0
- package/src/react/chart-tooltip.tsx +111 -0
- package/src/react/chart.tsx +489 -0
- package/src/react/focus-overlay.tsx +164 -0
- package/src/react/index.ts +9 -0
- package/src/react/messages.ts +49 -0
- package/src/react/renderer.ts +15 -0
- package/src/react/sr-only.ts +14 -0
- package/src/react/svg-renderer.tsx +18 -0
- package/src/react/svg-scene.tsx +146 -0
- package/src/react/use-animated-scene.ts +57 -0
- package/src/react/use-chart-focus.ts +245 -0
- package/src/react/use-chart-width.ts +27 -0
- package/src/react/use-chart-zoom.ts +67 -0
- package/src/react/use-text-measurer.ts +49 -0
- package/src/sankey/index.ts +6 -0
- package/src/sankey/sankey.ts +179 -0
- package/src/voronoi/index.ts +1 -0
- package/src/voronoi/voronoi.ts +84 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vocabulary of the chart pipeline. A definition lists marks; compiling it
|
|
3
|
+
* resolves scales from the marks' channels, lays out the guides, and asks each
|
|
4
|
+
* mark for its scene. The scene is plain data with stable keys: the SVG and
|
|
5
|
+
* Canvas renderers draw the same scene, and hit-testing, focus, tooltips and
|
|
6
|
+
* the data table all read it, never the DOM.
|
|
7
|
+
*/
|
|
8
|
+
/** A value a channel can carry onto a scale. */
|
|
9
|
+
export type ChartValue = number | string | Date;
|
|
10
|
+
/** A field of the datum, or a function of it. */
|
|
11
|
+
export type ChartAccessor<TDatum, TValue> = (keyof TDatum & string) | ((datum: TDatum, index: number) => TValue);
|
|
12
|
+
export interface ChartRect {
|
|
13
|
+
readonly x: number;
|
|
14
|
+
readonly y: number;
|
|
15
|
+
readonly width: number;
|
|
16
|
+
readonly height: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ChartMargin {
|
|
19
|
+
readonly top: number;
|
|
20
|
+
readonly right: number;
|
|
21
|
+
readonly bottom: number;
|
|
22
|
+
readonly left: number;
|
|
23
|
+
}
|
|
24
|
+
/** `[topLeft, topRight, bottomRight, bottomLeft]`, clockwise. */
|
|
25
|
+
export type ChartCorners = readonly [number, number, number, number];
|
|
26
|
+
/** How a line or area joins its points. */
|
|
27
|
+
export type ChartCurve = "linear" | "monotone" | "step";
|
|
28
|
+
export type ChartPositionScaleKind = "linear" | "log" | "time" | "band" | "point";
|
|
29
|
+
/**
|
|
30
|
+
* One positional scale. Every kind answers the same questions, so a mark never
|
|
31
|
+
* branches on the kind: `map` places the start of a value's slot, `center` its
|
|
32
|
+
* middle (they differ only on a band scale), and `invert` reads a pixel back.
|
|
33
|
+
*/
|
|
34
|
+
export interface ChartPositionScale {
|
|
35
|
+
readonly kind: ChartPositionScaleKind;
|
|
36
|
+
/** `[min, max]` for continuous kinds, every category for discrete ones. */
|
|
37
|
+
readonly domain: ReadonlyArray<ChartValue>;
|
|
38
|
+
readonly range: readonly [number, number];
|
|
39
|
+
readonly map: (value: ChartValue) => number;
|
|
40
|
+
readonly center: (value: ChartValue) => number;
|
|
41
|
+
readonly invert: (pixel: number) => ChartValue;
|
|
42
|
+
/** Slot width on a band scale, `0` everywhere else. */
|
|
43
|
+
readonly bandwidth: number;
|
|
44
|
+
readonly ticks: (count?: number) => ReadonlyArray<ChartValue>;
|
|
45
|
+
readonly format: (value: ChartValue) => string;
|
|
46
|
+
}
|
|
47
|
+
export interface ChartColorScale {
|
|
48
|
+
readonly kind: "ordinal" | "sequential";
|
|
49
|
+
readonly domain: ReadonlyArray<ChartValue>;
|
|
50
|
+
readonly map: (value: ChartValue) => string;
|
|
51
|
+
}
|
|
52
|
+
export interface ChartScales {
|
|
53
|
+
readonly x?: ChartPositionScale;
|
|
54
|
+
readonly y?: ChartPositionScale;
|
|
55
|
+
readonly color?: ChartColorScale;
|
|
56
|
+
}
|
|
57
|
+
export interface ChartPaint {
|
|
58
|
+
readonly fill?: string;
|
|
59
|
+
readonly stroke?: string;
|
|
60
|
+
readonly strokeWidth?: number;
|
|
61
|
+
readonly strokeDasharray?: string;
|
|
62
|
+
readonly strokeLinecap?: "butt" | "round" | "square";
|
|
63
|
+
readonly strokeLinejoin?: "miter" | "round" | "bevel";
|
|
64
|
+
readonly opacity?: number;
|
|
65
|
+
readonly fillOpacity?: number;
|
|
66
|
+
readonly strokeOpacity?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface ChartTextPaint extends ChartPaint {
|
|
69
|
+
readonly fontSize?: number;
|
|
70
|
+
readonly fontWeight?: number;
|
|
71
|
+
readonly textAnchor?: "start" | "middle" | "end";
|
|
72
|
+
readonly baseline?: "top" | "middle" | "bottom" | "alphabetic";
|
|
73
|
+
}
|
|
74
|
+
interface SceneNodeBase {
|
|
75
|
+
/** Stable across renders of the same data: what renderers reconcile on. */
|
|
76
|
+
readonly key: string;
|
|
77
|
+
/** The series the node draws, so a legend toggle can hide it. */
|
|
78
|
+
readonly series?: string;
|
|
79
|
+
/** A role for styling and tests: "mark", "axis", "grid", "label"… */
|
|
80
|
+
readonly role?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface SceneGroup extends SceneNodeBase {
|
|
83
|
+
readonly kind: "group";
|
|
84
|
+
/** Shifts the children: a facet's cell drawn at its place in the grid. Clips are in the shifted space. */
|
|
85
|
+
readonly translate?: {
|
|
86
|
+
readonly x: number;
|
|
87
|
+
readonly y: number;
|
|
88
|
+
};
|
|
89
|
+
readonly clip?: ChartRect;
|
|
90
|
+
readonly children: ReadonlyArray<SceneNode>;
|
|
91
|
+
}
|
|
92
|
+
export interface SceneRect extends SceneNodeBase {
|
|
93
|
+
readonly kind: "rect";
|
|
94
|
+
readonly x: number;
|
|
95
|
+
readonly y: number;
|
|
96
|
+
readonly width: number;
|
|
97
|
+
readonly height: number;
|
|
98
|
+
readonly corners?: ChartCorners;
|
|
99
|
+
readonly paint: ChartPaint;
|
|
100
|
+
}
|
|
101
|
+
/** Any outline: a line, an area, a wedge, a country. `d` is SVG path data, which `Path2D` reads as well. */
|
|
102
|
+
export interface ScenePath extends SceneNodeBase {
|
|
103
|
+
readonly kind: "path";
|
|
104
|
+
readonly d: string;
|
|
105
|
+
readonly paint: ChartPaint;
|
|
106
|
+
}
|
|
107
|
+
export interface SceneCircle extends SceneNodeBase {
|
|
108
|
+
readonly kind: "circle";
|
|
109
|
+
readonly cx: number;
|
|
110
|
+
readonly cy: number;
|
|
111
|
+
readonly r: number;
|
|
112
|
+
readonly paint: ChartPaint;
|
|
113
|
+
}
|
|
114
|
+
export interface SceneLine extends SceneNodeBase {
|
|
115
|
+
readonly kind: "line";
|
|
116
|
+
readonly x1: number;
|
|
117
|
+
readonly y1: number;
|
|
118
|
+
readonly x2: number;
|
|
119
|
+
readonly y2: number;
|
|
120
|
+
readonly paint: ChartPaint;
|
|
121
|
+
}
|
|
122
|
+
export interface SceneText extends SceneNodeBase {
|
|
123
|
+
readonly kind: "text";
|
|
124
|
+
readonly x: number;
|
|
125
|
+
readonly y: number;
|
|
126
|
+
readonly text: string;
|
|
127
|
+
/** Degrees, clockwise, around `(x, y)`. */
|
|
128
|
+
readonly rotate?: number;
|
|
129
|
+
readonly paint: ChartTextPaint;
|
|
130
|
+
}
|
|
131
|
+
export type SceneNode = SceneGroup | SceneRect | ScenePath | SceneCircle | SceneLine | SceneText;
|
|
132
|
+
/** The area a pointer has to land in to hit a point, beyond plain proximity. */
|
|
133
|
+
export type ChartHitShape = {
|
|
134
|
+
readonly kind: "rect";
|
|
135
|
+
readonly rect: ChartRect;
|
|
136
|
+
} | {
|
|
137
|
+
readonly kind: "arc";
|
|
138
|
+
readonly cx: number;
|
|
139
|
+
readonly cy: number;
|
|
140
|
+
readonly innerRadius: number;
|
|
141
|
+
readonly outerRadius: number;
|
|
142
|
+
/** Degrees clockwise from twelve o'clock. */
|
|
143
|
+
readonly startAngle: number;
|
|
144
|
+
readonly endAngle: number;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* One datum as the reader meets it: what the keyboard steps through, what the
|
|
148
|
+
* tooltip and the live region describe, what the data table lists.
|
|
149
|
+
*/
|
|
150
|
+
export interface ChartPoint<TDatum = unknown> {
|
|
151
|
+
readonly key: string;
|
|
152
|
+
readonly markId: string;
|
|
153
|
+
readonly index: number;
|
|
154
|
+
readonly datum: TDatum;
|
|
155
|
+
/** Anchor in chart pixels: where the focus ring and the tooltip go. */
|
|
156
|
+
readonly x: number;
|
|
157
|
+
readonly y: number;
|
|
158
|
+
readonly xValue?: ChartValue;
|
|
159
|
+
readonly yValue?: ChartValue;
|
|
160
|
+
readonly series?: string;
|
|
161
|
+
readonly seriesLabel?: string;
|
|
162
|
+
readonly color: string;
|
|
163
|
+
/** What the point reads as, without its series: "March 2026", "Paris". */
|
|
164
|
+
readonly title: string;
|
|
165
|
+
/** Its value, formatted: "1 240". */
|
|
166
|
+
readonly value: string;
|
|
167
|
+
readonly hit?: ChartHitShape;
|
|
168
|
+
/** The facet cell the point belongs to, on a faceted chart. */
|
|
169
|
+
readonly facet?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface ChartLegendItem {
|
|
172
|
+
readonly key: string;
|
|
173
|
+
readonly label: string;
|
|
174
|
+
readonly color: string;
|
|
175
|
+
readonly shape: "square" | "line" | "dashed" | "dot";
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* How the keyboard walks the points. `x` groups every point that shares an x
|
|
179
|
+
* value into one stop (a column of a multi-series chart), `y` does the same
|
|
180
|
+
* along y for horizontal bars, `point` visits each point on its own.
|
|
181
|
+
*/
|
|
182
|
+
export type ChartFocusOrder = "x" | "y" | "point";
|
|
183
|
+
export interface ChartScene {
|
|
184
|
+
readonly width: number;
|
|
185
|
+
readonly height: number;
|
|
186
|
+
readonly plot: ChartRect;
|
|
187
|
+
readonly nodes: ReadonlyArray<SceneNode>;
|
|
188
|
+
readonly points: ReadonlyArray<ChartPoint>;
|
|
189
|
+
readonly legend: ReadonlyArray<ChartLegendItem>;
|
|
190
|
+
readonly focusOrder: ChartFocusOrder;
|
|
191
|
+
readonly scales: ChartScales;
|
|
192
|
+
/** Column headings of the data table and tooltip: the axis labels. */
|
|
193
|
+
readonly xLabel: string;
|
|
194
|
+
readonly yLabel: string;
|
|
195
|
+
readonly theme: ChartTheme;
|
|
196
|
+
readonly locale: string;
|
|
197
|
+
/** A faceted chart's cells, each with its own plot, in reading order. */
|
|
198
|
+
readonly cells?: ReadonlyArray<{
|
|
199
|
+
readonly key: string;
|
|
200
|
+
readonly label: string;
|
|
201
|
+
readonly plot: ChartRect;
|
|
202
|
+
}>;
|
|
203
|
+
/** The sequential colour scale's ramp, for its legend: the colours and the ends' labels. */
|
|
204
|
+
readonly colorRamp?: {
|
|
205
|
+
readonly stops: ReadonlyArray<string>;
|
|
206
|
+
readonly low: string;
|
|
207
|
+
readonly high: string;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/** The values a mark puts on a scale, so the scale's domain can cover them. */
|
|
211
|
+
export interface ChartChannel {
|
|
212
|
+
readonly values: ReadonlyArray<ChartValue>;
|
|
213
|
+
/** Bars need a band; the first mark that asks for one gets it. */
|
|
214
|
+
readonly discrete?: "band" | "point";
|
|
215
|
+
/** A bar or an area measures from zero, so zero must be on the scale. */
|
|
216
|
+
readonly includeZero?: boolean;
|
|
217
|
+
/** The field the values come from: the axis title when none is given. */
|
|
218
|
+
readonly label?: string;
|
|
219
|
+
/** Pixels the mark reaches past its value (a dot's radius), kept inside the plot. */
|
|
220
|
+
readonly inset?: number;
|
|
221
|
+
/** Band padding the mark draws best with: cells touch, bars breathe. */
|
|
222
|
+
readonly padding?: number;
|
|
223
|
+
/** Outer band padding, when it differs: room for a ridge rising past its row. */
|
|
224
|
+
readonly paddingOuter?: number;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* A map projection, described without naming the library that implements it
|
|
228
|
+
* (`@voila.dev/chart/geo` does, with d3-geo). Declared once on the
|
|
229
|
+
* definition and fitted to the plot, so every map mark draws on the same one.
|
|
230
|
+
*/
|
|
231
|
+
export interface ChartProjection {
|
|
232
|
+
readonly fit: (plot: ChartRect) => ChartFittedProjection;
|
|
233
|
+
}
|
|
234
|
+
export interface ChartFittedProjection {
|
|
235
|
+
/** Longitude and latitude to chart pixels; `undefined` when clipped away. */
|
|
236
|
+
readonly project: (longitude: number, latitude: number) => {
|
|
237
|
+
x: number;
|
|
238
|
+
y: number;
|
|
239
|
+
} | undefined;
|
|
240
|
+
/** Path data for a GeoJSON object. */
|
|
241
|
+
readonly path: (geometry: unknown) => string;
|
|
242
|
+
readonly centroid: (geometry: unknown) => {
|
|
243
|
+
x: number;
|
|
244
|
+
y: number;
|
|
245
|
+
};
|
|
246
|
+
readonly bounds: (geometry: unknown) => ChartRect;
|
|
247
|
+
}
|
|
248
|
+
export type ChartTextMeasurer = (text: string, fontSize: number, fontWeight?: number) => number;
|
|
249
|
+
export interface ChartTheme {
|
|
250
|
+
readonly palette: ReadonlyArray<string>;
|
|
251
|
+
readonly foreground: string;
|
|
252
|
+
readonly muted: string;
|
|
253
|
+
readonly grid: string;
|
|
254
|
+
readonly background: string;
|
|
255
|
+
readonly fontSize: number;
|
|
256
|
+
}
|
|
257
|
+
export interface ChartMarkContext {
|
|
258
|
+
readonly scales: ChartScales;
|
|
259
|
+
readonly plot: ChartRect;
|
|
260
|
+
readonly theme: ChartTheme;
|
|
261
|
+
readonly measureText: ChartTextMeasurer;
|
|
262
|
+
readonly locale: string;
|
|
263
|
+
/** A colour for a mark with no color channel: its place in the palette. */
|
|
264
|
+
readonly paletteColor: (index: number) => string;
|
|
265
|
+
/** The colour of one value of the color channel. */
|
|
266
|
+
readonly colorOf: (value: ChartValue) => string;
|
|
267
|
+
/** The display name of one value of the color channel. */
|
|
268
|
+
readonly seriesLabel: (value: ChartValue) => string;
|
|
269
|
+
readonly formatX: (value: ChartValue) => string;
|
|
270
|
+
readonly formatY: (value: ChartValue) => string;
|
|
271
|
+
readonly markIndex: number;
|
|
272
|
+
/** The definition's projection, fitted to the plot. Map marks need it. */
|
|
273
|
+
readonly projection?: ChartFittedProjection;
|
|
274
|
+
}
|
|
275
|
+
export interface ChartMarkScene {
|
|
276
|
+
readonly nodes: ReadonlyArray<SceneNode>;
|
|
277
|
+
readonly points?: ReadonlyArray<ChartPoint>;
|
|
278
|
+
readonly legend?: ReadonlyArray<ChartLegendItem>;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* What every mark factory returns. A cartesian mark declares channels so the
|
|
282
|
+
* scales cover it; a `frame` mark (pie, treemap, map) owns the whole plot and
|
|
283
|
+
* ignores the x and y scales.
|
|
284
|
+
*/
|
|
285
|
+
export interface ChartMark {
|
|
286
|
+
readonly id?: string;
|
|
287
|
+
readonly coordinate: "cartesian" | "frame";
|
|
288
|
+
readonly channels: {
|
|
289
|
+
readonly x?: ChartChannel;
|
|
290
|
+
readonly y?: ChartChannel;
|
|
291
|
+
readonly color?: ChartChannel;
|
|
292
|
+
};
|
|
293
|
+
/** The keyboard order this mark reads best in. */
|
|
294
|
+
readonly focusOrder?: ChartFocusOrder;
|
|
295
|
+
/** `false` when the mark already names its colours itself (a labelled funnel). */
|
|
296
|
+
readonly colorLegend?: boolean;
|
|
297
|
+
/** What a frame mark's categories and values are called, for the table and the tooltip. */
|
|
298
|
+
readonly titles?: {
|
|
299
|
+
readonly category?: string;
|
|
300
|
+
readonly value?: string;
|
|
301
|
+
};
|
|
302
|
+
readonly render: (context: ChartMarkContext) => ChartMarkScene;
|
|
303
|
+
}
|
|
304
|
+
export {};
|
|
305
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAEhD,iDAAiD;AACjD,MAAM,MAAM,aAAa,CAAC,MAAM,EAAE,MAAM,IACrC,CAAC,MAA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AqB,CAAC;CAC5C;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACjD;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE;QAClB,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC;QAC1B,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC;QAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;KAC9B,CAAC;IACF,kDAAkD;IAClD,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IACtC,kFAAkF;IAClF,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,cAAc,CAAC;CAC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ChartMark } from "../core/types.js";
|
|
2
|
+
export interface ForceNode {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label?: string;
|
|
5
|
+
/** Colour group. */
|
|
6
|
+
readonly group?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ForceLink {
|
|
9
|
+
readonly source: string;
|
|
10
|
+
readonly target: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ForceOptions {
|
|
13
|
+
readonly id?: string;
|
|
14
|
+
readonly radius?: number;
|
|
15
|
+
/** Settling steps. More is tidier and slower. */
|
|
16
|
+
readonly ticks?: number;
|
|
17
|
+
readonly labels?: boolean;
|
|
18
|
+
readonly tip?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A network laid out by forces: linked nodes pull together, all nodes push
|
|
22
|
+
* apart. The simulation runs to rest before drawing, with a fixed seed, so
|
|
23
|
+
* the picture is the same every time; a reader moves through the nodes with
|
|
24
|
+
* the keyboard, each announced with how many links it has.
|
|
25
|
+
*/
|
|
26
|
+
export declare function forceGraph(data: {
|
|
27
|
+
readonly nodes: ReadonlyArray<ForceNode>;
|
|
28
|
+
readonly links: ReadonlyArray<ForceLink>;
|
|
29
|
+
}, options?: ForceOptions): ChartMark;
|
|
30
|
+
//# sourceMappingURL=force.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"force.d.ts","sourceRoot":"","sources":["../../src/force/force.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAyB,MAAM,iBAAiB,CAAC;AAExE,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACvB;AAgBD;;;;;GAKG;AACH,wBAAgB,UAAU,CACzB,IAAI,EAAE;IACL,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACzC,EACD,OAAO,GAAE,YAAiB,GACxB,SAAS,CA0IX"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forceCenter,
|
|
3
|
+
forceCollide,
|
|
4
|
+
forceLink,
|
|
5
|
+
forceManyBody,
|
|
6
|
+
forceSimulation,
|
|
7
|
+
forceX,
|
|
8
|
+
forceY
|
|
9
|
+
} from "d3-force";
|
|
10
|
+
import { markId } from "../core/marks/shared.js";
|
|
11
|
+
const DEFAULT_RADIUS = 5;
|
|
12
|
+
const DEFAULT_TICKS = 300;
|
|
13
|
+
function seeded(seed) {
|
|
14
|
+
let state = seed;
|
|
15
|
+
return () => {
|
|
16
|
+
state = (state * 1664525 + 1013904223) % 4294967296;
|
|
17
|
+
return state / 4294967296;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function forceGraph(data, options = {}) {
|
|
21
|
+
const groups = data.nodes.map((node) => node.group ?? "");
|
|
22
|
+
return {
|
|
23
|
+
id: options.id,
|
|
24
|
+
coordinate: "frame",
|
|
25
|
+
focusOrder: "point",
|
|
26
|
+
channels: groups.some((group) => group !== "") ? { color: { values: groups.filter((group) => group !== "") } } : {},
|
|
27
|
+
render(context) {
|
|
28
|
+
const id = markId(options.id, "force", context);
|
|
29
|
+
const { plot, theme } = context;
|
|
30
|
+
const radius = options.radius ?? DEFAULT_RADIUS;
|
|
31
|
+
const simulated = data.nodes.map((node) => ({
|
|
32
|
+
...node
|
|
33
|
+
}));
|
|
34
|
+
const links = data.links.map((link) => ({
|
|
35
|
+
...link
|
|
36
|
+
}));
|
|
37
|
+
const simulation = forceSimulation(simulated).randomSource(seeded(1)).force(
|
|
38
|
+
"link",
|
|
39
|
+
forceLink(links).id((node) => node.id).distance(radius * 10)
|
|
40
|
+
).force("charge", forceManyBody().strength(-radius * 20)).force("collide", forceCollide(radius * 3)).force("center", forceCenter(0, 0)).force("x", forceX(0).strength(0.08)).force("y", forceY(0).strength(0.08)).stop();
|
|
41
|
+
simulation.tick(options.ticks ?? DEFAULT_TICKS);
|
|
42
|
+
const xs = simulated.map((node) => node.x ?? 0);
|
|
43
|
+
const ys = simulated.map((node) => node.y ?? 0);
|
|
44
|
+
const [minX, maxX, minY, maxY] = [
|
|
45
|
+
Math.min(...xs),
|
|
46
|
+
Math.max(...xs),
|
|
47
|
+
Math.min(...ys),
|
|
48
|
+
Math.max(...ys)
|
|
49
|
+
];
|
|
50
|
+
const pad = radius * 2;
|
|
51
|
+
const scale = Math.min(
|
|
52
|
+
(plot.width - pad * 2) / Math.max(1, maxX - minX),
|
|
53
|
+
(plot.height - pad * 2) / Math.max(1, maxY - minY),
|
|
54
|
+
1.5
|
|
55
|
+
);
|
|
56
|
+
const place = (node) => ({
|
|
57
|
+
x: plot.x + plot.width / 2 + ((node.x ?? 0) - (minX + maxX) / 2) * scale,
|
|
58
|
+
y: plot.y + plot.height / 2 + ((node.y ?? 0) - (minY + maxY) / 2) * scale
|
|
59
|
+
});
|
|
60
|
+
const degree = /* @__PURE__ */ new Map();
|
|
61
|
+
const nodes = [];
|
|
62
|
+
for (const link of links) {
|
|
63
|
+
const source = link.source;
|
|
64
|
+
const target = link.target;
|
|
65
|
+
degree.set(source.id, (degree.get(source.id) ?? 0) + 1);
|
|
66
|
+
degree.set(target.id, (degree.get(target.id) ?? 0) + 1);
|
|
67
|
+
const from = place(source);
|
|
68
|
+
const to = place(target);
|
|
69
|
+
nodes.push({
|
|
70
|
+
kind: "line",
|
|
71
|
+
key: `${id}:link:${source.id}:${target.id}`,
|
|
72
|
+
role: "grid",
|
|
73
|
+
x1: from.x,
|
|
74
|
+
y1: from.y,
|
|
75
|
+
x2: to.x,
|
|
76
|
+
y2: to.y,
|
|
77
|
+
paint: { stroke: theme.grid, strokeWidth: 1.5 }
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const points = [];
|
|
81
|
+
for (const [index, node] of simulated.entries()) {
|
|
82
|
+
const at = place(node);
|
|
83
|
+
const color = node.group ? context.colorOf(node.group) : context.paletteColor(0);
|
|
84
|
+
nodes.push({
|
|
85
|
+
kind: "circle",
|
|
86
|
+
key: `${id}:${node.id}`,
|
|
87
|
+
series: node.group,
|
|
88
|
+
role: "mark",
|
|
89
|
+
cx: at.x,
|
|
90
|
+
cy: at.y,
|
|
91
|
+
r: radius,
|
|
92
|
+
paint: { fill: color, stroke: theme.background, strokeWidth: 1.5 }
|
|
93
|
+
});
|
|
94
|
+
if (options.labels) {
|
|
95
|
+
nodes.push({
|
|
96
|
+
kind: "text",
|
|
97
|
+
key: `${id}:label:${node.id}`,
|
|
98
|
+
role: "label",
|
|
99
|
+
x: at.x + radius + 3,
|
|
100
|
+
y: at.y,
|
|
101
|
+
text: node.label ?? node.id,
|
|
102
|
+
paint: {
|
|
103
|
+
fill: theme.foreground,
|
|
104
|
+
fontSize: theme.fontSize - 1,
|
|
105
|
+
baseline: "middle"
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (options.tip !== false) {
|
|
110
|
+
points.push({
|
|
111
|
+
key: `${id}:${node.id}`,
|
|
112
|
+
markId: id,
|
|
113
|
+
index,
|
|
114
|
+
datum: node,
|
|
115
|
+
x: at.x,
|
|
116
|
+
y: at.y,
|
|
117
|
+
xValue: node.label ?? node.id,
|
|
118
|
+
yValue: degree.get(node.id) ?? 0,
|
|
119
|
+
series: node.group,
|
|
120
|
+
seriesLabel: node.group,
|
|
121
|
+
color,
|
|
122
|
+
title: node.label ?? node.id,
|
|
123
|
+
value: context.formatY(degree.get(node.id) ?? 0),
|
|
124
|
+
hit: {
|
|
125
|
+
kind: "rect",
|
|
126
|
+
rect: {
|
|
127
|
+
x: at.x - radius - 2,
|
|
128
|
+
y: at.y - radius - 2,
|
|
129
|
+
width: radius * 2 + 4,
|
|
130
|
+
height: radius * 2 + 4
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return { nodes, points };
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
forceGraph
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=force.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/force/force.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n\tforceCenter,\n\tforceCollide,\n\tforceLink,\n\tforceManyBody,\n\tforceSimulation,\n\tforceX,\n\tforceY,\n\ttype SimulationLinkDatum,\n\ttype SimulationNodeDatum,\n} from \"d3-force\";\nimport { markId } from \"#/core/marks/shared.ts\";\nimport type { ChartMark, ChartPoint, SceneNode } from \"#/core/types.ts\";\n\nexport interface ForceNode {\n\treadonly id: string;\n\treadonly label?: string;\n\t/** Colour group. */\n\treadonly group?: string;\n}\n\nexport interface ForceLink {\n\treadonly source: string;\n\treadonly target: string;\n}\n\nexport interface ForceOptions {\n\treadonly id?: string;\n\treadonly radius?: number;\n\t/** Settling steps. More is tidier and slower. */\n\treadonly ticks?: number;\n\treadonly labels?: boolean;\n\treadonly tip?: boolean;\n}\n\ninterface SimulatedNode extends SimulationNodeDatum, ForceNode {}\n\nconst DEFAULT_RADIUS = 5;\nconst DEFAULT_TICKS = 300;\n\n/** A fixed-seed random stream: the same graph settles the same way on the server and in the browser. */\nfunction seeded(seed: number): () => number {\n\tlet state = seed;\n\treturn () => {\n\t\tstate = (state * 1664525 + 1013904223) % 4294967296;\n\t\treturn state / 4294967296;\n\t};\n}\n\n/**\n * A network laid out by forces: linked nodes pull together, all nodes push\n * apart. The simulation runs to rest before drawing, with a fixed seed, so\n * the picture is the same every time; a reader moves through the nodes with\n * the keyboard, each announced with how many links it has.\n */\nexport function forceGraph(\n\tdata: {\n\t\treadonly nodes: ReadonlyArray<ForceNode>;\n\t\treadonly links: ReadonlyArray<ForceLink>;\n\t},\n\toptions: ForceOptions = {},\n): ChartMark {\n\tconst groups = data.nodes.map((node) => node.group ?? \"\");\n\treturn {\n\t\tid: options.id,\n\t\tcoordinate: \"frame\",\n\t\tfocusOrder: \"point\",\n\t\tchannels: groups.some((group) => group !== \"\")\n\t\t\t? { color: { values: groups.filter((group) => group !== \"\") } }\n\t\t\t: {},\n\t\trender(context) {\n\t\t\tconst id = markId(options.id, \"force\", context);\n\t\t\tconst { plot, theme } = context;\n\t\t\tconst radius = options.radius ?? DEFAULT_RADIUS;\n\t\t\tconst simulated: SimulatedNode[] = data.nodes.map((node) => ({\n\t\t\t\t...node,\n\t\t\t}));\n\t\t\tconst links = data.links.map((link) => ({\n\t\t\t\t...link,\n\t\t\t})) as SimulationLinkDatum<SimulatedNode>[];\n\t\t\tconst simulation = forceSimulation(simulated)\n\t\t\t\t.randomSource(seeded(1))\n\t\t\t\t.force(\n\t\t\t\t\t\"link\",\n\t\t\t\t\tforceLink<SimulatedNode, SimulationLinkDatum<SimulatedNode>>(links)\n\t\t\t\t\t\t.id((node) => node.id)\n\t\t\t\t\t\t.distance(radius * 10),\n\t\t\t\t)\n\t\t\t\t.force(\"charge\", forceManyBody().strength(-radius * 20))\n\t\t\t\t.force(\"collide\", forceCollide(radius * 3))\n\t\t\t\t.force(\"center\", forceCenter(0, 0))\n\t\t\t\t// A gentle pull to the middle keeps separate groups on one picture.\n\t\t\t\t.force(\"x\", forceX(0).strength(0.08))\n\t\t\t\t.force(\"y\", forceY(0).strength(0.08))\n\t\t\t\t.stop();\n\t\t\tsimulation.tick(options.ticks ?? DEFAULT_TICKS);\n\t\t\tconst xs = simulated.map((node) => node.x ?? 0);\n\t\t\tconst ys = simulated.map((node) => node.y ?? 0);\n\t\t\tconst [minX, maxX, minY, maxY] = [\n\t\t\t\tMath.min(...xs),\n\t\t\t\tMath.max(...xs),\n\t\t\t\tMath.min(...ys),\n\t\t\t\tMath.max(...ys),\n\t\t\t];\n\t\t\tconst pad = radius * 2;\n\t\t\tconst scale = Math.min(\n\t\t\t\t(plot.width - pad * 2) / Math.max(1, maxX - minX),\n\t\t\t\t(plot.height - pad * 2) / Math.max(1, maxY - minY),\n\t\t\t\t1.5,\n\t\t\t);\n\t\t\tconst place = (node: SimulatedNode) => ({\n\t\t\t\tx:\n\t\t\t\t\tplot.x + plot.width / 2 + ((node.x ?? 0) - (minX + maxX) / 2) * scale,\n\t\t\t\ty:\n\t\t\t\t\tplot.y +\n\t\t\t\t\tplot.height / 2 +\n\t\t\t\t\t((node.y ?? 0) - (minY + maxY) / 2) * scale,\n\t\t\t});\n\t\t\tconst degree = new Map<string, number>();\n\t\t\tconst nodes: SceneNode[] = [];\n\t\t\tfor (const link of links) {\n\t\t\t\tconst source = link.source as SimulatedNode;\n\t\t\t\tconst target = link.target as SimulatedNode;\n\t\t\t\tdegree.set(source.id, (degree.get(source.id) ?? 0) + 1);\n\t\t\t\tdegree.set(target.id, (degree.get(target.id) ?? 0) + 1);\n\t\t\t\tconst from = place(source);\n\t\t\t\tconst to = place(target);\n\t\t\t\tnodes.push({\n\t\t\t\t\tkind: \"line\",\n\t\t\t\t\tkey: `${id}:link:${source.id}:${target.id}`,\n\t\t\t\t\trole: \"grid\",\n\t\t\t\t\tx1: from.x,\n\t\t\t\t\ty1: from.y,\n\t\t\t\t\tx2: to.x,\n\t\t\t\t\ty2: to.y,\n\t\t\t\t\tpaint: { stroke: theme.grid, strokeWidth: 1.5 },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst points: ChartPoint[] = [];\n\t\t\tfor (const [index, node] of simulated.entries()) {\n\t\t\t\tconst at = place(node);\n\t\t\t\tconst color = node.group\n\t\t\t\t\t? context.colorOf(node.group)\n\t\t\t\t\t: context.paletteColor(0);\n\t\t\t\tnodes.push({\n\t\t\t\t\tkind: \"circle\",\n\t\t\t\t\tkey: `${id}:${node.id}`,\n\t\t\t\t\tseries: node.group,\n\t\t\t\t\trole: \"mark\",\n\t\t\t\t\tcx: at.x,\n\t\t\t\t\tcy: at.y,\n\t\t\t\t\tr: radius,\n\t\t\t\t\tpaint: { fill: color, stroke: theme.background, strokeWidth: 1.5 },\n\t\t\t\t});\n\t\t\t\tif (options.labels) {\n\t\t\t\t\tnodes.push({\n\t\t\t\t\t\tkind: \"text\",\n\t\t\t\t\t\tkey: `${id}:label:${node.id}`,\n\t\t\t\t\t\trole: \"label\",\n\t\t\t\t\t\tx: at.x + radius + 3,\n\t\t\t\t\t\ty: at.y,\n\t\t\t\t\t\ttext: node.label ?? node.id,\n\t\t\t\t\t\tpaint: {\n\t\t\t\t\t\t\tfill: theme.foreground,\n\t\t\t\t\t\t\tfontSize: theme.fontSize - 1,\n\t\t\t\t\t\t\tbaseline: \"middle\",\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (options.tip !== false) {\n\t\t\t\t\tpoints.push({\n\t\t\t\t\t\tkey: `${id}:${node.id}`,\n\t\t\t\t\t\tmarkId: id,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t\tdatum: node,\n\t\t\t\t\t\tx: at.x,\n\t\t\t\t\t\ty: at.y,\n\t\t\t\t\t\txValue: node.label ?? node.id,\n\t\t\t\t\t\tyValue: degree.get(node.id) ?? 0,\n\t\t\t\t\t\tseries: node.group,\n\t\t\t\t\t\tseriesLabel: node.group,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\ttitle: node.label ?? node.id,\n\t\t\t\t\t\tvalue: context.formatY(degree.get(node.id) ?? 0),\n\t\t\t\t\t\thit: {\n\t\t\t\t\t\t\tkind: \"rect\",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+
import { type GeoPermissibleObjects, type GeoProjection } from "d3-geo";
|
|
2
|
+
import type { ChartAccessor, ChartMark, ChartProjection, ChartValue } from "../core/types.js";
|
|
3
|
+
export type ProjectionName = "equal-earth" | "natural-earth" | "mercator" | "equirectangular" | "orthographic" | "albers-usa"
|
|
4
|
+
/** Conformal conic on France's own standard parallels (Lambert 93's). */
|
|
5
|
+
| "france";
|
|
6
|
+
/**
|
|
7
|
+
* GeoJSON as RFC 7946 writes it winds rings counter-clockwise; d3-geo reads
|
|
8
|
+
* that as "the whole sphere except this region". A shape covering more than
|
|
9
|
+
* half the globe is that mistake, so its rings are turned round.
|
|
10
|
+
*/
|
|
11
|
+
export declare function rewind<T>(object: T): T;
|
|
12
|
+
export interface ProjectionOptions {
|
|
13
|
+
/** The GeoJSON the map should frame: usually the shapes it draws. */
|
|
14
|
+
readonly domain: GeoPermissibleObjects;
|
|
15
|
+
/** Pixels kept clear around the framed shape. */
|
|
16
|
+
readonly inset?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* How longitude and latitude become pixels, fitted so `domain` fills the
|
|
20
|
+
* plot. A name picks one of the usual projections; any d3-geo projection
|
|
21
|
+
* factory works too.
|
|
22
|
+
*/
|
|
23
|
+
export declare function projection(kind: ProjectionName | (() => GeoProjection), options: ProjectionOptions): ChartProjection;
|
|
24
|
+
interface Feature {
|
|
25
|
+
readonly type: "Feature";
|
|
26
|
+
readonly properties?: Record<string, unknown> | null;
|
|
27
|
+
readonly geometry: unknown;
|
|
28
|
+
}
|
|
29
|
+
export interface GeoShapeOptions<TFeature> {
|
|
30
|
+
readonly id?: string;
|
|
31
|
+
/** A region's name: tooltip, table, live region. */
|
|
32
|
+
readonly name: ChartAccessor<TFeature, unknown>;
|
|
33
|
+
/** A value per region: a choropleth on a sequential (numbers) or ordinal (categories) color scale. */
|
|
34
|
+
readonly color?: ChartAccessor<TFeature, ChartValue>;
|
|
35
|
+
readonly fill?: string;
|
|
36
|
+
readonly stroke?: string;
|
|
37
|
+
/** What the colour values are, for the table heading. */
|
|
38
|
+
readonly label?: string;
|
|
39
|
+
readonly tip?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Regions, countries, départements: one shape per GeoJSON feature. */
|
|
42
|
+
export declare function geoShape<TFeature extends Feature>(features: ReadonlyArray<TFeature>, options: GeoShapeOptions<TFeature>): ChartMark;
|
|
43
|
+
export interface GeoDotOptions<TDatum> {
|
|
44
|
+
readonly id?: string;
|
|
45
|
+
readonly longitude: ChartAccessor<TDatum, ChartValue>;
|
|
46
|
+
readonly latitude: ChartAccessor<TDatum, ChartValue>;
|
|
47
|
+
readonly name: ChartAccessor<TDatum, unknown>;
|
|
48
|
+
/** A radius in pixels, or a field whose values set each dot's area. */
|
|
49
|
+
readonly r?: number | ChartAccessor<TDatum, ChartValue>;
|
|
50
|
+
readonly maxRadius?: number;
|
|
51
|
+
readonly fill?: string;
|
|
52
|
+
readonly label?: string;
|
|
53
|
+
readonly value?: ChartAccessor<TDatum, ChartValue>;
|
|
54
|
+
readonly tip?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** Places on the map: a dot at each longitude and latitude, sized by a value if asked. */
|
|
57
|
+
export declare function geoDot<TDatum>(data: ReadonlyArray<TDatum>, options: GeoDotOptions<TDatum>): ChartMark;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=geo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo.d.ts","sourceRoot":"","sources":["../../src/geo/geo.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAUlB,MAAM,QAAQ,CAAC;AAGhB,OAAO,KAAK,EACX,aAAa,EAEb,SAAS,EAET,eAAe,EACf,UAAU,EAEV,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,cAAc,GACvB,aAAa,GACb,eAAe,GACf,UAAU,GACV,iBAAiB,GACjB,cAAc,GACd,YAAY;AACd,yEAAyE;G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