@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,41 @@
|
|
|
1
|
+
/** How a `chart` writes a channel's value in a tooltip (`frame.format`). */
|
|
2
|
+
import type { BandKey, TimeZone } from "@sophistry/core/geometry";
|
|
3
|
+
import type { OrdinalColorScale } from "../math/ordinal";
|
|
4
|
+
import type { MergedAxisOptions, ResolvedAxis } from "./fit";
|
|
5
|
+
import type { SecondaryFlags } from "./secondary";
|
|
6
|
+
import type { ChartColorOptions, ChartFormatChannel, ChartSizeLegendOptions } from "./types";
|
|
7
|
+
/** A formatter of one channel's values. */
|
|
8
|
+
export type ValueFormat = (value: number | BandKey) => string;
|
|
9
|
+
/**
|
|
10
|
+
* How an axis writes a value in a tooltip: a band axis a category's name, a
|
|
11
|
+
* continuous one through its `tickFormat` at its current range (a full date,
|
|
12
|
+
* by default, on a time axis).
|
|
13
|
+
*/
|
|
14
|
+
export declare function axisValueFormat(options: MergedAxisOptions, axis: ResolvedAxis): ValueFormat;
|
|
15
|
+
/** A moment written in full on `timeZone`'s clock, to the precision it carries: the day, then the minute or the second. */
|
|
16
|
+
export declare function dateText(value: number, timeZone: TimeZone): string;
|
|
17
|
+
/** An axis whose values a chart formats. */
|
|
18
|
+
export interface FormatAxis {
|
|
19
|
+
options: MergedAxisOptions;
|
|
20
|
+
axis: ResolvedAxis;
|
|
21
|
+
}
|
|
22
|
+
/** What a chart's formats read on one update. */
|
|
23
|
+
export interface ChartFormatsInput {
|
|
24
|
+
x: FormatAxis;
|
|
25
|
+
y: FormatAxis;
|
|
26
|
+
x2: FormatAxis;
|
|
27
|
+
y2: FormatAxis;
|
|
28
|
+
color: ChartColorOptions | undefined;
|
|
29
|
+
colorScale: OrdinalColorScale;
|
|
30
|
+
sizeOptions: ChartSizeLegendOptions;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The formatters a chart's contexts write values with, by secondary flags.
|
|
34
|
+
* Make one per chart; each update passes its axes, and a formatter is built
|
|
35
|
+
* lazily (when a tooltip asks) and kept while its axis keeps its identity.
|
|
36
|
+
*
|
|
37
|
+
* @returns `(input) => (flags) => format`: `format(channel)` for the context
|
|
38
|
+
* through `flags`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createChartFormats(): (input: ChartFormatsInput) => (flags: SecondaryFlags) => (channel: ChartFormatChannel) => ValueFormat;
|
|
41
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/frame/format.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,MAAM,SAAS,CAAC;AAEjB,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,KAAK,MAAM,CAAC;AAE9D;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,YAAY,GAChB,WAAW,CAmCb;AAED,2HAA2H;AAC3H,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAalE;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,YAAY,CAAC;CACnB;AAED,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IACjC,CAAC,EAAE,UAAU,CAAC;IACd,CAAC,EAAE,UAAU,CAAC;IACd,EAAE,EAAE,UAAU,CAAC;IACf,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACrC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,EAAE,sBAAsB,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,CACrC,KAAK,EAAE,iBAAiB,KACpB,CAAC,KAAK,EAAE,cAAc,KAAK,CAAC,OAAO,EAAE,kBAAkB,KAAK,WAAW,CAyD3E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Sizes and gaps for a chart's guides, shared by `chart` and a group's guides so they match. */
|
|
2
|
+
/** An axis title's font size when none is given. */
|
|
3
|
+
export declare const AXIS_LABEL_FONT_SIZE = 0.34;
|
|
4
|
+
/** The gap between an axis's numbers and its title. */
|
|
5
|
+
export declare const AXIS_LABEL_GAP = 0.22;
|
|
6
|
+
/** The title's font size when none is given. */
|
|
7
|
+
export declare const TITLE_FONT_SIZE = 0.42;
|
|
8
|
+
/** The gap under the title. */
|
|
9
|
+
export declare const TITLE_GAP = 0.35;
|
|
10
|
+
/** The gap between the plotting area and a legend beside or above it. */
|
|
11
|
+
export declare const LEGEND_GAP = 0.35;
|
|
12
|
+
/** The gap between the colour legend and the size key under (or beside) it. */
|
|
13
|
+
export declare const KEYS_GAP = 0.25;
|
|
14
|
+
/** The colour bar's thickness. */
|
|
15
|
+
export declare const COLORBAR_THICKNESS = 0.22;
|
|
16
|
+
/**
|
|
17
|
+
* Half a line of text at `fontSize` (a line is `1.2` of it): from a line's
|
|
18
|
+
* edge to its middle, as a rotated title stands off the edge it reads along.
|
|
19
|
+
*/
|
|
20
|
+
export declare function halfLine(fontSize: number): number;
|
|
21
|
+
/** A key's laid-out size, and how present it is (0 at a transition end with no legend), scaling the gap before it. */
|
|
22
|
+
export interface KeyExtent {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
presence: number;
|
|
26
|
+
}
|
|
27
|
+
/** A key's size at each end of a keyed transition (`to` only when the ends differ). */
|
|
28
|
+
export interface KeyEnds {
|
|
29
|
+
from: KeyExtent;
|
|
30
|
+
to: KeyExtent | undefined;
|
|
31
|
+
}
|
|
32
|
+
/** Two laid-out boxes of the same size (or both none). */
|
|
33
|
+
export declare function sameKeyExtent(a: KeyExtent | undefined, b: KeyExtent | undefined): boolean;
|
|
34
|
+
export declare function sameKeyEnds(a: KeyEnds | undefined, b: KeyEnds | undefined): boolean;
|
|
35
|
+
/** A key's size now: its own end's, or blended between the ends by the update stage's progress `u`. */
|
|
36
|
+
export declare function keyExtentNow(ends: KeyEnds | undefined, u: () => number): KeyExtent | undefined;
|
|
37
|
+
//# sourceMappingURL=guide-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guide-metrics.d.ts","sourceRoot":"","sources":["../../src/frame/guide-metrics.ts"],"names":[],"mappings":"AAAA,iGAAiG;AAIjG,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,uDAAuD;AACvD,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,gDAAgD;AAChD,eAAO,MAAM,eAAe,OAAO,CAAC;AACpC,+BAA+B;AAC/B,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B,yEAAyE;AACzE,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,+EAA+E;AAC/E,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,kCAAkC;AAClC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,sHAAsH;AACtH,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,uFAAuF;AACvF,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC;CAC1B;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAC5B,CAAC,EAAE,SAAS,GAAG,SAAS,EACxB,CAAC,EAAE,SAAS,GAAG,SAAS,GACtB,OAAO,CAMT;AAED,wBAAgB,WAAW,CAC1B,CAAC,EAAE,OAAO,GAAG,SAAS,EACtB,CAAC,EAAE,OAAO,GAAG,SAAS,GACpB,OAAO,CAIT;AAED,uGAAuG;AACvG,wBAAgB,YAAY,CAC3B,IAAI,EAAE,OAAO,GAAG,SAAS,EACzB,CAAC,EAAE,MAAM,MAAM,GACb,SAAS,GAAG,SAAS,CAQvB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `chart` draws around its layers: the grid, zero lines, axes
|
|
3
|
+
* (number lines and band axes, with a kind swap's ghost), titles, the colour
|
|
4
|
+
* bar, the legend and the size keys.
|
|
5
|
+
*
|
|
6
|
+
* {@link createChartGuides} is made once per chart; its function runs in
|
|
7
|
+
* every chart update, keeps each guide's node by role (writing props into
|
|
8
|
+
* it rather than rebuilding it) and returns the nodes in paint order.
|
|
9
|
+
*/
|
|
10
|
+
import type { CompositeContext, SceneNode } from "@sophistry/core";
|
|
11
|
+
import type { Range } from "@sophistry/core/geometry";
|
|
12
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
13
|
+
import type { JoinStages, StageWindow } from "../math/join";
|
|
14
|
+
import type { ChartCoords } from "./coords";
|
|
15
|
+
import type { AxisEnds, AxisSwapView, FittedTransition, GivenRange, MergedAxisOptions, ResolvedAxis } from "./fit";
|
|
16
|
+
import type { ChartKeys } from "./keys";
|
|
17
|
+
import type { ChartLayout } from "./layout";
|
|
18
|
+
import type { ChartLayerExtent, ChartProps } from "./types";
|
|
19
|
+
/** One primary axis as the guides draw it. */
|
|
20
|
+
export interface GuideAxis {
|
|
21
|
+
options: MergedAxisOptions;
|
|
22
|
+
axis: ResolvedAxis;
|
|
23
|
+
range: Range;
|
|
24
|
+
given: GivenRange;
|
|
25
|
+
fitted: FittedTransition | undefined;
|
|
26
|
+
ends: AxisEnds | undefined;
|
|
27
|
+
/** A kind swap's cross-fade (see `createAxisSwap`). */
|
|
28
|
+
swap: AxisSwapView;
|
|
29
|
+
}
|
|
30
|
+
/** One secondary axis as the guides draw it. */
|
|
31
|
+
export interface GuideSecondaryAxis {
|
|
32
|
+
has: boolean;
|
|
33
|
+
options: MergedAxisOptions;
|
|
34
|
+
given: GivenRange;
|
|
35
|
+
range: Range;
|
|
36
|
+
}
|
|
37
|
+
/** The frame state the guides draw from on one update. */
|
|
38
|
+
export interface GuideFrame {
|
|
39
|
+
props: Readonly<ChartProps>;
|
|
40
|
+
theme: Theme;
|
|
41
|
+
reports: readonly ChartLayerExtent[];
|
|
42
|
+
x: GuideAxis;
|
|
43
|
+
y: GuideAxis;
|
|
44
|
+
x2: GuideSecondaryAxis;
|
|
45
|
+
y2: GuideSecondaryAxis;
|
|
46
|
+
axisZeros: {
|
|
47
|
+
xSpans: boolean;
|
|
48
|
+
ySpans: boolean;
|
|
49
|
+
xFrom: boolean;
|
|
50
|
+
yFrom: boolean;
|
|
51
|
+
};
|
|
52
|
+
axisBands: {
|
|
53
|
+
x: boolean;
|
|
54
|
+
y: boolean;
|
|
55
|
+
};
|
|
56
|
+
stage(pick: (stages: JoinStages) => StageWindow): number;
|
|
57
|
+
layout: ChartLayout;
|
|
58
|
+
keys: ChartKeys;
|
|
59
|
+
coords: ChartCoords;
|
|
60
|
+
frameProgress: number;
|
|
61
|
+
legendProgress: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The frame's guides. Make one per chart in `setup`; call the result in
|
|
65
|
+
* every update with the chart's context and frame state.
|
|
66
|
+
*/
|
|
67
|
+
export declare function createChartGuides(): (ctx: CompositeContext<ChartProps>, frame: GuideFrame) => SceneNode[];
|
|
68
|
+
//# sourceMappingURL=guides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guides.d.ts","sourceRoot":"","sources":["../../src/frame/guides.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAEX,gBAAgB,EAEhB,SAAS,EAGT,MAAM,iBAAiB,CAAC;AAYzB,OAAO,KAAK,EAEX,KAAK,EAGL,MAAM,0BAA0B,CAAC;AAoBlC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAIpD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EACX,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAQ5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5D,8CAA8C;AAC9C,MAAM,WAAW,SAAS;IACzB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,uDAAuD;IACvD,IAAI,EAAE,YAAY,CAAC;CACnB;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IAClC,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;CACb;AAED,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACrC,CAAC,EAAE,SAAS,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;IACb,EAAE,EAAE,kBAAkB,CAAC;IACvB,EAAE,EAAE,kBAAkB,CAAC;IACvB,SAAS,EAAE;QACV,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,OAAO,CAAC;QACf,KAAK,EAAE,OAAO,CAAC;KACf,CAAC;IACF,SAAS,EAAE;QAAE,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACtC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,WAAW,GAAG,MAAM,CAAC;IACzD,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACvB;AAgDD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,CACpC,GAAG,EAAE,gBAAgB,CAAC,UAAU,CAAC,EACjC,KAAK,EAAE,UAAU,KACb,SAAS,EAAE,CAouBf"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `chart`'s keys show: the colour scale and its legend, the size
|
|
3
|
+
* keys, and the colour bar's ramp, all from the layers' steady reports.
|
|
4
|
+
*
|
|
5
|
+
* {@link createChartKeys} is made once per chart; its function runs in
|
|
6
|
+
* every chart update and keeps each result's identity while it is equal,
|
|
7
|
+
* so the legend and the layers see nothing new while only a blend moves.
|
|
8
|
+
* The size-scale helpers are shared with a chart group's guides.
|
|
9
|
+
*/
|
|
10
|
+
import type { ColorInput } from "@sophistry/core/color";
|
|
11
|
+
import type { BandKey } from "@sophistry/core/geometry";
|
|
12
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
13
|
+
import type { JoinStages, StageWindow } from "../math/join";
|
|
14
|
+
import type { OrdinalColorScale } from "../math/ordinal";
|
|
15
|
+
import type { ChartLayerExtent, ChartProps, ChartSizeLegendOptions, LegendMark, RampExtent, SharedSizeDomain, SizeExtent } from "./types";
|
|
16
|
+
/** One legend entry (as `legend` takes it). */
|
|
17
|
+
export interface FrameLegendEntry {
|
|
18
|
+
key?: BandKey;
|
|
19
|
+
label: string;
|
|
20
|
+
color: ColorInput;
|
|
21
|
+
mark?: LegendMark;
|
|
22
|
+
}
|
|
23
|
+
/** A legend's keyed transition (as `legend` takes it). */
|
|
24
|
+
export interface FrameLegendTransition {
|
|
25
|
+
from: readonly BandKey[];
|
|
26
|
+
to: readonly BandKey[];
|
|
27
|
+
exit: number;
|
|
28
|
+
update: number;
|
|
29
|
+
enter: number;
|
|
30
|
+
}
|
|
31
|
+
/** The stages a stack of size keys transitions on (as `sizeKeyStack` takes them). */
|
|
32
|
+
export interface FrameSizeKeyStages {
|
|
33
|
+
exit: number;
|
|
34
|
+
update: number;
|
|
35
|
+
enter: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* One size scale over sized layers' reports: the greatest maximum at each
|
|
39
|
+
* end (a pinned `sizeMaxValue` counts at both). Undefined when no layer
|
|
40
|
+
* sizes by value.
|
|
41
|
+
*/
|
|
42
|
+
export declare function sharedSizeDomain(reports: readonly ChartLayerExtent[]): SharedSizeDomain | undefined;
|
|
43
|
+
/** Two shared size domains with the same ends. */
|
|
44
|
+
export declare function sameSizeDomain(a: SharedSizeDomain | undefined, b: SharedSizeDomain | undefined): boolean;
|
|
45
|
+
/** A layer's size scale on a shared one: the shared maximum at each end, unless the layer pins its own or nothing is shared. */
|
|
46
|
+
export declare function onSharedSize(size: SizeExtent, shared: SharedSizeDomain | undefined): SizeExtent;
|
|
47
|
+
/**
|
|
48
|
+
* A frame's size keys over its sized layers, in layer order: one per
|
|
49
|
+
* distinct drawn scale, titled by its first layer's channel. With
|
|
50
|
+
* `byRange` (a group's keys), one per distinct `sizeRange`, left out
|
|
51
|
+
* unless its layers agree on the maximum.
|
|
52
|
+
*/
|
|
53
|
+
export declare function sizeKeysOf(sizes: readonly (SizeExtent | undefined)[], drawn: (size: SizeExtent) => SizeExtent, byRange?: boolean): SizeExtent[];
|
|
54
|
+
/** The legend swatch over every reporting layer: every layer's mark, merged. */
|
|
55
|
+
export declare function mergedLegendMark(reports: readonly ChartLayerExtent[]): LegendMark;
|
|
56
|
+
/** What one update of a chart's keys reads. */
|
|
57
|
+
export interface ChartKeysInput {
|
|
58
|
+
props: Readonly<ChartProps>;
|
|
59
|
+
theme: Theme;
|
|
60
|
+
/** The steady reports (identity kept while unchanged). */
|
|
61
|
+
reports: readonly ChartLayerExtent[];
|
|
62
|
+
/** Whether a keyed transition runs (steady while its blend moves). */
|
|
63
|
+
transitioning: boolean;
|
|
64
|
+
/** How far a stage of the transition has got. */
|
|
65
|
+
stage(pick: (stages: JoinStages) => StageWindow): number;
|
|
66
|
+
/** A chart group's colour scale, which wins over the chart's own. */
|
|
67
|
+
groupColorScale?: OrdinalColorScale;
|
|
68
|
+
/** A chart group's shared size domain, which wins over the chart's own. */
|
|
69
|
+
groupSizeDomain?: SharedSizeDomain;
|
|
70
|
+
/** The chart is a group's panel. */
|
|
71
|
+
grouped?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** A chart's keys on one update; every field keeps its identity while equal. */
|
|
74
|
+
export interface ChartKeys {
|
|
75
|
+
colorScale: OrdinalColorScale;
|
|
76
|
+
legendEntries: readonly FrameLegendEntry[];
|
|
77
|
+
legendPosition: "right" | "top" | undefined;
|
|
78
|
+
legendEnds: {
|
|
79
|
+
from: readonly BandKey[];
|
|
80
|
+
to: readonly BandKey[];
|
|
81
|
+
} | undefined;
|
|
82
|
+
legendTransition: FrameLegendTransition | undefined;
|
|
83
|
+
sizeDomain: SharedSizeDomain | undefined;
|
|
84
|
+
sizeOptions: ChartSizeLegendOptions;
|
|
85
|
+
sizeKeys: readonly SizeExtent[];
|
|
86
|
+
sizePosition: "right" | "top" | undefined;
|
|
87
|
+
/** Where the frame's keys go (the colour legend and the size key): their shared side. */
|
|
88
|
+
guidesPosition: "right" | "top" | undefined;
|
|
89
|
+
sizeStages: FrameSizeKeyStages | undefined;
|
|
90
|
+
ramp: RampExtent | undefined;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The colour scale, legend, size keys and colour bar ramp of a chart. Make
|
|
94
|
+
* one per chart in `setup`; call the result in every update.
|
|
95
|
+
*/
|
|
96
|
+
export declare function createChartKeys(): (input: ChartKeysInput) => ChartKeys;
|
|
97
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/frame/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD,OAAO,KAAK,EACX,gBAAgB,EAChB,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,MAAM,SAAS,CAAC;AAEjB,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAChC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,M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SAAS,gBAAgB,EAAE,CAAC;IACrC,sEAAsE;IACtE,aAAa,EAAE,OAAO,CAAC;IACvB,iDAAiD;IACjD,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,WAAW,GAAG,MAAM,CAAC;IACzD,qEAAqE;IACrE,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,gBAAgB,CAAC;IACnC,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,WAAW,SAAS;IACzB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC3C,cAAc,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IAC5C,UAAU,EAAE;QAAE,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;QAAC,EAAE,EAAE,SAAS,OAAO,EAAE,CAAA;KAAE,GAAG,SAAS,CAAC;IAC7E,gBAAgB,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACpD,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACzC,WAAW,EAAE,sBAAsB,CAAC;IACpC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IAChC,YAAY,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IAC1C,yFAAyF;IACzF,cAAc,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IAC5C,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC3C,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;CAC7B;AAID;;;GAGG;AACH,wBAAgB,eAAe,IAAI,CAAC,KAAK,EAAE,cAAc,KAAK,SAAS,CA6PtE"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much room a `chart`'s guides take around its plot, and so the plot's
|
|
3
|
+
* size and centre: pure measurements (text measured through `measureLabel`)
|
|
4
|
+
* and {@link createChartLayout}, which wires them to the frame with caches
|
|
5
|
+
* so a frame of a transition re-measures nothing it measured before.
|
|
6
|
+
*/
|
|
7
|
+
import type { AxisOptions, XAxisPosition, YAxisPosition } from "@sophistry/core";
|
|
8
|
+
import type { BandScale, Bounds, Point, Range, RangeTransition } from "@sophistry/core/geometry";
|
|
9
|
+
import type { Theme } from "@sophistry/core/themes";
|
|
10
|
+
import type { JoinStages, StageWindow } from "../math/join";
|
|
11
|
+
import type { FittedTransition, GivenRange, MergedAxisOptions, ResolvedAxis } from "./fit";
|
|
12
|
+
import { type KeyExtent } from "./guide-metrics";
|
|
13
|
+
import type { ChartKeys } from "./keys";
|
|
14
|
+
import type { ChartLayerExtent, ChartMargin, ChartProps, ChartSide } from "./types";
|
|
15
|
+
/** A category name's font size when the axis gives none. */
|
|
16
|
+
export declare const DEFAULT_CATEGORY_FONT_SIZE = 0.28;
|
|
17
|
+
/** The gap between a band axis's line and its names when the axis gives none. */
|
|
18
|
+
export declare const DEFAULT_CATEGORY_NUMBER_GAP = 0.16;
|
|
19
|
+
/** The subtitle's font size when none is given. */
|
|
20
|
+
export declare const DEFAULT_SUBTITLE_FONT_SIZE = 0.3;
|
|
21
|
+
/** The gap between the title and the subtitle under it. */
|
|
22
|
+
export declare const SUBTITLE_GAP = 0.14;
|
|
23
|
+
/** The least of `width` (or `height`) the plot keeps when the guides beside it would take more. */
|
|
24
|
+
export declare const MIN_PLOT_SHARE = 0.4;
|
|
25
|
+
/** Room on the two sides of one axis of the plot. */
|
|
26
|
+
export interface Sides {
|
|
27
|
+
low: number;
|
|
28
|
+
high: number;
|
|
29
|
+
}
|
|
30
|
+
/** The widest category name a band axis writes, in scene units; 0 when it writes none. */
|
|
31
|
+
export declare function bandNamesWidth(options: MergedAxisOptions, band: BandScale, fontFamily: string): number;
|
|
32
|
+
/** The chart-only keys stripped, for an axis's options to reach `numberLine`. */
|
|
33
|
+
export declare function numberLineOptions(options: MergedAxisOptions): AxisOptions;
|
|
34
|
+
/** What an axis's `numberLine` is given: the transition while one runs, else the resolved range. */
|
|
35
|
+
export declare function axisRange(given: Range | RangeTransition | undefined, resolved: Range): Range | RangeTransition;
|
|
36
|
+
/**
|
|
37
|
+
* Two ends' rooms mixed at `t`; a group's panel keeps the larger, since the
|
|
38
|
+
* group's grid holds still through a transition.
|
|
39
|
+
*/
|
|
40
|
+
export declare function mixRoom(from: number, to: number, t: number, grouped: boolean): number;
|
|
41
|
+
/** A room measured at a range, or at each end of a range transition and mixed by its progress. */
|
|
42
|
+
export declare function roomOver(range: Range | RangeTransition, measure: (at: Range) => number, grouped: boolean): number;
|
|
43
|
+
/** Whether an axis's line stands on the plot's low edge (bottom, left), where its numbers hang outside. */
|
|
44
|
+
export declare function atLowEdge(position: XAxisPosition | YAxisPosition, band: boolean, other: Range, otherBand: boolean): boolean;
|
|
45
|
+
/** The layers' reserved margins: the widest request per side. */
|
|
46
|
+
export declare function widestMargins(reports: readonly ChartLayerExtent[]): Required<ChartMargin>;
|
|
47
|
+
/**
|
|
48
|
+
* The keys on the right: the legend, then the size keys under it, or beside
|
|
49
|
+
* it when the two stacked would run past `maxHeight` (read only then).
|
|
50
|
+
*/
|
|
51
|
+
export declare function keysColumnOf(legend: KeyExtent | undefined, size: KeyExtent | undefined, maxHeight: () => number): (KeyExtent & {
|
|
52
|
+
beside: boolean;
|
|
53
|
+
}) | undefined;
|
|
54
|
+
/** The keys above the plot: the legend's rows, then the size key's under them. */
|
|
55
|
+
export declare function keysRowOf(legend: KeyExtent | undefined, size: KeyExtent | undefined): KeyExtent | undefined;
|
|
56
|
+
/** The room keys above the plot take: the gap before them (as present as they are) and their rows. */
|
|
57
|
+
export declare function keysRoom(keys: KeyExtent | undefined): number;
|
|
58
|
+
/** The room the title and subtitle take above everything else, with the gap under them. */
|
|
59
|
+
export declare function headingRoom(heading: {
|
|
60
|
+
title?: string;
|
|
61
|
+
titleFontSize?: number;
|
|
62
|
+
subtitle?: string;
|
|
63
|
+
subtitleFontSize?: number;
|
|
64
|
+
}): number;
|
|
65
|
+
/** The plot's extent along one axis: what `total` leaves after the guides, down to `MIN_PLOT_SHARE` of it. */
|
|
66
|
+
export declare function plotExtent(total: number, sides: Sides): number;
|
|
67
|
+
/** How far the plot's centre sits from the footprint's: toward the side with less room. */
|
|
68
|
+
export declare function centerOffset(shrink: number, sides: Sides): number;
|
|
69
|
+
/**
|
|
70
|
+
* A side's reserved margin in scene units: the band beside `box`, past
|
|
71
|
+
* `numbers` (that side's axis numbers), `depth` deep.
|
|
72
|
+
*/
|
|
73
|
+
export declare function marginBand(box: Bounds, side: ChartSide, depth: number, numbers: number): Bounds;
|
|
74
|
+
/** One primary axis as the layout reads it. */
|
|
75
|
+
export interface LayoutAxis {
|
|
76
|
+
options: MergedAxisOptions;
|
|
77
|
+
axis: ResolvedAxis;
|
|
78
|
+
given: GivenRange;
|
|
79
|
+
range: Range;
|
|
80
|
+
fitted: FittedTransition | undefined;
|
|
81
|
+
}
|
|
82
|
+
/** One secondary axis as the layout reads it. */
|
|
83
|
+
export interface LayoutSecondaryAxis {
|
|
84
|
+
options: MergedAxisOptions;
|
|
85
|
+
axis: ResolvedAxis;
|
|
86
|
+
given: GivenRange;
|
|
87
|
+
has: boolean;
|
|
88
|
+
}
|
|
89
|
+
/** What one update of a chart's layout reads. */
|
|
90
|
+
export interface ChartLayoutInput {
|
|
91
|
+
props: Readonly<ChartProps>;
|
|
92
|
+
theme: Theme;
|
|
93
|
+
/** Whether the chart is a panel of a group. */
|
|
94
|
+
grouped: boolean;
|
|
95
|
+
reports: readonly ChartLayerExtent[];
|
|
96
|
+
stage(pick: (stages: JoinStages) => StageWindow): number;
|
|
97
|
+
x: LayoutAxis;
|
|
98
|
+
y: LayoutAxis;
|
|
99
|
+
x2: LayoutSecondaryAxis;
|
|
100
|
+
y2: LayoutSecondaryAxis;
|
|
101
|
+
axisBands: {
|
|
102
|
+
x: boolean;
|
|
103
|
+
y: boolean;
|
|
104
|
+
};
|
|
105
|
+
keys: ChartKeys;
|
|
106
|
+
}
|
|
107
|
+
/** A chart's rooms, plot size and centre on one update. */
|
|
108
|
+
export interface ChartLayout {
|
|
109
|
+
xPosition: XAxisPosition;
|
|
110
|
+
yPosition: YAxisPosition;
|
|
111
|
+
xFar: boolean;
|
|
112
|
+
yFar: boolean;
|
|
113
|
+
margin: Required<ChartMargin>;
|
|
114
|
+
leftNumbersRoom: number;
|
|
115
|
+
bottomNumbersRoom: number;
|
|
116
|
+
rightNumbersRoom: number;
|
|
117
|
+
y2NumbersRoom: number;
|
|
118
|
+
topNumbersRoom: number;
|
|
119
|
+
rightAxisRoom: number;
|
|
120
|
+
topAxisRoom: number;
|
|
121
|
+
legendColumn: KeyExtent | undefined;
|
|
122
|
+
legendRow: KeyExtent | undefined;
|
|
123
|
+
sizeColumn: KeyExtent | undefined;
|
|
124
|
+
sizeRow: KeyExtent | undefined;
|
|
125
|
+
sizeOffsets: readonly Point[];
|
|
126
|
+
keysColumn: (KeyExtent & {
|
|
127
|
+
beside: boolean;
|
|
128
|
+
}) | undefined;
|
|
129
|
+
/** The frame's keys, laid out where they go: the column on the right, or the rows on top. */
|
|
130
|
+
keysNow: KeyExtent | undefined;
|
|
131
|
+
leftRoom: number;
|
|
132
|
+
rightRoom: number;
|
|
133
|
+
topRoom: number;
|
|
134
|
+
bottomRoom: number;
|
|
135
|
+
plotWidth: number;
|
|
136
|
+
plotHeight: number;
|
|
137
|
+
center: Point;
|
|
138
|
+
titleSize: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* A chart's layout. Make one per chart in `setup`; call the result in every
|
|
142
|
+
* update. Text is measured once per options and range (a range transition's
|
|
143
|
+
* frames mix their ends' measurements), legends and keys once per entry list.
|
|
144
|
+
*/
|
|
145
|
+
export declare function createChartLayout(): (input: ChartLayoutInput) => ChartLayout;
|
|
146
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.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S,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,CAAC,KAAK,EAAE,gBAAgB,KAAK,WAAW,CAwa5E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A chart's layer registry: where layers report their extents.
|
|
3
|
+
*
|
|
4
|
+
* Reports are kept per layer (by an owner object) in first-report order.
|
|
5
|
+
* A report is normalised as it arrives: each axis's `values` shrink to their
|
|
6
|
+
* finite extremes (only those count for fitting), so comparing a report
|
|
7
|
+
* with the last one costs a few numbers however large the data. A report
|
|
8
|
+
* equal by value to the layer's last one changes nothing; any other change
|
|
9
|
+
* asks the chart to update (`onChange`, which only marks).
|
|
10
|
+
*/
|
|
11
|
+
import type { ChartLayerExtent, ChartLayers } from "./types";
|
|
12
|
+
/** A report with every axis's values reduced to their extremes. */
|
|
13
|
+
export declare function normaliseReport(extent: ChartLayerExtent): ChartLayerExtent;
|
|
14
|
+
/**
|
|
15
|
+
* A chart's registry: {@link ChartLayers} plus the current reports.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export interface LayerRegistry extends ChartLayers {
|
|
20
|
+
/** Every layer's report, in first-report order; the same array while none changed. */
|
|
21
|
+
reports(): readonly ChartLayerExtent[];
|
|
22
|
+
/** How many layers have reported. */
|
|
23
|
+
readonly count: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Makes a registry. `onChange` runs (synchronously, possibly inside a
|
|
27
|
+
* commit) whenever the reports change; it must only mark.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function createLayerRegistry(onChange: () => void): LayerRegistry;
|
|
32
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/frame/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAc,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAgBzE,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAa1E;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IACjD,sFAAsF;IACtF,OAAO,IAAI,SAAS,gBAAgB,EAAE,CAAC;IACvC,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,aAAa,CA6BvE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a `chart` reads its layers' reports: the steady (blend-free) view of
|
|
3
|
+
* them, given ranges with dates, the zone an axis reads plain Temporal
|
|
4
|
+
* values in, and the shape of the keyed transition the layers report. The
|
|
5
|
+
* registry itself is `registry.ts`.
|
|
6
|
+
*/
|
|
7
|
+
import type { Range, RangeTransition, ScaleSpec, TimeZone } from "@sophistry/core/geometry";
|
|
8
|
+
import type { DateAxis } from "../data/channels";
|
|
9
|
+
import type { JoinStages, JoinStaging } from "../math/join";
|
|
10
|
+
import type { ChartAxisOptions, ChartLayerExtent, ChartProps, ChartRange } from "./types";
|
|
11
|
+
/** A given range with `Date` or Temporal ends read as epoch milliseconds (plain ones in `timeZone`); anything else as is. */
|
|
12
|
+
export declare function numericRange(range: ChartRange | RangeTransition | undefined, timeZone: TimeZone): Range | RangeTransition | undefined;
|
|
13
|
+
/** The zone an axis reads plain Temporal values in: its own, else its scale's (local for `"time"`), else UTC. */
|
|
14
|
+
export declare function optionsTimeZone(options: {
|
|
15
|
+
scale?: ScaleSpec | "band";
|
|
16
|
+
timeZone?: TimeZone;
|
|
17
|
+
}): TimeZone;
|
|
18
|
+
/** An axis's options as given to `props`, merged over `axis`. */
|
|
19
|
+
export declare function givenOptions(props: Readonly<ChartProps>, axis: DateAxis): ChartAxisOptions;
|
|
20
|
+
/**
|
|
21
|
+
* A layer's report with a keyed transition's blend held out: the same
|
|
22
|
+
* object when it has no transition, else a copy whose `transition.t` is 0.
|
|
23
|
+
*/
|
|
24
|
+
export declare function steadyReport(report: ChartLayerExtent): ChartLayerExtent;
|
|
25
|
+
/**
|
|
26
|
+
* Whether two values say the same thing: compared by value through plain
|
|
27
|
+
* objects and arrays, anything else (a colormap function, say) by identity.
|
|
28
|
+
*/
|
|
29
|
+
export declare function sameData(a: unknown, b: unknown): boolean;
|
|
30
|
+
/** Whether two joins are staged the same. */
|
|
31
|
+
export declare function sameStages(a: JoinStages | undefined, b: JoinStages | undefined): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The reports with the blend held out, compared by value: the same array
|
|
34
|
+
* while no layer changed anything but its blend. Make one per chart.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createSteadyReports(): (live: readonly ChartLayerExtent[]) => readonly ChartLayerExtent[];
|
|
37
|
+
/** The blend of the first transitioning layer, if any. */
|
|
38
|
+
export declare function firstBlend(live: readonly ChartLayerExtent[]): number | undefined;
|
|
39
|
+
/** The shape of a keyed transition: its staging and whether any join enters or exits. */
|
|
40
|
+
export interface TransitionShape {
|
|
41
|
+
staging: JoinStaging | undefined;
|
|
42
|
+
enters: boolean;
|
|
43
|
+
exits: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** The keyed transition the layers report, steady while its blend moves; undefined without one. */
|
|
46
|
+
export declare function transitionShapeOf(reports: readonly ChartLayerExtent[]): TransitionShape | undefined;
|
|
47
|
+
/** Two transition shapes alike. */
|
|
48
|
+
export declare function sameShape(a: TransitionShape | undefined, b: TransitionShape | undefined): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether a layer has noted dates on `axis` and no layer reports categories
|
|
51
|
+
* there (categories keep an axis a band axis).
|
|
52
|
+
*/
|
|
53
|
+
export declare function datesOn(dated: ReadonlySet<DateAxis>, live: readonly ChartLayerExtent[], axis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WT;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,CACtC,IAAI,EAAE,SAAS,gBAAgB,EAAE,KAC7B,SAAS,gBAAgB,EAAE,CAoB/B;AAED,0DAA0D;AAC1D,wBAAgB,UAAU,CACzB,IAAI,EAAE,SAAS,gBAAgB,EAAE,GAC/B,MAAM,GAAG,SAAS,CAGpB;AAED,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CACf;AAED,mGAAmG;AACnG,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAClC,eAAe,GAAG,SAAS,CAY7B;AAED,mCAAmC;AACnC,wBAAgB,SAAS,CACxB,CAAC,EAAE,eAAe,GAAG,SAAS,EAC9B,CAAC,EAAE,eAAe,GAAG,SAAS,GAC5B,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACtB,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,EAC5B,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,IAAI,EAAE,QAAQ,GACZ,OAAO,CAGT"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `secondaryX` and `secondaryY`: the layers inside map one axis through the
|
|
3
|
+
* enclosing chart's secondary scale. They provide lifted versions of the
|
|
4
|
+
* chart's contexts to their children: the frame and coordinate system
|
|
5
|
+
* through the secondary axis, a report sink that moves the layers' extents
|
|
6
|
+
* onto it, and a date sink that notes dates there.
|
|
7
|
+
*/
|
|
8
|
+
import type { SceneNode } from "@sophistry/core";
|
|
9
|
+
/**
|
|
10
|
+
* Props for {@link secondaryY}.
|
|
11
|
+
*
|
|
12
|
+
* @category Charts
|
|
13
|
+
*/
|
|
14
|
+
export interface SecondaryYProps {
|
|
15
|
+
/** The layers to map through the secondary y axis. */
|
|
16
|
+
children?: readonly SceneNode[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Props for {@link secondaryX}.
|
|
20
|
+
*
|
|
21
|
+
* @category Charts
|
|
22
|
+
*/
|
|
23
|
+
export interface SecondaryXProps {
|
|
24
|
+
/** The layers to map through the secondary x axis. */
|
|
25
|
+
children?: readonly SceneNode[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A secondary y axis, drawn on the plot's right edge. Layers inside share
|
|
29
|
+
* the chart's x axis, colours, legend and reveal but map y through the
|
|
30
|
+
* chart's `y2Range`, `y2Axis` and `y2Label`. Only inside a `chart`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { bars, chart, linePlot, secondaryY } from "@sophistry/charts";
|
|
35
|
+
*
|
|
36
|
+
* const data = [
|
|
37
|
+
* { month: "Jan", temp: 3, rain: 60 },
|
|
38
|
+
* { month: "Feb", temp: 4, rain: 45 },
|
|
39
|
+
* { month: "Mar", temp: 8, rain: 50 },
|
|
40
|
+
* ];
|
|
41
|
+
* chart.create({
|
|
42
|
+
* width: 8,
|
|
43
|
+
* height: 4,
|
|
44
|
+
* y2Label: "rain (mm)",
|
|
45
|
+
* children: [
|
|
46
|
+
* linePlot.create({ data, x: "month", y: "temp" }),
|
|
47
|
+
* secondaryY.create({ children: [bars.create({ data, category: "month", value: "rain" })] }),
|
|
48
|
+
* ],
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see https://sophistry.dev/guides/charts/#the-chart-frame
|
|
53
|
+
* @category Charts
|
|
54
|
+
*/
|
|
55
|
+
export declare const secondaryY: import("@sophistry/core").Definition<{
|
|
56
|
+
children?: readonly SceneNode[];
|
|
57
|
+
}, import("@sophistry/core/internal").CompositeNode<{
|
|
58
|
+
children?: readonly SceneNode[];
|
|
59
|
+
}>, "children">;
|
|
60
|
+
/**
|
|
61
|
+
* A secondary x axis, drawn along the plot's top edge. Layers inside share
|
|
62
|
+
* the chart's y axis, colours, legend and reveal but map x through the
|
|
63
|
+
* chart's `x2Range`, `x2Axis` and `x2Label`. Nest it with
|
|
64
|
+
* {@link secondaryY} for both. Only inside a `chart`.
|
|
65
|
+
*
|
|
66
|
+
* @see https://sophistry.dev/guides/charts/#the-chart-frame
|
|
67
|
+
* @category Charts
|
|
68
|
+
*/
|
|
69
|
+
export declare const secondaryX: import("@sophistry/core").Definition<{
|
|
70
|
+
children?: readonly SceneNode[];
|
|
71
|
+
}, import("@sophistry/core/internal").CompositeNode<{
|
|
72
|
+
children?: readonly SceneNode[];
|
|
73
|
+
}>, "children">;
|
|
74
|
+
//# sourceMappingURL=secondary-axes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secondary-axes.d.ts","sourceRoot":"","sources":["../../src/frame/secondary-axes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAoB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AASnE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;CAChC;AAmDD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU;eA7Dc,SAAS,SAAS,EAAE;;;eA6DX,CAAC;AAE/C;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU;eAxEc,SAAS,SAAS,EAAE;;;eAwEX,CAAC"}
|