@sophistry/charts 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +32 -2
- package/dist/3d/bar-chart3d.d.ts +56 -0
- package/dist/3d/bar-chart3d.d.ts.map +1 -0
- package/dist/3d/definitions.d.ts +38 -0
- package/dist/3d/definitions.d.ts.map +1 -0
- package/dist/3d/definitions.js +14 -0
- package/dist/3d/forward.d.ts +65 -0
- package/dist/3d/forward.d.ts.map +1 -0
- package/dist/3d/index.d.ts +31 -0
- package/dist/3d/index.d.ts.map +1 -0
- package/dist/3d/index.js +1 -0
- package/dist/3d/quiver3d.d.ts +53 -0
- package/dist/3d/quiver3d.d.ts.map +1 -0
- package/dist/3d/scatter3d.d.ts +45 -0
- package/dist/3d/scatter3d.d.ts.map +1 -0
- package/dist/3d/stem3d.d.ts +46 -0
- package/dist/3d/stem3d.d.ts.map +1 -0
- package/dist/3d/surface-grid3d.d.ts +34 -0
- package/dist/3d/surface-grid3d.d.ts.map +1 -0
- package/dist/3d/tri-surface3d.d.ts +46 -0
- package/dist/3d/tri-surface3d.d.ts.map +1 -0
- package/dist/3d/voxels3d.d.ts +26 -0
- package/dist/3d/voxels3d.d.ts.map +1 -0
- package/dist/3d/wireframe3d.d.ts +31 -0
- package/dist/3d/wireframe3d.d.ts.map +1 -0
- package/dist/band.d.ts +21 -0
- package/dist/band.d.ts.map +1 -0
- package/dist/bars/bar-chart.d.ts +144 -0
- package/dist/bars/bar-chart.d.ts.map +1 -0
- package/dist/bars/bar-labels.d.ts +117 -0
- package/dist/bars/bar-labels.d.ts.map +1 -0
- package/dist/bars/bars.d.ts +224 -0
- package/dist/bars/bars.d.ts.map +1 -0
- package/dist/bars/bullet.d.ts +158 -0
- package/dist/bars/bullet.d.ts.map +1 -0
- package/dist/bars/candlestick.d.ts +98 -0
- package/dist/bars/candlestick.d.ts.map +1 -0
- package/dist/bars/funnel.d.ts +91 -0
- package/dist/bars/funnel.d.ts.map +1 -0
- package/dist/bars/histogram.d.ts +109 -0
- package/dist/bars/histogram.d.ts.map +1 -0
- package/dist/bars/index.d.ts +23 -0
- package/dist/bars/index.d.ts.map +1 -0
- package/dist/bars/race.d.ts +29 -0
- package/dist/bars/race.d.ts.map +1 -0
- package/dist/bars/rules.d.ts +122 -0
- package/dist/bars/rules.d.ts.map +1 -0
- package/dist/bars/shared.d.ts +42 -0
- package/dist/bars/shared.d.ts.map +1 -0
- package/dist/bars/transforms.d.ts +250 -0
- package/dist/bars/transforms.d.ts.map +1 -0
- package/dist/bars/waterfall.d.ts +107 -0
- package/dist/bars/waterfall.d.ts.map +1 -0
- package/dist/batch.d.ts +143 -0
- package/dist/batch.d.ts.map +1 -0
- package/dist/channels-_Xf-p6Lx.js +56 -0
- package/dist/chart.d.ts +88 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/color-norm.d.ts +91 -0
- package/dist/color-norm.d.ts.map +1 -0
- package/dist/context.d.ts +112 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/curves/density.d.ts +126 -0
- package/dist/curves/density.d.ts.map +1 -0
- package/dist/curves/ecdf.d.ts +73 -0
- package/dist/curves/ecdf.d.ts.map +1 -0
- package/dist/curves/fill-between.d.ts +101 -0
- package/dist/curves/fill-between.d.ts.map +1 -0
- package/dist/curves/index.d.ts +16 -0
- package/dist/curves/index.d.ts.map +1 -0
- package/dist/curves/line-plot.d.ts +105 -0
- package/dist/curves/line-plot.d.ts.map +1 -0
- package/dist/curves/regression.d.ts +125 -0
- package/dist/curves/regression.d.ts.map +1 -0
- package/dist/curves/shared.d.ts +53 -0
- package/dist/curves/shared.d.ts.map +1 -0
- package/dist/curves/stack-plot.d.ts +141 -0
- package/dist/curves/stack-plot.d.ts.map +1 -0
- package/dist/curves/stairs.d.ts +171 -0
- package/dist/curves/stairs.d.ts.map +1 -0
- package/dist/data/channels.d.ts +171 -0
- package/dist/data/channels.d.ts.map +1 -0
- package/dist/end-space.d.ts +82 -0
- package/dist/end-space.d.ts.map +1 -0
- package/dist/entries/definitions.d.ts +21 -0
- package/dist/entries/definitions.d.ts.map +1 -0
- package/dist/entries/definitions.js +6 -0
- package/dist/frame/band-axis.d.ts +43 -0
- package/dist/frame/band-axis.d.ts.map +1 -0
- package/dist/frame/coords.d.ts +112 -0
- package/dist/frame/coords.d.ts.map +1 -0
- package/dist/frame/fit.d.ts +171 -0
- package/dist/frame/fit.d.ts.map +1 -0
- package/dist/frame/format.d.ts +41 -0
- package/dist/frame/format.d.ts.map +1 -0
- package/dist/frame/guide-metrics.d.ts +37 -0
- package/dist/frame/guide-metrics.d.ts.map +1 -0
- package/dist/frame/guides.d.ts +68 -0
- package/dist/frame/guides.d.ts.map +1 -0
- package/dist/frame/keys.d.ts +97 -0
- package/dist/frame/keys.d.ts.map +1 -0
- package/dist/frame/layout.d.ts +146 -0
- package/dist/frame/layout.d.ts.map +1 -0
- package/dist/frame/registry.d.ts +32 -0
- package/dist/frame/registry.d.ts.map +1 -0
- package/dist/frame/reports.d.ts +54 -0
- package/dist/frame/reports.d.ts.map +1 -0
- package/dist/frame/secondary-axes.d.ts +74 -0
- package/dist/frame/secondary-axes.d.ts.map +1 -0
- package/dist/frame/secondary.d.ts +57 -0
- package/dist/frame/secondary.d.ts.map +1 -0
- package/dist/frame/tooltip-overlay.d.ts +65 -0
- package/dist/frame/tooltip-overlay.d.ts.map +1 -0
- package/dist/frame/types.d.ts +659 -0
- package/dist/frame/types.d.ts.map +1 -0
- package/dist/grids/barbs.d.ts +52 -0
- package/dist/grids/barbs.d.ts.map +1 -0
- package/dist/grids/cell-rects.d.ts +38 -0
- package/dist/grids/cell-rects.d.ts.map +1 -0
- package/dist/grids/cells.d.ts +131 -0
- package/dist/grids/cells.d.ts.map +1 -0
- package/dist/grids/contour-f.d.ts +81 -0
- package/dist/grids/contour-f.d.ts.map +1 -0
- package/dist/grids/contour-shared.d.ts +54 -0
- package/dist/grids/contour-shared.d.ts.map +1 -0
- package/dist/grids/contour.d.ts +85 -0
- package/dist/grids/contour.d.ts.map +1 -0
- package/dist/grids/dendrogram.d.ts +105 -0
- package/dist/grids/dendrogram.d.ts.map +1 -0
- package/dist/grids/heatmap.d.ts +164 -0
- package/dist/grids/heatmap.d.ts.map +1 -0
- package/dist/grids/hex-bin.d.ts +94 -0
- package/dist/grids/hex-bin.d.ts.map +1 -0
- package/dist/grids/hist2d.d.ts +108 -0
- package/dist/grids/hist2d.d.ts.map +1 -0
- package/dist/grids/imshow.d.ts +85 -0
- package/dist/grids/imshow.d.ts.map +1 -0
- package/dist/grids/index.d.ts +27 -0
- package/dist/grids/index.d.ts.map +1 -0
- package/dist/grids/pcolormesh.d.ts +91 -0
- package/dist/grids/pcolormesh.d.ts.map +1 -0
- package/dist/grids/ramp-cells.d.ts +67 -0
- package/dist/grids/ramp-cells.d.ts.map +1 -0
- package/dist/grids/tri-contour.d.ts +121 -0
- package/dist/grids/tri-contour.d.ts.map +1 -0
- package/dist/grids/tri-shared.d.ts +62 -0
- package/dist/grids/tri-shared.d.ts.map +1 -0
- package/dist/grids/tripcolor.d.ts +74 -0
- package/dist/grids/tripcolor.d.ts.map +1 -0
- package/dist/guides/colorbar.d.ts +111 -0
- package/dist/guides/colorbar.d.ts.map +1 -0
- package/dist/guides/index.d.ts +12 -0
- package/dist/guides/index.d.ts.map +1 -0
- package/dist/guides/legend.d.ts +119 -0
- package/dist/guides/legend.d.ts.map +1 -0
- package/dist/guides/nodes.d.ts +14 -0
- package/dist/guides/nodes.d.ts.map +1 -0
- package/dist/guides/size-legend.d.ts +234 -0
- package/dist/guides/size-legend.d.ts.map +1 -0
- package/dist/hierarchy/breadcrumbs.d.ts +134 -0
- package/dist/hierarchy/breadcrumbs.d.ts.map +1 -0
- package/dist/hierarchy/circle-pack.d.ts +73 -0
- package/dist/hierarchy/circle-pack.d.ts.map +1 -0
- package/dist/hierarchy/drill.d.ts +246 -0
- package/dist/hierarchy/drill.d.ts.map +1 -0
- package/dist/hierarchy/frame.d.ts +68 -0
- package/dist/hierarchy/frame.d.ts.map +1 -0
- package/dist/hierarchy/icicle.d.ts +77 -0
- package/dist/hierarchy/icicle.d.ts.map +1 -0
- package/dist/hierarchy/index.d.ts +21 -0
- package/dist/hierarchy/index.d.ts.map +1 -0
- package/dist/hierarchy/labels.d.ts +25 -0
- package/dist/hierarchy/labels.d.ts.map +1 -0
- package/dist/hierarchy/mosaic.d.ts +131 -0
- package/dist/hierarchy/mosaic.d.ts.map +1 -0
- package/dist/hierarchy/own-tooltip.d.ts +13 -0
- package/dist/hierarchy/own-tooltip.d.ts.map +1 -0
- package/dist/hierarchy/props.d.ts +14 -0
- package/dist/hierarchy/props.d.ts.map +1 -0
- package/dist/hierarchy/sankey.d.ts +133 -0
- package/dist/hierarchy/sankey.d.ts.map +1 -0
- package/dist/hierarchy/shared.d.ts +248 -0
- package/dist/hierarchy/shared.d.ts.map +1 -0
- package/dist/hierarchy/sunburst.d.ts +75 -0
- package/dist/hierarchy/sunburst.d.ts.map +1 -0
- package/dist/hierarchy/tree.d.ts +125 -0
- package/dist/hierarchy/tree.d.ts.map +1 -0
- package/dist/hierarchy/treemap.d.ts +77 -0
- package/dist/hierarchy/treemap.d.ts.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/item-tooltip.d.ts +34 -0
- package/dist/item-tooltip.d.ts.map +1 -0
- package/dist/join.d.ts +224 -0
- package/dist/join.d.ts.map +1 -0
- package/dist/math/3d/bar3d.d.ts +28 -0
- package/dist/math/3d/bar3d.d.ts.map +1 -0
- package/dist/math/3d/quiver3d.d.ts +27 -0
- package/dist/math/3d/quiver3d.d.ts.map +1 -0
- package/dist/math/3d/scatter3d.d.ts +16 -0
- package/dist/math/3d/scatter3d.d.ts.map +1 -0
- package/dist/math/3d/stem3d.d.ts +23 -0
- package/dist/math/3d/stem3d.d.ts.map +1 -0
- package/dist/math/3d/surfaceGrid3d.d.ts +34 -0
- package/dist/math/3d/surfaceGrid3d.d.ts.map +1 -0
- package/dist/math/3d/trisurface.d.ts +12 -0
- package/dist/math/3d/trisurface.d.ts.map +1 -0
- package/dist/math/3d/voxels.d.ts +18 -0
- package/dist/math/3d/voxels.d.ts.map +1 -0
- package/dist/math/aggregate.d.ts +69 -0
- package/dist/math/aggregate.d.ts.map +1 -0
- package/dist/math/bar.d.ts +32 -0
- package/dist/math/bar.d.ts.map +1 -0
- package/dist/math/barLabels.d.ts +84 -0
- package/dist/math/barLabels.d.ts.map +1 -0
- package/dist/math/barbs.d.ts +37 -0
- package/dist/math/barbs.d.ts.map +1 -0
- package/dist/math/boxplot.d.ts +37 -0
- package/dist/math/boxplot.d.ts.map +1 -0
- package/dist/math/breadcrumbs.d.ts +129 -0
- package/dist/math/breadcrumbs.d.ts.map +1 -0
- package/dist/math/bubble.d.ts +39 -0
- package/dist/math/bubble.d.ts.map +1 -0
- package/dist/math/bullet.d.ts +111 -0
- package/dist/math/bullet.d.ts.map +1 -0
- package/dist/math/chord.d.ts +104 -0
- package/dist/math/chord.d.ts.map +1 -0
- package/dist/math/cluster.d.ts +89 -0
- package/dist/math/cluster.d.ts.map +1 -0
- package/dist/math/contour.d.ts +49 -0
- package/dist/math/contour.d.ts.map +1 -0
- package/dist/math/contourf.d.ts +51 -0
- package/dist/math/contourf.d.ts.map +1 -0
- package/dist/math/dodge.d.ts +37 -0
- package/dist/math/dodge.d.ts.map +1 -0
- package/dist/math/ecdf.d.ts +42 -0
- package/dist/math/ecdf.d.ts.map +1 -0
- package/dist/math/errorbar.d.ts +28 -0
- package/dist/math/errorbar.d.ts.map +1 -0
- package/dist/math/eventplot.d.ts +27 -0
- package/dist/math/eventplot.d.ts.map +1 -0
- package/dist/math/facet.d.ts +91 -0
- package/dist/math/facet.d.ts.map +1 -0
- package/dist/math/fillBetween.d.ts +29 -0
- package/dist/math/fillBetween.d.ts.map +1 -0
- package/dist/math/gauge.d.ts +72 -0
- package/dist/math/gauge.d.ts.map +1 -0
- package/dist/math/hexbin.d.ts +21 -0
- package/dist/math/hexbin.d.ts.map +1 -0
- package/dist/math/hierarchy.d.ts +180 -0
- package/dist/math/hierarchy.d.ts.map +1 -0
- package/dist/math/hierarchyJoin.d.ts +60 -0
- package/dist/math/hierarchyJoin.d.ts.map +1 -0
- package/dist/math/histogram.d.ts +37 -0
- package/dist/math/histogram.d.ts.map +1 -0
- package/dist/math/histogram2d.d.ts +45 -0
- package/dist/math/histogram2d.d.ts.map +1 -0
- package/dist/math/imshow.d.ts +27 -0
- package/dist/math/imshow.d.ts.map +1 -0
- package/dist/math/index.d.ts +140 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/math/index.js +3 -0
- package/dist/math/jitter.d.ts +17 -0
- package/dist/math/jitter.d.ts.map +1 -0
- package/dist/math/join.d.ts +136 -0
- package/dist/math/join.d.ts.map +1 -0
- package/dist/math/keyframes.d.ts +128 -0
- package/dist/math/keyframes.d.ts.map +1 -0
- package/dist/math/legend.d.ts +121 -0
- package/dist/math/legend.d.ts.map +1 -0
- package/dist/math/line.d.ts +54 -0
- package/dist/math/line.d.ts.map +1 -0
- package/dist/math/morph.d.ts +82 -0
- package/dist/math/morph.d.ts.map +1 -0
- package/dist/math/mosaic.d.ts +120 -0
- package/dist/math/mosaic.d.ts.map +1 -0
- package/dist/math/ordinal.d.ts +80 -0
- package/dist/math/ordinal.d.ts.map +1 -0
- package/dist/math/parallel.d.ts +39 -0
- package/dist/math/parallel.d.ts.map +1 -0
- package/dist/math/pcolormesh.d.ts +23 -0
- package/dist/math/pcolormesh.d.ts.map +1 -0
- package/dist/math/pie.d.ts +106 -0
- package/dist/math/pie.d.ts.map +1 -0
- package/dist/math/polarArea.d.ts +35 -0
- package/dist/math/polarArea.d.ts.map +1 -0
- package/dist/math/radar.d.ts +111 -0
- package/dist/math/radar.d.ts.map +1 -0
- package/dist/math/range.d.ts +99 -0
- package/dist/math/range.d.ts.map +1 -0
- package/dist/math/regression.d.ts +110 -0
- package/dist/math/regression.d.ts.map +1 -0
- package/dist/math/reveal.d.ts +64 -0
- package/dist/math/reveal.d.ts.map +1 -0
- package/dist/math/sankey.d.ts +155 -0
- package/dist/math/sankey.d.ts.map +1 -0
- package/dist/math/scatter.d.ts +15 -0
- package/dist/math/scatter.d.ts.map +1 -0
- package/dist/math/shared/binning.d.ts +24 -0
- package/dist/math/shared/binning.d.ts.map +1 -0
- package/dist/math/shared/gridCells.d.ts +42 -0
- package/dist/math/shared/gridCells.d.ts.map +1 -0
- package/dist/math/shared/gridExtent.d.ts +6 -0
- package/dist/math/shared/gridExtent.d.ts.map +1 -0
- package/dist/math/shared/pairs.d.ts +3 -0
- package/dist/math/shared/pairs.d.ts.map +1 -0
- package/dist/math/shared/polar.d.ts +24 -0
- package/dist/math/shared/polar.d.ts.map +1 -0
- package/dist/math/stack.d.ts +70 -0
- package/dist/math/stack.d.ts.map +1 -0
- package/dist/math/stackplot.d.ts +36 -0
- package/dist/math/stackplot.d.ts.map +1 -0
- package/dist/math/stairs.d.ts +18 -0
- package/dist/math/stairs.d.ts.map +1 -0
- package/dist/math/stem.d.ts +22 -0
- package/dist/math/stem.d.ts.map +1 -0
- package/dist/math/symbol.d.ts +26 -0
- package/dist/math/symbol.d.ts.map +1 -0
- package/dist/math/tree.d.ts +118 -0
- package/dist/math/tree.d.ts.map +1 -0
- package/dist/math/tricontour.d.ts +77 -0
- package/dist/math/tricontour.d.ts.map +1 -0
- package/dist/math/violin.d.ts +100 -0
- package/dist/math/violin.d.ts.map +1 -0
- package/dist/math/waffle.d.ts +49 -0
- package/dist/math/waffle.d.ts.map +1 -0
- package/dist/math/waterfall.d.ts +29 -0
- package/dist/math/waterfall.d.ts.map +1 -0
- package/dist/math-CSHNpGej.js +3648 -0
- package/dist/mix.d.ts +25 -0
- package/dist/mix.d.ts.map +1 -0
- package/dist/multiview/brush.d.ts +166 -0
- package/dist/multiview/brush.d.ts.map +1 -0
- package/dist/multiview/chart-group.d.ts +266 -0
- package/dist/multiview/chart-group.d.ts.map +1 -0
- package/dist/multiview/chart-link.d.ts +189 -0
- package/dist/multiview/chart-link.d.ts.map +1 -0
- package/dist/multiview/chart-zoom.d.ts +145 -0
- package/dist/multiview/chart-zoom.d.ts.map +1 -0
- package/dist/multiview/facet.d.ts +239 -0
- package/dist/multiview/facet.d.ts.map +1 -0
- package/dist/multiview/group-guides.d.ts +100 -0
- package/dist/multiview/group-guides.d.ts.map +1 -0
- package/dist/multiview/index.d.ts +18 -0
- package/dist/multiview/index.d.ts.map +1 -0
- package/dist/multiview/joint-plot.d.ts +115 -0
- package/dist/multiview/joint-plot.d.ts.map +1 -0
- package/dist/multiview/pair-plot.d.ts +154 -0
- package/dist/multiview/pair-plot.d.ts.map +1 -0
- package/dist/multiview/panels.d.ts +23 -0
- package/dist/multiview/panels.d.ts.map +1 -0
- package/dist/multiview/parallel-coordinates.d.ts +110 -0
- package/dist/multiview/parallel-coordinates.d.ts.map +1 -0
- package/dist/points/event-plot.d.ts +68 -0
- package/dist/points/event-plot.d.ts.map +1 -0
- package/dist/points/index.d.ts +20 -0
- package/dist/points/index.d.ts.map +1 -0
- package/dist/points/labels.d.ts +71 -0
- package/dist/points/labels.d.ts.map +1 -0
- package/dist/points/links.d.ts +124 -0
- package/dist/points/links.d.ts.map +1 -0
- package/dist/points/rects.d.ts +81 -0
- package/dist/points/rects.d.ts.map +1 -0
- package/dist/points/rug.d.ts +73 -0
- package/dist/points/rug.d.ts.map +1 -0
- package/dist/points/scatter.d.ts +170 -0
- package/dist/points/scatter.d.ts.map +1 -0
- package/dist/points/segment-marks.d.ts +40 -0
- package/dist/points/segment-marks.d.ts.map +1 -0
- package/dist/points/shared.d.ts +35 -0
- package/dist/points/shared.d.ts.map +1 -0
- package/dist/points/stem.d.ts +76 -0
- package/dist/points/stem.d.ts.map +1 -0
- package/dist/points/strip.d.ts +146 -0
- package/dist/points/strip.d.ts.map +1 -0
- package/dist/points/symbol-marker.d.ts +34 -0
- package/dist/points/symbol-marker.d.ts.map +1 -0
- package/dist/points/ticks.d.ts +103 -0
- package/dist/points/ticks.d.ts.map +1 -0
- package/dist/props.d.ts +127 -0
- package/dist/props.d.ts.map +1 -0
- package/dist/radial/chord.d.ts +149 -0
- package/dist/radial/chord.d.ts.map +1 -0
- package/dist/radial/gauge.d.ts +127 -0
- package/dist/radial/gauge.d.ts.map +1 -0
- package/dist/radial/index.d.ts +16 -0
- package/dist/radial/index.d.ts.map +1 -0
- package/dist/radial/pie-chart.d.ts +144 -0
- package/dist/radial/pie-chart.d.ts.map +1 -0
- package/dist/radial/polar-area-chart.d.ts +136 -0
- package/dist/radial/polar-area-chart.d.ts.map +1 -0
- package/dist/radial/radar-chart.d.ts +177 -0
- package/dist/radial/radar-chart.d.ts.map +1 -0
- package/dist/radial/radial-bar-chart.d.ts +117 -0
- package/dist/radial/radial-bar-chart.d.ts.map +1 -0
- package/dist/radial/shared.d.ts +79 -0
- package/dist/radial/shared.d.ts.map +1 -0
- package/dist/radial/waffle.d.ts +131 -0
- package/dist/radial/waffle.d.ts.map +1 -0
- package/dist/raster.d.ts +44 -0
- package/dist/raster.d.ts.map +1 -0
- package/dist/series.d.ts +72 -0
- package/dist/series.d.ts.map +1 -0
- package/dist/src-CwGo1bes.js +19221 -0
- package/dist/stagger.d.ts +55 -0
- package/dist/stagger.d.ts.map +1 -0
- package/dist/statistics/box-plot.d.ts +152 -0
- package/dist/statistics/box-plot.d.ts.map +1 -0
- package/dist/statistics/error-bar.d.ts +149 -0
- package/dist/statistics/error-bar.d.ts.map +1 -0
- package/dist/statistics/groups.d.ts +141 -0
- package/dist/statistics/groups.d.ts.map +1 -0
- package/dist/statistics/index.d.ts +8 -0
- package/dist/statistics/index.d.ts.map +1 -0
- package/dist/statistics/violin-plot.d.ts +144 -0
- package/dist/statistics/violin-plot.d.ts.map +1 -0
- package/dist/text-width.d.ts +10 -0
- package/dist/text-width.d.ts.map +1 -0
- package/dist/tooltip.d.ts +277 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/util.d.ts +34 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/voxels-9lJ2TZS4.js +235 -0
- package/dist/wireframe3d-D157GZAq.js +345 -0
- package/package.json +86 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Benjamin Lucier
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @sophistry/charts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Charts for sophistry scenes: bars, lines, scatter, histograms, pies, heatmaps, hierarchies and more, with keyed transitions and reveals.
|
|
4
|
+
|
|
5
|
+
Part of [sophistry](https://sophistry.dev), controllable Manim for the web. Pre-1.0: minor releases may break.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @sophistry/core @sophistry/charts
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createScene } from "@sophistry/core";
|
|
17
|
+
import { chart, scatter } from "@sophistry/charts";
|
|
18
|
+
|
|
19
|
+
const scene = createScene({ host: document.getElementById("stage") as HTMLElement });
|
|
20
|
+
scene.root.add(
|
|
21
|
+
chart.create({
|
|
22
|
+
width: 12,
|
|
23
|
+
height: 6,
|
|
24
|
+
children: [scatter.create({ data: [{ x: 1, y: 2 }, { x: 2, y: 3 }], x: "x", y: "y" })],
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use the components in [`@sophistry/solidjs/charts`](../solidjs) or `@sophistry/react/charts` from JSX. `/math` holds the plotting helpers and `/3d` the 3D charts.
|
|
30
|
+
|
|
31
|
+
## Links
|
|
32
|
+
|
|
33
|
+
[Documentation](https://sophistry.dev) · [API](https://sophistry.dev/reference/api/) · [Source](https://github.com/BenjaminLucier/sophistry/tree/main/packages/charts) · MIT
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** A 3D bar chart: one `prism3D` box per datum. */
|
|
2
|
+
import type { Prism3DProps } from "@sophistry/3d";
|
|
3
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
4
|
+
import type { ColorChannel, Quantity } from "../data/channels";
|
|
5
|
+
import type { AnyDatum } from "../props";
|
|
6
|
+
/** @category Plots */
|
|
7
|
+
export interface BarChart3DProps<T = unknown> extends Omit<Prism3DProps, "center" | "width" | "height" | "depth" | "fill"> {
|
|
8
|
+
/** One box per datum. A datum with a non-finite anchor or extent is skipped. */
|
|
9
|
+
data: readonly T[];
|
|
10
|
+
/** x of each box's anchor corner (the box spans `x` to `x + width`): a constant, a key of `T` or `(d, i) => number`. */
|
|
11
|
+
x: Quantity<T>;
|
|
12
|
+
/** y of each box's anchor corner (y is up, so this is the base for upright bars). */
|
|
13
|
+
y: Quantity<T>;
|
|
14
|
+
/** z of each box's anchor corner. A data channel, not the paint order: see `zIndex`. */
|
|
15
|
+
z: Quantity<T>;
|
|
16
|
+
/** Box extent along x, added onto `x`: a constant, a key of `T` or `(d, i) => number`. @default 1 */
|
|
17
|
+
width?: Quantity<T>;
|
|
18
|
+
/** Box extent along y (the bar height), added onto `y`: a constant, a key of `T` or `(d, i) => number`. */
|
|
19
|
+
height: Quantity<T>;
|
|
20
|
+
/** Box extent along z, added onto `z`: a constant, a key of `T` or `(d, i) => number`. @default 1 */
|
|
21
|
+
depth?: Quantity<T>;
|
|
22
|
+
/** One colour for every bar, or `(d, i) => colour` per bar. Wins over `colors`. */
|
|
23
|
+
color?: ColorChannel<T>;
|
|
24
|
+
/** Colours cycled across the bars by index. Defaults to the theme's series colours. */
|
|
25
|
+
colors?: readonly ColorInput[];
|
|
26
|
+
}
|
|
27
|
+
type Props = BarChart3DProps<AnyDatum>;
|
|
28
|
+
/**
|
|
29
|
+
* A 3D bar chart: one axis-aligned `prism3D` box per datum, anchored at its
|
|
30
|
+
* `(x, y, z)` corner and extending by `(width, height, depth)`; for upright
|
|
31
|
+
* bars set `height` to the values. Every other prop (`light`, `stroke`,
|
|
32
|
+
* `opacity`, `zIndex`, handlers, ...) goes to each box. Render under a
|
|
33
|
+
* `camera3D`.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { camera3D } from "@sophistry/3d";
|
|
38
|
+
* import { barChart3D } from "@sophistry/charts/3d";
|
|
39
|
+
*
|
|
40
|
+
* const sales = [
|
|
41
|
+
* { month: 0, region: 0, total: 3 },
|
|
42
|
+
* { month: 1, region: 0, total: 5 },
|
|
43
|
+
* { month: 0, region: 1, total: 2 },
|
|
44
|
+
* ];
|
|
45
|
+
* camera3D.create({
|
|
46
|
+
* children: [
|
|
47
|
+
* barChart3D.create({ data: sales, x: "month", y: 0, z: "region", height: "total", width: 0.8, depth: 0.8 }),
|
|
48
|
+
* ],
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @category Plots
|
|
53
|
+
*/
|
|
54
|
+
export declare const barChart3D: import("@sophistry/core").Definition<Props, import("@sophistry/core/internal").CompositeNode<Props>, keyof Props>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=bar-chart3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-chart3d.d.ts","sourceRoot":"","sources":["../../src/3d/bar-chart3d.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AASzC,sBAAsB;AACtB,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO,CAC3C,SAAQ,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5E,gFAAgF;IAChF,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB,wHAAwH;IACxH,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACf,qFAAqF;IACrF,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACf,wFAAwF;IACxF,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACf,qGAAqG;IACrG,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpB,2GAA2G;IAC3G,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpB,qGAAqG;IACrG,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpB,mFAAmF;IACnF,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACxB,uFAAuF;IACvF,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CAC/B;AAID,KAAK,KAAK,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAiEvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,UAAU,mHAmBrB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 3D charts' definitions, keyed by export name and sorted: merged into
|
|
3
|
+
* `@sophistry/charts/definitions`, which codegen reads to generate the
|
|
4
|
+
* bindings' 3D chart components (`export const BarChart3D = wrap(barChart3D);`).
|
|
5
|
+
* Listed by hand (eight entries) rather than collected from the barrel, so
|
|
6
|
+
* the 2D definitions record decides when to pull the `3d` peer in.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Every 3D chart definition, by export name.
|
|
10
|
+
*
|
|
11
|
+
* @category Scene graph
|
|
12
|
+
*/
|
|
13
|
+
export declare const charts3DDefinitions: Readonly<{
|
|
14
|
+
barChart3D: import("@sophistry/core").Definition<import("./bar-chart3d").BarChart3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./bar-chart3d").BarChart3DProps<any>>, keyof import("./bar-chart3d").BarChart3DProps<any>>;
|
|
15
|
+
quiver3D: import("@sophistry/core").Definition<import("./quiver3d").Quiver3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./quiver3d").Quiver3DProps<any>>, keyof import("./quiver3d").Quiver3DProps<any>>;
|
|
16
|
+
scatter3D: import("@sophistry/core").Definition<import("./scatter3d").Scatter3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./scatter3d").Scatter3DProps<any>>, keyof import("./scatter3d").Scatter3DProps<any>>;
|
|
17
|
+
stem3D: import("@sophistry/core").Definition<import("./stem3d").Stem3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./stem3d").Stem3DProps<any>>, keyof import("./stem3d").Stem3DProps<any>>;
|
|
18
|
+
surfaceGrid3D: import("@sophistry/core").Definition<import("./surface-grid3d").SurfaceGrid3DProps, import("@sophistry/3d").Shape3DNode<import("./surface-grid3d").SurfaceGrid3DProps, readonly import("@sophistry/3d").PreparedFace[]>, keyof import("./surface-grid3d").SurfaceGrid3DProps>;
|
|
19
|
+
triSurface3D: import("@sophistry/core").Definition<import("./tri-surface3d").TriSurface3DProps<any>, import("@sophistry/3d").Shape3DNode<import("./tri-surface3d").TriSurface3DProps<any>, readonly import("@sophistry/3d").PreparedFace[]>, keyof import("./tri-surface3d").TriSurface3DProps<any>>;
|
|
20
|
+
voxels3D: import("@sophistry/core").Definition<import("./voxels3d").Voxels3DProps, import("@sophistry/3d").Shape3DNode<import("./voxels3d").Voxels3DProps, readonly import("@sophistry/3d").PreparedFace[]>, keyof import("./voxels3d").Voxels3DProps>;
|
|
21
|
+
wireframe3D: import("@sophistry/core").Definition<import("./wireframe3d").Wireframe3DProps, import("@sophistry/core/internal").CompositeNode<import("./wireframe3d").Wireframe3DProps>, keyof import("./wireframe3d").Wireframe3DProps>;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* The same record under the name `@sophistry/codegen` reads.
|
|
25
|
+
*
|
|
26
|
+
* @category Charts
|
|
27
|
+
*/
|
|
28
|
+
export declare const definitions: Readonly<{
|
|
29
|
+
barChart3D: import("@sophistry/core").Definition<import("./bar-chart3d").BarChart3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./bar-chart3d").BarChart3DProps<any>>, keyof import("./bar-chart3d").BarChart3DProps<any>>;
|
|
30
|
+
quiver3D: import("@sophistry/core").Definition<import("./quiver3d").Quiver3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./quiver3d").Quiver3DProps<any>>, keyof import("./quiver3d").Quiver3DProps<any>>;
|
|
31
|
+
scatter3D: import("@sophistry/core").Definition<import("./scatter3d").Scatter3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./scatter3d").Scatter3DProps<any>>, keyof import("./scatter3d").Scatter3DProps<any>>;
|
|
32
|
+
stem3D: import("@sophistry/core").Definition<import("./stem3d").Stem3DProps<any>, import("@sophistry/core/internal").CompositeNode<import("./stem3d").Stem3DProps<any>>, keyof import("./stem3d").Stem3DProps<any>>;
|
|
33
|
+
surfaceGrid3D: import("@sophistry/core").Definition<import("./surface-grid3d").SurfaceGrid3DProps, import("@sophistry/3d").Shape3DNode<import("./surface-grid3d").SurfaceGrid3DProps, readonly import("@sophistry/3d").PreparedFace[]>, keyof import("./surface-grid3d").SurfaceGrid3DProps>;
|
|
34
|
+
triSurface3D: import("@sophistry/core").Definition<import("./tri-surface3d").TriSurface3DProps<any>, import("@sophistry/3d").Shape3DNode<import("./tri-surface3d").TriSurface3DProps<any>, readonly import("@sophistry/3d").PreparedFace[]>, keyof import("./tri-surface3d").TriSurface3DProps<any>>;
|
|
35
|
+
voxels3D: import("@sophistry/core").Definition<import("./voxels3d").Voxels3DProps, import("@sophistry/3d").Shape3DNode<import("./voxels3d").Voxels3DProps, readonly import("@sophistry/3d").PreparedFace[]>, keyof import("./voxels3d").Voxels3DProps>;
|
|
36
|
+
wireframe3D: import("@sophistry/core").Definition<import("./wireframe3d").Wireframe3DProps, import("@sophistry/core/internal").CompositeNode<import("./wireframe3d").Wireframe3DProps>, keyof import("./wireframe3d").Wireframe3DProps>;
|
|
37
|
+
}>;
|
|
38
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/3d/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;EAS9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;EAAsB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../wireframe3d-D157GZAq.js";
|
|
2
|
+
//#region src/3d/definitions.ts
|
|
3
|
+
var c = Object.freeze({
|
|
4
|
+
barChart3D: t,
|
|
5
|
+
quiver3D: o,
|
|
6
|
+
scatter3D: i,
|
|
7
|
+
stem3D: e,
|
|
8
|
+
surfaceGrid3D: n,
|
|
9
|
+
triSurface3D: a,
|
|
10
|
+
voxels3D: r,
|
|
11
|
+
wireframe3D: s
|
|
12
|
+
}), l = c;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { c as charts3DDefinitions, l as definitions };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prop forwarding for the 3D charts: a chart takes its drawn primitive's
|
|
3
|
+
* props (paints, reveal, interaction, `zIndex`, `light`, `worldWidth`, ...)
|
|
4
|
+
* and hands them to every node it draws.
|
|
5
|
+
*
|
|
6
|
+
* Unlike core's composite shapes, which bind one child to each forwarded
|
|
7
|
+
* prop, a chart may draw thousands of children: binding every forwarded key
|
|
8
|
+
* on each would cost a subscription per key per child. Instead the
|
|
9
|
+
* forwarded props rerun the chart's `update`, which writes only the keys
|
|
10
|
+
* that changed to the children it already has; a new child gets every
|
|
11
|
+
* forwarded prop that is set. An unset prop stays unset on the child (an
|
|
12
|
+
* unset `zIndex` must not become `0` and take the child out of the camera's
|
|
13
|
+
* depth sort), exactly as a Solid spread passed `undefined` on.
|
|
14
|
+
*
|
|
15
|
+
* Internal: not in the barrel.
|
|
16
|
+
*/
|
|
17
|
+
import type { Changes, PropsDescriptor, SceneNode } from "@sophistry/core";
|
|
18
|
+
import type { Point3 } from "@sophistry/core/internal";
|
|
19
|
+
/**
|
|
20
|
+
* A chart's descriptor entries for the props it forwards to its drawn
|
|
21
|
+
* nodes: every one reruns `update` (which writes it to the children).
|
|
22
|
+
* Defaults are kept for docs and bindings; `instanceable` is dropped.
|
|
23
|
+
*
|
|
24
|
+
* @param descriptor - The drawn primitive's descriptor (`prism3D.descriptor`).
|
|
25
|
+
* @param omit - Keys the chart sets itself (positions, colour).
|
|
26
|
+
* @returns The entries, to spread into the chart's descriptor.
|
|
27
|
+
*/
|
|
28
|
+
export declare function forwardedEntries<P, const O extends keyof P = never>(descriptor: PropsDescriptor<P>, omit?: readonly O[]): PropsDescriptor<Omit<P, O>>;
|
|
29
|
+
/**
|
|
30
|
+
* Writes every forwarded prop that is set to a new child, skipping keys the
|
|
31
|
+
* child's definition does not have (a stem's marker takes no `worldWidth`).
|
|
32
|
+
*
|
|
33
|
+
* @param props - The chart's props.
|
|
34
|
+
* @param child - The node just made.
|
|
35
|
+
* @param keys - The forwarded keys.
|
|
36
|
+
*/
|
|
37
|
+
export declare function forwardAll<P>(props: Readonly<P>, child: SceneNode, keys: readonly (keyof P)[]): void;
|
|
38
|
+
/**
|
|
39
|
+
* Writes the forwarded props among `changed` (set or unset) to each child
|
|
40
|
+
* that has them.
|
|
41
|
+
*
|
|
42
|
+
* @param changed - What changed since the last `update`.
|
|
43
|
+
* @param props - The chart's props.
|
|
44
|
+
* @param children - The chart's drawn nodes.
|
|
45
|
+
* @param keys - The forwarded keys, as a set.
|
|
46
|
+
*/
|
|
47
|
+
export declare function forwardChanged<P>(changed: Changes<P>, props: Readonly<P>, children: readonly SceneNode[], keys: ReadonlySet<keyof P>): void;
|
|
48
|
+
/**
|
|
49
|
+
* Whether `changed` holds anything besides forwarded props: a data channel,
|
|
50
|
+
* the data itself, or a context key the chart read (the theme).
|
|
51
|
+
*
|
|
52
|
+
* @param changed - What changed since the last `update`.
|
|
53
|
+
* @param keys - The forwarded keys, as a set.
|
|
54
|
+
*/
|
|
55
|
+
export declare function dataChanged<P>(changed: Changes<P>, keys: ReadonlySet<keyof P>): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Sets a point prop only when its coordinates changed: a fresh object with
|
|
58
|
+
* the same coordinates would otherwise rebuild the child's world geometry.
|
|
59
|
+
*
|
|
60
|
+
* @param node - The child.
|
|
61
|
+
* @param key - The point prop (`center`, `from`, `to`).
|
|
62
|
+
* @param point - The new value.
|
|
63
|
+
*/
|
|
64
|
+
export declare function setPoint3(node: SceneNode, key: string, point: Point3): void;
|
|
65
|
+
//# sourceMappingURL=forward.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forward.d.ts","sourceRoot":"","sources":["../../src/3d/forward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACX,OAAO,EAEP,eAAe,EACf,SAAS,EACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKvD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,KAAK,EAClE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,IAAI,GAAE,SAAS,CAAC,EAAO,GACrB,eAAe,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAc7B;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC3B,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACxB,IAAI,CAQN;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC/B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,GACxB,IAAI,CASN;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC5B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,GACxB,OAAO,CAKT;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAW3E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@sophistry/charts/3d`: charts drawn through a `camera3D` from
|
|
3
|
+
* `@sophistry/3d` (an optional peer). In these charts `z` is a data
|
|
4
|
+
* channel; `zIndex` is the paint order, forwarded to every drawn node.
|
|
5
|
+
*
|
|
6
|
+
* Charts of many marks (`barChart3D`, `quiver3D`, `scatter3D`, `stem3D`,
|
|
7
|
+
* `wireframe3D`) are composites over the 3D primitives, one per datum or
|
|
8
|
+
* segment; surfaces (`surfaceGrid3D`, `triSurface3D`, `voxels3D`) are one
|
|
9
|
+
* mesh each. Either way a camera move only re-projects: the chart's world
|
|
10
|
+
* geometry is rebuilt when its data changes.
|
|
11
|
+
*
|
|
12
|
+
* @module @sophistry/charts/3d
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
export type { BarChart3DProps } from "./bar-chart3d";
|
|
16
|
+
export { barChart3D } from "./bar-chart3d";
|
|
17
|
+
export type { Quiver3DProps } from "./quiver3d";
|
|
18
|
+
export { quiver3D } from "./quiver3d";
|
|
19
|
+
export type { Scatter3DProps } from "./scatter3d";
|
|
20
|
+
export { scatter3D } from "./scatter3d";
|
|
21
|
+
export type { Stem3DProps } from "./stem3d";
|
|
22
|
+
export { stem3D } from "./stem3d";
|
|
23
|
+
export type { SurfaceGrid3DProps } from "./surface-grid3d";
|
|
24
|
+
export { surfaceGrid3D } from "./surface-grid3d";
|
|
25
|
+
export type { TriSurface3DProps } from "./tri-surface3d";
|
|
26
|
+
export { triSurface3D } from "./tri-surface3d";
|
|
27
|
+
export type { Voxels3DProps } from "./voxels3d";
|
|
28
|
+
export { voxels3D } from "./voxels3d";
|
|
29
|
+
export type { Wireframe3DProps } from "./wireframe3d";
|
|
30
|
+
export { wireframe3D } from "./wireframe3d";
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/3d/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/3d/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { c as barChart3D, s as quiver3D, o as scatter3D, a as stem3D, i as surfaceGrid3D, r as triSurface3D, n as voxels3D, t as wireframe3D } from "../wireframe3d-D157GZAq.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** A 3D vector field: one `vector3D` arrow per datum. */
|
|
2
|
+
import type { Vector3DProps } from "@sophistry/3d";
|
|
3
|
+
import type { Channel, ColorChannel } from "../data/channels";
|
|
4
|
+
import type { AnyDatum } from "../props";
|
|
5
|
+
/** @category Plots */
|
|
6
|
+
export interface Quiver3DProps<T = unknown> extends Omit<Vector3DProps, "from" | "to" | "stroke" | "fill"> {
|
|
7
|
+
/** One arrow per datum. A datum with a non-finite component is skipped. */
|
|
8
|
+
data: readonly T[];
|
|
9
|
+
/** World x of the arrow's tail, a key of `T` or `(d, i) => number`. */
|
|
10
|
+
x: Channel<T, number>;
|
|
11
|
+
/** World y of the arrow's tail. */
|
|
12
|
+
y: Channel<T, number>;
|
|
13
|
+
/** World z of the arrow's tail. A data channel, not the paint order: see `zIndex`. */
|
|
14
|
+
z: Channel<T, number>;
|
|
15
|
+
/** x component of the arrow's direction, in world units (before `scale`). */
|
|
16
|
+
u: Channel<T, number>;
|
|
17
|
+
/** y component of the arrow's direction. */
|
|
18
|
+
v: Channel<T, number>;
|
|
19
|
+
/** z component of the arrow's direction. */
|
|
20
|
+
w: Channel<T, number>;
|
|
21
|
+
/** Multiplies `(u, v, w)` before it becomes the drawn arrow. @default 1 */
|
|
22
|
+
scale?: number;
|
|
23
|
+
/** Arrow colour: one constant, or `(d, i) => colour` per arrow. */
|
|
24
|
+
color?: ColorChannel<T>;
|
|
25
|
+
}
|
|
26
|
+
type Props = Quiver3DProps<AnyDatum>;
|
|
27
|
+
/**
|
|
28
|
+
* A 3D vector field: one `vector3D` arrow per datum, its tail at `(x, y, z)`
|
|
29
|
+
* and its tip at that point plus `(u, v, w) * scale` (lengths not
|
|
30
|
+
* normalised). Every other prop (`worldWidth`, `tipLength`, `opacity`,
|
|
31
|
+
* `zIndex`, handlers, ...) goes to each arrow. Render under a `camera3D`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { camera3D } from "@sophistry/3d";
|
|
36
|
+
* import { quiver3D } from "@sophistry/charts/3d";
|
|
37
|
+
*
|
|
38
|
+
* const field = [
|
|
39
|
+
* { x: 0, y: 0, z: 0, u: 1, v: 0, w: 0 },
|
|
40
|
+
* { x: 1, y: 0, z: 0, u: 0, v: 1, w: 0 },
|
|
41
|
+
* ];
|
|
42
|
+
* camera3D.create({
|
|
43
|
+
* children: [
|
|
44
|
+
* quiver3D.create({ data: field, x: "x", y: "y", z: "z", u: "u", v: "v", w: "w", scale: 0.5 }),
|
|
45
|
+
* ],
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @category Plots
|
|
50
|
+
*/
|
|
51
|
+
export declare const quiver3D: import("@sophistry/core").Definition<Props, import("@sophistry/core/internal").CompositeNode<Props>, keyof Props>;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=quiver3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiver3d.d.ts","sourceRoot":"","sources":["../../src/3d/quiver3d.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAI9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AASzC,sBAAsB;AACtB,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO,CACzC,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9D,2EAA2E;IAC3E,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB,uEAAuE;IACvE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,mCAAmC;IACnC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,sFAAsF;IACtF,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,6EAA6E;IAC7E,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,4CAA4C;IAC5C,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,4CAA4C;IAC5C,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CACxB;AAID,KAAK,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;AA0DrC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,QAAQ,mHAmBnB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** A 3D scatter plot: one `dot3D` per point. */
|
|
2
|
+
import type { Dot3DProps } from "@sophistry/3d";
|
|
3
|
+
import type { Channel, ColorChannel, Quantity } from "../data/channels";
|
|
4
|
+
import type { AnyDatum } from "../props";
|
|
5
|
+
/** @category Plots */
|
|
6
|
+
export interface Scatter3DProps<T = unknown> extends Omit<Dot3DProps, "center" | "radius" | "color"> {
|
|
7
|
+
/** One marker per datum. A datum with a non-finite coordinate is skipped. */
|
|
8
|
+
data: readonly T[];
|
|
9
|
+
/** World x, a key of `T` or `(d, i) => number`. */
|
|
10
|
+
x: Channel<T, number>;
|
|
11
|
+
/** World y (up), a key of `T` or `(d, i) => number`. */
|
|
12
|
+
y: Channel<T, number>;
|
|
13
|
+
/** World z, a key of `T` or `(d, i) => number`. A data channel, not the paint order: see `zIndex`. */
|
|
14
|
+
z: Channel<T, number>;
|
|
15
|
+
/** World-unit marker radius: a constant, a key of `T` or `(d, i) => number`. @default 0.08 */
|
|
16
|
+
radius?: Quantity<T>;
|
|
17
|
+
/** Marker colour: one constant, or `(d, i) => colour` per marker. */
|
|
18
|
+
color?: ColorChannel<T>;
|
|
19
|
+
}
|
|
20
|
+
type Props = Scatter3DProps<AnyDatum>;
|
|
21
|
+
/**
|
|
22
|
+
* A 3D scatter plot: one `dot3D` marker per finite `(x, y, z)`; `radius` and
|
|
23
|
+
* `color` may vary per datum. Every other prop (`shaded`, `stroke`,
|
|
24
|
+
* `opacity`, `zIndex`, handlers, ...) goes to each marker. Render under a
|
|
25
|
+
* `camera3D`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { camera3D } from "@sophistry/3d";
|
|
30
|
+
* import { scatter3D } from "@sophistry/charts/3d";
|
|
31
|
+
*
|
|
32
|
+
* const samples = [
|
|
33
|
+
* { x: 0, y: 1, z: 0 },
|
|
34
|
+
* { x: 1, y: 0.5, z: -1 },
|
|
35
|
+
* ];
|
|
36
|
+
* camera3D.create({
|
|
37
|
+
* children: [scatter3D.create({ data: samples, x: "x", y: "y", z: "z", radius: 0.1 })],
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @category Plots
|
|
42
|
+
*/
|
|
43
|
+
export declare const scatter3D: import("@sophistry/core").Definition<Props, import("@sophistry/core/internal").CompositeNode<Props>, keyof Props>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=scatter3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatter3d.d.ts","sourceRoot":"","sources":["../../src/3d/scatter3d.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AASzC,sBAAsB;AACtB,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO,CAC1C,SAAQ,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACvD,6EAA6E;IAC7E,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB,mDAAmD;IACnD,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,wDAAwD;IACxD,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,sGAAsG;IACtG,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrB,qEAAqE;IACrE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CACxB;AAID,KAAK,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AA0CtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,SAAS,mHAgBpB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** A 3D stem plot: a drop line and a marker per point. */
|
|
2
|
+
import type { Line3DProps } from "@sophistry/3d";
|
|
3
|
+
import type { Channel, ColorChannel } from "../data/channels";
|
|
4
|
+
import type { AnyDatum } from "../props";
|
|
5
|
+
/** @category Plots */
|
|
6
|
+
export interface Stem3DProps<T = unknown> extends Omit<Line3DProps, "from" | "to" | "stroke" | "fill"> {
|
|
7
|
+
/** One drop line and marker per datum. A datum with a non-finite coordinate is skipped. */
|
|
8
|
+
data: readonly T[];
|
|
9
|
+
/** World x, a key of `T` or `(d, i) => number`. */
|
|
10
|
+
x: Channel<T, number>;
|
|
11
|
+
/** World y (height; the drop line runs along y from `baseline` to this value), a key of `T` or `(d, i) => number`. */
|
|
12
|
+
y: Channel<T, number>;
|
|
13
|
+
/** World z, a key of `T` or `(d, i) => number`. A data channel, not the paint order: see `zIndex`. */
|
|
14
|
+
z: Channel<T, number>;
|
|
15
|
+
/** The y value each drop line starts from. @default 0 */
|
|
16
|
+
baseline?: number;
|
|
17
|
+
/** World-unit marker radius. @default 0.08 */
|
|
18
|
+
markerRadius?: number;
|
|
19
|
+
/** Colour of line and marker: one constant, or `(d, i) => colour` per stem. */
|
|
20
|
+
color?: ColorChannel<T>;
|
|
21
|
+
}
|
|
22
|
+
type Props = Stem3DProps<AnyDatum>;
|
|
23
|
+
/**
|
|
24
|
+
* A 3D stem plot: a drop line along world y from `baseline` to `y`, plus a
|
|
25
|
+
* marker, per point. Style props apply to lines and markers. Render under a
|
|
26
|
+
* `camera3D`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { camera3D } from "@sophistry/3d";
|
|
31
|
+
* import { stem3D } from "@sophistry/charts/3d";
|
|
32
|
+
*
|
|
33
|
+
* const heights = [
|
|
34
|
+
* { x: -1, y: 1.5, z: 0 },
|
|
35
|
+
* { x: 1, y: 0.7, z: 1 },
|
|
36
|
+
* ];
|
|
37
|
+
* camera3D.create({
|
|
38
|
+
* children: [stem3D.create({ data: heights, x: "x", y: "y", z: "z", color: "#4af" })],
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @category Plots
|
|
43
|
+
*/
|
|
44
|
+
export declare const stem3D: import("@sophistry/core").Definition<Props, import("@sophistry/core/internal").CompositeNode<Props>, keyof Props>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=stem3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stem3d.d.ts","sourceRoot":"","sources":["../../src/3d/stem3d.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAI9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AASzC,sBAAsB;AACtB,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO,CACvC,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5D,2FAA2F;IAC3F,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB,mDAAmD;IACnD,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,sHAAsH;IACtH,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,sGAAsG;IACtG,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CACxB;AAID,KAAK,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;AA2EnC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM,mHAiBjB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** A surface from three precomputed coordinate grids, drawn as flat-shaded quads. */
|
|
2
|
+
import type { MeshFacesProps } from "@sophistry/3d";
|
|
3
|
+
/** @category Plots */
|
|
4
|
+
export interface SurfaceGrid3DProps extends Omit<MeshFacesProps, "faces"> {
|
|
5
|
+
/** `nrows x ncols` grid of world x coordinates, `xs[row][col]`. All three grids must share a shape, or this throws. */
|
|
6
|
+
xs: number[][];
|
|
7
|
+
/** Grid of world y (height) coordinates, same shape as `xs`. */
|
|
8
|
+
ys: number[][];
|
|
9
|
+
/** Grid of world z coordinates, same shape as `xs`. */
|
|
10
|
+
zs: number[][];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A surface given as three coordinate grids (`xs`, `ys`, `zs`) you compute
|
|
14
|
+
* yourself, drawn as flat-shaded quads. Faces are one-sided: with `xs`
|
|
15
|
+
* increasing along columns and `zs` along rows, the top (+y) side shows.
|
|
16
|
+
* The quads are rebuilt only when a grid changes, never on a camera move.
|
|
17
|
+
* Render under a `camera3D`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { camera3D } from "@sophistry/3d";
|
|
22
|
+
* import { surfaceGrid3D } from "@sophistry/charts/3d";
|
|
23
|
+
*
|
|
24
|
+
* const xs = [[0, 1], [0, 1]];
|
|
25
|
+
* const ys = [[0, 0.5], [0.5, 1]];
|
|
26
|
+
* const zs = [[0, 0], [1, 1]];
|
|
27
|
+
* camera3D.create({ children: [surfaceGrid3D.create({ xs, ys, zs, fill: "#4af" })] });
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @see {@link surfacePlot3D} for a surface from a function.
|
|
31
|
+
* @category Plots
|
|
32
|
+
*/
|
|
33
|
+
export declare const surfaceGrid3D: import("@sophistry/core").Definition<SurfaceGrid3DProps, import("@sophistry/3d").Shape3DNode<SurfaceGrid3DProps, readonly import("@sophistry/3d").PreparedFace[]>, keyof SurfaceGrid3DProps>;
|
|
34
|
+
//# sourceMappingURL=surface-grid3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface-grid3d.d.ts","sourceRoot":"","sources":["../../src/3d/surface-grid3d.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAKpD,sBAAsB;AACtB,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACxE,uHAAuH;IACvH,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,gEAAgE;IAChE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,uDAAuD;IACvD,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,8LAcxB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A triangulated surface through scattered vertices. y is up, so the
|
|
3
|
+
* Delaunay triangulation runs over the `(x, z)` ground plane and `y` is the
|
|
4
|
+
* height.
|
|
5
|
+
*/
|
|
6
|
+
import type { MeshFacesProps } from "@sophistry/3d";
|
|
7
|
+
import type { Channel } from "../data/channels";
|
|
8
|
+
import type { AnyDatum } from "../props";
|
|
9
|
+
/** @category Plots */
|
|
10
|
+
export interface TriSurface3DProps<T = unknown> extends Omit<MeshFacesProps, "faces"> {
|
|
11
|
+
/** One vertex per datum. */
|
|
12
|
+
data: readonly T[];
|
|
13
|
+
/** World x of the vertex, a key of `T` or `(d, i) => number`. */
|
|
14
|
+
x: Channel<T, number>;
|
|
15
|
+
/** World y (height) of the vertex. Triangles with a non-finite height are dropped. */
|
|
16
|
+
y: Channel<T, number>;
|
|
17
|
+
/** World z of the vertex. The triangulation runs over `(x, z)`. A data channel, not the paint order: see `zIndex`. */
|
|
18
|
+
z: Channel<T, number>;
|
|
19
|
+
}
|
|
20
|
+
type Props = TriSurface3DProps<AnyDatum>;
|
|
21
|
+
/**
|
|
22
|
+
* A surface through scattered vertices (`x`, `z` on the ground, `y` the
|
|
23
|
+
* height), Delaunay-triangulated over the ground plane and drawn as
|
|
24
|
+
* flat-shaded triangles. Fewer than three usable or all-collinear points
|
|
25
|
+
* draw nothing. The triangles are rebuilt only when the data or a channel
|
|
26
|
+
* changes, never on a camera move. Render under a `camera3D`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { camera3D } from "@sophistry/3d";
|
|
31
|
+
* import { triSurface3D } from "@sophistry/charts/3d";
|
|
32
|
+
*
|
|
33
|
+
* const samples = [
|
|
34
|
+
* { x: 0, y: 0, z: 0 },
|
|
35
|
+
* { x: 1, y: 0.5, z: 0 },
|
|
36
|
+
* { x: 0, y: 0.8, z: 1 },
|
|
37
|
+
* { x: 1, y: 0.2, z: 1 },
|
|
38
|
+
* ];
|
|
39
|
+
* camera3D.create({ children: [triSurface3D.create({ data: samples, x: "x", y: "y", z: "z" })] });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @category Plots
|
|
43
|
+
*/
|
|
44
|
+
export declare const triSurface3D: import("@sophistry/core").Definition<Props, import("@sophistry/3d").Shape3DNode<Props, readonly import("@sophistry/3d").PreparedFace[]>, keyof Props>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=tri-surface3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tri-surface3d.d.ts","sourceRoot":"","sources":["../../src/3d/tri-surface3d.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,eAAe,CAAC;AAI9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,sBAAsB;AACtB,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO,CAC7C,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACrC,4BAA4B;IAC5B,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;IACnB,iEAAiE;IACjE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,sFAAsF;IACtF,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtB,sHAAsH;IACtH,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;CACtB;AAED,KAAK,KAAK,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAiCzC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,YAAY,uJAUvB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A boolean voxel grid drawn as flat-shaded cube faces, hidden shared faces culled. */
|
|
2
|
+
import type { MeshFacesProps } from "@sophistry/3d";
|
|
3
|
+
/** @category Plots */
|
|
4
|
+
export interface Voxels3DProps extends Omit<MeshFacesProps, "faces"> {
|
|
5
|
+
/** `values[i][j][k]`; ragged or `undefined` entries are empty. A `true` voxel fills the unit cube `[i,i+1] x [j,j+1] x [k,k+1]`. */
|
|
6
|
+
values: readonly (readonly (readonly boolean[])[])[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A grid of unit cubes, drawn as flat-shaded quads (faces hidden by a
|
|
10
|
+
* neighbour are skipped). The faces are rebuilt only when `values` changes,
|
|
11
|
+
* never on a camera move. Render under a `camera3D`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { camera3D } from "@sophistry/3d";
|
|
16
|
+
* import { voxels3D } from "@sophistry/charts/3d";
|
|
17
|
+
*
|
|
18
|
+
* // An L of three cubes.
|
|
19
|
+
* const values = [[[true], [true]], [[true]]];
|
|
20
|
+
* camera3D.create({ children: [voxels3D.create({ values, fill: "#fa4" })] });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category Plots
|
|
24
|
+
*/
|
|
25
|
+
export declare const voxels3D: import("@sophistry/core").Definition<Voxels3DProps, import("@sophistry/3d").Shape3DNode<Voxels3DProps, readonly import("@sophistry/3d").PreparedFace[]>, keyof Voxels3DProps>;
|
|
26
|
+
//# sourceMappingURL=voxels3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voxels3d.d.ts","sourceRoot":"","sources":["../../src/3d/voxels3d.ts"],"names":[],"mappings":"AAAA,wFAAwF;AAExF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAKpD,sBAAsB;AACtB,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACnE,oIAAoI;IACpI,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;CACrD;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,+KAOnB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** A structured-grid surface drawn as lines only: one polyline per grid row and column, as `line3D` segments. */
|
|
2
|
+
import type { Line3DProps } from "@sophistry/3d";
|
|
3
|
+
/** @category Primitives */
|
|
4
|
+
export interface Wireframe3DProps extends Omit<Line3DProps, "from" | "to"> {
|
|
5
|
+
/** `nrows x ncols` grid of world x coordinates, `xs[row][col]`. All three grids must share a shape, or this throws. */
|
|
6
|
+
xs: number[][];
|
|
7
|
+
/** Grid of world y (height) coordinates, same shape as `xs`. */
|
|
8
|
+
ys: number[][];
|
|
9
|
+
/** Grid of world z coordinates, same shape as `xs`. */
|
|
10
|
+
zs: number[][];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A grid surface drawn as lines only: one polyline per grid row and column,
|
|
14
|
+
* no fill. Takes {@link surfaceGrid3D}'s grids; style props apply to every
|
|
15
|
+
* segment. Render under a `camera3D`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { camera3D } from "@sophistry/3d";
|
|
20
|
+
* import { wireframe3D } from "@sophistry/charts/3d";
|
|
21
|
+
*
|
|
22
|
+
* const xs = [[0, 1], [0, 1]];
|
|
23
|
+
* const ys = [[0, 0.5], [0.5, 1]];
|
|
24
|
+
* const zs = [[0, 0], [1, 1]];
|
|
25
|
+
* camera3D.create({ children: [wireframe3D.create({ xs, ys, zs, stroke: "#4af" })] });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @category Primitives
|
|
29
|
+
*/
|
|
30
|
+
export declare const wireframe3D: import("@sophistry/core").Definition<Wireframe3DProps, import("@sophistry/core/internal").CompositeNode<Wireframe3DProps>, keyof Wireframe3DProps>;
|
|
31
|
+
//# sourceMappingURL=wireframe3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireframe3d.d.ts","sourceRoot":"","sources":["../../src/3d/wireframe3d.ts"],"names":[],"mappings":"AAAA,iHAAiH;AAEjH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAcjD,2BAA2B;AAC3B,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACzE,uHAAuH;IACvH,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,gEAAgE;IAChE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,uDAAuD;IACvD,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAsDD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,oJAatB,CAAC"}
|
package/dist/band.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a value sits on an axis that may be categorical, and whether a value
|
|
3
|
+
* axis has a zero for a mark to grow from. Pure; internal to the charts.
|
|
4
|
+
*/
|
|
5
|
+
import type { BandKey, BandScale, Range } from "@sophistry/core/geometry";
|
|
6
|
+
/**
|
|
7
|
+
* Where `value` sits along an axis, in data units: a category's band centre
|
|
8
|
+
* on a band axis (a number is looked up as a category first, then taken as
|
|
9
|
+
* a slot coordinate), otherwise the number itself.
|
|
10
|
+
*
|
|
11
|
+
* @returns The position, or undefined when there is none.
|
|
12
|
+
*/
|
|
13
|
+
export declare function positionOf(band: BandScale | undefined, value: BandKey | null | undefined): number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The extent of a category's band, `[start, end]` in data units, or undefined
|
|
16
|
+
* when there is no band axis or the category is not on it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function bandSpan(band: BandScale | undefined, value: BandKey | null | undefined): [number, number] | undefined;
|
|
19
|
+
/** Whether a value axis's range contains 0 for a mark to grow from; marks on axes without one fade in instead. */
|
|
20
|
+
export declare function growsFromZero(range: Readonly<Range>): boolean;
|
|
21
|
+
//# sourceMappingURL=band.d.ts.map
|