@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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `regression`: a fitted trend (least squares or LOESS) with its confidence
|
|
3
|
+
* band, one per `series`, drawn as one path batch (per fit a closed band
|
|
4
|
+
* item, then an open line item) in a group whose clip the reveal sweeps.
|
|
5
|
+
*/
|
|
6
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
7
|
+
import type { BandKey } from "@sophistry/core/geometry";
|
|
8
|
+
import type { Channel, PositionValue } from "../data/channels";
|
|
9
|
+
import type { SeriesTransitionProps } from "../props";
|
|
10
|
+
/**
|
|
11
|
+
* Props of {@link regressionPlot}: `x` and `y` default to the index and the
|
|
12
|
+
* datum when `data` is `number[]`; name them otherwise.
|
|
13
|
+
*
|
|
14
|
+
* @category Charts
|
|
15
|
+
*/
|
|
16
|
+
export interface RegressionProps<T = unknown> extends SeriesTransitionProps<T> {
|
|
17
|
+
/** The points the fit is through: one per datum. */
|
|
18
|
+
data: readonly T[];
|
|
19
|
+
/**
|
|
20
|
+
* Predictor, in data units (a `Date` reads as epoch ms). Defaults to the index when `data` is
|
|
21
|
+
* `number[]`; required otherwise.
|
|
22
|
+
*/
|
|
23
|
+
x?: Channel<T, PositionValue>;
|
|
24
|
+
/**
|
|
25
|
+
* Response, in data units. Defaults to the datum when `data` is `number[]`; required otherwise.
|
|
26
|
+
* Pairs with a non-finite member are dropped.
|
|
27
|
+
*/
|
|
28
|
+
y?: Channel<T, number>;
|
|
29
|
+
/**
|
|
30
|
+
* The fit: `"linear"`, `"poly"` (a polynomial of `degree`) or `"loess"` (a local smooth over
|
|
31
|
+
* `bandwidth` of the points).
|
|
32
|
+
* @default "linear"
|
|
33
|
+
*/
|
|
34
|
+
method?: "linear" | "poly" | "loess";
|
|
35
|
+
/**
|
|
36
|
+
* Polynomial degree for `method="poly"`.
|
|
37
|
+
* @default 2
|
|
38
|
+
*/
|
|
39
|
+
degree?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Fraction of the points each local fit uses, for `method="loess"`.
|
|
42
|
+
* @default 0.3
|
|
43
|
+
*/
|
|
44
|
+
bandwidth?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Make a `method="loess"` smooth robust to outliers: `true` for 2 re-weighting passes, or a
|
|
47
|
+
* number of passes.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
robust?: boolean | number;
|
|
51
|
+
/**
|
|
52
|
+
* Confidence level of the band around the fit, 0..1 (0 for no band): the fitted mean's t-band
|
|
53
|
+
* for least squares, the standard-error band for LOESS (see {@link loessBand}).
|
|
54
|
+
* @default 0.95
|
|
55
|
+
*/
|
|
56
|
+
level?: number;
|
|
57
|
+
/**
|
|
58
|
+
* How many x positions the fit is drawn through.
|
|
59
|
+
* @default 50
|
|
60
|
+
*/
|
|
61
|
+
samples?: number;
|
|
62
|
+
/**
|
|
63
|
+
* The category of each datum: one fit per category, coloured through the chart's shared colour
|
|
64
|
+
* scale and legend. `color` wins.
|
|
65
|
+
*/
|
|
66
|
+
series?: Channel<T, BandKey>;
|
|
67
|
+
/**
|
|
68
|
+
* Line and band colour. Defaults to the `series` colour, else the theme's first series colour.
|
|
69
|
+
*/
|
|
70
|
+
color?: ColorInput;
|
|
71
|
+
/**
|
|
72
|
+
* Band fill opacity, 0..1.
|
|
73
|
+
* @default 0.2
|
|
74
|
+
*/
|
|
75
|
+
bandOpacity?: number;
|
|
76
|
+
/** Line width. */
|
|
77
|
+
strokeWidth?: number;
|
|
78
|
+
/** Opacity 0..1. @default 1 */
|
|
79
|
+
opacity?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Reveal, 0..1: the line and its band sweep in left to right together.
|
|
82
|
+
* @default 1
|
|
83
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
84
|
+
*/
|
|
85
|
+
progress?: number;
|
|
86
|
+
/**
|
|
87
|
+
* The data to transition to, fits matched by `series`: shared fits morph with their bands, new
|
|
88
|
+
* ones sweep in, leaving ones fade out. See {@link SeriesTransitionProps}.
|
|
89
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
90
|
+
*/
|
|
91
|
+
to?: readonly T[];
|
|
92
|
+
/** Paint order. */
|
|
93
|
+
zIndex?: number;
|
|
94
|
+
/** Set to false to hide the fits. */
|
|
95
|
+
visible?: boolean;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A fitted trend with its confidence band over the data's x extent: least
|
|
99
|
+
* squares (a line or polynomial) or a LOESS smooth. Draw it over a
|
|
100
|
+
* `scatter` of the same data. See the `regression` and `loessBand` maths for
|
|
101
|
+
* the fits alone.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* import { chart, regressionPlot, scatter } from "@sophistry/charts";
|
|
106
|
+
*
|
|
107
|
+
* const rows = [1, 2, 3, 4, 5, 6, 7, 8].map((x) => ({ x, y: Math.sqrt(x) + Math.sin(x) / 4 }));
|
|
108
|
+
* chart.create({
|
|
109
|
+
* width: 8,
|
|
110
|
+
* height: 4,
|
|
111
|
+
* children: [
|
|
112
|
+
* scatter.create({ data: rows, x: "x", y: "y" }),
|
|
113
|
+
* regressionPlot.create({ data: rows, x: "x", y: "y", method: "loess" }),
|
|
114
|
+
* ],
|
|
115
|
+
* });
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* Exported as `regressionPlot` (definition name `"Regression"`): the
|
|
119
|
+
* package entry already exports the `regression` fit from its maths.
|
|
120
|
+
*
|
|
121
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#lines-scatter-and-error-bars
|
|
122
|
+
* @category Charts
|
|
123
|
+
*/
|
|
124
|
+
export declare const regressionPlot: import("@sophistry/core").Definition<RegressionProps<any>, import("@sophistry/core/internal").CompositeNode<RegressionProps<any>>, keyof RegressionProps<any>>;
|
|
125
|
+
//# sourceMappingURL=regression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regression.d.ts","sourceRoot":"","sources":["../../src/curves/regression.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAS,MAAM,0BAA0B,CAAC;AAI/D,OAAO,KAAK,EAAE,OAAO,EAAY,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAoBzE,OAAO,KAAK,EAAY,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAWhE;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,qBAAqB,CAAC,CAAC,CAAC;IAC7E,oDAAoD;IACpD,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB;;;OAGG;IACH,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;IAC9B;;;OAGG;IACH,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;IAClB,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAkTD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,cAAc,gKAuCzB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the line and area marks (`linePlot`, `stackPlot`, `fillBetween`,
|
|
3
|
+
* `stairs`, `ecdf`, `density`, `regression`) share: the one path batch each
|
|
4
|
+
* draws through (with the clip a sweep reveal needs), stable items so an
|
|
5
|
+
* outline that did not move is prepared once, and group colours across a
|
|
6
|
+
* keyed transition. Internal.
|
|
7
|
+
*
|
|
8
|
+
* Every curve mark draws one shape per group (a `series` category, or the
|
|
9
|
+
* one `WHOLE` group), and those shapes have outlines of their own, so the
|
|
10
|
+
* mark is one core `pathBatch` node: an item per line, band or region, each
|
|
11
|
+
* with its own stroke or fill and opacity. A `reveal="length"` draw hands
|
|
12
|
+
* each item its `progress` (the stroke traced along
|
|
13
|
+
* the outline, a closed outline's fill coming up with it), over the whole
|
|
14
|
+
* outline; the batch keeps an outline's arrays while only that changes, so
|
|
15
|
+
* the renderer measures their arc length once.
|
|
16
|
+
*/
|
|
17
|
+
import type { Bindable, PathBatchItem, PathBatchItemsProps, PathBatchNode, SceneNode } from "@sophistry/core";
|
|
18
|
+
import type { Bounds } from "@sophistry/core/geometry";
|
|
19
|
+
import type { ChartLayer } from "../context";
|
|
20
|
+
import type { GroupJoin } from "../join";
|
|
21
|
+
import type { GroupKey, SeriesState } from "../series";
|
|
22
|
+
/**
|
|
23
|
+
* A group's colour from the series scale, across a keyed transition: while
|
|
24
|
+
* one runs, over both ends' categories (`data`'s first), so a category keeps
|
|
25
|
+
* its colour. Undefined for {@link WHOLE}, or when an explicit colour wins.
|
|
26
|
+
*/
|
|
27
|
+
export declare function groupColors(layer: ChartLayer, series: SeriesState, join: GroupJoin): (key: GroupKey) => string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The one path batch of a curve mark, inside a group whose clip a sweep
|
|
30
|
+
* reveal moves. Call once, in `setup`.
|
|
31
|
+
*/
|
|
32
|
+
export interface CurveBatch {
|
|
33
|
+
/** The node to return from the mark: the group holding the batch. */
|
|
34
|
+
readonly node: SceneNode;
|
|
35
|
+
/** The batch itself. */
|
|
36
|
+
readonly batch: PathBatchNode<PathBatchItemsProps>;
|
|
37
|
+
/**
|
|
38
|
+
* Writes one update's items (`[slot key, item]` pairs, in paint order),
|
|
39
|
+
* shared props and clip. An item equal to the one its slot held last time
|
|
40
|
+
* is handed over as that same object, one whose outline alone is equal
|
|
41
|
+
* (its `progress` or a paint changed) around the same outline arrays, and
|
|
42
|
+
* an unchanged list as the same array, so the batch re-prepares only
|
|
43
|
+
* outlines that moved.
|
|
44
|
+
*/
|
|
45
|
+
update(items: readonly (readonly [unknown, PathBatchItem])[], shared: Bindable<Omit<PathBatchItemsProps, "items">>, clip?: Bounds | undefined): void;
|
|
46
|
+
/** The items as last written. */
|
|
47
|
+
readonly items: readonly PathBatchItem[];
|
|
48
|
+
}
|
|
49
|
+
/** Makes a mark's {@link CurveBatch}. */
|
|
50
|
+
export declare function createCurveBatch(): CurveBatch;
|
|
51
|
+
/** A group's slot key in a batch with more than one item per group (`"fill"`, `"line"`). */
|
|
52
|
+
export declare function slotOf(key: GroupKey, part: string): string;
|
|
53
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/curves/shared.ts"],"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
|
1
|
+
/**
|
|
2
|
+
* `stackPlot`: a stacked area chart, drawn as one path batch (a closed item
|
|
3
|
+
* per band) in a group whose clip the `"x"` reveal sweeps; `reveal="length"`
|
|
4
|
+
* traces each band's outline (the item's `progress`), its fill coming up
|
|
5
|
+
* with it.
|
|
6
|
+
*
|
|
7
|
+
* Across a keyed transition each end is stacked on its own, a band one end
|
|
8
|
+
* lacks stands with no thickness on its seam, and the update morphs each
|
|
9
|
+
* band's bounds together, so adjacent bands stay touching on every frame.
|
|
10
|
+
*/
|
|
11
|
+
import type { PaintSpec } from "@sophistry/core";
|
|
12
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
13
|
+
import type { BandKey, CurveKind } from "@sophistry/core/geometry";
|
|
14
|
+
import type { Channel, PositionValue } from "../data/channels";
|
|
15
|
+
import type { JoinStaging } from "../math/join";
|
|
16
|
+
import type { StackOffset, StackOrder } from "../math/stack";
|
|
17
|
+
import type { StackReveal, TransitionProps } from "../props";
|
|
18
|
+
/**
|
|
19
|
+
* Props of {@link stackPlot}: `x` defaults to the index when `data` is
|
|
20
|
+
* `number[]`; name it otherwise.
|
|
21
|
+
*
|
|
22
|
+
* @category Charts
|
|
23
|
+
*/
|
|
24
|
+
export interface StackPlotProps<T = unknown> extends TransitionProps<T> {
|
|
25
|
+
/**
|
|
26
|
+
* Wide format (`y` a list): one row per x position. Long format (`y` one channel, with a
|
|
27
|
+
* `series`): one row per band per x position.
|
|
28
|
+
*/
|
|
29
|
+
data: readonly T[];
|
|
30
|
+
/**
|
|
31
|
+
* X position, in data units (a `Date` reads as epoch ms). Defaults to the index when `data` is
|
|
32
|
+
* `number[]`; required otherwise.
|
|
33
|
+
*/
|
|
34
|
+
x?: Channel<T, PositionValue>;
|
|
35
|
+
/**
|
|
36
|
+
* One channel per band, stacked in the order given (`y: ["north", "south"]`); or one channel,
|
|
37
|
+
* for long-format `data`, with `series` naming each row's band. Non-finite heights count as 0.
|
|
38
|
+
*/
|
|
39
|
+
y: readonly Channel<T, number>[] | Channel<T, number>;
|
|
40
|
+
/**
|
|
41
|
+
* Which series each band is, colouring bands through the chart's shared colour scale and
|
|
42
|
+
* legend: with a list of `y` channels, one name per channel; with one `y` channel, a channel
|
|
43
|
+
* naming each row's band (rows missing at an x count as 0).
|
|
44
|
+
*/
|
|
45
|
+
series?: readonly BandKey[] | Channel<T, BandKey>;
|
|
46
|
+
/**
|
|
47
|
+
* Colours cycled across bands by index. Defaults to the `series` colours, else the theme's
|
|
48
|
+
* categorical colours.
|
|
49
|
+
*/
|
|
50
|
+
colors?: readonly ColorInput[];
|
|
51
|
+
/**
|
|
52
|
+
* Data-space y the first band stacks on, under the `"zero"` offset. Defaults to the axis
|
|
53
|
+
* baseline.
|
|
54
|
+
*/
|
|
55
|
+
baseline?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Where each x's stack is placed: `"zero"` on the baseline, `"normalize"` as shares of the
|
|
58
|
+
* total, `"center"` centred on zero, `"wiggle"` a streamgraph (needs ascending, evenly spaced
|
|
59
|
+
* x). See {@link StackOffset}.
|
|
60
|
+
* @default "zero"
|
|
61
|
+
*/
|
|
62
|
+
offset?: StackOffset;
|
|
63
|
+
/**
|
|
64
|
+
* Which band sits at the bottom: `"appearance"`, `"reverse"`, `"sum"` (largest on top),
|
|
65
|
+
* `"insideOut"` (streamgraph order), or band indices bottom to top. Colours stay with their
|
|
66
|
+
* band.
|
|
67
|
+
* @default "appearance"
|
|
68
|
+
*/
|
|
69
|
+
order?: StackOrder;
|
|
70
|
+
/**
|
|
71
|
+
* How `progress` reveals the stack: `"grow"` every band's height from the baseline together,
|
|
72
|
+
* `"x"` left to right behind one front, `"length"` each band's outline by arc length.
|
|
73
|
+
* @default "grow"
|
|
74
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
75
|
+
*/
|
|
76
|
+
reveal?: StackReveal;
|
|
77
|
+
/**
|
|
78
|
+
* How band edges run between rows: `"linear"` or any {@link CurveKind} (`"monotone"` for a
|
|
79
|
+
* smooth stack). Adjacent bands still share their edge exactly.
|
|
80
|
+
* @default "linear"
|
|
81
|
+
*/
|
|
82
|
+
curve?: CurveKind;
|
|
83
|
+
/**
|
|
84
|
+
* The data to transition to, bands matched by `series` (long format) or place in `y` (wide):
|
|
85
|
+
* each end is stacked on its own and shared bands morph between them, so every frame is a
|
|
86
|
+
* stack. Leaving bands shrink away, new ones grow in.
|
|
87
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
88
|
+
*/
|
|
89
|
+
to?: readonly T[];
|
|
90
|
+
/**
|
|
91
|
+
* How the transition spends `blend`.
|
|
92
|
+
* @default "staged"
|
|
93
|
+
*/
|
|
94
|
+
staging?: JoinStaging;
|
|
95
|
+
/**
|
|
96
|
+
* With `to`: fraction of the enter stage spent staggering arriving bands, bottom up, 0..0.95.
|
|
97
|
+
* @default 0
|
|
98
|
+
*/
|
|
99
|
+
enterStagger?: number;
|
|
100
|
+
/** Band fill opacity 0..1. @default 0.85 */
|
|
101
|
+
fillOpacity?: number;
|
|
102
|
+
/** Band outline. @default "none" */
|
|
103
|
+
stroke?: PaintSpec;
|
|
104
|
+
/** Outline width. */
|
|
105
|
+
strokeWidth?: number;
|
|
106
|
+
/** Opacity 0..1. @default 1 */
|
|
107
|
+
opacity?: number;
|
|
108
|
+
/** Reveal 0..1 (see `reveal`). @default 1 */
|
|
109
|
+
progress?: number;
|
|
110
|
+
/** Paint order (the bands paint under the axes of that order). */
|
|
111
|
+
zIndex?: number;
|
|
112
|
+
/** Set to false to hide the bands. */
|
|
113
|
+
visible?: boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A stacked area chart: bands stacked atop a shared baseline, each shaded in
|
|
117
|
+
* its own colour. Use `offset` for 100% areas or streamgraphs. Inside a
|
|
118
|
+
* `chart` (or any `axes` whose y range covers the stacked total). See
|
|
119
|
+
* {@link stackedBands} for the stacking alone.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* import { chart, stackPlot } from "@sophistry/charts";
|
|
124
|
+
*
|
|
125
|
+
* const rows = [
|
|
126
|
+
* { year: 2022, north: 3, south: 2 },
|
|
127
|
+
* { year: 2023, north: 4, south: 3 },
|
|
128
|
+
* { year: 2024, north: 5, south: 3 },
|
|
129
|
+
* ];
|
|
130
|
+
* chart.create({
|
|
131
|
+
* width: 8,
|
|
132
|
+
* height: 4,
|
|
133
|
+
* children: [stackPlot.create({ data: rows, x: "year", y: ["north", "south"], series: ["North", "South"] })],
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#stacked-areas
|
|
138
|
+
* @category Charts
|
|
139
|
+
*/
|
|
140
|
+
export declare const stackPlot: import("@sophistry/core").Definition<StackPlotProps<any>, import("@sophistry/core/internal").CompositeNode<StackPlotProps<any>>, keyof StackPlotProps<any>>;
|
|
141
|
+
//# sourceMappingURL=stack-plot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack-plot.d.ts","sourceRoot":"","sources":["../../src/curves/stack-plot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAGX,SAAS,EAGT,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAS,MAAM,0BAA0B,CAAC;AAI1E,OAAO,KAAK,EAAE,OAAO,EAAY,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAczE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,KAAK,EAAY,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQvE;;;;;GAKG;AACH,MAAM,WAAW,cAAc,CAAC,CAA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AO,CAAC,EAAE,OAAO,CAAC;CAClB;AAgkBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,SAAS,6JAwCpB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `stairs`: a step function held flat across each `[edges[i], edges[i + 1]]`
|
|
3
|
+
* interval, one open line per `series`, drawn as one path batch. Also the
|
|
4
|
+
* step-line drawing `ecdf` shares ({@link stepLineItems}): lines kept by
|
|
5
|
+
* group, coloured by the series scale unless `stroke` is set, revealed along
|
|
6
|
+
* x behind one front (or by arc length), and morphed as step functions
|
|
7
|
+
* across a keyed transition.
|
|
8
|
+
*/
|
|
9
|
+
import type { CoordinateSystem, PaintSpec, SceneNode } from "@sophistry/core";
|
|
10
|
+
import type { BandKey, Point } from "@sophistry/core/geometry";
|
|
11
|
+
import type { Channel } from "../data/channels";
|
|
12
|
+
import type { ChartFrame } from "../frame/types";
|
|
13
|
+
import type { GroupJoin } from "../join";
|
|
14
|
+
import type { StepFunction } from "../math/morph";
|
|
15
|
+
import type { CurveReveal, SeriesTransitionProps } from "../props";
|
|
16
|
+
import type { GroupKey } from "../series";
|
|
17
|
+
import type { CurveBatch } from "./shared";
|
|
18
|
+
/**
|
|
19
|
+
* The stroke props every step line takes (`stairs`, `ecdf`).
|
|
20
|
+
*
|
|
21
|
+
* @category Charts
|
|
22
|
+
*/
|
|
23
|
+
export interface StepLineStyleProps {
|
|
24
|
+
/** Line colour (or gradient) for every line. Defaults to the `series` colour, else the theme's foreground. */
|
|
25
|
+
stroke?: PaintSpec;
|
|
26
|
+
/** Line width. Defaults to the theme's stroke width. */
|
|
27
|
+
strokeWidth?: number;
|
|
28
|
+
/** Dash pattern, in scene units. Solid when omitted. */
|
|
29
|
+
dash?: number[];
|
|
30
|
+
/** Offset into `dash`. @default 0 */
|
|
31
|
+
dashOffset?: number;
|
|
32
|
+
/** How line ends are capped. @default "round" */
|
|
33
|
+
lineCap?: CanvasLineCap;
|
|
34
|
+
/** How corners are joined. @default "round" */
|
|
35
|
+
lineJoin?: CanvasLineJoin;
|
|
36
|
+
/** Opacity 0..1. @default 1 */
|
|
37
|
+
opacity?: number;
|
|
38
|
+
/** Reveal 0..1 (see `reveal`). @default 1 */
|
|
39
|
+
progress?: number;
|
|
40
|
+
/** Paint order. */
|
|
41
|
+
zIndex?: number;
|
|
42
|
+
/** Set to false to hide the lines. */
|
|
43
|
+
visible?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Props of {@link stairs}: `value` defaults to the datum when `data` is
|
|
47
|
+
* `number[]`; name it otherwise.
|
|
48
|
+
*
|
|
49
|
+
* @category Charts
|
|
50
|
+
*/
|
|
51
|
+
export interface StairsProps<T = unknown> extends SeriesTransitionProps<T>, StepLineStyleProps {
|
|
52
|
+
/** One step per datum. */
|
|
53
|
+
data: readonly T[];
|
|
54
|
+
/**
|
|
55
|
+
* Height of each step, in data units, held across `[edges[i], edges[i + 1]]`. Defaults to the
|
|
56
|
+
* datum when `data` is `number[]`; required otherwise.
|
|
57
|
+
*/
|
|
58
|
+
value?: Channel<T, number>;
|
|
59
|
+
/**
|
|
60
|
+
* Step boundaries in data units, ascending, exactly one more than `data` (else throws). With a
|
|
61
|
+
* `series`, shared by every category. Defaults to `0..data.length`.
|
|
62
|
+
*/
|
|
63
|
+
edges?: readonly number[];
|
|
64
|
+
/**
|
|
65
|
+
* The category of each datum: one step line per category, coloured through the chart's shared
|
|
66
|
+
* colour scale and legend. `stroke` wins.
|
|
67
|
+
*/
|
|
68
|
+
series?: Channel<T, BandKey>;
|
|
69
|
+
/**
|
|
70
|
+
* How `progress` reveals the steps: `"x"` left to right at a constant rate, or `"length"` by
|
|
71
|
+
* arc length.
|
|
72
|
+
* @default "x"
|
|
73
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
74
|
+
*/
|
|
75
|
+
reveal?: CurveReveal;
|
|
76
|
+
/**
|
|
77
|
+
* The data to transition to, lines matched by `series`: shared lines morph and stay step
|
|
78
|
+
* functions every frame, new ones sweep in, leaving ones fade out. See {@link
|
|
79
|
+
* SeriesTransitionProps}.
|
|
80
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
81
|
+
*/
|
|
82
|
+
to?: readonly T[];
|
|
83
|
+
}
|
|
84
|
+
/** The descriptor entries of {@link StepLineStyleProps}. */
|
|
85
|
+
export declare const stepLineStyleDescriptor: {
|
|
86
|
+
readonly stroke: {
|
|
87
|
+
readonly invalidates: 64;
|
|
88
|
+
};
|
|
89
|
+
readonly strokeWidth: {
|
|
90
|
+
readonly invalidates: 64;
|
|
91
|
+
};
|
|
92
|
+
readonly dash: {
|
|
93
|
+
readonly invalidates: 64;
|
|
94
|
+
};
|
|
95
|
+
readonly dashOffset: {
|
|
96
|
+
readonly invalidates: 64;
|
|
97
|
+
};
|
|
98
|
+
readonly lineCap: {
|
|
99
|
+
readonly invalidates: 64;
|
|
100
|
+
};
|
|
101
|
+
readonly lineJoin: {
|
|
102
|
+
readonly invalidates: 64;
|
|
103
|
+
};
|
|
104
|
+
readonly opacity: {
|
|
105
|
+
readonly invalidates: 64;
|
|
106
|
+
};
|
|
107
|
+
readonly progress: {
|
|
108
|
+
readonly default: 1;
|
|
109
|
+
readonly invalidates: 64;
|
|
110
|
+
};
|
|
111
|
+
readonly zIndex: {
|
|
112
|
+
readonly invalidates: 64;
|
|
113
|
+
};
|
|
114
|
+
readonly visible: {
|
|
115
|
+
readonly invalidates: 64;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
/** What a step-line drawing keeps between updates. */
|
|
119
|
+
export interface StepLines {
|
|
120
|
+
scene: (deps: readonly unknown[], make: () => Map<GroupKey, Point[][]>) => Map<GroupKey, Point[][]>;
|
|
121
|
+
lines: CurveBatch;
|
|
122
|
+
}
|
|
123
|
+
/** Makes a {@link StepLines}. Call once, in `setup`. */
|
|
124
|
+
export declare function createStepLines(): StepLines;
|
|
125
|
+
/**
|
|
126
|
+
* Draws one step line per group (what `stairs` and `ecdf` share): each
|
|
127
|
+
* group's line in scene units on this frame (morphed as a step function on
|
|
128
|
+
* the update stage, entering ones swept in, leaving ones faded), cut at one
|
|
129
|
+
* front along x (or by arc length), as path batch items.
|
|
130
|
+
*
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
export declare function drawStepLines(own: StepLines, spec: {
|
|
134
|
+
props: StepLineStyleProps;
|
|
135
|
+
theme: {
|
|
136
|
+
palette: {
|
|
137
|
+
foreground: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
frame: ChartFrame | null;
|
|
141
|
+
coords: CoordinateSystem;
|
|
142
|
+
/** `data`'s step functions, per group. */
|
|
143
|
+
steps: Map<GroupKey, StepFunction>;
|
|
144
|
+
/** `to`'s, while a transition runs. */
|
|
145
|
+
to: Map<GroupKey, StepFunction> | undefined;
|
|
146
|
+
join: GroupJoin;
|
|
147
|
+
colorOf: (key: GroupKey) => string | undefined;
|
|
148
|
+
progress: number | undefined;
|
|
149
|
+
alongX: boolean;
|
|
150
|
+
}): SceneNode[];
|
|
151
|
+
/**
|
|
152
|
+
* A step function held flat across each `[edges[i], edges[i + 1]]` interval,
|
|
153
|
+
* drawn as one open line: a histogram's outline without the fill. Inside a
|
|
154
|
+
* `chart` or `axes`. See {@link stairsPolyline} for the geometry alone.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* import { chart, stairs } from "@sophistry/charts";
|
|
159
|
+
*
|
|
160
|
+
* chart.create({
|
|
161
|
+
* width: 8,
|
|
162
|
+
* height: 4,
|
|
163
|
+
* children: [stairs.create({ data: [3, 5, 2, 6], edges: [0, 1, 2, 4, 5] })],
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#histograms
|
|
168
|
+
* @category Charts
|
|
169
|
+
*/
|
|
170
|
+
export declare const stairs: import("@sophistry/core").Definition<StairsProps<any>, import("@sophistry/core/internal").CompositeNode<StairsProps<any>>, keyof StairsProps<any>>;
|
|
171
|
+
//# sourceMappingURL=stairs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stairs.d.ts","sourceRoot":"","sources":["../../src/curves/stairs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAEX,gBAAgB,EAChB,SAAS,EAET,SAAS,EACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,kBAAkB,CAAC;AAS1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAOzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,KAAK,EAAY,WAAW,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,8GAA8G;IAC9G,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,QAAQ,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