@sophistry/charts 0.0.0-stage → 0.0.1
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 +56 -0
- package/dist/3d/bar-chart3d.d.ts.map +1 -0
- package/dist/3d/definitions.d.ts +38 -0
- package/dist/3d/definitions.d.ts.map +1 -0
- package/dist/3d/definitions.js +14 -0
- package/dist/3d/forward.d.ts +65 -0
- package/dist/3d/forward.d.ts.map +1 -0
- package/dist/3d/index.d.ts +31 -0
- package/dist/3d/index.d.ts.map +1 -0
- package/dist/3d/index.js +1 -0
- package/dist/3d/quiver3d.d.ts +53 -0
- package/dist/3d/quiver3d.d.ts.map +1 -0
- package/dist/3d/scatter3d.d.ts +45 -0
- package/dist/3d/scatter3d.d.ts.map +1 -0
- package/dist/3d/stem3d.d.ts +46 -0
- package/dist/3d/stem3d.d.ts.map +1 -0
- package/dist/3d/surface-grid3d.d.ts +34 -0
- package/dist/3d/surface-grid3d.d.ts.map +1 -0
- package/dist/3d/tri-surface3d.d.ts +46 -0
- package/dist/3d/tri-surface3d.d.ts.map +1 -0
- package/dist/3d/voxels3d.d.ts +26 -0
- package/dist/3d/voxels3d.d.ts.map +1 -0
- package/dist/3d/wireframe3d.d.ts +31 -0
- package/dist/3d/wireframe3d.d.ts.map +1 -0
- package/dist/band.d.ts +21 -0
- package/dist/band.d.ts.map +1 -0
- package/dist/bars/bar-chart.d.ts +144 -0
- package/dist/bars/bar-chart.d.ts.map +1 -0
- package/dist/bars/bar-labels.d.ts +117 -0
- package/dist/bars/bar-labels.d.ts.map +1 -0
- package/dist/bars/bars.d.ts +224 -0
- package/dist/bars/bars.d.ts.map +1 -0
- package/dist/bars/bullet.d.ts +158 -0
- package/dist/bars/bullet.d.ts.map +1 -0
- package/dist/bars/candlestick.d.ts +98 -0
- package/dist/bars/candlestick.d.ts.map +1 -0
- package/dist/bars/funnel.d.ts +91 -0
- package/dist/bars/funnel.d.ts.map +1 -0
- package/dist/bars/histogram.d.ts +109 -0
- package/dist/bars/histogram.d.ts.map +1 -0
- package/dist/bars/index.d.ts +23 -0
- package/dist/bars/index.d.ts.map +1 -0
- package/dist/bars/race.d.ts +29 -0
- package/dist/bars/race.d.ts.map +1 -0
- package/dist/bars/rules.d.ts +122 -0
- package/dist/bars/rules.d.ts.map +1 -0
- package/dist/bars/shared.d.ts +42 -0
- package/dist/bars/shared.d.ts.map +1 -0
- package/dist/bars/transforms.d.ts +250 -0
- package/dist/bars/transforms.d.ts.map +1 -0
- package/dist/bars/waterfall.d.ts +107 -0
- package/dist/bars/waterfall.d.ts.map +1 -0
- package/dist/batch.d.ts +143 -0
- package/dist/batch.d.ts.map +1 -0
- package/dist/channels-_Xf-p6Lx.js +56 -0
- package/dist/chart.d.ts +88 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/color-norm.d.ts +91 -0
- package/dist/color-norm.d.ts.map +1 -0
- package/dist/context.d.ts +112 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/curves/density.d.ts +126 -0
- package/dist/curves/density.d.ts.map +1 -0
- package/dist/curves/ecdf.d.ts +73 -0
- package/dist/curves/ecdf.d.ts.map +1 -0
- package/dist/curves/fill-between.d.ts +101 -0
- package/dist/curves/fill-between.d.ts.map +1 -0
- package/dist/curves/index.d.ts +16 -0
- package/dist/curves/index.d.ts.map +1 -0
- package/dist/curves/line-plot.d.ts +105 -0
- package/dist/curves/line-plot.d.ts.map +1 -0
- package/dist/curves/regression.d.ts +125 -0
- package/dist/curves/regression.d.ts.map +1 -0
- package/dist/curves/shared.d.ts +53 -0
- package/dist/curves/shared.d.ts.map +1 -0
- package/dist/curves/stack-plot.d.ts +141 -0
- package/dist/curves/stack-plot.d.ts.map +1 -0
- package/dist/curves/stairs.d.ts +171 -0
- package/dist/curves/stairs.d.ts.map +1 -0
- package/dist/data/channels.d.ts +171 -0
- package/dist/data/channels.d.ts.map +1 -0
- package/dist/end-space.d.ts +82 -0
- package/dist/end-space.d.ts.map +1 -0
- package/dist/entries/definitions.d.ts +21 -0
- package/dist/entries/definitions.d.ts.map +1 -0
- package/dist/entries/definitions.js +6 -0
- package/dist/frame/band-axis.d.ts +43 -0
- package/dist/frame/band-axis.d.ts.map +1 -0
- package/dist/frame/coords.d.ts +112 -0
- package/dist/frame/coords.d.ts.map +1 -0
- package/dist/frame/fit.d.ts +171 -0
- package/dist/frame/fit.d.ts.map +1 -0
- package/dist/frame/format.d.ts +41 -0
- package/dist/frame/format.d.ts.map +1 -0
- package/dist/frame/guide-metrics.d.ts +37 -0
- package/dist/frame/guide-metrics.d.ts.map +1 -0
- package/dist/frame/guides.d.ts +68 -0
- package/dist/frame/guides.d.ts.map +1 -0
- package/dist/frame/keys.d.ts +97 -0
- package/dist/frame/keys.d.ts.map +1 -0
- package/dist/frame/layout.d.ts +146 -0
- package/dist/frame/layout.d.ts.map +1 -0
- package/dist/frame/registry.d.ts +32 -0
- package/dist/frame/registry.d.ts.map +1 -0
- package/dist/frame/reports.d.ts +54 -0
- package/dist/frame/reports.d.ts.map +1 -0
- package/dist/frame/secondary-axes.d.ts +74 -0
- package/dist/frame/secondary-axes.d.ts.map +1 -0
- package/dist/frame/secondary.d.ts +57 -0
- package/dist/frame/secondary.d.ts.map +1 -0
- package/dist/frame/tooltip-overlay.d.ts +65 -0
- package/dist/frame/tooltip-overlay.d.ts.map +1 -0
- package/dist/frame/types.d.ts +659 -0
- package/dist/frame/types.d.ts.map +1 -0
- package/dist/grids/barbs.d.ts +52 -0
- package/dist/grids/barbs.d.ts.map +1 -0
- package/dist/grids/cell-rects.d.ts +38 -0
- package/dist/grids/cell-rects.d.ts.map +1 -0
- package/dist/grids/cells.d.ts +131 -0
- package/dist/grids/cells.d.ts.map +1 -0
- package/dist/grids/contour-f.d.ts +81 -0
- package/dist/grids/contour-f.d.ts.map +1 -0
- package/dist/grids/contour-shared.d.ts +54 -0
- package/dist/grids/contour-shared.d.ts.map +1 -0
- package/dist/grids/contour.d.ts +85 -0
- package/dist/grids/contour.d.ts.map +1 -0
- package/dist/grids/dendrogram.d.ts +105 -0
- package/dist/grids/dendrogram.d.ts.map +1 -0
- package/dist/grids/heatmap.d.ts +164 -0
- package/dist/grids/heatmap.d.ts.map +1 -0
- package/dist/grids/hex-bin.d.ts +94 -0
- package/dist/grids/hex-bin.d.ts.map +1 -0
- package/dist/grids/hist2d.d.ts +108 -0
- package/dist/grids/hist2d.d.ts.map +1 -0
- package/dist/grids/imshow.d.ts +85 -0
- package/dist/grids/imshow.d.ts.map +1 -0
- package/dist/grids/index.d.ts +27 -0
- package/dist/grids/index.d.ts.map +1 -0
- package/dist/grids/pcolormesh.d.ts +91 -0
- package/dist/grids/pcolormesh.d.ts.map +1 -0
- package/dist/grids/ramp-cells.d.ts +67 -0
- package/dist/grids/ramp-cells.d.ts.map +1 -0
- package/dist/grids/tri-contour.d.ts +121 -0
- package/dist/grids/tri-contour.d.ts.map +1 -0
- package/dist/grids/tri-shared.d.ts +62 -0
- package/dist/grids/tri-shared.d.ts.map +1 -0
- package/dist/grids/tripcolor.d.ts +74 -0
- package/dist/grids/tripcolor.d.ts.map +1 -0
- package/dist/guides/colorbar.d.ts +111 -0
- package/dist/guides/colorbar.d.ts.map +1 -0
- package/dist/guides/index.d.ts +12 -0
- package/dist/guides/index.d.ts.map +1 -0
- package/dist/guides/legend.d.ts +119 -0
- package/dist/guides/legend.d.ts.map +1 -0
- package/dist/guides/nodes.d.ts +14 -0
- package/dist/guides/nodes.d.ts.map +1 -0
- package/dist/guides/size-legend.d.ts +234 -0
- package/dist/guides/size-legend.d.ts.map +1 -0
- package/dist/hierarchy/breadcrumbs.d.ts +134 -0
- package/dist/hierarchy/breadcrumbs.d.ts.map +1 -0
- package/dist/hierarchy/circle-pack.d.ts +73 -0
- package/dist/hierarchy/circle-pack.d.ts.map +1 -0
- package/dist/hierarchy/drill.d.ts +246 -0
- package/dist/hierarchy/drill.d.ts.map +1 -0
- package/dist/hierarchy/frame.d.ts +68 -0
- package/dist/hierarchy/frame.d.ts.map +1 -0
- package/dist/hierarchy/icicle.d.ts +77 -0
- package/dist/hierarchy/icicle.d.ts.map +1 -0
- package/dist/hierarchy/index.d.ts +21 -0
- package/dist/hierarchy/index.d.ts.map +1 -0
- package/dist/hierarchy/labels.d.ts +25 -0
- package/dist/hierarchy/labels.d.ts.map +1 -0
- package/dist/hierarchy/mosaic.d.ts +131 -0
- package/dist/hierarchy/mosaic.d.ts.map +1 -0
- package/dist/hierarchy/own-tooltip.d.ts +13 -0
- package/dist/hierarchy/own-tooltip.d.ts.map +1 -0
- package/dist/hierarchy/props.d.ts +14 -0
- package/dist/hierarchy/props.d.ts.map +1 -0
- package/dist/hierarchy/sankey.d.ts +133 -0
- package/dist/hierarchy/sankey.d.ts.map +1 -0
- package/dist/hierarchy/shared.d.ts +248 -0
- package/dist/hierarchy/shared.d.ts.map +1 -0
- package/dist/hierarchy/sunburst.d.ts +75 -0
- package/dist/hierarchy/sunburst.d.ts.map +1 -0
- package/dist/hierarchy/tree.d.ts +125 -0
- package/dist/hierarchy/tree.d.ts.map +1 -0
- package/dist/hierarchy/treemap.d.ts +77 -0
- package/dist/hierarchy/treemap.d.ts.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/item-tooltip.d.ts +34 -0
- package/dist/item-tooltip.d.ts.map +1 -0
- package/dist/join.d.ts +224 -0
- package/dist/join.d.ts.map +1 -0
- package/dist/math/3d/bar3d.d.ts +28 -0
- package/dist/math/3d/bar3d.d.ts.map +1 -0
- package/dist/math/3d/quiver3d.d.ts +27 -0
- package/dist/math/3d/quiver3d.d.ts.map +1 -0
- package/dist/math/3d/scatter3d.d.ts +16 -0
- package/dist/math/3d/scatter3d.d.ts.map +1 -0
- package/dist/math/3d/stem3d.d.ts +23 -0
- package/dist/math/3d/stem3d.d.ts.map +1 -0
- package/dist/math/3d/surfaceGrid3d.d.ts +34 -0
- package/dist/math/3d/surfaceGrid3d.d.ts.map +1 -0
- package/dist/math/3d/trisurface.d.ts +12 -0
- package/dist/math/3d/trisurface.d.ts.map +1 -0
- package/dist/math/3d/voxels.d.ts +18 -0
- package/dist/math/3d/voxels.d.ts.map +1 -0
- package/dist/math/aggregate.d.ts +69 -0
- package/dist/math/aggregate.d.ts.map +1 -0
- package/dist/math/bar.d.ts +32 -0
- package/dist/math/bar.d.ts.map +1 -0
- package/dist/math/barLabels.d.ts +84 -0
- package/dist/math/barLabels.d.ts.map +1 -0
- package/dist/math/barbs.d.ts +37 -0
- package/dist/math/barbs.d.ts.map +1 -0
- package/dist/math/boxplot.d.ts +37 -0
- package/dist/math/boxplot.d.ts.map +1 -0
- package/dist/math/breadcrumbs.d.ts +129 -0
- package/dist/math/breadcrumbs.d.ts.map +1 -0
- package/dist/math/bubble.d.ts +39 -0
- package/dist/math/bubble.d.ts.map +1 -0
- package/dist/math/bullet.d.ts +111 -0
- package/dist/math/bullet.d.ts.map +1 -0
- package/dist/math/chord.d.ts +104 -0
- package/dist/math/chord.d.ts.map +1 -0
- package/dist/math/cluster.d.ts +89 -0
- package/dist/math/cluster.d.ts.map +1 -0
- package/dist/math/contour.d.ts +49 -0
- package/dist/math/contour.d.ts.map +1 -0
- package/dist/math/contourf.d.ts +51 -0
- package/dist/math/contourf.d.ts.map +1 -0
- package/dist/math/dodge.d.ts +37 -0
- package/dist/math/dodge.d.ts.map +1 -0
- package/dist/math/ecdf.d.ts +42 -0
- package/dist/math/ecdf.d.ts.map +1 -0
- package/dist/math/errorbar.d.ts +28 -0
- package/dist/math/errorbar.d.ts.map +1 -0
- package/dist/math/eventplot.d.ts +27 -0
- package/dist/math/eventplot.d.ts.map +1 -0
- package/dist/math/facet.d.ts +91 -0
- package/dist/math/facet.d.ts.map +1 -0
- package/dist/math/fillBetween.d.ts +29 -0
- package/dist/math/fillBetween.d.ts.map +1 -0
- package/dist/math/gauge.d.ts +72 -0
- package/dist/math/gauge.d.ts.map +1 -0
- package/dist/math/hexbin.d.ts +21 -0
- package/dist/math/hexbin.d.ts.map +1 -0
- package/dist/math/hierarchy.d.ts +180 -0
- package/dist/math/hierarchy.d.ts.map +1 -0
- package/dist/math/hierarchyJoin.d.ts +60 -0
- package/dist/math/hierarchyJoin.d.ts.map +1 -0
- package/dist/math/histogram.d.ts +37 -0
- package/dist/math/histogram.d.ts.map +1 -0
- package/dist/math/histogram2d.d.ts +45 -0
- package/dist/math/histogram2d.d.ts.map +1 -0
- package/dist/math/imshow.d.ts +27 -0
- package/dist/math/imshow.d.ts.map +1 -0
- package/dist/math/index.d.ts +140 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/math/index.js +3 -0
- package/dist/math/jitter.d.ts +17 -0
- package/dist/math/jitter.d.ts.map +1 -0
- package/dist/math/join.d.ts +136 -0
- package/dist/math/join.d.ts.map +1 -0
- package/dist/math/keyframes.d.ts +128 -0
- package/dist/math/keyframes.d.ts.map +1 -0
- package/dist/math/legend.d.ts +121 -0
- package/dist/math/legend.d.ts.map +1 -0
- package/dist/math/line.d.ts +54 -0
- package/dist/math/line.d.ts.map +1 -0
- package/dist/math/morph.d.ts +82 -0
- package/dist/math/morph.d.ts.map +1 -0
- package/dist/math/mosaic.d.ts +120 -0
- package/dist/math/mosaic.d.ts.map +1 -0
- package/dist/math/ordinal.d.ts +80 -0
- package/dist/math/ordinal.d.ts.map +1 -0
- package/dist/math/parallel.d.ts +39 -0
- package/dist/math/parallel.d.ts.map +1 -0
- package/dist/math/pcolormesh.d.ts +23 -0
- package/dist/math/pcolormesh.d.ts.map +1 -0
- package/dist/math/pie.d.ts +106 -0
- package/dist/math/pie.d.ts.map +1 -0
- package/dist/math/polarArea.d.ts +35 -0
- package/dist/math/polarArea.d.ts.map +1 -0
- package/dist/math/radar.d.ts +111 -0
- package/dist/math/radar.d.ts.map +1 -0
- package/dist/math/range.d.ts +99 -0
- package/dist/math/range.d.ts.map +1 -0
- package/dist/math/regression.d.ts +110 -0
- package/dist/math/regression.d.ts.map +1 -0
- package/dist/math/reveal.d.ts +64 -0
- package/dist/math/reveal.d.ts.map +1 -0
- package/dist/math/sankey.d.ts +155 -0
- package/dist/math/sankey.d.ts.map +1 -0
- package/dist/math/scatter.d.ts +15 -0
- package/dist/math/scatter.d.ts.map +1 -0
- package/dist/math/shared/binning.d.ts +24 -0
- package/dist/math/shared/binning.d.ts.map +1 -0
- package/dist/math/shared/gridCells.d.ts +42 -0
- package/dist/math/shared/gridCells.d.ts.map +1 -0
- package/dist/math/shared/gridExtent.d.ts +6 -0
- package/dist/math/shared/gridExtent.d.ts.map +1 -0
- package/dist/math/shared/pairs.d.ts +3 -0
- package/dist/math/shared/pairs.d.ts.map +1 -0
- package/dist/math/shared/polar.d.ts +24 -0
- package/dist/math/shared/polar.d.ts.map +1 -0
- package/dist/math/stack.d.ts +70 -0
- package/dist/math/stack.d.ts.map +1 -0
- package/dist/math/stackplot.d.ts +36 -0
- package/dist/math/stackplot.d.ts.map +1 -0
- package/dist/math/stairs.d.ts +18 -0
- package/dist/math/stairs.d.ts.map +1 -0
- package/dist/math/stem.d.ts +22 -0
- package/dist/math/stem.d.ts.map +1 -0
- package/dist/math/symbol.d.ts +26 -0
- package/dist/math/symbol.d.ts.map +1 -0
- package/dist/math/tree.d.ts +118 -0
- package/dist/math/tree.d.ts.map +1 -0
- package/dist/math/tricontour.d.ts +77 -0
- package/dist/math/tricontour.d.ts.map +1 -0
- package/dist/math/violin.d.ts +100 -0
- package/dist/math/violin.d.ts.map +1 -0
- package/dist/math/waffle.d.ts +49 -0
- package/dist/math/waffle.d.ts.map +1 -0
- package/dist/math/waterfall.d.ts +29 -0
- package/dist/math/waterfall.d.ts.map +1 -0
- package/dist/math-CSHNpGej.js +3648 -0
- package/dist/mix.d.ts +25 -0
- package/dist/mix.d.ts.map +1 -0
- package/dist/multiview/brush.d.ts +166 -0
- package/dist/multiview/brush.d.ts.map +1 -0
- package/dist/multiview/chart-group.d.ts +266 -0
- package/dist/multiview/chart-group.d.ts.map +1 -0
- package/dist/multiview/chart-link.d.ts +189 -0
- package/dist/multiview/chart-link.d.ts.map +1 -0
- package/dist/multiview/chart-zoom.d.ts +145 -0
- package/dist/multiview/chart-zoom.d.ts.map +1 -0
- package/dist/multiview/facet.d.ts +239 -0
- package/dist/multiview/facet.d.ts.map +1 -0
- package/dist/multiview/group-guides.d.ts +100 -0
- package/dist/multiview/group-guides.d.ts.map +1 -0
- package/dist/multiview/index.d.ts +18 -0
- package/dist/multiview/index.d.ts.map +1 -0
- package/dist/multiview/joint-plot.d.ts +115 -0
- package/dist/multiview/joint-plot.d.ts.map +1 -0
- package/dist/multiview/pair-plot.d.ts +154 -0
- package/dist/multiview/pair-plot.d.ts.map +1 -0
- package/dist/multiview/panels.d.ts +23 -0
- package/dist/multiview/panels.d.ts.map +1 -0
- package/dist/multiview/parallel-coordinates.d.ts +110 -0
- package/dist/multiview/parallel-coordinates.d.ts.map +1 -0
- package/dist/points/event-plot.d.ts +68 -0
- package/dist/points/event-plot.d.ts.map +1 -0
- package/dist/points/index.d.ts +20 -0
- package/dist/points/index.d.ts.map +1 -0
- package/dist/points/labels.d.ts +71 -0
- package/dist/points/labels.d.ts.map +1 -0
- package/dist/points/links.d.ts +124 -0
- package/dist/points/links.d.ts.map +1 -0
- package/dist/points/rects.d.ts +81 -0
- package/dist/points/rects.d.ts.map +1 -0
- package/dist/points/rug.d.ts +73 -0
- package/dist/points/rug.d.ts.map +1 -0
- package/dist/points/scatter.d.ts +170 -0
- package/dist/points/scatter.d.ts.map +1 -0
- package/dist/points/segment-marks.d.ts +40 -0
- package/dist/points/segment-marks.d.ts.map +1 -0
- package/dist/points/shared.d.ts +35 -0
- package/dist/points/shared.d.ts.map +1 -0
- package/dist/points/stem.d.ts +76 -0
- package/dist/points/stem.d.ts.map +1 -0
- package/dist/points/strip.d.ts +146 -0
- package/dist/points/strip.d.ts.map +1 -0
- package/dist/points/symbol-marker.d.ts +34 -0
- package/dist/points/symbol-marker.d.ts.map +1 -0
- package/dist/points/ticks.d.ts +103 -0
- package/dist/points/ticks.d.ts.map +1 -0
- package/dist/props.d.ts +127 -0
- package/dist/props.d.ts.map +1 -0
- package/dist/radial/chord.d.ts +149 -0
- package/dist/radial/chord.d.ts.map +1 -0
- package/dist/radial/gauge.d.ts +127 -0
- package/dist/radial/gauge.d.ts.map +1 -0
- package/dist/radial/index.d.ts +16 -0
- package/dist/radial/index.d.ts.map +1 -0
- package/dist/radial/pie-chart.d.ts +144 -0
- package/dist/radial/pie-chart.d.ts.map +1 -0
- package/dist/radial/polar-area-chart.d.ts +136 -0
- package/dist/radial/polar-area-chart.d.ts.map +1 -0
- package/dist/radial/radar-chart.d.ts +177 -0
- package/dist/radial/radar-chart.d.ts.map +1 -0
- package/dist/radial/radial-bar-chart.d.ts +117 -0
- package/dist/radial/radial-bar-chart.d.ts.map +1 -0
- package/dist/radial/shared.d.ts +79 -0
- package/dist/radial/shared.d.ts.map +1 -0
- package/dist/radial/waffle.d.ts +131 -0
- package/dist/radial/waffle.d.ts.map +1 -0
- package/dist/raster.d.ts +44 -0
- package/dist/raster.d.ts.map +1 -0
- package/dist/series.d.ts +72 -0
- package/dist/series.d.ts.map +1 -0
- package/dist/src-CwGo1bes.js +19221 -0
- package/dist/stagger.d.ts +55 -0
- package/dist/stagger.d.ts.map +1 -0
- package/dist/statistics/box-plot.d.ts +152 -0
- package/dist/statistics/box-plot.d.ts.map +1 -0
- package/dist/statistics/error-bar.d.ts +149 -0
- package/dist/statistics/error-bar.d.ts.map +1 -0
- package/dist/statistics/groups.d.ts +141 -0
- package/dist/statistics/groups.d.ts.map +1 -0
- package/dist/statistics/index.d.ts +8 -0
- package/dist/statistics/index.d.ts.map +1 -0
- package/dist/statistics/violin-plot.d.ts +144 -0
- package/dist/statistics/violin-plot.d.ts.map +1 -0
- package/dist/text-width.d.ts +10 -0
- package/dist/text-width.d.ts.map +1 -0
- package/dist/tooltip.d.ts +277 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/util.d.ts +34 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/voxels-9lJ2TZS4.js +235 -0
- package/dist/wireframe3d-D157GZAq.js +345 -0
- package/package.json +86 -3
package/dist/mix.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blends a keyed transition draws between its two ends — colours, paints,
|
|
3
|
+
* boxes, point lists — and the text colour that reads on a fill. Internal to
|
|
4
|
+
* the charts. Colour work is cached per colour (and per pair), since marks
|
|
5
|
+
* call these per datum per frame.
|
|
6
|
+
*/
|
|
7
|
+
import type { Bounds, Point } from "@sophistry/core/geometry";
|
|
8
|
+
/** Two CSS colours blended at `t` in OKLCH, exact at 0 and 1, memoised per pair. */
|
|
9
|
+
export declare function blendCss(a: string, b: string, t: number): string;
|
|
10
|
+
/** Two boxes blended at `t`, edge by edge: `a` at 0, `b` at 1. */
|
|
11
|
+
export declare function mixBounds(a: Bounds, b: Bounds, t: number): Bounds;
|
|
12
|
+
/**
|
|
13
|
+
* Two point lists blended at `t`, point by point: `a` at 0, `b` at 1. Lists
|
|
14
|
+
* of different lengths can't blend point by point: the nearer one is
|
|
15
|
+
* returned whole.
|
|
16
|
+
*/
|
|
17
|
+
export declare function mixPoints<P extends readonly Point[]>(a: P, b: P, t: number): P;
|
|
18
|
+
/**
|
|
19
|
+
* A paint blended at `t`: colours in OKLCH ({@link blendCss}); paints that
|
|
20
|
+
* are not colours (gradients) switch at the midpoint.
|
|
21
|
+
*/
|
|
22
|
+
export declare function mixPaint<P>(a: P, b: P, t: number): P;
|
|
23
|
+
/** Whichever of `dark` and `light` reads better on `fill`, by OKLCH lightness, for numbers written on coloured cells. */
|
|
24
|
+
export declare function readableOn(fill: string, dark: string, light: string): string;
|
|
25
|
+
//# sourceMappingURL=mix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mix.d.ts","sourceRoot":"","sources":["../src/mix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAS9D,oFAAoF;AACpF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAWhE;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CASjE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,KAAK,EAAE,EACnD,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,MAAM,GACP,CAAC,CAKH;AACD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAIpD;AAeD,yHAAyH;AACzH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM5E"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gesture arithmetic behind `rangeBrush` and `chartZoom`: brush drags and
|
|
3
|
+
* wheel resizes, and zoom, pan and box zoom over a chart's coordinate
|
|
4
|
+
* system and range tracks. Components wire these to pointer, wheel and keys.
|
|
5
|
+
*
|
|
6
|
+
* The coordinate system is read through a getter on every gesture step: a
|
|
7
|
+
* chart publishes a new one whenever its ranges change, so a gesture never
|
|
8
|
+
* holds on to a stale one.
|
|
9
|
+
*/
|
|
10
|
+
import type { Animatable, CoordinateSystem, DragBehaviour, Readable, SceneNodeWheelEvent, ScenePointerEvent } from "@sophistry/core";
|
|
11
|
+
import type { Point } from "@sophistry/core/geometry";
|
|
12
|
+
/**
|
|
13
|
+
* A number a `rangeBrush` or `chartZoom` reads and writes: a `track(...)`, or
|
|
14
|
+
* any `Readable` with `set`.
|
|
15
|
+
*
|
|
16
|
+
* @category Charts
|
|
17
|
+
*/
|
|
18
|
+
export type BrushCell = Readable<number> & Animatable<number>;
|
|
19
|
+
/**
|
|
20
|
+
* A drag-to-zoom rectangle, in the plot's local scene units: its two
|
|
21
|
+
* corners and which axes it zooms (a thin box zooms only along its length).
|
|
22
|
+
*
|
|
23
|
+
* @category Charts
|
|
24
|
+
*/
|
|
25
|
+
export interface ChartZoomBox {
|
|
26
|
+
a: Point;
|
|
27
|
+
b: Point;
|
|
28
|
+
x: boolean;
|
|
29
|
+
y: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Where the coordinate system comes from: read on every use. */
|
|
32
|
+
type CoordsSource = () => CoordinateSystem;
|
|
33
|
+
/** CSS pixels a wheel `deltaMode` of lines or pages is worth, as `panZoom` reads them. */
|
|
34
|
+
export declare const WHEEL_LINE = 16;
|
|
35
|
+
export declare const WHEEL_PAGE = 400;
|
|
36
|
+
/** An axis of a chart, `"x"` or `"y"`. */
|
|
37
|
+
type Axis = "x" | "y";
|
|
38
|
+
/** One brushed axis: its two tracks and how they may move. */
|
|
39
|
+
export interface BrushAxis {
|
|
40
|
+
axis: "x" | "y";
|
|
41
|
+
from: BrushCell;
|
|
42
|
+
to: BrushCell;
|
|
43
|
+
bounds: () => readonly [number, number] | undefined;
|
|
44
|
+
minSpan: () => number | undefined;
|
|
45
|
+
/** Keep the ends on whole slots (a band axis). */
|
|
46
|
+
snap: () => boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The wheel on a `rangeBrush`: grows or shrinks its span about the
|
|
50
|
+
* cursor on every brushed axis (geometrically on a log axis), within the
|
|
51
|
+
* limits and `minSpan`; a snapped axis moves a whole slot once the resize
|
|
52
|
+
* accumulates. Returns whether the wheel was taken.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function brushWheel(options: {
|
|
57
|
+
coords: CoordsSource;
|
|
58
|
+
axes: readonly BrushAxis[];
|
|
59
|
+
speed?: () => number;
|
|
60
|
+
}): (event: SceneNodeWheelEvent) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The gestures of a one-axis `rangeBrush`: the body (keeping the span)
|
|
63
|
+
* and each edge, clamped to the bounds and snapped with `snap`.
|
|
64
|
+
*
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export declare function brushDrags(options: {
|
|
68
|
+
coords: CoordsSource;
|
|
69
|
+
from: BrushCell;
|
|
70
|
+
to: BrushCell;
|
|
71
|
+
vertical: () => boolean;
|
|
72
|
+
bounds: () => readonly [number, number] | undefined;
|
|
73
|
+
minSpan: () => number | undefined;
|
|
74
|
+
snap?: () => boolean;
|
|
75
|
+
disabled: () => boolean;
|
|
76
|
+
}): {
|
|
77
|
+
pointAt: (v: number) => Point;
|
|
78
|
+
drag: {
|
|
79
|
+
body: import("@sophistry/core").DraggableProps;
|
|
80
|
+
from: import("@sophistry/core").DraggableProps;
|
|
81
|
+
to: import("@sophistry/core").DraggableProps;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The gestures of a box `rangeBrush`: the body, the four edges and
|
|
86
|
+
* the four corners.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export declare function boxBrushDrags(options: {
|
|
91
|
+
coords: CoordsSource;
|
|
92
|
+
x: BrushAxis;
|
|
93
|
+
y: BrushAxis;
|
|
94
|
+
disabled: () => boolean;
|
|
95
|
+
}): {
|
|
96
|
+
body: import("@sophistry/core").DraggableProps;
|
|
97
|
+
x: {
|
|
98
|
+
from: import("@sophistry/core").DraggableProps;
|
|
99
|
+
to: import("@sophistry/core").DraggableProps;
|
|
100
|
+
};
|
|
101
|
+
y: {
|
|
102
|
+
from: import("@sophistry/core").DraggableProps;
|
|
103
|
+
to: import("@sophistry/core").DraggableProps;
|
|
104
|
+
};
|
|
105
|
+
corners: {
|
|
106
|
+
x: "a" | "b";
|
|
107
|
+
y: "a" | "b";
|
|
108
|
+
drag: import("@sophistry/core").DraggableProps;
|
|
109
|
+
}[];
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Zoom and pan over a chart's coordinate system and range tracks, as
|
|
113
|
+
* `chartZoom` wires them to pointer, wheel and keys. Positions are in
|
|
114
|
+
* the plot's local scene units.
|
|
115
|
+
*
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
export declare function chartZoomActions(options: {
|
|
119
|
+
coords: CoordsSource;
|
|
120
|
+
x?: readonly [BrushCell, BrushCell];
|
|
121
|
+
y?: readonly [BrushCell, BrushCell];
|
|
122
|
+
bounds: (axis: Axis) => readonly [number, number] | undefined;
|
|
123
|
+
minSpan: (axis: Axis) => number | undefined;
|
|
124
|
+
/** Whether an axis settles on whole slots (a band axis). Defaults to never. */
|
|
125
|
+
snap?: (axis: Axis) => boolean;
|
|
126
|
+
}): {
|
|
127
|
+
/** Which axes zoom. */
|
|
128
|
+
has: (axis: Axis) => boolean;
|
|
129
|
+
transform: (at: Point, factor: number, by: Point) => void;
|
|
130
|
+
zoomAbout: (at: Point, factor: number) => void;
|
|
131
|
+
panBy: (by: Point) => void;
|
|
132
|
+
zoomTo: (box: ChartZoomBox) => boolean;
|
|
133
|
+
settle: (origin: readonly number[], how: "slide" | "ends", step?: boolean | "in" | "out") => void;
|
|
134
|
+
reset: () => boolean;
|
|
135
|
+
centre: () => Point;
|
|
136
|
+
pointOf: (value: {
|
|
137
|
+
x: number;
|
|
138
|
+
y: number;
|
|
139
|
+
}) => Point;
|
|
140
|
+
dataAt: (at: Point) => {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
};
|
|
144
|
+
snapshot: () => number[];
|
|
145
|
+
restore: (values: readonly number[]) => void;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* The pointer gestures of a `chartZoom`: one finger or the mouse
|
|
149
|
+
* pans, two fingers pinch-zoom; with `box`, the drag draws a rectangle and
|
|
150
|
+
* the release zooms into it. A still press stays a tap; a cancelled gesture
|
|
151
|
+
* puts the ranges back.
|
|
152
|
+
*
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
export declare function chartZoomDrag(actions: ReturnType<typeof chartZoomActions>, enabled: () => boolean, options?: {
|
|
156
|
+
/** Whether this press draws a zoom box rather than panning. */
|
|
157
|
+
box?: (event: ScenePointerEvent) => boolean;
|
|
158
|
+
/** The box as it is drawn, or null when it is gone. */
|
|
159
|
+
onBox?: (box: ChartZoomBox | null) => void;
|
|
160
|
+
/** A box zoom happened; `before` is the ranges it replaced (a {@link chartZoomActions} snapshot). */
|
|
161
|
+
onZoom?: (before: number[]) => void;
|
|
162
|
+
/** Whether one finger pans (a box can still be drawn without). Defaults to `enabled`. */
|
|
163
|
+
pan?: () => boolean;
|
|
164
|
+
}): DragBehaviour;
|
|
165
|
+
export {};
|
|
166
|
+
//# sourceMappingURL=brush.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brush.d.ts","sourceRoot":"","sources":["../../src/multiview/brush.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,gBAAgB,EAChB,aAAa,EAEb,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,OAAO,CAAC;IACX,CAAC,EAAE,OAA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O,EAAE,MAAM,OAAO,EACtB,OAAO,GAAE;IACR,+DAA+D;IAC/D,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC;IAC5C,uDAAuD;IACvD,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,qGAAqG;IACrG,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,yFAAyF;IACzF,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC;CACf,GACJ,aAAa,CAkIf"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frames that share scales: the store behind `chartLink`, `facet`,
|
|
3
|
+
* `pairPlot` and `jointPlot`. Each `chart` inside registers as a panel;
|
|
4
|
+
* panels with the same share key on an axis fit it to the union of their
|
|
5
|
+
* reports, all colour through one scale, and with `shareSize` all sized
|
|
6
|
+
* layers share one maximum. Nothing here draws. Internal.
|
|
7
|
+
*
|
|
8
|
+
* How it runs (one commit, as a chart and its layers do): a preset (or
|
|
9
|
+
* `chartLink`) makes the store in `setup` and provides a
|
|
10
|
+
* {@link ChartGroupScope} through {@link chartGroupContext}. A chart that
|
|
11
|
+
* finds one joins as a panel ({@link chartPanel}): at the start of each of
|
|
12
|
+
* its updates it publishes its layers' reports, then fits its shared axes to
|
|
13
|
+
* the group's. A report that changed by value marks every other panel
|
|
14
|
+
* (`ctx.invalidate`), which refit in the same commit; the panel's guide
|
|
15
|
+
* room, axis spans and transition stages, published at the end of its
|
|
16
|
+
* update, mark only the group's watchers (the preset laying the panels
|
|
17
|
+
* out). Values equal to the last ones change nothing, so the loop settles.
|
|
18
|
+
*/
|
|
19
|
+
import type { CompositeContext, ContextKey } from "@sophistry/core";
|
|
20
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
21
|
+
import type { BandKey, Range, RangeTransition } from "@sophistry/core/geometry";
|
|
22
|
+
import type { ChartLayerExtent, LegendMark, RampExtent, SharedSizeDomain, SizeExtent } from "../frame/types";
|
|
23
|
+
import type { JoinStages } from "../math/join";
|
|
24
|
+
import type { OrdinalColorScale } from "../math/ordinal";
|
|
25
|
+
/** Room a panel's guides take on each side of its plotting area, in scene units. */
|
|
26
|
+
export interface PanelRoom {
|
|
27
|
+
left: number;
|
|
28
|
+
right: number;
|
|
29
|
+
top: number;
|
|
30
|
+
bottom: number;
|
|
31
|
+
}
|
|
32
|
+
/** Which scales a panel shares: panels with the same key on an axis fit it together. */
|
|
33
|
+
export interface PanelKeys {
|
|
34
|
+
x?: string;
|
|
35
|
+
y?: string;
|
|
36
|
+
/** Axes where the panel takes the shared fit without adding its data (a joint plot's marginals). */
|
|
37
|
+
follows?: {
|
|
38
|
+
x?: boolean;
|
|
39
|
+
y?: boolean;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Where a panel sits in its preset's grid, when it has one. */
|
|
43
|
+
export interface PanelPlace {
|
|
44
|
+
/** Grid row, from the top. */
|
|
45
|
+
readonly row: number;
|
|
46
|
+
/** Grid column, from the left. */
|
|
47
|
+
readonly column: number;
|
|
48
|
+
}
|
|
49
|
+
/** A panel's own state, as it last published it. */
|
|
50
|
+
export interface PanelState {
|
|
51
|
+
/** The panel's own layers' reports, a keyed transition's blend held out (its `t` reads 0). */
|
|
52
|
+
reports: readonly ChartLayerExtent[];
|
|
53
|
+
/** The blend of the panel's first transitioning layer, if any. */
|
|
54
|
+
blend: number | undefined;
|
|
55
|
+
/** The panel could draw on its own (its layers have reported). */
|
|
56
|
+
ready: boolean;
|
|
57
|
+
/** The room its guides take around the plot. */
|
|
58
|
+
room: PanelRoom;
|
|
59
|
+
/** The stages of the keyed transition its frame runs, if any (the group's guides follow them). */
|
|
60
|
+
stages: JoinStages | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Each axis's range length in its own units (band count, data span,
|
|
63
|
+
* decades on a log axis), independent of panel size, for `facet`'s `space="free"`.
|
|
64
|
+
*/
|
|
65
|
+
span: {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
} | undefined;
|
|
69
|
+
}
|
|
70
|
+
/** A panel as the group sees it: its keys, place and last published state. */
|
|
71
|
+
export interface GroupPanel {
|
|
72
|
+
readonly keys: PanelKeys;
|
|
73
|
+
readonly place: PanelPlace | undefined;
|
|
74
|
+
readonly state: Readonly<PanelState>;
|
|
75
|
+
}
|
|
76
|
+
/** A panel's link to its group: what it publishes, and leaving. */
|
|
77
|
+
export interface GroupMember {
|
|
78
|
+
/**
|
|
79
|
+
* Publishes what the other panels read: the panel's reports and its
|
|
80
|
+
* transition's blend. Marks the other panels and the watchers when it
|
|
81
|
+
* changed. Call at the start of the panel's update, before reading the
|
|
82
|
+
* group's shared fits.
|
|
83
|
+
*/
|
|
84
|
+
publishReports(reports: readonly ChartLayerExtent[], blend?: number): void;
|
|
85
|
+
/**
|
|
86
|
+
* Publishes what only the preset reads (room, spans, stages, readiness).
|
|
87
|
+
* Marks the watchers when it changed by value.
|
|
88
|
+
*/
|
|
89
|
+
publishLayout(layout: Partial<Pick<PanelState, "room" | "span" | "stages" | "ready">>): void;
|
|
90
|
+
/** Leaves the group; the others refit. */
|
|
91
|
+
dispose(): void;
|
|
92
|
+
}
|
|
93
|
+
/** The colour scale options a group takes (`ChartColorOptions`). */
|
|
94
|
+
export interface GroupColorOptions {
|
|
95
|
+
domain?: readonly BandKey[];
|
|
96
|
+
range?: readonly ColorInput[];
|
|
97
|
+
label?: (key: BandKey, index: number) => string;
|
|
98
|
+
}
|
|
99
|
+
/** Options for {@link createChartGroup}, set again on every update of the owner. */
|
|
100
|
+
export interface ChartGroupOptions {
|
|
101
|
+
color?: GroupColorOptions;
|
|
102
|
+
/** A range every panel sharing x (under any key) takes, unless it gives its own. */
|
|
103
|
+
xRange?: Range | RangeTransition;
|
|
104
|
+
/** A range every panel sharing y takes, unless it gives its own. */
|
|
105
|
+
yRange?: Range | RangeTransition;
|
|
106
|
+
/**
|
|
107
|
+
* Give every panel's sized layers one size scale: the greatest maximum any
|
|
108
|
+
* reports. A layer pinning `sizeMaxValue` keeps its own.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
shareSize?: boolean;
|
|
112
|
+
/** The colours a scale without `color.range` cycles: the theme's series colours. */
|
|
113
|
+
palette?: readonly string[];
|
|
114
|
+
}
|
|
115
|
+
/** One legend entry of a group's shared legend. */
|
|
116
|
+
export interface GroupLegendEntry {
|
|
117
|
+
key: BandKey;
|
|
118
|
+
label: string;
|
|
119
|
+
color: string;
|
|
120
|
+
mark: LegendMark;
|
|
121
|
+
}
|
|
122
|
+
/** A group of panels sharing scales. */
|
|
123
|
+
export interface ChartGroup {
|
|
124
|
+
/**
|
|
125
|
+
* Adds a panel. `onChange` is told (mark only) whenever something the
|
|
126
|
+
* panel reads from the group changed: another panel's reports, the
|
|
127
|
+
* options. Returns the panel's link.
|
|
128
|
+
*/
|
|
129
|
+
join(entry: {
|
|
130
|
+
keys: PanelKeys;
|
|
131
|
+
place?: PanelPlace;
|
|
132
|
+
}, onChange: () => void): GroupMember;
|
|
133
|
+
/**
|
|
134
|
+
* Watches every change (the preset laying the panels out): `onChange` is
|
|
135
|
+
* told whenever any panel published something new. Returns unsubscribe.
|
|
136
|
+
*/
|
|
137
|
+
watch(onChange: () => void): () => void;
|
|
138
|
+
/** Sets the options; a change marks every panel. */
|
|
139
|
+
setOptions(options: ChartGroupOptions): void;
|
|
140
|
+
/** The panels, in joining order. */
|
|
141
|
+
panels(): readonly GroupPanel[];
|
|
142
|
+
/** Every panel's reports (blends held out, as in {@link PanelState.reports}). */
|
|
143
|
+
all(): readonly ChartLayerExtent[];
|
|
144
|
+
/** The blend of the first panel in a keyed transition: the one the group stages on. */
|
|
145
|
+
blend(): number | undefined;
|
|
146
|
+
/** The reports of every panel sharing `key` on `axis`. */
|
|
147
|
+
shared(axis: "x" | "y", key: string): readonly ChartLayerExtent[];
|
|
148
|
+
/** The range given for an axis, for panels sharing it. */
|
|
149
|
+
range(axis: "x" | "y"): Range | RangeTransition | undefined;
|
|
150
|
+
/** The one colour scale; the same object while its domain and colours hold. */
|
|
151
|
+
colorScale(): OrdinalColorScale;
|
|
152
|
+
/** One entry per category of the colour scale, swatches merged over every panel's layers. */
|
|
153
|
+
legendEntries(): readonly GroupLegendEntry[];
|
|
154
|
+
/** The first value-coloured layer's ramp, for one colour bar. */
|
|
155
|
+
ramp(): RampExtent | undefined;
|
|
156
|
+
/** The size maximum every panel's sized layers share at each end; undefined unless sharing and some layer sizes by value. */
|
|
157
|
+
sizeDomain(): SharedSizeDomain | undefined;
|
|
158
|
+
/** A layer's size scale as it is drawn in this group: the shared maximum, unless it pins its own. */
|
|
159
|
+
sizeOf(size: SizeExtent): SizeExtent;
|
|
160
|
+
/** The stages of the panels' keyed transition (the first that has one), for the group's own guides. */
|
|
161
|
+
stages(): JoinStages | undefined;
|
|
162
|
+
/** Every panel is ready, so shared fits are complete. */
|
|
163
|
+
ready(): boolean;
|
|
164
|
+
/** The largest room any panel's guides take on each side. */
|
|
165
|
+
room(): PanelRoom;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* What a panel finds in context: its group and its share keys.
|
|
169
|
+
*
|
|
170
|
+
* @category Extending
|
|
171
|
+
*/
|
|
172
|
+
export interface ChartGroupScope {
|
|
173
|
+
group: ChartGroup;
|
|
174
|
+
keys: PanelKeys;
|
|
175
|
+
/** The panel's place in the grid, so the preset can tell its panels' rooms apart. */
|
|
176
|
+
place?: PanelPlace;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The group a `chart` is a panel of, or null. Presets provide it on a
|
|
180
|
+
* container around each panel; `chartLink` provides it to its whole subtree.
|
|
181
|
+
*
|
|
182
|
+
* @category Extending
|
|
183
|
+
*/
|
|
184
|
+
export declare const chartGroupContext: ContextKey<ChartGroupScope | null>;
|
|
185
|
+
/** Column widths (x) or row heights (y) for `space="free"`: each as long as the longest range among its panels. */
|
|
186
|
+
export declare function spanRatios(panels: readonly GroupPanel[], axis: "x" | "y", count: number): number[];
|
|
187
|
+
/** Two optional ratio lists with the same entries. */
|
|
188
|
+
export declare function sameRatios(a: readonly number[] | undefined, b: readonly number[] | undefined): boolean;
|
|
189
|
+
/** The legend swatch over every reporting layer: what `chart` merges too. */
|
|
190
|
+
export declare function mergedLegendMark(reports: readonly ChartLayerExtent[]): LegendMark;
|
|
191
|
+
/**
|
|
192
|
+
* One size scale over sized layers' reports: the greatest maximum at each
|
|
193
|
+
* end (a pinned `sizeMaxValue` counts at both). Undefined when no layer
|
|
194
|
+
* sizes by value.
|
|
195
|
+
*/
|
|
196
|
+
export declare function sharedSizeDomain(reports: readonly ChartLayerExtent[]): SharedSizeDomain | undefined;
|
|
197
|
+
/** Two shared size domains with the same ends. */
|
|
198
|
+
export declare function sameSizeDomain(a: SharedSizeDomain | undefined, b: SharedSizeDomain | undefined): boolean;
|
|
199
|
+
/** A layer's size scale on a shared one: the shared maximum at each end, unless the layer pins its own or nothing is shared. */
|
|
200
|
+
export declare function onSharedSize(size: SizeExtent, shared: SharedSizeDomain | undefined): SizeExtent;
|
|
201
|
+
/**
|
|
202
|
+
* A frame's size keys over its sized layers, in layer order: one per
|
|
203
|
+
* distinct drawn scale, titled by its first layer's channel. With
|
|
204
|
+
* `byRange` (a group's keys), one per distinct `sizeRange`, left out
|
|
205
|
+
* unless its layers agree on the maximum.
|
|
206
|
+
*/
|
|
207
|
+
export declare function sizeKeysOf(sizes: readonly (SizeExtent | undefined)[], drawn: (size: SizeExtent) => SizeExtent, byRange?: boolean): SizeExtent[];
|
|
208
|
+
/**
|
|
209
|
+
* A group store. Make one in a composite's `setup`, give it its options in
|
|
210
|
+
* every update ({@link ChartGroup.setOptions}), and provide a
|
|
211
|
+
* {@link ChartGroupScope} through {@link chartGroupContext}; panels find it
|
|
212
|
+
* there. Everything it computes is cached until a panel publishes or the
|
|
213
|
+
* options change.
|
|
214
|
+
*/
|
|
215
|
+
export declare function createChartGroup(options?: ChartGroupOptions): ChartGroup;
|
|
216
|
+
/**
|
|
217
|
+
* A chart's side of a group: the hook `chart` calls so it works as a panel.
|
|
218
|
+
* Outside a group every method falls back to the chart's own state.
|
|
219
|
+
*
|
|
220
|
+
* In the chart's update, in this order:
|
|
221
|
+
*
|
|
222
|
+
* ```ts
|
|
223
|
+
* const panel = state.panel.begin(reports, blend); // publishes; null outside a group
|
|
224
|
+
* const xReports = state.panel.fitReports("x", reports);
|
|
225
|
+
* const xGiven = numericRange(props.xRange) ?? state.panel.range("x");
|
|
226
|
+
* const colorScale = state.panel.colorScale() ?? colorScaleOf(...);
|
|
227
|
+
* const sizeDomain = state.panel.sizeDomain() ?? ownSizeDomain;
|
|
228
|
+
* // ... fit, lay out, draw ...
|
|
229
|
+
* state.panel.end({ room, span, stages, ready });
|
|
230
|
+
* ```
|
|
231
|
+
*
|
|
232
|
+
* @category Extending
|
|
233
|
+
*/
|
|
234
|
+
export interface ChartPanel {
|
|
235
|
+
/**
|
|
236
|
+
* Reads the group scope (joining or leaving as it changes) and publishes
|
|
237
|
+
* the chart's layers' reports. Returns the scope, or null outside a group.
|
|
238
|
+
*/
|
|
239
|
+
begin(reports: readonly ChartLayerExtent[], blend?: number): ChartGroupScope | null;
|
|
240
|
+
/** The reports an axis is fitted to: its share key's across the group, or the chart's own. */
|
|
241
|
+
fitReports(axis: "x" | "y", own: readonly ChartLayerExtent[]): readonly ChartLayerExtent[];
|
|
242
|
+
/** Every report a keyed transition stages on: the whole group's, or the chart's own. */
|
|
243
|
+
allReports(own: readonly ChartLayerExtent[]): readonly ChartLayerExtent[];
|
|
244
|
+
/** The group's range for an axis the chart shares, or undefined. */
|
|
245
|
+
range(axis: "x" | "y"): Range | RangeTransition | undefined;
|
|
246
|
+
/** The group's colour scale, or undefined outside a group. */
|
|
247
|
+
colorScale(): OrdinalColorScale | undefined;
|
|
248
|
+
/** The group's shared size domain, or undefined (outside, or not sharing). */
|
|
249
|
+
sizeDomain(): SharedSizeDomain | undefined;
|
|
250
|
+
/** The group's blend (the first transitioning panel's), or undefined. */
|
|
251
|
+
blend(): number | undefined;
|
|
252
|
+
/** Whether the chart is a panel (its legend is the group's, its room the group's to lay out). */
|
|
253
|
+
readonly grouped: boolean;
|
|
254
|
+
/** Publishes what the preset lays the panels out by. */
|
|
255
|
+
end(layout: Partial<Pick<PanelState, "room" | "span" | "stages" | "ready">>): void;
|
|
256
|
+
}
|
|
257
|
+
/** Why a chart's update reruns for its group: another panel or the options changed. */
|
|
258
|
+
export declare const GROUP_CHANGED: ContextKey<unknown>;
|
|
259
|
+
/**
|
|
260
|
+
* Makes a chart's {@link ChartPanel}. Call once, in the chart's `setup`.
|
|
261
|
+
* Leaves the group when the chart is disposed.
|
|
262
|
+
*
|
|
263
|
+
* @category Extending
|
|
264
|
+
*/
|
|
265
|
+
export declare function chartPanel<P>(ctx: CompositeContext<P>): ChartPanel;
|
|
266
|
+
//# sourceMappingURL=chart-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-group.d.ts","sourceRoot":"","sources":["../../src/multiview/chart-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhF,OAAO,KAAK,EACX,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,oFAAoF;AACpF,MAAM,WAAW,SAAS;IACzB,IAAI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AAE,GAAG,GAAG,GAAG,EACf,GAAG,EAAE,SAAS,gBAAgB,EAAE,GAC9B,SAAS,gBAAgB,EAAE,CAAC;IAC/B,wFAAwF;IACxF,UAAU,CAAC,GAAG,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,gBAAgB,EAAE,CAAC;IAC1E,oEAAoE;IACpE,KAAK,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,GAAG,eAAe,GAAG,SAAS,CAAC;IAC5D,8DAA8D;IAC9D,UAAU,IAAI,iBAAiB,GAAG,SAAS,CAAC;IAC5C,8EAA8E;IAC9E,UAAU,IAAI,gBAAgB,GAAG,SAAS,CAAC;IAC3C,yEAAyE;IACzE,KAAK,IAAI,MAAM,GAAG,SAAS,CAAC;IAC5B,iGAAiG;IACjG,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,wDAAwD;IACxD,GAAG,CACF,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC,GACrE,IAAI,CAAC;CACR;AAED,uFAAuF;AACvF,eAAO,MAAM,aAAa,EAAE,UAAU,CAAC,OAAO,CACR,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,UAAU,CAwClE"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linked frames: `chartLink` shares scales between `chart`s, and
|
|
3
|
+
* `rangeBrush` is the interaction that drives a linked range. Both are
|
|
4
|
+
* driven by tracks, so they scrub and seek.
|
|
5
|
+
*/
|
|
6
|
+
import type { SceneNode } from "@sophistry/core";
|
|
7
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
8
|
+
import type { BandKey, BandScale, Range, RangeTransition } from "@sophistry/core/geometry";
|
|
9
|
+
import type { ChartColorOptions, ChartFrame } from "../frame/types";
|
|
10
|
+
import type { BrushCell } from "./brush";
|
|
11
|
+
/**
|
|
12
|
+
* Props for {@link chartLink}.
|
|
13
|
+
*
|
|
14
|
+
* @category Charts
|
|
15
|
+
*/
|
|
16
|
+
export interface ChartLinkProps {
|
|
17
|
+
/**
|
|
18
|
+
* Share the x axis: every member fits x to the union of all members' layers.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
x?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Share the y axis the same way.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
y?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A range every member sharing x takes (unless it gives its own `xRange`): one value to zoom
|
|
29
|
+
* them all. Omitted, the shared fit.
|
|
30
|
+
*/
|
|
31
|
+
xRange?: Range | RangeTransition;
|
|
32
|
+
/** A range every member sharing y takes; see `xRange`. */
|
|
33
|
+
yRange?: Range | RangeTransition;
|
|
34
|
+
/** The members' one colour scale: order, colours and legend names. */
|
|
35
|
+
color?: ChartColorOptions;
|
|
36
|
+
/** The `chart`s to link, anywhere inside. */
|
|
37
|
+
children?: readonly SceneNode[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Links the `chart`s inside it: one shared colour scale, and the axes chosen by `x`/`y`
|
|
41
|
+
* fitted to the union of every member's data (or all set to `xRange`/`yRange`). A member with
|
|
42
|
+
* its own `xRange` keeps it, so an overview with a {@link rangeBrush} can drive linked detail
|
|
43
|
+
* views. Each member draws its own legend; set `legend: false` on all but one. Which axes are
|
|
44
|
+
* shared (`x`, `y`) is read once, at creation.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { derive, track } from "@sophistry/core";
|
|
49
|
+
* import { chart, chartLink, linePlot } from "@sophistry/charts";
|
|
50
|
+
*
|
|
51
|
+
* const data = [3, 1, 4, 1, 5, 9, 2, 6];
|
|
52
|
+
* const from = track(2);
|
|
53
|
+
* const to = track(5);
|
|
54
|
+
* chartLink.create({
|
|
55
|
+
* xRange: derive([from, to], (a, b) => [a, b]),
|
|
56
|
+
* children: [chart.create({ width: 8, height: 3, children: [linePlot.create({ data })] })],
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @see https://sophistry.dev/guides/charts/#multiple-views
|
|
61
|
+
* @category Charts
|
|
62
|
+
*/
|
|
63
|
+
export declare const chartLink: import("@sophistry/core").Definition<ChartLinkProps, import("@sophistry/core/internal").CompositeNode<ChartLinkProps>, keyof ChartLinkProps>;
|
|
64
|
+
/**
|
|
65
|
+
* A per-axis option of {@link rangeBrush}: one value for every brushed axis, or one per axis.
|
|
66
|
+
*
|
|
67
|
+
* @category Charts
|
|
68
|
+
*/
|
|
69
|
+
export type BrushAxisOption<V> = V | {
|
|
70
|
+
x?: V;
|
|
71
|
+
y?: V;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Props for {@link rangeBrush}.
|
|
75
|
+
*
|
|
76
|
+
* @category Charts
|
|
77
|
+
*/
|
|
78
|
+
export interface RangeBrushProps {
|
|
79
|
+
/** The selection's low end, in data units, read and written while dragging. Use with `axis`. */
|
|
80
|
+
from?: BrushCell;
|
|
81
|
+
/** The selection's high end, in data units. */
|
|
82
|
+
to?: BrushCell;
|
|
83
|
+
/**
|
|
84
|
+
* The axis `from`/`to` run along.
|
|
85
|
+
* @default "x"
|
|
86
|
+
*/
|
|
87
|
+
axis?: "x" | "y";
|
|
88
|
+
/** The x selection's two ends, `[from, to]`; with `y` too, a box brush. */
|
|
89
|
+
x?: readonly [BrushCell, BrushCell];
|
|
90
|
+
/** The y selection's two ends; with `x`, a box brush. */
|
|
91
|
+
y?: readonly [BrushCell, BrushCell];
|
|
92
|
+
/**
|
|
93
|
+
* Where the ends may go, in data units: `[min, max]`, or per axis. Defaults to the frame's
|
|
94
|
+
* range on each axis.
|
|
95
|
+
*/
|
|
96
|
+
bounds?: BrushAxisOption<readonly [number, number]>;
|
|
97
|
+
/**
|
|
98
|
+
* The narrowest selection an edge drag can make, in data units (or per axis). Defaults to 0
|
|
99
|
+
* (one category on a band axis).
|
|
100
|
+
*/
|
|
101
|
+
minSpan?: BrushAxisOption<number>;
|
|
102
|
+
/**
|
|
103
|
+
* On a band axis, keep the ends on whole categories (the tracks hold slot edges, `0`..`n`).
|
|
104
|
+
* Read the selection with {@link brushedCategories}. Defaults to true on a band axis.
|
|
105
|
+
*/
|
|
106
|
+
snap?: boolean;
|
|
107
|
+
/** Fill and edge colour. Defaults to the theme's first series colour. */
|
|
108
|
+
color?: ColorInput;
|
|
109
|
+
/**
|
|
110
|
+
* Opacity of the selection's fill.
|
|
111
|
+
* @default 0.18
|
|
112
|
+
*/
|
|
113
|
+
fillOpacity?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Draw a draggable edge at each end (and corners on a box brush).
|
|
116
|
+
* @default true
|
|
117
|
+
*/
|
|
118
|
+
handles?: boolean;
|
|
119
|
+
/** Read-only: draw the selection but take no input. */
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Let the wheel over the brush grow or shrink it about the cursor, within `bounds` and
|
|
123
|
+
* `minSpan`.
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
wheel?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Multiplies the wheel's resize.
|
|
129
|
+
* @default 1
|
|
130
|
+
*/
|
|
131
|
+
wheelSpeed?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Accessible name of the selection; its edges add `"start"`/`"end"`.
|
|
134
|
+
* @default "selected range"
|
|
135
|
+
*/
|
|
136
|
+
label?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Reveal, 0..1: fades in with the frame's data.
|
|
139
|
+
* @default 1
|
|
140
|
+
*/
|
|
141
|
+
progress?: number;
|
|
142
|
+
zIndex?: number;
|
|
143
|
+
visible?: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** A per-axis option's value for one axis. Internal. */
|
|
146
|
+
export declare function brushAxisOption<V>(option: BrushAxisOption<V> | undefined, axis: "x" | "y", isValue: (option: BrushAxisOption<V>) => option is V): V | undefined;
|
|
147
|
+
export declare const isPair: (option: BrushAxisOption<readonly [number, number]>) => option is readonly [number, number];
|
|
148
|
+
export declare const isNumber: (option: BrushAxisOption<number>) => option is number;
|
|
149
|
+
/**
|
|
150
|
+
* The categories a band brush's selection covers: those whose slot's middle lies between
|
|
151
|
+
* `from` and `to`. Pass the axis's {@link BandScale} (`chartHandle(node).xBand`) or the
|
|
152
|
+
* categories in axis order.
|
|
153
|
+
*
|
|
154
|
+
* @category Charts
|
|
155
|
+
*/
|
|
156
|
+
export declare function brushedCategories<K extends BandKey>(categories: readonly K[] | BandScale<K>, from: number, to: number): K[];
|
|
157
|
+
/**
|
|
158
|
+
* Throws unless the node is inside a chart, and returns its frame.
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
export declare function requireFrame(frame: ChartFrame | null, name: string): ChartFrame;
|
|
162
|
+
/**
|
|
163
|
+
* A draggable selection on a `chart`: a band between `from` and `to` on one axis, or a
|
|
164
|
+
* box with `x` and `y`. It holds no state of its own: the tracks are the state, so any chart
|
|
165
|
+
* reading them (`xRange: derive([from, to], (a, b) => [a, b])`) is linked. Drag the body to
|
|
166
|
+
* move, an edge or corner to resize; the body and edges are also keyboard-focusable (arrows,
|
|
167
|
+
* Shift for fine steps, Escape cancels a drag). Which tracks it brushes is read once, at
|
|
168
|
+
* creation.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { track } from "@sophistry/core";
|
|
173
|
+
* import { chart, linePlot, rangeBrush } from "@sophistry/charts";
|
|
174
|
+
*
|
|
175
|
+
* const data = [3, 1, 4, 1, 5, 9, 2, 6];
|
|
176
|
+
* const from = track(2);
|
|
177
|
+
* const to = track(4);
|
|
178
|
+
* chart.create({
|
|
179
|
+
* width: 8,
|
|
180
|
+
* height: 2,
|
|
181
|
+
* children: [linePlot.create({ data }), rangeBrush.create({ from, to })],
|
|
182
|
+
* });
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* @see https://sophistry.dev/guides/charts/#multiple-views
|
|
186
|
+
* @category Charts
|
|
187
|
+
*/
|
|
188
|
+
export declare const rangeBrush: import("@sophistry/core").Definition<RangeBrushProps, import("@sophistry/core/internal").CompositeNode<RangeBrushProps>, keyof RangeBrushProps>;
|
|
189
|
+
//# sourceMappingURL=chart-link.d.ts.map
|