@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,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pieChart`: a pie (or doughnut) of one wedge per datum.
|
|
3
|
+
*
|
|
4
|
+
* The wedges draw as one path batch: each item is the native curve outline
|
|
5
|
+
* of a `sector` (or `annularSector`, with a hole), with its own
|
|
6
|
+
* fill; the stroke, its width and the fill opacity are shared. Per-wedge
|
|
7
|
+
* picking and accessible names go through the batch's items (`event.item`,
|
|
8
|
+
* `itemLabel`). Slice labels stay `label` nodes, one per present slice.
|
|
9
|
+
*/
|
|
10
|
+
import type { ColorInput } from "@sophistry/core";
|
|
11
|
+
import type { BandKey, Point } from "@sophistry/core/geometry";
|
|
12
|
+
import type { Channel, ColorChannel, RequiredUnless } from "../data/channels";
|
|
13
|
+
import type { KeyedJoin } from "../math/join";
|
|
14
|
+
import type { KeyedTransitionProps, RadialReveal } from "../props";
|
|
15
|
+
/** @category Charts */
|
|
16
|
+
export interface PieChartBaseProps<T> extends KeyedTransitionProps<T> {
|
|
17
|
+
/** One slice per datum. */
|
|
18
|
+
data: readonly T[];
|
|
19
|
+
/**
|
|
20
|
+
* The slice's value, in data units. Defaults to the datum when `data` is `number[]`; required
|
|
21
|
+
* otherwise. Negative and non-finite values count as 0 (an empty slice).
|
|
22
|
+
*/
|
|
23
|
+
value?: Channel<T, number>;
|
|
24
|
+
/**
|
|
25
|
+
* The slice's visible label. Omitted, a rounded percentage. See `ariaLabel` for the accessible
|
|
26
|
+
* name.
|
|
27
|
+
*/
|
|
28
|
+
label?: Channel<T, string>;
|
|
29
|
+
/**
|
|
30
|
+
* The chart's accessible name; each slice is announced as `"<ariaLabel>: <slice label>"`.
|
|
31
|
+
* Omitted, slices are not exposed to assistive technology.
|
|
32
|
+
*/
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
/** Centre of the chart. Defaults to the origin. */
|
|
35
|
+
center?: Point;
|
|
36
|
+
/**
|
|
37
|
+
* Outer radius.
|
|
38
|
+
* @default 1
|
|
39
|
+
*/
|
|
40
|
+
radius?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Radius of a hole through the centre, making a doughnut chart. `0` draws a plain pie.
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
innerRadius?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Reveal, 0..1: `reveal="grow"` opens every slice at once, keeping their true ratio, until they
|
|
48
|
+
* close the circle; `"sweep"` wipes round the pie, uncovering slices in data order.
|
|
49
|
+
* @default 1
|
|
50
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
51
|
+
*/
|
|
52
|
+
progress?: number;
|
|
53
|
+
reveal?: RadialReveal;
|
|
54
|
+
/**
|
|
55
|
+
* Angle the first slice begins at, in radians from +x. The default is 12 o'clock.
|
|
56
|
+
* @default Math.PI / 2
|
|
57
|
+
*/
|
|
58
|
+
startAngle?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Whether slices run clockwise.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
clockwise?: boolean;
|
|
64
|
+
/** One colour for every slice, or `(d, i) => colour`. Wins over `colors`. */
|
|
65
|
+
color?: ColorChannel<T>;
|
|
66
|
+
/** Colours cycled across the slices by index. Defaults to the theme's categorical colours. */
|
|
67
|
+
colors?: readonly ColorInput[];
|
|
68
|
+
/**
|
|
69
|
+
* Whether to draw slice labels.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
labels?: boolean;
|
|
73
|
+
/** Label font size. */
|
|
74
|
+
labelFontSize?: number;
|
|
75
|
+
/** Label colour. Defaults to the theme background. */
|
|
76
|
+
labelColor?: ColorInput;
|
|
77
|
+
/**
|
|
78
|
+
* Each slice's identity across transitions. See {@link KeyedTransitionProps}. Defaults to
|
|
79
|
+
* `label`, else the index.
|
|
80
|
+
*/
|
|
81
|
+
key?: Channel<T, BandKey>;
|
|
82
|
+
/**
|
|
83
|
+
* The data to transition to, matched to `data` by `key`: values blend and the pie is re-laid
|
|
84
|
+
* out every frame, so the slices always fill the turn; leaving slices shrink away, new ones
|
|
85
|
+
* open up. See {@link KeyedTransitionProps}.
|
|
86
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
87
|
+
*/
|
|
88
|
+
to?: readonly T[];
|
|
89
|
+
/** Slice outline. Defaults to the theme background. */
|
|
90
|
+
stroke?: ColorInput;
|
|
91
|
+
/**
|
|
92
|
+
* Outline width.
|
|
93
|
+
* @default 0.02
|
|
94
|
+
*/
|
|
95
|
+
strokeWidth?: number;
|
|
96
|
+
/** Fill opacity of the slices, 0..1. */
|
|
97
|
+
fillOpacity?: number;
|
|
98
|
+
/** Paint order. */
|
|
99
|
+
zIndex?: number;
|
|
100
|
+
/** Set to false to hide the chart. */
|
|
101
|
+
visible?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Props of {@link pieChart}: `value` is required unless `data` is `number[]`.
|
|
105
|
+
*
|
|
106
|
+
* @category Charts
|
|
107
|
+
*/
|
|
108
|
+
export type PieChartProps<T> = PieChartBaseProps<T> & RequiredUnless<T, number, "value">;
|
|
109
|
+
/**
|
|
110
|
+
* A pie chart, or a doughnut with `innerRadius`: one slice per value, sized by its share of
|
|
111
|
+
* the total, separated by a thin background-coloured outline. Draws in scene units; nothing is
|
|
112
|
+
* drawn if every value is 0. The slices are one path batch (`event.item` is the slice's place
|
|
113
|
+
* among the drawn ones). See {@link pieSlices} for the angle math alone.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* import { pieChart } from "@sophistry/charts";
|
|
118
|
+
*
|
|
119
|
+
* pieChart.create({
|
|
120
|
+
* data: [
|
|
121
|
+
* { lang: "Rust", share: 3 },
|
|
122
|
+
* { lang: "Go", share: 2 },
|
|
123
|
+
* ],
|
|
124
|
+
* value: "share",
|
|
125
|
+
* label: "lang",
|
|
126
|
+
* innerRadius: 0.4,
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#pie-polar-area-and-radar
|
|
131
|
+
* @category Charts
|
|
132
|
+
*/
|
|
133
|
+
export declare const pieChart: import("@sophistry/core").Definition<PieChartBaseProps<any>, import("@sophistry/core/internal").CompositeNode<PieChartBaseProps<any>>, keyof PieChartBaseProps<any>>;
|
|
134
|
+
/** Both ends' ring orders. */
|
|
135
|
+
export interface RingOrders {
|
|
136
|
+
from: readonly BandKey[];
|
|
137
|
+
to: readonly BandKey[];
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The ring order at each end: one order unless the keys both ends have are
|
|
141
|
+
* reordered. Memoise it on the join (kept by identity while the keys hold).
|
|
142
|
+
*/
|
|
143
|
+
export declare function ringOrders(join: KeyedJoin | undefined, keys: readonly BandKey[]): RingOrders;
|
|
144
|
+
//# sourceMappingURL=pie-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pie-chart.d.ts","sourceRoot":"","sources":["../../src/radial/pie-chart.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACX,UAAU,EAMV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAU9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,KAAK,EAAY,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAsB7E,uBAAuB;AACvB,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAC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IAChB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAClD,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AA0NpC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,QAAQ,sKA2DnB,CAAC;AAEH,8BAA8B;AAC9B,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IACzB,EAAE,EAAE,SAAS,OAAO,EAAE,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACzB,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,IAAI,EAAE,SAAS,OAAO,EAAE,GACtB,UAAU,CAKZ"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `polarAreaChart`: a rose of equal-angle wedges whose radius carries the
|
|
3
|
+
* value.
|
|
4
|
+
*
|
|
5
|
+
* The wedges draw as one path batch (each item the native outline of a
|
|
6
|
+
* `sector`, with its own fill); per-wedge picking and accessible names
|
|
7
|
+
* go through its items. Wedge labels stay `label` nodes. Inside a chart the
|
|
8
|
+
* layer reports its series (for the legend) and its transition (for the
|
|
9
|
+
* staging); it fits no axes.
|
|
10
|
+
*/
|
|
11
|
+
import type { ColorInput } from "@sophistry/core";
|
|
12
|
+
import type { BandKey, Point } from "@sophistry/core/geometry";
|
|
13
|
+
import type { Channel, ColorChannel, RequiredUnless } from "../data/channels";
|
|
14
|
+
import type { KeyedTransitionProps, RevealProps } from "../props";
|
|
15
|
+
/** @category Charts */
|
|
16
|
+
export interface PolarAreaChartBaseProps<T> extends KeyedTransitionProps<T>, RevealProps {
|
|
17
|
+
/** One wedge per datum. */
|
|
18
|
+
data: readonly T[];
|
|
19
|
+
/**
|
|
20
|
+
* The wedge's value, in data units. Defaults to the datum when `data` is `number[]`; required
|
|
21
|
+
* otherwise. Negative and non-finite values count as 0 (an empty wedge).
|
|
22
|
+
*/
|
|
23
|
+
value?: Channel<T, number>;
|
|
24
|
+
/**
|
|
25
|
+
* The wedge's visible label. Omitted, a rounded percentage. See `ariaLabel` for the accessible
|
|
26
|
+
* name.
|
|
27
|
+
*/
|
|
28
|
+
label?: Channel<T, string>;
|
|
29
|
+
/**
|
|
30
|
+
* The chart's accessible name; each wedge is announced as `"<ariaLabel>: <wedge label>"`.
|
|
31
|
+
* Omitted, wedges are not exposed to assistive technology.
|
|
32
|
+
*/
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
/** Centre of the chart. Defaults to the origin. */
|
|
35
|
+
center?: Point;
|
|
36
|
+
/**
|
|
37
|
+
* Radius a value of `maxValue` reaches.
|
|
38
|
+
* @default 1
|
|
39
|
+
*/
|
|
40
|
+
radius?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The value that reaches `radius`. Pin it to keep the scale fixed as `data` changes. Defaults
|
|
43
|
+
* to the greatest value in `data`.
|
|
44
|
+
*/
|
|
45
|
+
maxValue?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Angle the first wedge begins at, in radians from +x. The default is 12 o'clock.
|
|
48
|
+
* @default Math.PI / 2
|
|
49
|
+
*/
|
|
50
|
+
startAngle?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Whether wedges run clockwise.
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
55
|
+
clockwise?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Reveal, 0..1: one sweep round the chart from `startAngle`, uncovering wedges in data order.
|
|
58
|
+
* @default 1
|
|
59
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
60
|
+
*/
|
|
61
|
+
progress?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Fraction of the reveal spent staggering wedge after wedge, 0..0.95; 0 opens every wedge
|
|
64
|
+
* together. Defaults to one continuous sweep, `(n − 1) / n`.
|
|
65
|
+
*/
|
|
66
|
+
stagger?: number;
|
|
67
|
+
/**
|
|
68
|
+
* The category of each wedge: colours wedges through the chart's shared colour scale and
|
|
69
|
+
* legend. `color` and `colors` win.
|
|
70
|
+
*/
|
|
71
|
+
series?: Channel<T, BandKey>;
|
|
72
|
+
/** One colour for every wedge, or `(d, i) => colour`. Wins over `colors` and `series`. */
|
|
73
|
+
color?: ColorChannel<T>;
|
|
74
|
+
/**
|
|
75
|
+
* Colours cycled across the wedges by index. Wins over `series`. Defaults to the `series`
|
|
76
|
+
* colours, else the theme's categorical colours.
|
|
77
|
+
*/
|
|
78
|
+
colors?: readonly ColorInput[];
|
|
79
|
+
/**
|
|
80
|
+
* Whether to draw wedge labels.
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
labels?: boolean;
|
|
84
|
+
/** Label font size. */
|
|
85
|
+
labelFontSize?: number;
|
|
86
|
+
/** Label colour. Defaults to the theme background. */
|
|
87
|
+
labelColor?: ColorInput;
|
|
88
|
+
/**
|
|
89
|
+
* Each wedge's identity across transitions. See {@link KeyedTransitionProps}. Defaults to
|
|
90
|
+
* `label`, else the place within its `series`, else the index.
|
|
91
|
+
*/
|
|
92
|
+
key?: Channel<T, BandKey>;
|
|
93
|
+
/**
|
|
94
|
+
* The data to transition to, matched to `data` by `key`: wedges reach out or draw in to their
|
|
95
|
+
* new value; leaving wedges narrow away and new ones open up as the rest make room. See {@link
|
|
96
|
+
* KeyedTransitionProps}.
|
|
97
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
98
|
+
*/
|
|
99
|
+
to?: readonly T[];
|
|
100
|
+
/** Wedge outline. Defaults to the theme background. */
|
|
101
|
+
stroke?: ColorInput;
|
|
102
|
+
/**
|
|
103
|
+
* Outline width.
|
|
104
|
+
* @default 0.02
|
|
105
|
+
*/
|
|
106
|
+
strokeWidth?: number;
|
|
107
|
+
/** Fill opacity of the wedges, 0..1. */
|
|
108
|
+
fillOpacity?: number;
|
|
109
|
+
/** Paint order. */
|
|
110
|
+
zIndex?: number;
|
|
111
|
+
/** Set to false to hide the chart. */
|
|
112
|
+
visible?: boolean;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Props of {@link polarAreaChart}: `value` is required unless `data` is `number[]`.
|
|
116
|
+
*
|
|
117
|
+
* @category Charts
|
|
118
|
+
*/
|
|
119
|
+
export type PolarAreaChartProps<T> = PolarAreaChartBaseProps<T> & RequiredUnless<T, number, "value">;
|
|
120
|
+
/**
|
|
121
|
+
* A polar area (rose) chart: wedges of equal angle whose radius carries the value, linear
|
|
122
|
+
* against `maxValue`. Draws in scene units; zero-value wedges are skipped. The wedges are one
|
|
123
|
+
* path batch. See {@link polarAreaSlices} for the wedge math alone.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* import { polarAreaChart } from "@sophistry/charts";
|
|
128
|
+
*
|
|
129
|
+
* polarAreaChart.create({ data: [4, 2, 3, 1], labels: false, stagger: 0.4 });
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#pie-polar-area-and-radar
|
|
133
|
+
* @category Charts
|
|
134
|
+
*/
|
|
135
|
+
export declare const polarAreaChart: import("@sophistry/core").Definition<PolarAreaChartBaseProps<any>, import("@sophistry/core/internal").CompositeNode<PolarAreaChartBaseProps<any>>, keyof PolarAreaChartBaseProps<any>>;
|
|
136
|
+
//# sourceMappingURL=polar-area-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polar-area-chart.d.ts","sourceRoot":"","sources":["../../src/radial/polar-area-chart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACX,UAAU,EAMV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAS/D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,E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E,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC1B;;;;;OAKG;IACH,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;IAClB,uDAAuD;IACvD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,GAC9D,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AA2UpC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,wLAiEzB,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `radarChart`: one polygon per series on evenly spaced axes, over a grid of
|
|
3
|
+
* rings and spokes, with axis names outside.
|
|
4
|
+
*
|
|
5
|
+
* The series polygons draw as one path batch (each item a series' outline
|
|
6
|
+
* with its own fill and stroke colour; fill opacity and stroke width
|
|
7
|
+
* shared). Under `reveal="sweep"` the clip groups are one wedge that
|
|
8
|
+
* clips every series while the series' reveal plays, and a series coming or
|
|
9
|
+
* going (each series, under a staggered sweep) is clipped to its own wedge
|
|
10
|
+
* inside it. A path batch has one clip, so the series split into runs, each
|
|
11
|
+
* run a batch under its own pair of groups: one run (one batch) when no
|
|
12
|
+
* series has a wedge of its own. The grid rings and spokes stay
|
|
13
|
+
* `polygon` / `line` nodes: they reveal by tracing their stroke
|
|
14
|
+
* (`progress`), which a path batch does not do per item, and there are a
|
|
15
|
+
* handful of them. Axis names are `label` nodes.
|
|
16
|
+
*/
|
|
17
|
+
import type { ColorInput } from "@sophistry/core";
|
|
18
|
+
import type { BandKey, ClosedCurveKind, Point } from "@sophistry/core/geometry";
|
|
19
|
+
import type { Channel, ColorChannel, RequiredUnless } from "../data/channels";
|
|
20
|
+
import type { KeyedTransitionProps, RadialReveal, RevealProps, StaggerOrder } from "../props";
|
|
21
|
+
/** @category Charts */
|
|
22
|
+
export interface RadarChartBaseProps<T> extends KeyedTransitionProps<T>, RevealProps {
|
|
23
|
+
/** One polygon per datum (a series), all read against the same axes and `maxValue`. */
|
|
24
|
+
data: readonly T[];
|
|
25
|
+
/**
|
|
26
|
+
* The series' value on each axis, one entry per axis. Defaults to the datum when `data` is
|
|
27
|
+
* `number[][]`; required otherwise.
|
|
28
|
+
*/
|
|
29
|
+
axisValues?: Channel<T, readonly number[]>;
|
|
30
|
+
/**
|
|
31
|
+
* One name per axis, drawn outside the rings; when given, every non-empty group must have
|
|
32
|
+
* exactly that many values or the chart throws. `false` draws no names; `true` draws them even
|
|
33
|
+
* when only `toAxisLabels` names the axes.
|
|
34
|
+
*/
|
|
35
|
+
axisLabels?: boolean | readonly string[];
|
|
36
|
+
/** Centre of the chart. Defaults to the origin. */
|
|
37
|
+
center?: Point;
|
|
38
|
+
/**
|
|
39
|
+
* Radius a value of `maxValue` reaches.
|
|
40
|
+
* @default 1
|
|
41
|
+
*/
|
|
42
|
+
radius?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The value that reaches `radius`. Pin it to keep the scale fixed as `data` changes. Defaults
|
|
45
|
+
* to the greatest value across every series.
|
|
46
|
+
*/
|
|
47
|
+
maxValue?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Angle of the first axis, in radians from +x. The default is 12 o'clock.
|
|
50
|
+
* @default Math.PI / 2
|
|
51
|
+
*/
|
|
52
|
+
startAngle?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Whether axes run clockwise.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
clockwise?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The category of each polygon: colours polygons through the chart's shared colour scale and
|
|
60
|
+
* legend. `color` and `colors` win.
|
|
61
|
+
*/
|
|
62
|
+
series?: Channel<T, BandKey>;
|
|
63
|
+
/**
|
|
64
|
+
* Each polygon's identity across data changes and transitions. See {@link
|
|
65
|
+
* KeyedTransitionProps}. Defaults to the datum's place within its `series`, else its index.
|
|
66
|
+
*/
|
|
67
|
+
key?: Channel<T, BandKey>;
|
|
68
|
+
/** One colour for every series, or `(d, i) => colour`. Wins over `colors` and `series`. */
|
|
69
|
+
color?: ColorChannel<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Colours cycled across the series by index. Wins over `series`. Defaults to the `series`
|
|
72
|
+
* colours, else the theme's categorical colours.
|
|
73
|
+
*/
|
|
74
|
+
colors?: readonly ColorInput[];
|
|
75
|
+
/**
|
|
76
|
+
* Fill opacity of each polygon.
|
|
77
|
+
* @default 0.25
|
|
78
|
+
*/
|
|
79
|
+
fillOpacity?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Outline width of each polygon.
|
|
82
|
+
* @default 0.02
|
|
83
|
+
*/
|
|
84
|
+
strokeWidth?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Number of concentric grid rings under the data.
|
|
87
|
+
* @default 4
|
|
88
|
+
*/
|
|
89
|
+
gridRings?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Whether to draw the grid rings and spokes.
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
grid?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Axis name font size.
|
|
97
|
+
* @default 0.28
|
|
98
|
+
*/
|
|
99
|
+
labelFontSize?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Space between the outer ring and each axis name, which is anchored by its side facing the
|
|
102
|
+
* chart.
|
|
103
|
+
* @default 0.12
|
|
104
|
+
*/
|
|
105
|
+
labelGap?: number;
|
|
106
|
+
/** Colour of the grid rings and spokes. Defaults to the theme's grid colour. */
|
|
107
|
+
gridColor?: ColorInput;
|
|
108
|
+
/**
|
|
109
|
+
* Reveal, 0..1: grid and names first, then the series, which grow out of the centre
|
|
110
|
+
* (`reveal="grow"`) or are uncovered by a clockwise sweep (`"sweep"`).
|
|
111
|
+
* @default 1
|
|
112
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
113
|
+
*/
|
|
114
|
+
progress?: number;
|
|
115
|
+
reveal?: RadialReveal;
|
|
116
|
+
/**
|
|
117
|
+
* How each polygon runs between vertices: `"linear"` straight edges or `"catmull-rom"` a smooth
|
|
118
|
+
* closed spline. The grid stays polygonal.
|
|
119
|
+
* @default "linear"
|
|
120
|
+
*/
|
|
121
|
+
curve?: ClosedCurveKind;
|
|
122
|
+
/**
|
|
123
|
+
* Fraction of the series' reveal spent staggering polygon after polygon in data order, 0..0.95.
|
|
124
|
+
* @default 0
|
|
125
|
+
*/
|
|
126
|
+
stagger?: number;
|
|
127
|
+
/**
|
|
128
|
+
* The order `stagger` and `enterStagger` take. See {@link StaggerOrder}.
|
|
129
|
+
* @default "position"
|
|
130
|
+
*/
|
|
131
|
+
staggerOrder?: StaggerOrder;
|
|
132
|
+
/**
|
|
133
|
+
* The data to transition to, matched to `data` by `key`: each vertex moves along its axis to
|
|
134
|
+
* its new value. Axes are joined by name (`axisLabels`/`toAxisLabels`), else by position; axes
|
|
135
|
+
* that come and go fold in and out. See {@link KeyedTransitionProps}.
|
|
136
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
137
|
+
*/
|
|
138
|
+
to?: readonly T[];
|
|
139
|
+
/** `to`'s axis names, one per value of each `to` group. Defaults to `axisLabels`. */
|
|
140
|
+
toAxisLabels?: readonly string[];
|
|
141
|
+
/** Paint order. */
|
|
142
|
+
zIndex?: number;
|
|
143
|
+
/** Set to false to hide the chart. */
|
|
144
|
+
visible?: boolean;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Props of {@link radarChart}: `axisValues` is required unless `data` is `number[][]`.
|
|
148
|
+
*
|
|
149
|
+
* @category Charts
|
|
150
|
+
*/
|
|
151
|
+
export type RadarChartProps<T> = RadarChartBaseProps<T> & RequiredUnless<T, readonly number[], "axisValues">;
|
|
152
|
+
/**
|
|
153
|
+
* A radar (spider) chart: one polygon per series, its values on evenly spaced axes around a
|
|
154
|
+
* full turn, over a grid of rings and spokes. Draws in scene units; needs at least 3 axes.
|
|
155
|
+
* Pass `maxValue` when the data can change, so the scale stays fixed. The polygons are one
|
|
156
|
+
* path batch.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* import { radarChart } from "@sophistry/charts";
|
|
161
|
+
*
|
|
162
|
+
* radarChart.create({
|
|
163
|
+
* data: [
|
|
164
|
+
* { team: "a", v: [3, 4, 5, 2] },
|
|
165
|
+
* { team: "b", v: [4, 2, 3, 5] },
|
|
166
|
+
* ],
|
|
167
|
+
* axisValues: "v",
|
|
168
|
+
* series: "team",
|
|
169
|
+
* axisLabels: ["Speed", "Power", "Range", "Cost"],
|
|
170
|
+
* });
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#pie-polar-area-and-radar
|
|
174
|
+
* @category Charts
|
|
175
|
+
*/
|
|
176
|
+
export declare const radarChart: import("@sophistry/core").Definition<RadarChartBaseProps<any>, import("@sophistry/core/internal").CompositeNode<RadarChartBaseProps<any>>, keyof RadarChartBaseProps<any>>;
|
|
177
|
+
//# sourceMappingURL=radar-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radar-chart.d.ts","sourceRoot":"","sources":["../../src/radial/radar-chart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACX,UAAU,EAQV,MAAM,iBAAiB,CAAC;AAUzB,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAUhF,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAA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AC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;OAKG;IACH,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC;IAClB,qFAAqF;IACrF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,GACtD,cAAc,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,YAAY,CAAC,CAAC;AAwjBpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,4KA6FrB,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `radialBarChart`: concentric ring bars, one per datum, the first outermost.
|
|
3
|
+
*
|
|
4
|
+
* Two path batches: the faint full-length tracks (one shared paint, faded in
|
|
5
|
+
* together) and the value arcs (each its own fill; hover, taps, tooltips
|
|
6
|
+
* and accessible names per ring through `event.item` and `itemLabel`). Ring
|
|
7
|
+
* names stay `label` nodes.
|
|
8
|
+
*/
|
|
9
|
+
import type { ColorInput } from "@sophistry/core";
|
|
10
|
+
import type { BandKey, Point } from "@sophistry/core/geometry";
|
|
11
|
+
import type { Channel, ColorChannel, RequiredUnless } from "../data/channels";
|
|
12
|
+
import type { TooltipSpec } from "../tooltip";
|
|
13
|
+
/** @category Charts */
|
|
14
|
+
export interface RadialBarChartBaseProps<T> {
|
|
15
|
+
/** One ring per datum, the first outermost. */
|
|
16
|
+
data: readonly T[];
|
|
17
|
+
/**
|
|
18
|
+
* The ring's value. Defaults to the datum when `data` is `number[]`; required otherwise.
|
|
19
|
+
* Negative and non-finite values count as 0 (an empty ring).
|
|
20
|
+
*/
|
|
21
|
+
value?: Channel<T, number>;
|
|
22
|
+
/** The ring's name, written at its start. */
|
|
23
|
+
label?: Channel<T, string>;
|
|
24
|
+
/**
|
|
25
|
+
* The value that fills a ring's whole `sweep`; larger values are drawn full. Defaults to the
|
|
26
|
+
* greatest value.
|
|
27
|
+
*/
|
|
28
|
+
maxValue?: number;
|
|
29
|
+
/** Centre of the chart. Defaults to the origin. */
|
|
30
|
+
center?: Point;
|
|
31
|
+
/**
|
|
32
|
+
* Outer radius of the outermost ring.
|
|
33
|
+
* @default 1
|
|
34
|
+
*/
|
|
35
|
+
radius?: number;
|
|
36
|
+
/** Inner radius of the innermost ring. Defaults to 0.3 × `radius`. */
|
|
37
|
+
innerRadius?: number;
|
|
38
|
+
/** Gap between rings. Defaults to a quarter of a ring's width. */
|
|
39
|
+
ringGap?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Radians a ring of `maxValue` turns through, clockwise from 12 o'clock. The default, 270°,
|
|
42
|
+
* leaves the top-left quadrant for labels.
|
|
43
|
+
* @default 3 * Math.PI / 2
|
|
44
|
+
*/
|
|
45
|
+
sweep?: number;
|
|
46
|
+
/**
|
|
47
|
+
* The category of each ring: colours rings through the chart's shared colour scale and legend.
|
|
48
|
+
* `color` and `colors` win.
|
|
49
|
+
*/
|
|
50
|
+
series?: Channel<T, BandKey>;
|
|
51
|
+
/** One colour for every ring, or `(d, i) => colour`. Wins over `colors` and `series`. */
|
|
52
|
+
color?: ColorChannel<T>;
|
|
53
|
+
/**
|
|
54
|
+
* Colours cycled across the rings by index. Wins over `series`. Defaults to the `series`
|
|
55
|
+
* colours, else the theme's categorical colours.
|
|
56
|
+
*/
|
|
57
|
+
colors?: readonly ColorInput[];
|
|
58
|
+
/**
|
|
59
|
+
* Colour of the faint full-length track behind each ring. Defaults to the theme's grid colour.
|
|
60
|
+
*/
|
|
61
|
+
trackColor?: ColorInput;
|
|
62
|
+
/**
|
|
63
|
+
* Write each ring's `label` at its start.
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
labels?: boolean;
|
|
67
|
+
/** Label font size. Defaults to 0.7 × a ring's width, at most 0.26. */
|
|
68
|
+
labelFontSize?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Reveal, 0..1: tracks and labels fade in, then each ring sweeps clockwise, outermost first.
|
|
71
|
+
* @default 1
|
|
72
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
73
|
+
*/
|
|
74
|
+
progress?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Fraction of the bars' reveal spent staggering ring after ring, outer to inner, 0..0.95.
|
|
77
|
+
* @default 0.3
|
|
78
|
+
*/
|
|
79
|
+
stagger?: number;
|
|
80
|
+
/** Hover tooltip: `true` for "label: value", or `(d, i) => string`. */
|
|
81
|
+
tooltip?: TooltipSpec<T>;
|
|
82
|
+
/** Paint order; higher draws later. */
|
|
83
|
+
zIndex?: number;
|
|
84
|
+
visible?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Props of {@link radialBarChart}: `value` is required unless `data` is `number[]`.
|
|
88
|
+
*
|
|
89
|
+
* @category Charts
|
|
90
|
+
*/
|
|
91
|
+
export type RadialBarChartProps<T> = RadialBarChartBaseProps<T> & RequiredUnless<T, number, "value">;
|
|
92
|
+
/**
|
|
93
|
+
* Concentric ring bars: a bar chart bent round a centre, one ring per datum (the first
|
|
94
|
+
* outermost), each arc its value over `maxValue`. Outer rings are longer at the same value, so
|
|
95
|
+
* compare angles, not lengths. Draws in scene units; needs no `chart`.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* import { radialBarChart } from "@sophistry/charts";
|
|
100
|
+
*
|
|
101
|
+
* radialBarChart.create({
|
|
102
|
+
* data: [
|
|
103
|
+
* { goal: "Move", pct: 80 },
|
|
104
|
+
* { goal: "Stand", pct: 50 },
|
|
105
|
+
* ],
|
|
106
|
+
* value: "pct",
|
|
107
|
+
* label: "goal",
|
|
108
|
+
* maxValue: 100,
|
|
109
|
+
* tooltip: true,
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#gauges-bullets-waffles-mosaics-and-radial-bars
|
|
114
|
+
* @category Charts
|
|
115
|
+
*/
|
|
116
|
+
export declare const radialBarChart: import("@sophistry/core").Definition<RadialBarChartBaseProps<any>, import("@sophistry/core/internal").CompositeNode<RadialBarChartBaseProps<any>>, keyof RadialBarChartBaseProps<any>>;
|
|
117
|
+
//# sourceMappingURL=radial-bar-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radial-bar-chart.d.ts","sourceRoot":"","sources":["../../src/radial/radial-bar-chart.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,UAAU,EAMV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAW/D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAY9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAsB9C,uBAAuB;AACvB,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACzC,+CAA+C;IAC/C,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3B,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@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers shared by the radial charts (pie, polar area, radar, radial bars,
|
|
3
|
+
* gauge, chord, waffle): wedge outlines as path batch items, a per-key item
|
|
4
|
+
* cache (so an unchanged wedge keeps its prepared outline), keyed label
|
|
5
|
+
* lists, the far end's colour scale across a keyed transition, and the
|
|
6
|
+
* standalone tooltip state. Internal to the family.
|
|
7
|
+
*/
|
|
8
|
+
import type { CompositeContext, LabelProps, PathBatchItem, SceneNode } from "@sophistry/core";
|
|
9
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
10
|
+
import type { OrdinalColorScale } from "../math/ordinal";
|
|
11
|
+
import type { Category } from "../series";
|
|
12
|
+
import type { TooltipState } from "../tooltip";
|
|
13
|
+
/** Smallest sweep worth drawing, in radians: what `sector` and `annularSector` skip. */
|
|
14
|
+
export declare const NO_SWEEP = 1e-9;
|
|
15
|
+
/** What a wedge's outline is made from. */
|
|
16
|
+
export interface WedgeShape {
|
|
17
|
+
cx: number;
|
|
18
|
+
cy: number;
|
|
19
|
+
/** 0 for a plain pie slice (`sector`), else a ring slice (`annularSector`). */
|
|
20
|
+
innerRadius: number;
|
|
21
|
+
outerRadius: number;
|
|
22
|
+
startAngle: number;
|
|
23
|
+
/** Signed sweep, radians; positive is counter-clockwise. */
|
|
24
|
+
angle: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A wedge as a path batch item: the same native curve geometry `sector` (no
|
|
28
|
+
* hole) or `annularSector` (a hole) build, so each item outlines exactly
|
|
29
|
+
* what the per-datum shape does. Undefined when the sweep is too small
|
|
30
|
+
* to draw (as those shapes draw nothing).
|
|
31
|
+
*
|
|
32
|
+
* @param annular - Draw a ring slice even when `innerRadius` is 0.
|
|
33
|
+
*/
|
|
34
|
+
export declare function wedgeItem(shape: WedgeShape, paints: Omit<PathBatchItem, "closed" | "polylines" | "curvePaths">, annular?: boolean): PathBatchItem | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* A per-key cache of path batch items: hands back last update's item while
|
|
37
|
+
* its inputs are equal (shallowly), so the batch reuses its prepared outline.
|
|
38
|
+
* Call `sweep()` after an update to forget keys that were not asked for.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createItemCache<I>(): {
|
|
41
|
+
get(key: unknown, inputs: readonly unknown[], make: () => I): I;
|
|
42
|
+
sweep(): void;
|
|
43
|
+
};
|
|
44
|
+
/** One label of a keyed list: its key and the label's props. */
|
|
45
|
+
export interface KeyedLabel {
|
|
46
|
+
key: unknown;
|
|
47
|
+
props: LabelProps;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Keyed `label` nodes for one list (`slot`): a node per key, created once
|
|
51
|
+
* and updated in place (equal values are no-ops on the node), disposed when
|
|
52
|
+
* its key leaves.
|
|
53
|
+
*/
|
|
54
|
+
export declare function labelList<P>(ctx: CompositeContext<P>, slot: string, labels: readonly KeyedLabel[]): SceneNode[];
|
|
55
|
+
/**
|
|
56
|
+
* The colour scale `to`'s series colour through, across a keyed transition:
|
|
57
|
+
* the chart's shared scale inside a chart (`own`), else one over `to`'s own
|
|
58
|
+
* categories, as its plain chart has. Call once, in
|
|
59
|
+
* `setup`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createFarScale(): (inChart: boolean, toOf: readonly Category[] | undefined, own: OrdinalColorScale, theme: Theme) => OrdinalColorScale;
|
|
62
|
+
/**
|
|
63
|
+
* The tooltip a standalone radial chart shows through: the enclosing
|
|
64
|
+
* chart's, else its own. Call once,
|
|
65
|
+
* in `setup`, and read the result in each `update`.
|
|
66
|
+
*
|
|
67
|
+
* Outside a chart the state is kept (handlers, accessible names, the item
|
|
68
|
+
* walked by the keys) and `overlay(ctx)` returns the panel drawing it, a
|
|
69
|
+
* {@link tooltipOverlay} bound to the scene's pointer and view: append it to the composite's children. Inside a
|
|
70
|
+
* chart it returns nothing, the frame's overlay draws the tooltip.
|
|
71
|
+
*/
|
|
72
|
+
export declare function createOwnTooltip(): OwnTooltip;
|
|
73
|
+
/** What {@link createOwnTooltip} returns: the state, and its standalone panel. */
|
|
74
|
+
export interface OwnTooltip {
|
|
75
|
+
<P>(ctx: CompositeContext<P>): TooltipState;
|
|
76
|
+
/** The panel to append to the children outside a chart; empty inside one. */
|
|
77
|
+
overlay<P>(ctx: CompositeContext<P>): SceneNode[];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=shared.d.ts.map
|