@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,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tap-to-drill for the zoomable hierarchy charts (`treemap`, `icicle`,
|
|
3
|
+
* `sunburst`, `circlePack`, `tree`): {@link createDrillDown}, which turns
|
|
4
|
+
* "zoom to this node" into a tweened, scrubbable `{ from, to, t }` focus,
|
|
5
|
+
* plus the drill props the charts share and the interaction a chart's
|
|
6
|
+
* batched node carries.
|
|
7
|
+
*
|
|
8
|
+
* The drill-down is plain tracks (`focus` and `path` are `Readable`s a chart
|
|
9
|
+
* prop binds to) and its zoom runs on a clock it is given. A chart without
|
|
10
|
+
* a controlled `focus` keeps one of its own on its scene's clock.
|
|
11
|
+
*
|
|
12
|
+
* A chart's nodes are one batched node, so the chart is one tab stop whose
|
|
13
|
+
* nodes the arrow keys walk (the accessibility layer's item list): Enter or
|
|
14
|
+
* Space taps the current node (drilling as a tap does), Escape zooms out one
|
|
15
|
+
* level (`aria-keyshortcuts="Escape"`). The item list walks every drawn node.
|
|
16
|
+
*/
|
|
17
|
+
import type { Clock, CompositeContext, Easing, KeyboardBehaviour, PlayResult, Readable, ReducedMotion, ScenePointerEvent, Track } from "@sophistry/core";
|
|
18
|
+
import type { Point } from "@sophistry/core/geometry";
|
|
19
|
+
import type { HierarchyPathSpec } from "../math/breadcrumbs";
|
|
20
|
+
import type { HierarchyNodeInfo } from "../math/hierarchy";
|
|
21
|
+
import type { TooltipSpec, TooltipState } from "../tooltip";
|
|
22
|
+
import type { HierarchyFocusSpec, ResolvedFocus } from "./shared";
|
|
23
|
+
/**
|
|
24
|
+
* How a drill-down zoom animates.
|
|
25
|
+
*
|
|
26
|
+
* @category Charts
|
|
27
|
+
*/
|
|
28
|
+
export interface DrillOptions {
|
|
29
|
+
/** Length of the zoom, in seconds. @default 0.75 */
|
|
30
|
+
duration?: number;
|
|
31
|
+
/** Easing of the zoom. @default "smooth" */
|
|
32
|
+
easing?: Easing;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Options for {@link createDrillDown}.
|
|
36
|
+
*
|
|
37
|
+
* @category Charts
|
|
38
|
+
*/
|
|
39
|
+
export interface DrillDownOptions extends DrillOptions {
|
|
40
|
+
/** The path in focus at first. Defaults to the root. @default [] */
|
|
41
|
+
initial?: readonly string[];
|
|
42
|
+
/**
|
|
43
|
+
* The clock the zoom's tween runs on: pass the scene's (`scene.clock`) so
|
|
44
|
+
* it pauses and steps with it. @default defaultClock
|
|
45
|
+
*/
|
|
46
|
+
clock?: Clock;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the zoom reduces motion (jumps to its end): `"auto"` defers to
|
|
49
|
+
* the clock, a `Readable` answers live (a scene's own setting).
|
|
50
|
+
* @default "auto"
|
|
51
|
+
*/
|
|
52
|
+
reducedMotion?: ReducedMotion | Readable<boolean>;
|
|
53
|
+
/** Called just before a reduced-motion zoom jumps to its end. */
|
|
54
|
+
onReducedJump?: () => void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A drill-down's state: where it is going and the tween getting it there.
|
|
58
|
+
* Returned by {@link createDrillDown}.
|
|
59
|
+
*
|
|
60
|
+
* @category Charts
|
|
61
|
+
*/
|
|
62
|
+
export interface DrillDown {
|
|
63
|
+
/**
|
|
64
|
+
* The focus to hand to a chart (and to {@link breadcrumbs}): a transition
|
|
65
|
+
* from the view when the last zoom started to {@link DrillDown.path}. A
|
|
66
|
+
* `Readable`: pass it as the chart's `focus` prop and the chart follows.
|
|
67
|
+
*/
|
|
68
|
+
readonly focus: Readable<HierarchyPathSpec>;
|
|
69
|
+
/** Where the drill-down is (or is going): names below the root. */
|
|
70
|
+
readonly path: Readable<readonly string[]>;
|
|
71
|
+
/** The last zoom's 0..1 track; set or scrub it to replay that zoom. */
|
|
72
|
+
readonly t: Track<number>;
|
|
73
|
+
/**
|
|
74
|
+
* Zooms to the node at `path` from the view on screen now, interrupting any
|
|
75
|
+
* running zoom. Resolves `"done"`, or `"aborted"` if replaced; a no-op when
|
|
76
|
+
* already there. Hand it straight to a chart's `onFocusChange` or a trail's
|
|
77
|
+
* `onSelect`.
|
|
78
|
+
*/
|
|
79
|
+
zoomTo(path: readonly string[]): Promise<PlayResult>;
|
|
80
|
+
/** Zooms out one level, to the parent of {@link DrillDown.path}. */
|
|
81
|
+
zoomOut(): Promise<PlayResult>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Animated, scrubbable drill-down for a zoomable hierarchy chart. Pass
|
|
85
|
+
* `focus` to the chart (and to {@link breadcrumbs}), and `zoomTo` to the
|
|
86
|
+
* chart's `onFocusChange`; every frame is a pure function of the track `t`.
|
|
87
|
+
* Give it the scene's clock so the zoom runs with the scene.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* import { createScene } from "@sophistry/core";
|
|
92
|
+
* import { createDrillDown, treemap } from "@sophistry/charts";
|
|
93
|
+
*
|
|
94
|
+
* const scene = createScene({ host: document.querySelector("#figure")!, units: 10 });
|
|
95
|
+
* const files = {
|
|
96
|
+
* name: "repo",
|
|
97
|
+
* children: [
|
|
98
|
+
* { name: "src", children: [{ name: "index.ts", size: 12 }, { name: "chart.ts", size: 30 }] },
|
|
99
|
+
* { name: "README.md", size: 4 },
|
|
100
|
+
* ],
|
|
101
|
+
* };
|
|
102
|
+
* const zoom = createDrillDown({ clock: scene.clock });
|
|
103
|
+
* scene.add(
|
|
104
|
+
* treemap.create({
|
|
105
|
+
* data: files,
|
|
106
|
+
* value: "size",
|
|
107
|
+
* label: "name",
|
|
108
|
+
* width: 8,
|
|
109
|
+
* height: 4,
|
|
110
|
+
* focus: zoom.focus,
|
|
111
|
+
* onFocusChange: (path) => void zoom.zoomTo(path),
|
|
112
|
+
* }),
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#hierarchies
|
|
117
|
+
* @category Charts
|
|
118
|
+
*/
|
|
119
|
+
export declare function createDrillDown(options?: DrillDownOptions): DrillDown;
|
|
120
|
+
/**
|
|
121
|
+
* A breadcrumb trail drawn by a zoomable hierarchy chart itself (its
|
|
122
|
+
* `breadcrumbs` prop), by default just above the chart's top-left corner.
|
|
123
|
+
*
|
|
124
|
+
* @category Charts
|
|
125
|
+
*/
|
|
126
|
+
export interface HierarchyBreadcrumbOptions {
|
|
127
|
+
/** The root crumb's text. Defaults to the root's `label`, else `"All"`. */
|
|
128
|
+
root?: string;
|
|
129
|
+
/** Where the trail starts (its left end, vertically centred). */
|
|
130
|
+
at?: Point;
|
|
131
|
+
/** Font size. Defaults to the chart's label size + 0.04. */
|
|
132
|
+
fontSize?: number;
|
|
133
|
+
/**
|
|
134
|
+
* The widest the trail may be before its middle collapses into `…`;
|
|
135
|
+
* `false` never collapses. Defaults to the chart's width.
|
|
136
|
+
*/
|
|
137
|
+
maxWidth?: number | false;
|
|
138
|
+
/**
|
|
139
|
+
* A back control before the trail (`true` for `"←"`, or its text) that zooms
|
|
140
|
+
* out one level.
|
|
141
|
+
* @default false
|
|
142
|
+
*/
|
|
143
|
+
back?: boolean | string;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Tap-to-drill props shared by `treemap`, `icicle`, `sunburst`, `circlePack`
|
|
147
|
+
* and `tree`. Uncontrolled (`drill`, no `focus`), the chart keeps its own
|
|
148
|
+
* focus and tweens to tapped nodes; controlled (`focus` + `onFocusChange`),
|
|
149
|
+
* a tap only calls `onFocusChange`. A tap on the focused node zooms out,
|
|
150
|
+
* on a parent zooms in, on a leaf zooms to its parent; Enter and Space tap
|
|
151
|
+
* the node the arrow keys are on, Escape zooms out. Focus is by name path,
|
|
152
|
+
* so keep sibling labels unique.
|
|
153
|
+
*
|
|
154
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#hierarchies
|
|
155
|
+
* @category Charts
|
|
156
|
+
*/
|
|
157
|
+
export interface HierarchyDrillProps<T> {
|
|
158
|
+
/**
|
|
159
|
+
* Tap or Enter on a node to zoom to it: `true`, or the zoom's timing.
|
|
160
|
+
* Defaults to true when `onFocusChange` is given, else false.
|
|
161
|
+
*/
|
|
162
|
+
drill?: boolean | DrillOptions;
|
|
163
|
+
/** Called when a tap or breadcrumb asks to zoom, with the path below the root and that node's datum. */
|
|
164
|
+
onFocusChange?: (path: string[], datum: NoInfer<T>) => void;
|
|
165
|
+
/** The uncontrolled focus at first: a path of names below the root. Defaults to the root. */
|
|
166
|
+
defaultFocus?: readonly string[];
|
|
167
|
+
/** Draw a breadcrumb trail of the focus path above the chart; tap a crumb to zoom out to it. */
|
|
168
|
+
breadcrumbs?: boolean | HierarchyBreadcrumbOptions;
|
|
169
|
+
}
|
|
170
|
+
/** The drill prop keys every zoomable hierarchy chart declares. */
|
|
171
|
+
export declare const DRILL_PROP_KEYS: readonly ["drill", "onFocusChange", "defaultFocus", "breadcrumbs", "focus"];
|
|
172
|
+
/** A chart's drill-down state on one update: the focus to draw and how to ask for a new one. @internal */
|
|
173
|
+
export interface HierarchyDrill<T> {
|
|
174
|
+
/** The focus to draw. */
|
|
175
|
+
focus: HierarchyFocusSpec<T> | undefined;
|
|
176
|
+
/** Whether taps drill. */
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
/** Whether asking to zoom does anything (uncontrolled, or someone listens). */
|
|
179
|
+
canSelect: boolean;
|
|
180
|
+
/** Asks to zoom to the node at `position` of the current layout. */
|
|
181
|
+
select(position: number): void;
|
|
182
|
+
/** Asks to zoom to a path. */
|
|
183
|
+
selectPath(path: readonly string[]): void;
|
|
184
|
+
}
|
|
185
|
+
/** The props {@link createHierarchyDrill} reads. */
|
|
186
|
+
type DrillChartProps<T> = HierarchyDrillProps<T> & {
|
|
187
|
+
focus?: HierarchyFocusSpec<T>;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* A chart's drill-down: its `focus`, `drill`, `onFocusChange` and
|
|
191
|
+
* `defaultFocus` props resolved, with the uncontrolled focus kept on the
|
|
192
|
+
* scene's clock. The chart reruns its `update` while its own zoom runs.
|
|
193
|
+
* Call once, in `setup`; call the result in every update.
|
|
194
|
+
*
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
export declare function createHierarchyDrill<T, P extends DrillChartProps<T>>(ctx: CompositeContext<P>): (props: DrillChartProps<T>, nodes: readonly HierarchyNodeInfo<T>[]) => HierarchyDrill<T>;
|
|
198
|
+
/** What a chart's node interaction reads on each event: the latest update's state. @internal */
|
|
199
|
+
export interface NodeInteractionState<T> {
|
|
200
|
+
/** The chart's tooltip. */
|
|
201
|
+
tooltip: TooltipState;
|
|
202
|
+
/** The chart's `tooltip` prop. */
|
|
203
|
+
spec: TooltipSpec<T> | undefined;
|
|
204
|
+
/** The whole layout. */
|
|
205
|
+
nodes: readonly HierarchyNodeInfo<T>[];
|
|
206
|
+
/** The node the zoom is heading for. */
|
|
207
|
+
target: number;
|
|
208
|
+
/** The resolved focus: no tooltip opens while it moves. */
|
|
209
|
+
resolved: ResolvedFocus;
|
|
210
|
+
drill: HierarchyDrill<T>;
|
|
211
|
+
/** A batched item's position in the whole layout, or undefined. */
|
|
212
|
+
positionOf(item: number): number | undefined;
|
|
213
|
+
/** Where a batched item's tooltip points, in scene units. */
|
|
214
|
+
atOf(item: number): Point | undefined;
|
|
215
|
+
}
|
|
216
|
+
/** The interaction props a hierarchy chart's batched node carries. @internal */
|
|
217
|
+
export interface NodeInteractionProps {
|
|
218
|
+
label?: string;
|
|
219
|
+
itemLabel?: (item: number) => string | undefined;
|
|
220
|
+
onEnter?: (event: ScenePointerEvent) => void;
|
|
221
|
+
onLeave?: (event: ScenePointerEvent) => void;
|
|
222
|
+
onTap?: (event: ScenePointerEvent) => void;
|
|
223
|
+
keyboard?: KeyboardBehaviour;
|
|
224
|
+
cursor?: string;
|
|
225
|
+
}
|
|
226
|
+
/** A chart's node interaction: see {@link createNodeInteraction}. @internal */
|
|
227
|
+
export interface NodeInteraction {
|
|
228
|
+
/**
|
|
229
|
+
* The props to spread into the batched node's shared props (empty when
|
|
230
|
+
* neither drilling nor tooltips are on), naming the node `name`.
|
|
231
|
+
*/
|
|
232
|
+
props(name: string): NodeInteractionProps;
|
|
233
|
+
/** Taps the node at layout `position` (its tooltip pointing at `at`), as a tap on its item does. */
|
|
234
|
+
tapNode(position: number, at: Point): void;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* The interaction of a hierarchy chart's batched node (tooltip, drilling
|
|
238
|
+
* tap, Escape, cursor, each node's accessible name), made once so the
|
|
239
|
+
* handlers' identities hold across updates. `stateOf` hands back the latest
|
|
240
|
+
* update's state. Call once, in `setup`.
|
|
241
|
+
*
|
|
242
|
+
* @internal
|
|
243
|
+
*/
|
|
244
|
+
export declare function createNodeInteraction<T>(stateOf: () => NodeInteractionState<T>): NodeInteraction;
|
|
245
|
+
export {};
|
|
246
|
+
//# sourceMappingURL=drill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drill.d.ts","sourceRoot":"","sources":["../../src/hierarchy/drill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACX,KAAK,EACL,gBAAgB,EAChB,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,KAAK,EACL,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB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,CAAC;CAChB;AAQD,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC/B;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAAC;IAC1C,oGAAoG;IACpG,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACtC,OAAO,EAAE,MAAM,oBAAoB,CAAC,CAAC,CAAC,GACpC,eAAe,CAmHjB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The steps every zoomable hierarchy chart (`treemap`, `icicle`, `sunburst`,
|
|
3
|
+
* `circlePack`, `tree`) takes on an update before drawing: lay out (both
|
|
4
|
+
* ends of a keyed transition, joined at `blend`), key, colour, resolve the
|
|
5
|
+
* drill-down and the zoom window, close a tooltip the view moved away from.
|
|
6
|
+
* Each step is cached on its inputs (see `shared.ts`), so a `progress` frame
|
|
7
|
+
* re-lays out nothing and a zoom scrub only moves the window.
|
|
8
|
+
*
|
|
9
|
+
* Internal to the family.
|
|
10
|
+
*/
|
|
11
|
+
import type { CompositeContext, SceneNode } from "@sophistry/core";
|
|
12
|
+
import type { Point } from "@sophistry/core/geometry";
|
|
13
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
14
|
+
import type { HierarchyNodeInfo } from "../math/hierarchy";
|
|
15
|
+
import type { TooltipState } from "../tooltip";
|
|
16
|
+
import type { ChartBreadcrumbsFrame } from "./breadcrumbs";
|
|
17
|
+
import type { HierarchyDrill, HierarchyDrillProps, NodeInteractionProps } from "./drill";
|
|
18
|
+
import type { HierarchyChartBaseProps, HierarchyEnds, HierarchyFocusSpec, HierarchyTransitionProps, HierarchyView, HierarchyZoom, Joined } from "./shared";
|
|
19
|
+
/** The props the shared steps read. */
|
|
20
|
+
export type ZoomableChartProps<T> = HierarchyChartBaseProps<T> & HierarchyTransitionProps<T> & HierarchyDrillProps<T> & {
|
|
21
|
+
focus?: HierarchyFocusSpec<T>;
|
|
22
|
+
};
|
|
23
|
+
/** One update's shared state of a hierarchy chart. @internal */
|
|
24
|
+
export interface HierarchyChartFrame<T, N extends HierarchyNodeInfo<T>> {
|
|
25
|
+
ends: HierarchyEnds<N>;
|
|
26
|
+
/** The layout drawn: `data`'s, or both ends joined at `blend`. */
|
|
27
|
+
layout: readonly Joined<N>[];
|
|
28
|
+
/** Each node's identity (its path of names): the instance key of its mark. */
|
|
29
|
+
keys: readonly string[];
|
|
30
|
+
/** Each node's fill. */
|
|
31
|
+
fills: readonly string[];
|
|
32
|
+
drill: HierarchyDrill<T>;
|
|
33
|
+
zoom: HierarchyZoom;
|
|
34
|
+
/** The chart's tooltip: the enclosing chart's, else its own. */
|
|
35
|
+
tooltip: TooltipState;
|
|
36
|
+
/** Whether nodes take part in interaction (taps, tooltips, the item list). */
|
|
37
|
+
interactive: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** How a chart turns its layout into the windows its zoom moves between. */
|
|
40
|
+
export interface HierarchyViewOptions<N> {
|
|
41
|
+
/** The window showing the subtree of the node at `position`. */
|
|
42
|
+
viewOf: (layout: readonly Joined<N>[], position: number) => HierarchyView;
|
|
43
|
+
/** How two windows blend. @default linear */
|
|
44
|
+
blend?: (a: HierarchyView, b: HierarchyView, t: number) => HierarchyView;
|
|
45
|
+
}
|
|
46
|
+
/** A hierarchy chart's shared machinery. See {@link createHierarchyChart}. @internal */
|
|
47
|
+
export interface HierarchyChart<T, N extends HierarchyNodeInfo<T>> {
|
|
48
|
+
/** Runs the shared steps for this update. */
|
|
49
|
+
frame(props: ZoomableChartProps<T>, theme: Theme, layoutOf: (data: T, end: "from" | "to") => N[], deps: readonly unknown[], view: HierarchyViewOptions<N>): HierarchyChartFrame<T, N>;
|
|
50
|
+
/**
|
|
51
|
+
* The batched node's interaction props for this update, named `name`;
|
|
52
|
+
* `positionOf` and `atOf` map a batched item to its node and tooltip anchor.
|
|
53
|
+
*/
|
|
54
|
+
interaction(name: string, positionOf: (item: number) => number | undefined, atOf: (item: number) => Point | undefined): NodeInteractionProps;
|
|
55
|
+
/** Taps the node at layout `position`, as a tap on its item does (for a node's name). */
|
|
56
|
+
tapNode(position: number, at: Point): void;
|
|
57
|
+
/** The chart's own trail, or null for none. */
|
|
58
|
+
breadcrumbs(frame: Omit<ChartBreadcrumbsFrame<T>, "nodes" | "resolved" | "drill">): SceneNode | null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A hierarchy chart's shared machinery: its layout cache, keys, fills,
|
|
62
|
+
* drill-down, zoom, tooltip and trail. Call once, in `setup`.
|
|
63
|
+
*
|
|
64
|
+
* @param fields - The numeric fields that place a node (for the keyed join).
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export declare function createHierarchyChart<T, N extends HierarchyNodeInfo<T>, P extends ZoomableChartProps<T>>(ctx: CompositeContext<P>, fields: readonly (keyof N & string)[]): HierarchyChart<T, N>;
|
|
68
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/hierarchy/frame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,OAAO,KAAK,EACX,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EAEpB,MAAM,SAAS,CAAC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3
|
+
*
|
|
4
|
+
* Every band is one `rect` instance of one instances node, keyed by the
|
|
5
|
+
* node's path of names; per-node picking, tooltips and drilling go through
|
|
6
|
+
* `event.item`. The level-by-level reveal grows each rectangle from its
|
|
7
|
+
* parent side (geometry). Names are `label` nodes, one per
|
|
8
|
+
* rectangle whose name fits.
|
|
9
|
+
*/
|
|
10
|
+
import type { Point } from "@sophistry/core/geometry";
|
|
11
|
+
import type { RequiredUnless } from "../data/channels";
|
|
12
|
+
import type { HierarchyDrillProps } from "./drill";
|
|
13
|
+
import type { HierarchyChartBaseProps, HierarchyFocusSpec, HierarchyTransitionProps } from "./shared";
|
|
14
|
+
/** @category Charts */
|
|
15
|
+
export interface IcicleBaseProps<T> extends HierarchyChartBaseProps<T>, HierarchyTransitionProps<T>, HierarchyDrillProps<T> {
|
|
16
|
+
/** Width of the whole chart. */
|
|
17
|
+
width: number;
|
|
18
|
+
/** Height of the whole chart. */
|
|
19
|
+
height: number;
|
|
20
|
+
/** Centre of the chart. Defaults to the origin. */
|
|
21
|
+
center?: Point;
|
|
22
|
+
/**
|
|
23
|
+
* `"horizontal"`: the root is a column at the left, depth increasing to the right.
|
|
24
|
+
* `"vertical"`: the root is a row at the top, depth increasing downward.
|
|
25
|
+
* @default "horizontal"
|
|
26
|
+
*/
|
|
27
|
+
orientation?: "horizontal" | "vertical";
|
|
28
|
+
/**
|
|
29
|
+
* Draw the root's band; `false` gives its room to the other levels.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
root?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Gap left around each rectangle.
|
|
35
|
+
* @default 0.01
|
|
36
|
+
*/
|
|
37
|
+
inset?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Zoom into a node: it spans the whole breadth, its descendants fill the depth after it, and
|
|
40
|
+
* the rest fades away. A path of names below the root (`["a"]`), a predicate, or `{ from, to, t
|
|
41
|
+
* }` for a scrubbable transition. Given, the chart is controlled: taps only call
|
|
42
|
+
* `onFocusChange`. Defaults to the root.
|
|
43
|
+
*/
|
|
44
|
+
focus?: HierarchyFocusSpec<T>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Props of {@link icicle}: `value` is required unless the tree's nodes are numbers.
|
|
48
|
+
*
|
|
49
|
+
* @category Charts
|
|
50
|
+
*/
|
|
51
|
+
export type IcicleProps<T> = IcicleBaseProps<T> & RequiredUnless<T, number, "value">;
|
|
52
|
+
/**
|
|
53
|
+
* An icicle chart: the partition layout as rectangles, one band per depth, each node spanning
|
|
54
|
+
* exactly its children, sized by value. Lays itself out in a `width × height` box; reveals one
|
|
55
|
+
* depth at a time from the root. Supports drill-down `focus` and keyed transitions. The
|
|
56
|
+
* rectangles are one instances node (`event.item` picks a node). See {@link partitionLayout} for
|
|
57
|
+
* the layout alone.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* import { icicle } from "@sophistry/charts";
|
|
62
|
+
*
|
|
63
|
+
* const files = {
|
|
64
|
+
* name: "repo",
|
|
65
|
+
* children: [
|
|
66
|
+
* { name: "src", children: [{ name: "index.ts", size: 12 }, { name: "chart.ts", size: 30 }] },
|
|
67
|
+
* { name: "README.md", size: 4 },
|
|
68
|
+
* ],
|
|
69
|
+
* };
|
|
70
|
+
* icicle.create({ data: files, value: "size", label: "name", width: 8, height: 4, orientation: "vertical" });
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#hierarchies
|
|
74
|
+
* @category Charts
|
|
75
|
+
*/
|
|
76
|
+
export declare const icicle: import("@sophistry/core").Definition<IcicleBaseProps<any>, import("@sophistry/core/internal").CompositeNode<IcicleBaseProps<any>>, keyof IcicleBaseProps<any>>;
|
|
77
|
+
//# sourceMappingURL=icicle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icicle.d.ts","sourceRoot":"","sources":["../../src/hierarchy/icicle.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAItD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAMnD,OAAO,KAAK,EACX,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,UAAU,CAAC;AAclB,uBAAuB;AACvB,MAAM,WAAW,eAAe,CAAC,CAAC,CACjC,SAAQ,uBAAuB,CAAC,CAAC,CAAC,EACjC,wBAAwB,CAAC,CAAC,CAAC,EAC3B,mBAAmB,CAAC,CAAC,CAAC;IACvB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAC9C,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAgLpC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,MAAM,gKAiCjB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Family barrel: hierarchy. Owned by its family; re-exported from the package entry. */
|
|
2
|
+
export type { BreadcrumbsProps } from "./breadcrumbs";
|
|
3
|
+
export { breadcrumbs } from "./breadcrumbs";
|
|
4
|
+
export type { CirclePackBaseProps, CirclePackProps } from "./circle-pack";
|
|
5
|
+
export { circlePack } from "./circle-pack";
|
|
6
|
+
export type { DrillDown, DrillDownOptions, DrillOptions, HierarchyBreadcrumbOptions, HierarchyDrillProps, } from "./drill";
|
|
7
|
+
export { createDrillDown } from "./drill";
|
|
8
|
+
export type { IcicleBaseProps, IcicleProps } from "./icicle";
|
|
9
|
+
export { icicle } from "./icicle";
|
|
10
|
+
export type { MosaicProps } from "./mosaic";
|
|
11
|
+
export { mosaic } from "./mosaic";
|
|
12
|
+
export type { SankeyBaseProps, SankeyProps } from "./sankey";
|
|
13
|
+
export { sankey } from "./sankey";
|
|
14
|
+
export type { HierarchyChartBaseProps, HierarchyFocus, HierarchyFocusSpec, HierarchyTransitionProps, HierarchyView, } from "./shared";
|
|
15
|
+
export type { SunburstBaseProps, SunburstProps } from "./sunburst";
|
|
16
|
+
export { sunburst } from "./sunburst";
|
|
17
|
+
export type { TreeProps } from "./tree";
|
|
18
|
+
export { tree } from "./tree";
|
|
19
|
+
export type { TreemapBaseProps, TreemapProps } from "./treemap";
|
|
20
|
+
export { treemap } from "./treemap";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hierarchy/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EACX,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,0BAA0B,EAC1B,mBAAmB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACX,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,GACb,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node names of the hierarchy, flow and mosaic charts: one `label` node per
|
|
3
|
+
* name drawn, keyed by its node (so a name moving through a transition
|
|
4
|
+
* keeps its node), and a text-width cache so fitting names on every frame
|
|
5
|
+
* of a reveal or zoom measures each string once. Internal to the family.
|
|
6
|
+
*/
|
|
7
|
+
import type { CompositeContext, LabelProps, SceneNode } from "@sophistry/core";
|
|
8
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
9
|
+
/** One label of a keyed list: its key and the label's props. */
|
|
10
|
+
export interface KeyedLabel {
|
|
11
|
+
key: unknown;
|
|
12
|
+
props: LabelProps;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Keyed `label` nodes for one list (`slot`): a node per key, created once
|
|
16
|
+
* and updated in place, disposed when its key leaves.
|
|
17
|
+
*/
|
|
18
|
+
export declare function labelList<P>(ctx: CompositeContext<P>, slot: string, labels: readonly KeyedLabel[]): SceneNode[];
|
|
19
|
+
/**
|
|
20
|
+
* A text-width cache for one chart: `(text, fontSize, theme, weight?)` is
|
|
21
|
+
* `textWidth` at the theme's font, measured once per string and size.
|
|
22
|
+
* Call once, in `setup`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createLabelMeasure(): (text: string, fontSize: number, theme: Theme, fontWeight?: number) => number;
|
|
25
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/hierarchy/labels.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAGpD,gEAAgE;AAChE,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAC1B,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,UAAU,EAAE,GAC3B,SAAS,EAAE,CAQb;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,CACrC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,UAAU,CAAC,EAAE,MAAM,KACf,MAAM,CAiBV"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mosaic`: a Marimekko chart, columns as wide as their share of the whole,
|
|
3
|
+
* split into segments as tall as each row's share within the column.
|
|
4
|
+
*
|
|
5
|
+
* Every segment is one `rect` instance of one instances node, keyed by its
|
|
6
|
+
* (column, row) pair; per-segment picking and tooltips go through
|
|
7
|
+
* `event.item`. Columns grow from the bottom edge (geometry).
|
|
8
|
+
* Segment and column names are `label` nodes, one per name that fits.
|
|
9
|
+
*/
|
|
10
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
11
|
+
import type { Point } from "@sophistry/core/geometry";
|
|
12
|
+
import type { Channel, ColorChannel } from "../data/channels";
|
|
13
|
+
import type { MosaicKey } from "../math/mosaic";
|
|
14
|
+
import type { TooltipSpec } from "../tooltip";
|
|
15
|
+
/**
|
|
16
|
+
* Props of {@link mosaic}.
|
|
17
|
+
*
|
|
18
|
+
* @category Charts
|
|
19
|
+
*/
|
|
20
|
+
export interface MosaicProps<T> {
|
|
21
|
+
/** Long-form table: one datum per (column, row, value); duplicate pairs sum. */
|
|
22
|
+
data: readonly T[];
|
|
23
|
+
/** The column category. Data with no category are skipped. */
|
|
24
|
+
x: Channel<T, MosaicKey>;
|
|
25
|
+
/** The segment (row) category. Data with no category are skipped. */
|
|
26
|
+
y: Channel<T, MosaicKey>;
|
|
27
|
+
/**
|
|
28
|
+
* The amount; negative and non-finite values count as 0. Omitted, every datum counts 1 (a
|
|
29
|
+
* contingency table of counts).
|
|
30
|
+
*/
|
|
31
|
+
value?: Channel<T, number>;
|
|
32
|
+
/** Column order, left to right; unlisted categories follow. Defaults to first-seen order. */
|
|
33
|
+
columns?: readonly MosaicKey[];
|
|
34
|
+
/** Segment order, bottom to top; unlisted categories follow. Defaults to first-seen order. */
|
|
35
|
+
rows?: readonly MosaicKey[];
|
|
36
|
+
/** Width of the mosaic. */
|
|
37
|
+
width: number;
|
|
38
|
+
/** Height of the mosaic (column names hang below it). */
|
|
39
|
+
height: number;
|
|
40
|
+
/** Centre of the mosaic. Defaults to the origin. */
|
|
41
|
+
center?: Point;
|
|
42
|
+
/**
|
|
43
|
+
* Gap between columns, and between segments in a column.
|
|
44
|
+
* @default 0.04
|
|
45
|
+
*/
|
|
46
|
+
padding?: number;
|
|
47
|
+
/**
|
|
48
|
+
* One colour for every segment, or `(d, i) => colour` called with the segment's first datum
|
|
49
|
+
* (returning nothing falls back to `colors`). Wins over `colors`.
|
|
50
|
+
*/
|
|
51
|
+
color?: ColorChannel<T>;
|
|
52
|
+
/**
|
|
53
|
+
* Colours cycled across the row categories, so a row has one colour in every column. Defaults
|
|
54
|
+
* to the theme's categorical colours.
|
|
55
|
+
*/
|
|
56
|
+
colors?: readonly ColorInput[];
|
|
57
|
+
/**
|
|
58
|
+
* Fill opacity of the segments, 0..1.
|
|
59
|
+
* @default 1
|
|
60
|
+
*/
|
|
61
|
+
fillOpacity?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Write each row's name inside its segment where it fits.
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
labels?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Write each column's name under it where it fits.
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
columnLabels?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Write each column's share of the total under its name.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
shares?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Label font size.
|
|
79
|
+
* @default 0.2
|
|
80
|
+
*/
|
|
81
|
+
labelFontSize?: number;
|
|
82
|
+
/**
|
|
83
|
+
* Reveal, 0..1: column names fade in first, then the columns grow left to right from the
|
|
84
|
+
* bottom, segment names fading in as they go.
|
|
85
|
+
* @default 1
|
|
86
|
+
* @see https://sophistry.dev/guides/chart-animation/#reveals
|
|
87
|
+
*/
|
|
88
|
+
progress?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Fraction of the columns' reveal spent staggering column after column, 0..0.95.
|
|
91
|
+
* @default 0.5
|
|
92
|
+
*/
|
|
93
|
+
stagger?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Hover tooltip on a segment: `true` for "column · row: value (pct% of column)", or `(d, i) =>
|
|
96
|
+
* string` called with its first datum.
|
|
97
|
+
*/
|
|
98
|
+
tooltip?: TooltipSpec<T>;
|
|
99
|
+
/** Paint order; labels draw at `zIndex + 1`. */
|
|
100
|
+
zIndex?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Set to `false` to hide the chart.
|
|
103
|
+
* @default true
|
|
104
|
+
*/
|
|
105
|
+
visible?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A mosaic (Marimekko) chart: columns whose widths are their share of the whole, split into
|
|
109
|
+
* segments whose heights are each row's share within the column, so every rectangle's area is
|
|
110
|
+
* its value. `data` is long-form, one datum per (column, row, value). Lays itself out in a
|
|
111
|
+
* `width × height` box; needs no `chart`. The segments are one instances node (`event.item`
|
|
112
|
+
* picks one). See {@link mosaicLayout} for the layout alone.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { mosaic } from "@sophistry/charts";
|
|
117
|
+
*
|
|
118
|
+
* const sales = [
|
|
119
|
+
* { region: "north", product: "tea", units: 30 },
|
|
120
|
+
* { region: "north", product: "coffee", units: 50 },
|
|
121
|
+
* { region: "south", product: "tea", units: 45 },
|
|
122
|
+
* { region: "south", product: "coffee", units: 15 },
|
|
123
|
+
* ];
|
|
124
|
+
* mosaic.create({ data: sales, x: "region", y: "product", value: "units", width: 8, height: 4, shares: true });
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* @see https://sophistry.dev/reference/chart-catalogue/#gauges-bullets-waffles-mosaics-and-radial-bars
|
|
128
|
+
* @category Charts
|
|
129
|
+
*/
|
|
130
|
+
export declare const mosaic: import("@sophistry/core").Definition<MosaicProps<any>, import("@sophistry/core/internal").CompositeNode<MosaicProps<any>>, keyof MosaicProps<any>>;
|
|
131
|
+
//# sourceMappingURL=mosaic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mosaic.d.ts","sourceRoot":"","sources":["../../src/hierarchy/mosaic.ts"],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IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACzB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAmOD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM,oJAgHjB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tooltip a standalone hierarchy, flow or mosaic chart shows through:
|
|
3
|
+
* the enclosing chart's, else its own. Internal to the family.
|
|
4
|
+
*
|
|
5
|
+
* Outside a chart the state is kept (handlers, accessible names, the item
|
|
6
|
+
* walked by the keys) but no panel is drawn yet: the overlay is the chart
|
|
7
|
+
* frame's (`frame/tooltip-overlay.ts`).
|
|
8
|
+
*/
|
|
9
|
+
import type { CompositeContext } from "@sophistry/core";
|
|
10
|
+
import type { TooltipState } from "../tooltip";
|
|
11
|
+
/** Call once, in `setup`; read the result in each `update`. */
|
|
12
|
+
export declare function createOwnTooltip(): <P>(ctx: CompositeContext<P>) => TooltipState;
|
|
13
|
+
//# sourceMappingURL=own-tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"own-tooltip.d.ts","sourceRoot":"","sources":["../../src/hierarchy/own-tooltip.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,+DAA+D;AAC/D,wBAAgB,gBAAgB,IAAI,CAAC,CAAC,EACrC,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,KACpB,YAAY,CAQhB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The props descriptor the zoomable hierarchy charts share: every base,
|
|
3
|
+
* transition and drill prop reruns `update`, plus each chart's own. Internal
|
|
4
|
+
* to the family.
|
|
5
|
+
*/
|
|
6
|
+
import type { PropsDescriptor } from "@sophistry/core";
|
|
7
|
+
/**
|
|
8
|
+
* A hierarchy chart's props descriptor: the shared keys and `own`, each
|
|
9
|
+
* rerunning `update` when written (`progress` defaults to 1).
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function hierarchyPropsDescriptor<P extends object>(own: readonly (keyof P & string)[]): PropsDescriptor<P>;
|
|
14
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/hierarchy/props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAKvD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,MAAM,EACxD,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,GAChC,eAAe,CAAC,CAAC,CAAC,CAMpB"}
|