@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
|
+
* `violinPlot`: a violin plot, its own chart with one mirrored kernel
|
|
3
|
+
* density silhouette per group and its median marked.
|
|
4
|
+
*
|
|
5
|
+
* The preset reads groups as `boxPlot` does (`groups.ts`). Its inner layer
|
|
6
|
+
* draws every violin and every median tick as **one path batch** (each
|
|
7
|
+
* violin's outline is its own; one batch keeps the order, a violin then
|
|
8
|
+
* its tick). Hover resolves per item (`event.item`).
|
|
9
|
+
*
|
|
10
|
+
* The reveal is geometry: each violin widens out of its centre line (every
|
|
11
|
+
* x pulled `t` of the way out from it), its tick with it. Keyed transitions
|
|
12
|
+
* blend densities on a shared grid (`blendViolinProfiles`) and move medians
|
|
13
|
+
* in data units.
|
|
14
|
+
*/
|
|
15
|
+
import type { SceneNode } from "@sophistry/core";
|
|
16
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
17
|
+
import type { BandKey, Point, Range } from "@sophistry/core/geometry";
|
|
18
|
+
import type { Channel, ColorChannel } from "../data/channels";
|
|
19
|
+
import type { ChartYAxisOptions } from "../frame/types";
|
|
20
|
+
import type { RevealProps, TransitionProps } from "../props";
|
|
21
|
+
/**
|
|
22
|
+
* Props of {@link violinPlot}. `values` is required unless `data` is
|
|
23
|
+
* `number[][]`.
|
|
24
|
+
*
|
|
25
|
+
* @category Charts
|
|
26
|
+
*/
|
|
27
|
+
export interface ViolinPlotProps<T = unknown> extends TransitionProps<T>, RevealProps {
|
|
28
|
+
/** One violin per datum, each holding (or yielding via `values`) one group's raw sample. */
|
|
29
|
+
data: readonly T[];
|
|
30
|
+
/**
|
|
31
|
+
* The group's raw sample, in data units. Defaults to the datum when `data` is `number[][]`;
|
|
32
|
+
* required otherwise. Groups with fewer than 2 finite values draw no violin.
|
|
33
|
+
*/
|
|
34
|
+
values?: Channel<T, readonly number[]>;
|
|
35
|
+
/** The name drawn under each violin. With a `series`, violins sharing a name share its slot. */
|
|
36
|
+
label?: Channel<T, string>;
|
|
37
|
+
/**
|
|
38
|
+
* The series each violin belongs to: colours violins through the chart's colour scale and
|
|
39
|
+
* legend; with a `label`, violins sharing a name stand side by side in its slot. `color` wins.
|
|
40
|
+
*/
|
|
41
|
+
series?: Channel<T, BandKey>;
|
|
42
|
+
/**
|
|
43
|
+
* The legend for `series`: `"right"`, `"top"`, or `false`. As `chart`'s `legend`. Defaults to
|
|
44
|
+
* `"right"` with a series.
|
|
45
|
+
*/
|
|
46
|
+
legend?: boolean | "right" | "top";
|
|
47
|
+
/**
|
|
48
|
+
* Gaussian kernel bandwidth, in data units. Defaults to Silverman's rule of thumb, per group.
|
|
49
|
+
*/
|
|
50
|
+
bandwidth?: number;
|
|
51
|
+
/**
|
|
52
|
+
* How many points each violin's density is evaluated at.
|
|
53
|
+
* @default 80
|
|
54
|
+
*/
|
|
55
|
+
samples?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Half-width of a violin at its widest, as a fraction of the slot pitch. Every violin shares
|
|
58
|
+
* it, so shapes compare but absolute densities don't.
|
|
59
|
+
* @default 0.4
|
|
60
|
+
*/
|
|
61
|
+
scale?: number;
|
|
62
|
+
/** `[min, max, step?]` in data units. Omitted, fitted to the data (including 0). */
|
|
63
|
+
yRange?: Range;
|
|
64
|
+
/** Width of the plotting area. */
|
|
65
|
+
width: number;
|
|
66
|
+
/** Height of the plotting area. */
|
|
67
|
+
height: number;
|
|
68
|
+
/** Centre of the plotting area. Defaults to the origin. */
|
|
69
|
+
center?: Point;
|
|
70
|
+
/**
|
|
71
|
+
* One colour for every violin, or `(d, i) => colour`. Wins over `colors` and `series` (whose
|
|
72
|
+
* legend then goes).
|
|
73
|
+
*/
|
|
74
|
+
color?: ColorChannel<T>;
|
|
75
|
+
/**
|
|
76
|
+
* Colours cycled across the violins by index, or across the `series` categories. Defaults to
|
|
77
|
+
* the theme's categorical colours.
|
|
78
|
+
*/
|
|
79
|
+
colors?: readonly ColorInput[];
|
|
80
|
+
/**
|
|
81
|
+
* Fill opacity, 0..1.
|
|
82
|
+
* @default 0.7
|
|
83
|
+
*/
|
|
84
|
+
fillOpacity?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Draw a short tick at each group's median.
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
median?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* The value axis: `false` hides it; an object styles it and sets its ticks.
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
yAxis?: boolean | ChartYAxisOptions;
|
|
95
|
+
/**
|
|
96
|
+
* Reveal, 0..1: the frame first, then each violin widens out of its centre line.
|
|
97
|
+
* @default 1
|
|
98
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
99
|
+
*/
|
|
100
|
+
progress?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Fraction of the violins' reveal spent staggering violin after violin, left to right, 0..0.95.
|
|
103
|
+
* @default 0
|
|
104
|
+
*/
|
|
105
|
+
stagger?: number;
|
|
106
|
+
/**
|
|
107
|
+
* The data to transition to, groups matched by `label` and `series` (else by place): densities
|
|
108
|
+
* blend on a shared grid and medians move; new groups widen in, removed ones narrow out. See
|
|
109
|
+
* {@link TransitionProps}.
|
|
110
|
+
* @see https://sophistry.dev/guides/chart-animation/#data-transitions
|
|
111
|
+
*/
|
|
112
|
+
to?: readonly T[];
|
|
113
|
+
zIndex?: number;
|
|
114
|
+
visible?: boolean;
|
|
115
|
+
/** Drawn inside the chart's coordinate context. */
|
|
116
|
+
children?: readonly SceneNode[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A violin plot: one mirrored kernel density silhouette per group, with its
|
|
120
|
+
* median marked. It is its own plot, sized by `width`/`height`; don't put it
|
|
121
|
+
* inside an `axes` or `chart`. Violins and median ticks draw as one path
|
|
122
|
+
* batch. See {@link violinRing} for the geometry alone.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { violinPlot } from "@sophistry/charts";
|
|
127
|
+
*
|
|
128
|
+
* violinPlot.create({
|
|
129
|
+
* data: [
|
|
130
|
+
* { arm: "control", scores: [3, 4, 4, 5, 6, 7, 12] },
|
|
131
|
+
* { arm: "treated", scores: [5, 6, 7, 7, 8, 9, 10] },
|
|
132
|
+
* ],
|
|
133
|
+
* values: "scores",
|
|
134
|
+
* label: "arm",
|
|
135
|
+
* width: 6,
|
|
136
|
+
* height: 4,
|
|
137
|
+
* });
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#box-and-violin-plots
|
|
141
|
+
* @category Charts
|
|
142
|
+
*/
|
|
143
|
+
export declare const violinPlot: import("@sophistry/core").Definition<ViolinPlotProps<any>, import("@sophistry/core/internal").CompositeNode<ViolinPlotProps<any>>, keyof ViolinPlotProps<any>>;
|
|
144
|
+
//# sourceMappingURL=violin-plot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"violin-plot.d.ts","sourceRoot":"","sources":["../../src/statistics/violin-plot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAIX,SAAS,EACT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAItE,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG9D,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAkBpE,OAAO,KAAK,EAAY,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+BvE;;;;;GAKG;AACH,MA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AC,EAAE,SAAS,CAAC,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;CAChC;AAqbD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,UAAU,gKA8CrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Text measurement for chart layout: the one place marks ask how wide a label is. Internal to the charts. */
|
|
2
|
+
/**
|
|
3
|
+
* The advance width of `text` at `fontSize`, in scene units, as `label`
|
|
4
|
+
* draws it: measured on a canvas where there is one, else estimated.
|
|
5
|
+
*
|
|
6
|
+
* @param fontFamily - The theme's `defaults.fontFamily`.
|
|
7
|
+
* @param fontWeight - Defaults to `label`'s, 500.
|
|
8
|
+
*/
|
|
9
|
+
export declare function textWidth(text: string, fontSize: number, fontFamily: string, fontWeight?: number): number;
|
|
10
|
+
//# sourceMappingURL=text-width.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-width.d.ts","sourceRoot":"","sources":["../src/text-width.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAI9G;;;;;;GAMG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,SAAsB,GAC9B,MAAM,CAQR"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart tooltips, the state half: what a tooltip shows (rows, templates,
|
|
3
|
+
* formats), which datum is showing, the handlers marks attach, and the
|
|
4
|
+
* shared nearest-x mode's points. The panel itself is drawn by the chart
|
|
5
|
+
* (`frame/tooltip-overlay.ts`).
|
|
6
|
+
*
|
|
7
|
+
* A chart provides one {@link TooltipState} through {@link tooltipContext};
|
|
8
|
+
* marks read it with `ctx.context(tooltipContext)`.
|
|
9
|
+
*/
|
|
10
|
+
import type { ContextKey, Readable, ScenePointerEvent } from "@sophistry/core";
|
|
11
|
+
import type { BandKey, Bounds, Point } from "@sophistry/core/geometry";
|
|
12
|
+
/** Gap between a tooltip panel and the point it describes, scene units. */
|
|
13
|
+
export declare const TIP_GAP = 0.18;
|
|
14
|
+
/**
|
|
15
|
+
* One line of a tooltip: a channel's name and its formatted value.
|
|
16
|
+
*
|
|
17
|
+
* @category Charts
|
|
18
|
+
*/
|
|
19
|
+
export interface TooltipRow {
|
|
20
|
+
/** The channel the value comes from (`"x"`, `"y"`, `"series"`, `"size"`, `"value"`, …); `"text"` for a sentence. */
|
|
21
|
+
channel: string;
|
|
22
|
+
/** The row's name: the field's name when the channel is a key of the datum, else the channel's. Empty for none. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** The value, formatted. */
|
|
25
|
+
value: string;
|
|
26
|
+
/** The value before formatting, when there is one. */
|
|
27
|
+
raw?: number | BandKey;
|
|
28
|
+
/** A swatch drawn before the row: the datum's series colour. */
|
|
29
|
+
color?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* What a tooltip shows: one line of text (`\n` breaks it), or rows of names
|
|
33
|
+
* and values in two columns.
|
|
34
|
+
*
|
|
35
|
+
* @category Charts
|
|
36
|
+
*/
|
|
37
|
+
export type TooltipContent = string | readonly TooltipRow[];
|
|
38
|
+
/**
|
|
39
|
+
* Per-channel formatters replacing the chart's own, keyed by channel
|
|
40
|
+
* (`{ y: (v) => `$${v}` }`). A band axis's value is its category key.
|
|
41
|
+
*
|
|
42
|
+
* @category Charts
|
|
43
|
+
*/
|
|
44
|
+
export type TooltipFormat = {
|
|
45
|
+
readonly [channel: string]: ((value: number | BandKey) => string) | undefined;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A mark's `tooltip` as an object: the default rows, reformatted or rewritten.
|
|
49
|
+
*
|
|
50
|
+
* @see https://sophistry.dev/guides/charts/#tooltips
|
|
51
|
+
* @category Charts
|
|
52
|
+
*/
|
|
53
|
+
export interface TooltipOptions<T> {
|
|
54
|
+
/** Formatters for some channels, replacing the axis's or legend's format. */
|
|
55
|
+
format?: TooltipFormat;
|
|
56
|
+
/** Your own content from the formatted default rows: return text, or rows (filtered, reordered, renamed or added to). */
|
|
57
|
+
content?: (rows: readonly TooltipRow[], datum: T, index: number) => TooltipContent;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A mark's `tooltip` prop: `true` for its default rows (one per channel,
|
|
61
|
+
* formatted as the chart's axes write them); a template such as
|
|
62
|
+
* `"{series}: {y}"`; `(d, i) => string`; a {@link TooltipOptions} object;
|
|
63
|
+
* or `false` for none. Omitted, the enclosing `<Chart tooltip>` decides.
|
|
64
|
+
*
|
|
65
|
+
* @see https://sophistry.dev/guides/charts/#tooltips
|
|
66
|
+
* @category Charts
|
|
67
|
+
*/
|
|
68
|
+
export type TooltipSpec<T> = boolean | string | ((datum: T, index: number) => string) | TooltipOptions<T>;
|
|
69
|
+
/**
|
|
70
|
+
* Where a hover tooltip stands: by the pointer, following it, or above its datum.
|
|
71
|
+
*
|
|
72
|
+
* @category Charts
|
|
73
|
+
*/
|
|
74
|
+
export type TooltipAnchor = "pointer" | "datum";
|
|
75
|
+
/**
|
|
76
|
+
* A chart's tooltip settings (`<Chart tooltip>`), as its {@link TooltipState} carries them.
|
|
77
|
+
*
|
|
78
|
+
* @category Extending
|
|
79
|
+
*/
|
|
80
|
+
export interface TooltipConfig {
|
|
81
|
+
/** Marks without a `tooltip` of their own show their default. */
|
|
82
|
+
all: boolean;
|
|
83
|
+
/** Formatters for some channels; a mark's own win. */
|
|
84
|
+
format?: TooltipFormat;
|
|
85
|
+
/** Where a hover tooltip stands. @default "pointer" */
|
|
86
|
+
anchor?: TooltipAnchor;
|
|
87
|
+
/**
|
|
88
|
+
* `"x"`: one shared tooltip for every series at the x nearest the pointer,
|
|
89
|
+
* with a crosshair; marks' own tooltips are off.
|
|
90
|
+
* @default "item"
|
|
91
|
+
*/
|
|
92
|
+
mode?: "item" | "x";
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* What a tooltip shows and where, in scene units.
|
|
96
|
+
*
|
|
97
|
+
* @category Extending
|
|
98
|
+
*/
|
|
99
|
+
export interface ActiveTooltip {
|
|
100
|
+
owner: object;
|
|
101
|
+
/** The content as one string: the accessible name. */
|
|
102
|
+
text: string;
|
|
103
|
+
content: TooltipContent;
|
|
104
|
+
at: Point;
|
|
105
|
+
/** Opened by a hovering pointer, so it follows it. */
|
|
106
|
+
follow: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* One point a mark offers a chart's shared nearest-x tooltip
|
|
110
|
+
* (`<Chart tooltip={{ mode: "x" }}>`).
|
|
111
|
+
*
|
|
112
|
+
* @category Extending
|
|
113
|
+
*/
|
|
114
|
+
export interface TooltipPoint {
|
|
115
|
+
/** Where it is drawn, in scene units. */
|
|
116
|
+
at: Point;
|
|
117
|
+
/** Its x, as the x axis writes it: the tooltip's heading. */
|
|
118
|
+
x: string;
|
|
119
|
+
/** The row it adds: its series' name and its formatted y. */
|
|
120
|
+
row: TooltipRow;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* One chart's tooltip: which datum, if any, it is showing.
|
|
124
|
+
*
|
|
125
|
+
* @category Extending
|
|
126
|
+
*/
|
|
127
|
+
export interface TooltipState {
|
|
128
|
+
/** What is showing, if anything; the overlay binds to it. */
|
|
129
|
+
active: Readable<ActiveTooltip | null>;
|
|
130
|
+
/** Shows `content` about the point `at` on behalf of `owner`; with `follow`, by the pointer while it hovers. */
|
|
131
|
+
show(owner: object, content: TooltipContent, at: Point, follow?: boolean): void;
|
|
132
|
+
/** Hides the tooltip, if `owner` is the one showing it. */
|
|
133
|
+
hide(owner: object): void;
|
|
134
|
+
/** The chart's settings (`chart`'s `tooltip`): undefined for none, false to turn tooltips off. */
|
|
135
|
+
config(): TooltipConfig | false | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the points `owner` offers the shared nearest-x tooltip (a mark
|
|
138
|
+
* calls it from each update); `null` withdraws them (on dispose).
|
|
139
|
+
*/
|
|
140
|
+
offerPoints(owner: object, points: readonly TooltipPoint[] | null): void;
|
|
141
|
+
/** Every point offered, from every mark, in the order they were first offered. */
|
|
142
|
+
points(): readonly TooltipPoint[];
|
|
143
|
+
/** Bumps whenever the offered points change: the overlay binds to it. */
|
|
144
|
+
pointsVersion: Readable<number>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Creates a {@link TooltipState}.
|
|
148
|
+
*
|
|
149
|
+
* @param config - The chart's tooltip settings, read when asked.
|
|
150
|
+
* @category Extending
|
|
151
|
+
*/
|
|
152
|
+
export declare function createTooltipState(config?: () => TooltipConfig | false | undefined): TooltipState;
|
|
153
|
+
/**
|
|
154
|
+
* The enclosing chart's tooltip state, or null outside a chart. Read it with
|
|
155
|
+
* `ctx.context(tooltipContext)`.
|
|
156
|
+
*
|
|
157
|
+
* @category Extending
|
|
158
|
+
*/
|
|
159
|
+
export declare const tooltipContext: ContextKey<TooltipState | null>;
|
|
160
|
+
/**
|
|
161
|
+
* One channel a mark's default tooltip reports, before formatting.
|
|
162
|
+
*
|
|
163
|
+
* @category Extending
|
|
164
|
+
*/
|
|
165
|
+
export interface TooltipField {
|
|
166
|
+
/** The channel's prop name: `"x"`, `"y"`, `"series"`, `"size"`, … */
|
|
167
|
+
channel: string;
|
|
168
|
+
/** The channel prop as given; a key of the datum names the row. */
|
|
169
|
+
of?: unknown;
|
|
170
|
+
/** The row's name, overriding the one `of` gives. */
|
|
171
|
+
name?: string;
|
|
172
|
+
/** The value; null or undefined drops the row. */
|
|
173
|
+
value: number | BandKey | null | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* How the chart writes the value (`useChart().format(…)`). Defaults to `formatTick` for
|
|
176
|
+
* numbers.
|
|
177
|
+
*/
|
|
178
|
+
format?: (value: number | BandKey) => string;
|
|
179
|
+
/** A swatch before the row. */
|
|
180
|
+
color?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* A tooltip's content as one string, its accessible name: text as is, rows
|
|
184
|
+
* as `name: value` joined by commas.
|
|
185
|
+
*
|
|
186
|
+
* @category Extending
|
|
187
|
+
*/
|
|
188
|
+
export declare function tooltipLabel(content: TooltipContent): string;
|
|
189
|
+
/**
|
|
190
|
+
* Resolves a {@link TooltipSpec} to one datum's content, or undefined for
|
|
191
|
+
* none. `fallback` is the mark's default; with `state`, the chart's
|
|
192
|
+
* `<Chart tooltip>` settings apply.
|
|
193
|
+
*/
|
|
194
|
+
export declare function tooltipText<T>(spec: TooltipSpec<T> | undefined, fallback: (datum: T, index: number) => string | readonly TooltipField[], datum: T, index: number, state?: TooltipState): TooltipContent | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* Interaction props that make a shape show its tooltip on hover, tap or
|
|
197
|
+
* Enter; spread onto the shape. A mark whose `tooltip` is off registers no
|
|
198
|
+
* interaction. Outside a chart, only the accessible `label` is set.
|
|
199
|
+
*
|
|
200
|
+
* @param tooltip - The chart's tooltip state, if any.
|
|
201
|
+
* @param text - The content, or undefined for none; read reactively.
|
|
202
|
+
* @param at - Where the tooltip points, in scene units.
|
|
203
|
+
* @category Extending
|
|
204
|
+
*/
|
|
205
|
+
export declare function tooltipHandlers(tooltip: TooltipState | undefined, text: () => TooltipContent | undefined, at: () => Point): {
|
|
206
|
+
readonly label?: string;
|
|
207
|
+
readonly onEnter?: (event: ScenePointerEvent) => void;
|
|
208
|
+
readonly onLeave?: (event: ScenePointerEvent) => void;
|
|
209
|
+
readonly onTap?: (event: ScenePointerEvent) => void;
|
|
210
|
+
};
|
|
211
|
+
/** Width and height of a tooltip's panel, padding included. */
|
|
212
|
+
interface TooltipSize {
|
|
213
|
+
width: number;
|
|
214
|
+
height: number;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* A tooltip panel's bounds: `"above"` centred over `at`, `"right"` beside it,
|
|
218
|
+
* flipped when `frame`'s edge would cut it, then clamped inside `frame`.
|
|
219
|
+
*
|
|
220
|
+
* @internal
|
|
221
|
+
*/
|
|
222
|
+
export declare function placeTooltip(size: TooltipSize, at: Point, frame: Bounds | undefined, side?: "above" | "right", gap?: number): Bounds;
|
|
223
|
+
/**
|
|
224
|
+
* The points at the scene x nearest `x` (all within a hair of it, so series
|
|
225
|
+
* on one grid share a tooltip). Undefined for none.
|
|
226
|
+
*
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
export declare function nearestX(points: readonly TooltipPoint[], x: number): {
|
|
230
|
+
x: number;
|
|
231
|
+
points: TooltipPoint[];
|
|
232
|
+
} | undefined;
|
|
233
|
+
/**
|
|
234
|
+
* {@link nearestX} over one set of points, for a pointer that asks on every
|
|
235
|
+
* move: the points are sorted by x once and each query bisects, rather than
|
|
236
|
+
* scanning and filtering them all. Answers exactly as the scan did: the
|
|
237
|
+
* nearest finite point wins, a tie going to the one offered first, and the
|
|
238
|
+
* group is every point within a hair of its x, in the order offered.
|
|
239
|
+
*
|
|
240
|
+
* @internal
|
|
241
|
+
*/
|
|
242
|
+
export declare function nearestXIndex(points: readonly TooltipPoint[]): (x: number) => {
|
|
243
|
+
x: number;
|
|
244
|
+
points: TooltipPoint[];
|
|
245
|
+
} | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* One datum's channel value: a key, or `(d, i) => value`; undefined for an
|
|
248
|
+
* omitted or constant channel.
|
|
249
|
+
*
|
|
250
|
+
* @internal
|
|
251
|
+
*/
|
|
252
|
+
export declare function datumValue<T>(of: unknown, datum: T, index: number): number | BandKey | undefined;
|
|
253
|
+
/** One datum a mark offers the shared nearest-x tooltip, before formatting. @internal */
|
|
254
|
+
export interface SharedTooltipDatum {
|
|
255
|
+
/** Data units. */
|
|
256
|
+
x: number;
|
|
257
|
+
y: number;
|
|
258
|
+
/** Where it is drawn, in scene units. */
|
|
259
|
+
at: Point;
|
|
260
|
+
/** Its series, naming its row; omitted, the row is named by the `y` channel. */
|
|
261
|
+
series?: BandKey;
|
|
262
|
+
color?: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* The points a mark offers the shared nearest-x tooltip: one row each, named
|
|
266
|
+
* by series (else the `y` channel). Empty unless the chart's tooltip mode is
|
|
267
|
+
* `"x"`, so `data` is only read while it is on. Pass the result to
|
|
268
|
+
* `tooltip.offerPoints(owner, points)`.
|
|
269
|
+
*
|
|
270
|
+
* @internal
|
|
271
|
+
*/
|
|
272
|
+
export declare function sharedTooltipPoints(tooltip: TooltipState | null | undefined, data: () => readonly SharedTooltipDatum[], channels: {
|
|
273
|
+
y: unknown;
|
|
274
|
+
format?: (channel: "x" | "y" | "series") => (value: number | BandKey) => string;
|
|
275
|
+
}): readonly TooltipPoint[];
|
|
276
|
+
export {};
|
|
277
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/tooltip.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAIvE,2EAA2E;AAC3E,eAAO,MAAM,OAAO,OAAO,CAAC;AAE5B;;;;GAIG;AACH,MAAM,WAAW,UAAU;IAC1B,oHAAoH;IACpH,OAAO,EAAE,MAAM,CAAC;IAChB,mHAAmH;IACnH,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,G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
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small helpers the chart components share: value equality for memo
|
|
3
|
+
* boundaries, point mixing, bisection. Internal; not exported from the
|
|
4
|
+
* package entry.
|
|
5
|
+
*/
|
|
6
|
+
import type { Point } from "@sophistry/core/geometry";
|
|
7
|
+
/**
|
|
8
|
+
* Whether two values are equal one level deep: the same value, or arrays
|
|
9
|
+
* (or plain objects) whose members are identical (`Object.is`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function shallowEqual(a: unknown, b: unknown): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether two values are equal by structure (arrays, plain objects,
|
|
14
|
+
* primitives; functions and class instances by identity). For reports and
|
|
15
|
+
* other small configuration values, never for large data.
|
|
16
|
+
*/
|
|
17
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
18
|
+
/** `a + (b − a)·t`. */
|
|
19
|
+
export declare function mix(a: number, b: number, t: number): number;
|
|
20
|
+
/** Two points mixed by `t`. */
|
|
21
|
+
export declare function mixPoint(a: Point, b: Point, t: number): Point;
|
|
22
|
+
/** The first index of sorted `values` whose value is `>= target`. */
|
|
23
|
+
export declare function lowerBound(values: readonly number[], target: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* A last-value cache by equality: returns the previous value while
|
|
26
|
+
* `equals(previous, next)` holds, so identity-keyed caches downstream hit.
|
|
27
|
+
*/
|
|
28
|
+
export declare function stableValue<T>(equals?: (a: T, b: T) => boolean): (next: T) => T;
|
|
29
|
+
/**
|
|
30
|
+
* A last-input cache over a dependency list: `make()` runs only when `deps`
|
|
31
|
+
* differ (shallowly) from the last call's, else the last result is returned.
|
|
32
|
+
*/
|
|
33
|
+
export declare function keyedMemo<T>(): (deps: readonly unknown[], make: () => T) => T;
|
|
34
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CA4B5D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CA+BzD;AAED,uBAAuB;AACvB,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,+BAA+B;AAC/B,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,CAE7D;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAS5E;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC5B,MAAM,GAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAsB,GAC5C,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAOhB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAQ7E"}
|