@fusedashlabs/widgets 0.2.0 → 0.4.0
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/CHANGELOG.md +94 -17
- package/README.md +24 -26
- package/dist/components/area-chart/element/ui9000-area-chart.d.ts +1 -1
- package/dist/components/area-grouped-bar-chart/element/ui9000-area-grouped-bar-chart.d.ts +1 -1
- package/dist/components/area-grouped-bar-chart/lib/normalize.js +3 -3
- package/dist/components/area-grouped-bar-chart/lib/normalize.js.map +1 -1
- package/dist/components/bar-chart/element/ui9000-bar-chart.d.ts +1 -1
- package/dist/components/bias-variance-tradeoff-chart/element/styles.d.ts +7 -0
- package/dist/components/bias-variance-tradeoff-chart/element/styles.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/element/styles.js +13 -0
- package/dist/components/bias-variance-tradeoff-chart/element/styles.js.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/element/ui9000-bias-variance-tradeoff-chart.d.ts +27 -0
- package/dist/components/bias-variance-tradeoff-chart/element/ui9000-bias-variance-tradeoff-chart.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/element/ui9000-bias-variance-tradeoff-chart.js +173 -0
- package/dist/components/bias-variance-tradeoff-chart/element/ui9000-bias-variance-tradeoff-chart.js.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/index.d.ts +5 -0
- package/dist/components/bias-variance-tradeoff-chart/index.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/index.js +19 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/domain.d.ts +8 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/domain.js +37 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/domain.js.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/format.d.ts +3 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/format.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/format.js +9 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/format.js.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/index.d.ts +5 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/index.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/normalize.d.ts +4 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/normalize.js +135 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/normalize.js.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/types.d.ts +47 -0
- package/dist/components/bias-variance-tradeoff-chart/lib/types.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/metadata.json.d.ts +41 -0
- package/dist/components/bias-variance-tradeoff-chart/metadata.json.js +42 -0
- package/dist/components/bias-variance-tradeoff-chart/metadata.json.js.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/render/draw.d.ts +31 -0
- package/dist/components/bias-variance-tradeoff-chart/render/draw.d.ts.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/render/draw.js +203 -0
- package/dist/components/bias-variance-tradeoff-chart/render/draw.js.map +1 -0
- package/dist/components/bias-variance-tradeoff-chart/render/index.d.ts +2 -0
- package/dist/components/bias-variance-tradeoff-chart/render/index.d.ts.map +1 -0
- package/dist/components/box-plot-chart/element/ui9000-box-plot-chart.d.ts +1 -1
- package/dist/components/bubble-chart/element/ui9000-bubble-chart.d.ts +1 -1
- package/dist/components/chart-renderer/element/ui9000-chart-renderer.d.ts +1 -0
- package/dist/components/chart-renderer/element/ui9000-chart-renderer.d.ts.map +1 -1
- package/dist/components/chart-renderer/element/ui9000-chart-renderer.js +12 -1
- package/dist/components/chart-renderer/element/ui9000-chart-renderer.js.map +1 -1
- package/dist/components/chart-renderer/lib/registry.d.ts.map +1 -1
- package/dist/components/chart-renderer/lib/registry.js +29 -4
- package/dist/components/chart-renderer/lib/registry.js.map +1 -1
- package/dist/components/chart-renderer/lib/types.d.ts +5 -0
- package/dist/components/chart-renderer/lib/types.d.ts.map +1 -1
- package/dist/components/donut-chart/element/ui9000-donut-chart.d.ts +1 -1
- package/dist/components/donut-chart/element/ui9000-donut-chart.js +1 -1
- package/dist/components/donut-chart/element/ui9000-donut-chart.js.map +1 -1
- package/dist/components/gini-impurity-entropy-chart/element/styles.d.ts +2 -0
- package/dist/components/gini-impurity-entropy-chart/element/styles.d.ts.map +1 -0
- package/dist/components/{donut-group-chart → gini-impurity-entropy-chart}/element/styles.js +17 -11
- package/dist/components/gini-impurity-entropy-chart/element/styles.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/element/ui9000-gini-impurity-entropy-chart.d.ts +36 -0
- package/dist/components/gini-impurity-entropy-chart/element/ui9000-gini-impurity-entropy-chart.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/element/ui9000-gini-impurity-entropy-chart.js +186 -0
- package/dist/components/gini-impurity-entropy-chart/element/ui9000-gini-impurity-entropy-chart.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/index.d.ts +5 -0
- package/dist/components/gini-impurity-entropy-chart/index.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/index.js +32 -0
- package/dist/components/gini-impurity-entropy-chart/index.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/domain.d.ts +9 -0
- package/dist/components/gini-impurity-entropy-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/domain.js +32 -0
- package/dist/components/gini-impurity-entropy-chart/lib/domain.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/format.d.ts +10 -0
- package/dist/components/gini-impurity-entropy-chart/lib/format.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/format.js +22 -0
- package/dist/components/gini-impurity-entropy-chart/lib/format.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/index.d.ts +7 -0
- package/dist/components/gini-impurity-entropy-chart/lib/index.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/normalize.d.ts +7 -0
- package/dist/components/gini-impurity-entropy-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/normalize.js +117 -0
- package/dist/components/gini-impurity-entropy-chart/lib/normalize.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/overlays.d.ts +19 -0
- package/dist/components/gini-impurity-entropy-chart/lib/overlays.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/overlays.js +63 -0
- package/dist/components/gini-impurity-entropy-chart/lib/overlays.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/series.d.ts +12 -0
- package/dist/components/gini-impurity-entropy-chart/lib/series.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/series.js +45 -0
- package/dist/components/gini-impurity-entropy-chart/lib/series.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/types.d.ts +83 -0
- package/dist/components/gini-impurity-entropy-chart/lib/types.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/lib/types.js +19 -0
- package/dist/components/gini-impurity-entropy-chart/lib/types.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/metadata.json.d.ts +115 -0
- package/dist/components/gini-impurity-entropy-chart/metadata.json.js +42 -0
- package/dist/components/gini-impurity-entropy-chart/metadata.json.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/render/draw.d.ts +40 -0
- package/dist/components/gini-impurity-entropy-chart/render/draw.d.ts.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/render/draw.js +160 -0
- package/dist/components/gini-impurity-entropy-chart/render/draw.js.map +1 -0
- package/dist/components/gini-impurity-entropy-chart/render/index.d.ts +2 -0
- package/dist/components/gini-impurity-entropy-chart/render/index.d.ts.map +1 -0
- package/dist/components/histogram-chart/element/ui9000-histogram-chart.d.ts +1 -1
- package/dist/components/kpi-widget/element/ui9000-kpi-widget.d.ts +1 -1
- package/dist/components/kpi-widget/element/ui9000-kpi-widget.js +1 -1
- package/dist/components/line-chart/element/ui9000-line-chart.d.ts +1 -1
- package/dist/components/lollipop/element/styles.d.ts.map +1 -1
- package/dist/components/lollipop/element/styles.js +19 -1
- package/dist/components/lollipop/element/styles.js.map +1 -1
- package/dist/components/lollipop/element/ui9000-lollipop.d.ts +7 -2
- package/dist/components/lollipop/element/ui9000-lollipop.d.ts.map +1 -1
- package/dist/components/lollipop/element/ui9000-lollipop.js +68 -7
- package/dist/components/lollipop/element/ui9000-lollipop.js.map +1 -1
- package/dist/components/lollipop/index.d.ts +1 -1
- package/dist/components/lollipop/index.d.ts.map +1 -1
- package/dist/components/lollipop/index.js +2 -0
- package/dist/components/lollipop/index.js.map +1 -1
- package/dist/components/lollipop/lib/domain.d.ts +16 -1
- package/dist/components/lollipop/lib/domain.d.ts.map +1 -1
- package/dist/components/lollipop/lib/domain.js +56 -1
- package/dist/components/lollipop/lib/domain.js.map +1 -1
- package/dist/components/lollipop/lib/index.d.ts +3 -2
- package/dist/components/lollipop/lib/index.d.ts.map +1 -1
- package/dist/components/lollipop/lib/layout.d.ts +16 -0
- package/dist/components/lollipop/lib/layout.d.ts.map +1 -0
- package/dist/components/lollipop/lib/layout.js +16 -0
- package/dist/components/lollipop/lib/layout.js.map +1 -0
- package/dist/components/lollipop/lib/types.d.ts +5 -0
- package/dist/components/lollipop/lib/types.d.ts.map +1 -1
- package/dist/components/lollipop/metadata.json.d.ts +10 -0
- package/dist/components/lollipop/metadata.json.js +4 -1
- package/dist/components/lollipop/metadata.json.js.map +1 -1
- package/dist/components/lollipop/render/draw.d.ts +8 -1
- package/dist/components/lollipop/render/draw.d.ts.map +1 -1
- package/dist/components/lollipop/render/draw.js +155 -84
- package/dist/components/lollipop/render/draw.js.map +1 -1
- package/dist/components/map-chart/element/styles.d.ts +2 -0
- package/dist/components/map-chart/element/styles.d.ts.map +1 -0
- package/dist/components/map-chart/element/styles.js +372 -0
- package/dist/components/map-chart/element/styles.js.map +1 -0
- package/dist/components/map-chart/element/ui9000-map-chart.d.ts +54 -0
- package/dist/components/map-chart/element/ui9000-map-chart.d.ts.map +1 -0
- package/dist/components/map-chart/element/ui9000-map-chart.js +539 -0
- package/dist/components/map-chart/element/ui9000-map-chart.js.map +1 -0
- package/dist/components/map-chart/index.d.ts +5 -0
- package/dist/components/map-chart/index.d.ts.map +1 -0
- package/dist/components/map-chart/index.js +29 -0
- package/dist/components/map-chart/index.js.map +1 -0
- package/dist/components/map-chart/lib/constants.d.ts +34 -0
- package/dist/components/map-chart/lib/constants.d.ts.map +1 -0
- package/dist/components/map-chart/lib/constants.js +122 -0
- package/dist/components/map-chart/lib/constants.js.map +1 -0
- package/dist/components/map-chart/lib/domain.d.ts +12 -0
- package/dist/components/map-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/map-chart/lib/domain.js +105 -0
- package/dist/components/map-chart/lib/domain.js.map +1 -0
- package/dist/components/map-chart/lib/format.d.ts +8 -0
- package/dist/components/map-chart/lib/format.d.ts.map +1 -0
- package/dist/components/map-chart/lib/format.js +45 -0
- package/dist/components/map-chart/lib/format.js.map +1 -0
- package/dist/components/map-chart/lib/geo-index.d.ts +7 -0
- package/dist/components/map-chart/lib/geo-index.d.ts.map +1 -0
- package/dist/components/map-chart/lib/geo-index.js +200 -0
- package/dist/components/map-chart/lib/geo-index.js.map +1 -0
- package/dist/components/map-chart/lib/geojson.d.ts +5 -0
- package/dist/components/map-chart/lib/geojson.d.ts.map +1 -0
- package/dist/components/map-chart/lib/geojson.js +47 -0
- package/dist/components/map-chart/lib/geojson.js.map +1 -0
- package/dist/components/map-chart/lib/index.d.ts +13 -0
- package/dist/components/map-chart/lib/index.d.ts.map +1 -0
- package/dist/components/map-chart/lib/join.d.ts +7 -0
- package/dist/components/map-chart/lib/join.d.ts.map +1 -0
- package/dist/components/map-chart/lib/join.js +156 -0
- package/dist/components/map-chart/lib/join.js.map +1 -0
- package/dist/components/map-chart/lib/legend.d.ts +45 -0
- package/dist/components/map-chart/lib/legend.d.ts.map +1 -0
- package/dist/components/map-chart/lib/legend.js +108 -0
- package/dist/components/map-chart/lib/legend.js.map +1 -0
- package/dist/components/map-chart/lib/normalize.d.ts +3 -0
- package/dist/components/map-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/map-chart/lib/normalize.js +177 -0
- package/dist/components/map-chart/lib/normalize.js.map +1 -0
- package/dist/components/map-chart/lib/pmtiles.d.ts +41 -0
- package/dist/components/map-chart/lib/pmtiles.d.ts.map +1 -0
- package/dist/components/map-chart/lib/pmtiles.js +112 -0
- package/dist/components/map-chart/lib/pmtiles.js.map +1 -0
- package/dist/components/map-chart/lib/types.d.ts +128 -0
- package/dist/components/map-chart/lib/types.d.ts.map +1 -0
- package/dist/components/map-chart/metadata.json.d.ts +83 -0
- package/dist/components/map-chart/metadata.json.js +42 -0
- package/dist/components/map-chart/metadata.json.js.map +1 -0
- package/dist/components/map-chart/render/draw.d.ts +24 -0
- package/dist/components/map-chart/render/draw.d.ts.map +1 -0
- package/dist/components/map-chart/render/draw.js +455 -0
- package/dist/components/map-chart/render/draw.js.map +1 -0
- package/dist/components/map-chart/render/index.d.ts +2 -0
- package/dist/components/map-chart/render/index.d.ts.map +1 -0
- package/dist/components/matrix-chart/element/styles.d.ts +2 -0
- package/dist/components/matrix-chart/element/styles.d.ts.map +1 -0
- package/dist/components/matrix-chart/element/styles.js +97 -0
- package/dist/components/matrix-chart/element/styles.js.map +1 -0
- package/dist/components/matrix-chart/element/ui9000-matrix-chart.d.ts +39 -0
- package/dist/components/matrix-chart/element/ui9000-matrix-chart.d.ts.map +1 -0
- package/dist/components/matrix-chart/element/ui9000-matrix-chart.js +238 -0
- package/dist/components/matrix-chart/element/ui9000-matrix-chart.js.map +1 -0
- package/dist/components/matrix-chart/index.d.ts +5 -0
- package/dist/components/matrix-chart/index.d.ts.map +1 -0
- package/dist/components/matrix-chart/index.js +20 -0
- package/dist/components/matrix-chart/index.js.map +1 -0
- package/dist/components/matrix-chart/lib/domain.d.ts +7 -0
- package/dist/components/matrix-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/matrix-chart/lib/domain.js +58 -0
- package/dist/components/matrix-chart/lib/domain.js.map +1 -0
- package/dist/components/matrix-chart/lib/format.d.ts +5 -0
- package/dist/components/matrix-chart/lib/format.d.ts.map +1 -0
- package/dist/components/matrix-chart/lib/format.js +16 -0
- package/dist/components/matrix-chart/lib/format.js.map +1 -0
- package/dist/components/matrix-chart/lib/index.d.ts +5 -0
- package/dist/components/matrix-chart/lib/index.d.ts.map +1 -0
- package/dist/components/matrix-chart/lib/normalize.d.ts +5 -0
- package/dist/components/matrix-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/matrix-chart/lib/normalize.js +165 -0
- package/dist/components/matrix-chart/lib/normalize.js.map +1 -0
- package/dist/components/matrix-chart/lib/types.d.ts +33 -0
- package/dist/components/matrix-chart/lib/types.d.ts.map +1 -0
- package/dist/components/matrix-chart/metadata.json.d.ts +110 -0
- package/dist/components/matrix-chart/metadata.json.js +42 -0
- package/dist/components/matrix-chart/metadata.json.js.map +1 -0
- package/dist/components/matrix-chart/render/draw.d.ts +63 -0
- package/dist/components/matrix-chart/render/draw.d.ts.map +1 -0
- package/dist/components/matrix-chart/render/draw.js +225 -0
- package/dist/components/matrix-chart/render/draw.js.map +1 -0
- package/dist/components/matrix-chart/render/index.d.ts +2 -0
- package/dist/components/matrix-chart/render/index.d.ts.map +1 -0
- package/dist/components/network-graph/element/styles.d.ts +2 -0
- package/dist/components/network-graph/element/styles.d.ts.map +1 -0
- package/dist/components/network-graph/element/styles.js +272 -0
- package/dist/components/network-graph/element/styles.js.map +1 -0
- package/dist/components/network-graph/element/ui9000-network-graph.d.ts +47 -0
- package/dist/components/network-graph/element/ui9000-network-graph.d.ts.map +1 -0
- package/dist/components/network-graph/element/ui9000-network-graph.js +307 -0
- package/dist/components/network-graph/element/ui9000-network-graph.js.map +1 -0
- package/dist/components/network-graph/index.d.ts +5 -0
- package/dist/components/network-graph/index.d.ts.map +1 -0
- package/dist/components/network-graph/index.js +37 -0
- package/dist/components/network-graph/index.js.map +1 -0
- package/dist/components/network-graph/lib/domain.d.ts +96 -0
- package/dist/components/network-graph/lib/domain.d.ts.map +1 -0
- package/dist/components/network-graph/lib/domain.js +211 -0
- package/dist/components/network-graph/lib/domain.js.map +1 -0
- package/dist/components/network-graph/lib/format.d.ts +7 -0
- package/dist/components/network-graph/lib/format.d.ts.map +1 -0
- package/dist/components/network-graph/lib/format.js +29 -0
- package/dist/components/network-graph/lib/format.js.map +1 -0
- package/dist/components/network-graph/lib/index.d.ts +6 -0
- package/dist/components/network-graph/lib/index.d.ts.map +1 -0
- package/dist/components/network-graph/lib/legend.d.ts +15 -0
- package/dist/components/network-graph/lib/legend.d.ts.map +1 -0
- package/dist/components/network-graph/lib/legend.js +35 -0
- package/dist/components/network-graph/lib/legend.js.map +1 -0
- package/dist/components/network-graph/lib/normalize.d.ts +10 -0
- package/dist/components/network-graph/lib/normalize.d.ts.map +1 -0
- package/dist/components/network-graph/lib/normalize.js +140 -0
- package/dist/components/network-graph/lib/normalize.js.map +1 -0
- package/dist/components/network-graph/lib/types.d.ts +56 -0
- package/dist/components/network-graph/lib/types.d.ts.map +1 -0
- package/dist/components/network-graph/metadata.json.d.ts +91 -0
- package/dist/components/network-graph/metadata.json.js +42 -0
- package/dist/components/network-graph/metadata.json.js.map +1 -0
- package/dist/components/network-graph/render/draw.d.ts +49 -0
- package/dist/components/network-graph/render/draw.d.ts.map +1 -0
- package/dist/components/network-graph/render/draw.js +493 -0
- package/dist/components/network-graph/render/draw.js.map +1 -0
- package/dist/components/network-graph/render/index.d.ts +2 -0
- package/dist/components/network-graph/render/index.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/element/styles.d.ts +2 -0
- package/dist/components/parallel-coordinates-chart/element/styles.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/element/styles.js +71 -0
- package/dist/components/parallel-coordinates-chart/element/styles.js.map +1 -0
- package/dist/components/parallel-coordinates-chart/element/ui9000-parallel-coordinates-chart.d.ts +33 -0
- package/dist/components/parallel-coordinates-chart/element/ui9000-parallel-coordinates-chart.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/element/ui9000-parallel-coordinates-chart.js +182 -0
- package/dist/components/parallel-coordinates-chart/element/ui9000-parallel-coordinates-chart.js.map +1 -0
- package/dist/components/parallel-coordinates-chart/index.d.ts +5 -0
- package/dist/components/parallel-coordinates-chart/index.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/index.js +23 -0
- package/dist/components/parallel-coordinates-chart/index.js.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/domain.d.ts +14 -0
- package/dist/components/parallel-coordinates-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/domain.js +28 -0
- package/dist/components/parallel-coordinates-chart/lib/domain.js.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/format.d.ts +12 -0
- package/dist/components/parallel-coordinates-chart/lib/format.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/format.js +18 -0
- package/dist/components/parallel-coordinates-chart/lib/format.js.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/index.d.ts +5 -0
- package/dist/components/parallel-coordinates-chart/lib/index.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/normalize.d.ts +23 -0
- package/dist/components/parallel-coordinates-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/normalize.js +156 -0
- package/dist/components/parallel-coordinates-chart/lib/normalize.js.map +1 -0
- package/dist/components/parallel-coordinates-chart/lib/types.d.ts +48 -0
- package/dist/components/parallel-coordinates-chart/lib/types.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/metadata.json.d.ts +103 -0
- package/dist/components/parallel-coordinates-chart/metadata.json.js +45 -0
- package/dist/components/parallel-coordinates-chart/render/draw.d.ts +30 -0
- package/dist/components/parallel-coordinates-chart/render/draw.d.ts.map +1 -0
- package/dist/components/parallel-coordinates-chart/render/draw.js +160 -0
- package/dist/components/parallel-coordinates-chart/render/draw.js.map +1 -0
- package/dist/components/parallel-coordinates-chart/render/index.d.ts +2 -0
- package/dist/components/parallel-coordinates-chart/render/index.d.ts.map +1 -0
- package/dist/components/pie-chart/element/styles.d.ts.map +1 -1
- package/dist/components/pie-chart/element/styles.js +34 -1
- package/dist/components/pie-chart/element/styles.js.map +1 -1
- package/dist/components/pie-chart/element/ui9000-pie-chart.d.ts +1 -3
- package/dist/components/pie-chart/element/ui9000-pie-chart.d.ts.map +1 -1
- package/dist/components/pie-chart/element/ui9000-pie-chart.js +2 -8
- package/dist/components/pie-chart/element/ui9000-pie-chart.js.map +1 -1
- package/dist/components/pie-chart/metadata.json.d.ts +1 -7
- package/dist/components/pie-chart/metadata.json.js +2 -2
- package/dist/components/polar-area-chart/element/styles.d.ts +2 -0
- package/dist/components/polar-area-chart/element/styles.d.ts.map +1 -0
- package/dist/components/polar-area-chart/element/styles.js +48 -0
- package/dist/components/polar-area-chart/element/styles.js.map +1 -0
- package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.d.ts +29 -0
- package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.d.ts.map +1 -0
- package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.js +168 -0
- package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.js.map +1 -0
- package/dist/components/polar-area-chart/index.d.ts +5 -0
- package/dist/components/polar-area-chart/index.d.ts.map +1 -0
- package/dist/components/polar-area-chart/index.js +19 -0
- package/dist/components/polar-area-chart/index.js.map +1 -0
- package/dist/components/polar-area-chart/lib/domain.d.ts +33 -0
- package/dist/components/polar-area-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/polar-area-chart/lib/domain.js +67 -0
- package/dist/components/polar-area-chart/lib/domain.js.map +1 -0
- package/dist/components/polar-area-chart/lib/index.d.ts +4 -0
- package/dist/components/polar-area-chart/lib/index.d.ts.map +1 -0
- package/dist/components/polar-area-chart/lib/normalize.d.ts +4 -0
- package/dist/components/polar-area-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/polar-area-chart/lib/normalize.js +183 -0
- package/dist/components/polar-area-chart/lib/normalize.js.map +1 -0
- package/dist/components/polar-area-chart/lib/types.d.ts +48 -0
- package/dist/components/polar-area-chart/lib/types.d.ts.map +1 -0
- package/dist/components/polar-area-chart/metadata.json.d.ts +79 -0
- package/dist/components/polar-area-chart/metadata.json.js +42 -0
- package/dist/components/polar-area-chart/metadata.json.js.map +1 -0
- package/dist/components/polar-area-chart/render/draw.d.ts +25 -0
- package/dist/components/polar-area-chart/render/draw.d.ts.map +1 -0
- package/dist/components/polar-area-chart/render/draw.js +127 -0
- package/dist/components/polar-area-chart/render/draw.js.map +1 -0
- package/dist/components/polar-area-chart/render/index.d.ts +2 -0
- package/dist/components/polar-area-chart/render/index.d.ts.map +1 -0
- package/dist/components/punchcard-chart/element/ui9000-punchcard-chart.d.ts +1 -1
- package/dist/components/punchcard-chart/metadata.json.d.ts +1 -1
- package/dist/components/punchcard-chart/metadata.json.js +1 -1
- package/dist/components/radar-chart/element/ui9000-radar-chart.d.ts +1 -1
- package/dist/components/radial-bar-chart/element/styles.d.ts +2 -0
- package/dist/components/radial-bar-chart/element/styles.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/element/styles.js +53 -0
- package/dist/components/radial-bar-chart/element/styles.js.map +1 -0
- package/dist/components/radial-bar-chart/element/ui9000-radial-bar-chart.d.ts +35 -0
- package/dist/components/radial-bar-chart/element/ui9000-radial-bar-chart.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/element/ui9000-radial-bar-chart.js +174 -0
- package/dist/components/radial-bar-chart/element/ui9000-radial-bar-chart.js.map +1 -0
- package/dist/components/radial-bar-chart/index.d.ts +5 -0
- package/dist/components/radial-bar-chart/index.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/index.js +21 -0
- package/dist/components/radial-bar-chart/index.js.map +1 -0
- package/dist/components/radial-bar-chart/lib/domain.d.ts +47 -0
- package/dist/components/radial-bar-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/lib/domain.js +50 -0
- package/dist/components/radial-bar-chart/lib/domain.js.map +1 -0
- package/dist/components/radial-bar-chart/lib/format.d.ts +6 -0
- package/dist/components/radial-bar-chart/lib/format.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/lib/format.js +12 -0
- package/dist/components/radial-bar-chart/lib/format.js.map +1 -0
- package/dist/components/radial-bar-chart/lib/index.d.ts +5 -0
- package/dist/components/radial-bar-chart/lib/index.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/lib/normalize.d.ts +4 -0
- package/dist/components/radial-bar-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/lib/normalize.js +92 -0
- package/dist/components/radial-bar-chart/lib/normalize.js.map +1 -0
- package/dist/components/radial-bar-chart/lib/types.d.ts +34 -0
- package/dist/components/radial-bar-chart/lib/types.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/metadata.json.d.ts +62 -0
- package/dist/components/radial-bar-chart/metadata.json.js +42 -0
- package/dist/components/radial-bar-chart/metadata.json.js.map +1 -0
- package/dist/components/radial-bar-chart/render/draw.d.ts +29 -0
- package/dist/components/radial-bar-chart/render/draw.d.ts.map +1 -0
- package/dist/components/radial-bar-chart/render/draw.js +92 -0
- package/dist/components/radial-bar-chart/render/draw.js.map +1 -0
- package/dist/components/radial-bar-chart/render/index.d.ts +2 -0
- package/dist/components/radial-bar-chart/render/index.d.ts.map +1 -0
- package/dist/components/sankey-chart/element/styles.d.ts.map +1 -1
- package/dist/components/sankey-chart/element/styles.js +7 -27
- package/dist/components/sankey-chart/element/styles.js.map +1 -1
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.d.ts +6 -6
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.d.ts.map +1 -1
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.js +39 -36
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.js.map +1 -1
- package/dist/components/sankey-chart/index.js +4 -2
- package/dist/components/sankey-chart/index.js.map +1 -1
- package/dist/components/sankey-chart/lib/domain.d.ts +2 -2
- package/dist/components/sankey-chart/lib/domain.d.ts.map +1 -1
- package/dist/components/sankey-chart/lib/domain.js +1 -13
- package/dist/components/sankey-chart/lib/domain.js.map +1 -1
- package/dist/components/sankey-chart/lib/format.d.ts +1 -2
- package/dist/components/sankey-chart/lib/format.d.ts.map +1 -1
- package/dist/components/sankey-chart/lib/format.js +3 -7
- package/dist/components/sankey-chart/lib/format.js.map +1 -1
- package/dist/components/scatter-plot-chart/element/ui9000-scatter-plot.d.ts +1 -1
- package/dist/components/scatter-sparkline-chart/element/ui9000-scatter-sparkline-chart.d.ts +1 -1
- package/dist/components/spark-area-chart/element/ui9000-spark-area-chart.d.ts +1 -1
- package/dist/components/spark-line-chart/element/ui9000-spark-line-chart.d.ts +1 -1
- package/dist/components/step-line-chart/element/ui9000-step-line-chart.d.ts +1 -1
- package/dist/components/treemap-chart/element/styles.d.ts +2 -0
- package/dist/components/treemap-chart/element/styles.d.ts.map +1 -0
- package/dist/components/treemap-chart/element/styles.js +141 -0
- package/dist/components/treemap-chart/element/styles.js.map +1 -0
- package/dist/components/treemap-chart/element/ui9000-treemap-chart.d.ts +35 -0
- package/dist/components/treemap-chart/element/ui9000-treemap-chart.d.ts.map +1 -0
- package/dist/components/treemap-chart/element/ui9000-treemap-chart.js +177 -0
- package/dist/components/treemap-chart/element/ui9000-treemap-chart.js.map +1 -0
- package/dist/components/treemap-chart/index.d.ts +5 -0
- package/dist/components/treemap-chart/index.d.ts.map +1 -0
- package/dist/components/treemap-chart/index.js +22 -0
- package/dist/components/treemap-chart/index.js.map +1 -0
- package/dist/components/treemap-chart/lib/color.d.ts +25 -0
- package/dist/components/treemap-chart/lib/color.d.ts.map +1 -0
- package/dist/components/treemap-chart/lib/color.js +67 -0
- package/dist/components/treemap-chart/lib/color.js.map +1 -0
- package/dist/components/treemap-chart/lib/format.d.ts +7 -0
- package/dist/components/treemap-chart/lib/format.d.ts.map +1 -0
- package/dist/components/treemap-chart/lib/format.js +9 -0
- package/dist/components/treemap-chart/lib/format.js.map +1 -0
- package/dist/components/treemap-chart/lib/index.d.ts +6 -0
- package/dist/components/treemap-chart/lib/index.d.ts.map +1 -0
- package/dist/components/treemap-chart/lib/layout.d.ts +18 -0
- package/dist/components/treemap-chart/lib/layout.d.ts.map +1 -0
- package/dist/components/treemap-chart/lib/layout.js +31 -0
- package/dist/components/treemap-chart/lib/layout.js.map +1 -0
- package/dist/components/treemap-chart/lib/normalize.d.ts +4 -0
- package/dist/components/treemap-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/treemap-chart/lib/normalize.js +182 -0
- package/dist/components/treemap-chart/lib/normalize.js.map +1 -0
- package/dist/components/treemap-chart/lib/types.d.ts +63 -0
- package/dist/components/treemap-chart/lib/types.d.ts.map +1 -0
- package/dist/components/treemap-chart/metadata.json.d.ts +126 -0
- package/dist/components/treemap-chart/metadata.json.js +45 -0
- package/dist/components/treemap-chart/metadata.json.js.map +1 -0
- package/dist/components/treemap-chart/render/draw.d.ts +24 -0
- package/dist/components/treemap-chart/render/draw.d.ts.map +1 -0
- package/dist/components/treemap-chart/render/draw.js +124 -0
- package/dist/components/treemap-chart/render/draw.js.map +1 -0
- package/dist/components/treemap-chart/render/index.d.ts +2 -0
- package/dist/components/treemap-chart/render/index.d.ts.map +1 -0
- package/dist/components/violin-chart/element/ui9000-violin-chart.d.ts +1 -1
- package/dist/components/waterfall-chart/element/ui9000-waterfall-chart.d.ts +1 -1
- package/dist/element/chart-legend-render.d.ts +5 -0
- package/dist/element/chart-legend-render.d.ts.map +1 -1
- package/dist/element/chart-legend-render.js +19 -1
- package/dist/element/chart-legend-render.js.map +1 -1
- package/dist/element/chart-shell-styles.d.ts.map +1 -1
- package/dist/element/chart-shell-styles.js +35 -0
- package/dist/element/chart-shell-styles.js.map +1 -1
- package/dist/element/ui9000-chart-base.d.ts +2 -2
- package/dist/index.d.ts +20 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +178 -47
- package/dist/index.js.map +1 -1
- package/dist/lazy/bias-variance-tradeoff-chart.d.ts +4 -0
- package/dist/lazy/bias-variance-tradeoff-chart.d.ts.map +1 -0
- package/dist/lazy/bias-variance-tradeoff-chart.js +5 -0
- package/dist/lazy/bias-variance-tradeoff-chart.js.map +1 -0
- package/dist/lazy/gini-impurity-entropy-chart.d.ts +4 -0
- package/dist/lazy/gini-impurity-entropy-chart.d.ts.map +1 -0
- package/dist/lazy/gini-impurity-entropy-chart.js +5 -0
- package/dist/lazy/gini-impurity-entropy-chart.js.map +1 -0
- package/dist/lazy/index.d.ts +10 -2
- package/dist/lazy/index.d.ts.map +1 -1
- package/dist/lazy/index.js +72 -8
- package/dist/lazy/index.js.map +1 -1
- package/dist/lazy/map-chart.d.ts +4 -0
- package/dist/lazy/map-chart.d.ts.map +1 -0
- package/dist/lazy/map-chart.js +5 -0
- package/dist/lazy/map-chart.js.map +1 -0
- package/dist/lazy/matrix-chart.d.ts +4 -0
- package/dist/lazy/matrix-chart.d.ts.map +1 -0
- package/dist/lazy/matrix-chart.js +5 -0
- package/dist/lazy/matrix-chart.js.map +1 -0
- package/dist/lazy/network-graph.d.ts +4 -0
- package/dist/lazy/network-graph.d.ts.map +1 -0
- package/dist/lazy/network-graph.js +5 -0
- package/dist/lazy/network-graph.js.map +1 -0
- package/dist/lazy/parallel-coordinates-chart.d.ts +4 -0
- package/dist/lazy/parallel-coordinates-chart.d.ts.map +1 -0
- package/dist/lazy/parallel-coordinates-chart.js +5 -0
- package/dist/lazy/parallel-coordinates-chart.js.map +1 -0
- package/dist/lazy/polar-area-chart.d.ts +4 -0
- package/dist/lazy/polar-area-chart.d.ts.map +1 -0
- package/dist/lazy/polar-area-chart.js +5 -0
- package/dist/lazy/polar-area-chart.js.map +1 -0
- package/dist/lazy/radial-bar-chart.d.ts +4 -0
- package/dist/lazy/radial-bar-chart.d.ts.map +1 -0
- package/dist/lazy/radial-bar-chart.js +5 -0
- package/dist/lazy/radial-bar-chart.js.map +1 -0
- package/dist/lazy/treemap-chart.d.ts +4 -0
- package/dist/lazy/treemap-chart.d.ts.map +1 -0
- package/dist/lazy/treemap-chart.js +5 -0
- package/dist/lazy/treemap-chart.js.map +1 -0
- package/dist/node_modules/lit-html/directive.js.map +1 -0
- package/dist/node_modules/lit-html/directives/style-map.js.map +1 -0
- package/dist/node_modules/lit-html/lit-html.js.map +1 -0
- package/dist/utils/axis-units.d.ts +15 -0
- package/dist/utils/axis-units.d.ts.map +1 -0
- package/dist/utils/axis-units.js +27 -0
- package/dist/utils/axis-units.js.map +1 -0
- package/dist/utils/breakpoints.d.ts +7 -0
- package/dist/utils/breakpoints.d.ts.map +1 -0
- package/dist/utils/breakpoints.js +17 -0
- package/dist/utils/breakpoints.js.map +1 -0
- package/dist/utils/chart-helpers.d.ts +25 -6
- package/dist/utils/chart-helpers.d.ts.map +1 -1
- package/dist/utils/chart-helpers.js +70 -15
- package/dist/utils/chart-helpers.js.map +1 -1
- package/dist/utils/format-text.d.ts +22 -0
- package/dist/utils/format-text.d.ts.map +1 -0
- package/dist/utils/format-text.js +33 -0
- package/dist/utils/format-text.js.map +1 -0
- package/dist/utils/fuse-palette.d.ts +12 -0
- package/dist/utils/fuse-palette.d.ts.map +1 -1
- package/dist/utils/fuse-palette.js +23 -1
- package/dist/utils/fuse-palette.js.map +1 -1
- package/dist/utils/fuse-widget.d.ts +13 -4
- package/dist/utils/fuse-widget.d.ts.map +1 -1
- package/dist/utils/fuse-widget.js.map +1 -1
- package/dist/utils/fusedash-visual.d.ts +208 -52
- package/dist/utils/fusedash-visual.d.ts.map +1 -1
- package/dist/utils/fusedash-visual.js +162 -30
- package/dist/utils/fusedash-visual.js.map +1 -1
- package/package.json +91 -12
- package/dist/components/donut-group-chart/element/styles.d.ts +0 -2
- package/dist/components/donut-group-chart/element/styles.d.ts.map +0 -1
- package/dist/components/donut-group-chart/element/styles.js.map +0 -1
- package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.d.ts +0 -34
- package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.d.ts.map +0 -1
- package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.js +0 -169
- package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.js.map +0 -1
- package/dist/components/donut-group-chart/index.d.ts +0 -5
- package/dist/components/donut-group-chart/index.d.ts.map +0 -1
- package/dist/components/donut-group-chart/index.js +0 -23
- package/dist/components/donut-group-chart/lib/domain.d.ts +0 -39
- package/dist/components/donut-group-chart/lib/domain.d.ts.map +0 -1
- package/dist/components/donut-group-chart/lib/domain.js +0 -51
- package/dist/components/donut-group-chart/lib/domain.js.map +0 -1
- package/dist/components/donut-group-chart/lib/format.d.ts +0 -7
- package/dist/components/donut-group-chart/lib/format.d.ts.map +0 -1
- package/dist/components/donut-group-chart/lib/format.js +0 -21
- package/dist/components/donut-group-chart/lib/format.js.map +0 -1
- package/dist/components/donut-group-chart/lib/index.d.ts +0 -5
- package/dist/components/donut-group-chart/lib/index.d.ts.map +0 -1
- package/dist/components/donut-group-chart/lib/normalize.d.ts +0 -14
- package/dist/components/donut-group-chart/lib/normalize.d.ts.map +0 -1
- package/dist/components/donut-group-chart/lib/normalize.js +0 -98
- package/dist/components/donut-group-chart/lib/normalize.js.map +0 -1
- package/dist/components/donut-group-chart/lib/types.d.ts +0 -49
- package/dist/components/donut-group-chart/lib/types.d.ts.map +0 -1
- package/dist/components/donut-group-chart/metadata.json.d.ts +0 -113
- package/dist/components/donut-group-chart/metadata.json.js +0 -45
- package/dist/components/donut-group-chart/render/draw.d.ts +0 -44
- package/dist/components/donut-group-chart/render/draw.d.ts.map +0 -1
- package/dist/components/donut-group-chart/render/draw.js +0 -194
- package/dist/components/donut-group-chart/render/draw.js.map +0 -1
- package/dist/components/donut-group-chart/render/index.d.ts +0 -2
- package/dist/components/donut-group-chart/render/index.d.ts.map +0 -1
- package/dist/components/donut-group-chart/tests/fixtures.d.ts +0 -33
- package/dist/components/donut-group-chart/tests/fixtures.d.ts.map +0 -1
- package/dist/lazy/donut-group-chart.d.ts +0 -4
- package/dist/lazy/donut-group-chart.d.ts.map +0 -1
- package/dist/lazy/donut-group-chart.js +0 -5
- package/dist/lazy/donut-group-chart.js.map +0 -1
- package/dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive.js.map +0 -1
- package/dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/style-map.js.map +0 -1
- package/dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js.map +0 -1
- /package/dist/components/{donut-group-chart → bias-variance-tradeoff-chart}/index.js.map +0 -0
- /package/dist/components/{donut-group-chart → parallel-coordinates-chart}/metadata.json.js.map +0 -0
- /package/dist/node_modules/{.pnpm/lit-html@3.3.3/node_modules/lit-html → lit-html}/directive.js +0 -0
- /package/dist/node_modules/{.pnpm/lit-html@3.3.3/node_modules/lit-html → lit-html}/directives/style-map.js +0 -0
- /package/dist/node_modules/{.pnpm/lit-html@3.3.3/node_modules/lit-html → lit-html}/lit-html.js +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { nothing, html } from "lit";
|
|
2
|
+
import { property, state, customElement } from "lit/decorators.js";
|
|
3
|
+
import { readThemeFromElement } from "../../../context/widget-context.js";
|
|
4
|
+
import { renderPaletteLegend } from "../../../element/chart-legend-render.js";
|
|
5
|
+
import { Ui9000ChartElement } from "../../../element/ui9000-chart-base.js";
|
|
6
|
+
import { parseJsonAttr, getTreemapDimensions } from "../../../utils/chart-helpers.js";
|
|
7
|
+
import { chartPropsChanged } from "../../../utils/lit-draw.js";
|
|
8
|
+
import { formatValueWithUnit } from "../../../utils/axis-units.js";
|
|
9
|
+
import { formatCapitalizedText, formatCapitalizedWords } from "../../../utils/format-text.js";
|
|
10
|
+
import { formatTreemapValue } from "../lib/format.js";
|
|
11
|
+
import { normalizeTreemapData } from "../lib/normalize.js";
|
|
12
|
+
import { renderTreemapChart } from "../render/draw.js";
|
|
13
|
+
import { treemapChartStyles } from "./styles.js";
|
|
14
|
+
import { chartShellStyles } from "../../../element/chart-shell-styles.js";
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
17
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
18
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
19
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
20
|
+
if (decorator = decorators[i])
|
|
21
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
22
|
+
if (kind && result) __defProp(target, key, result);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
let Ui9000TreemapChart = class extends Ui9000ChartElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.showLegend = true;
|
|
29
|
+
this.showTooltip = true;
|
|
30
|
+
this._tooltip = null;
|
|
31
|
+
this._empty = false;
|
|
32
|
+
this._rangeColors = [];
|
|
33
|
+
this._raf = 0;
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback();
|
|
37
|
+
this._resizeObserver = new ResizeObserver(() => this.scheduleDraw());
|
|
38
|
+
this._resizeObserver.observe(this);
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
var _a;
|
|
42
|
+
(_a = this._resizeObserver) == null ? void 0 : _a.disconnect();
|
|
43
|
+
cancelAnimationFrame(this._raf);
|
|
44
|
+
super.disconnectedCallback();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The palette legend only appears once the data is known, which shortens the
|
|
48
|
+
* plot — observing the plot box (not just the host) redraws it at the size it
|
|
49
|
+
* actually got.
|
|
50
|
+
*/
|
|
51
|
+
firstUpdated() {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const root = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(".chart-root");
|
|
54
|
+
if (root) (_b = this._resizeObserver) == null ? void 0 : _b.observe(root);
|
|
55
|
+
}
|
|
56
|
+
updated(changed) {
|
|
57
|
+
if (chartPropsChanged(changed)) this.scheduleDraw();
|
|
58
|
+
}
|
|
59
|
+
scheduleDraw() {
|
|
60
|
+
cancelAnimationFrame(this._raf);
|
|
61
|
+
this._raf = requestAnimationFrame(() => this.draw());
|
|
62
|
+
}
|
|
63
|
+
parseData() {
|
|
64
|
+
const raw = parseJsonAttr(this.dataJson, null);
|
|
65
|
+
return normalizeTreemapData(raw);
|
|
66
|
+
}
|
|
67
|
+
/** Client tooltip: `Value` plus the dimension the tile encodes. */
|
|
68
|
+
tooltipFor(model, payload) {
|
|
69
|
+
var _a;
|
|
70
|
+
const { tile, group } = payload;
|
|
71
|
+
const rows = [
|
|
72
|
+
{ key: "Value", value: formatTreemapValue(tile.value, model.mode) }
|
|
73
|
+
];
|
|
74
|
+
if (model.mode === "grouped") {
|
|
75
|
+
if (group && model.categoryField) {
|
|
76
|
+
rows.push({ key: formatCapitalizedText(model.categoryField), value: group.label });
|
|
77
|
+
}
|
|
78
|
+
return { title: formatCapitalizedWords(tile.label), rows };
|
|
79
|
+
}
|
|
80
|
+
if (model.categoryField) {
|
|
81
|
+
const detail = (_a = model.axisDetails) == null ? void 0 : _a[model.categoryField];
|
|
82
|
+
rows.push({
|
|
83
|
+
key: (detail == null ? void 0 : detail.label) ?? model.categoryField,
|
|
84
|
+
value: formatValueWithUnit(tile.label, detail)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return { rows };
|
|
88
|
+
}
|
|
89
|
+
draw() {
|
|
90
|
+
var _a;
|
|
91
|
+
const root = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(".chart-root");
|
|
92
|
+
if (!root) return;
|
|
93
|
+
const model = this.parseData();
|
|
94
|
+
this._empty = model.mode === "single" ? !model.tiles.length : !model.groups.length;
|
|
95
|
+
this._rangeColors = !this._empty && model.mode === "single" ? model.rangeColors : [];
|
|
96
|
+
if (this._empty) {
|
|
97
|
+
root.replaceChildren();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const theme = readThemeFromElement(this);
|
|
101
|
+
const { width, height } = getTreemapDimensions(root);
|
|
102
|
+
renderTreemapChart(root, {
|
|
103
|
+
model,
|
|
104
|
+
width,
|
|
105
|
+
height,
|
|
106
|
+
theme,
|
|
107
|
+
showTooltip: this.showTooltip,
|
|
108
|
+
onHover: this.showTooltip ? (payload) => {
|
|
109
|
+
const rect = this.getBoundingClientRect();
|
|
110
|
+
this._tooltip = {
|
|
111
|
+
x: payload.event.clientX - rect.left,
|
|
112
|
+
y: payload.event.clientY - rect.top,
|
|
113
|
+
...this.tooltipFor(model, payload)
|
|
114
|
+
};
|
|
115
|
+
} : void 0,
|
|
116
|
+
onLeave: this.showTooltip ? () => {
|
|
117
|
+
this._tooltip = null;
|
|
118
|
+
} : void 0
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
renderLegend() {
|
|
122
|
+
if (!this.showLegend || !this._rangeColors.length) return nothing;
|
|
123
|
+
return renderPaletteLegend(this._rangeColors);
|
|
124
|
+
}
|
|
125
|
+
render() {
|
|
126
|
+
const title = this.headerTitle();
|
|
127
|
+
return html`
|
|
128
|
+
<div class="widget-shell" part="shell">
|
|
129
|
+
${this.renderShellHeader(title)}
|
|
130
|
+
<div class="widget-body">
|
|
131
|
+
${this.renderLegend()}
|
|
132
|
+
<div class="chart-root" part="chart" ?hidden=${this._empty}></div>
|
|
133
|
+
${this._empty ? html`<div class="empty" part="empty">No data</div>` : nothing}
|
|
134
|
+
${this._tooltip ? html`<div
|
|
135
|
+
class="tooltip"
|
|
136
|
+
part="tooltip"
|
|
137
|
+
style="left:${this._tooltip.x}px;top:${this._tooltip.y}px"
|
|
138
|
+
>
|
|
139
|
+
${this._tooltip.title ? html`<div class="tooltip-title">${this._tooltip.title}</div>` : nothing}
|
|
140
|
+
${this._tooltip.rows.map((row) => html`<div>${row.key}: ${row.value}</div>`)}
|
|
141
|
+
</div>` : nothing}
|
|
142
|
+
${this.renderShellLabelTooltip()}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
`;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
Ui9000TreemapChart.styles = [treemapChartStyles, chartShellStyles];
|
|
149
|
+
__decorateClass([
|
|
150
|
+
property({ type: Boolean, attribute: "show-legend" })
|
|
151
|
+
], Ui9000TreemapChart.prototype, "showLegend", 2);
|
|
152
|
+
__decorateClass([
|
|
153
|
+
property({ type: Boolean, attribute: "show-tooltip" })
|
|
154
|
+
], Ui9000TreemapChart.prototype, "showTooltip", 2);
|
|
155
|
+
__decorateClass([
|
|
156
|
+
state()
|
|
157
|
+
], Ui9000TreemapChart.prototype, "_tooltip", 2);
|
|
158
|
+
__decorateClass([
|
|
159
|
+
state()
|
|
160
|
+
], Ui9000TreemapChart.prototype, "_empty", 2);
|
|
161
|
+
__decorateClass([
|
|
162
|
+
state()
|
|
163
|
+
], Ui9000TreemapChart.prototype, "_rangeColors", 2);
|
|
164
|
+
Ui9000TreemapChart = __decorateClass([
|
|
165
|
+
customElement("ui9000-treemap-chart")
|
|
166
|
+
], Ui9000TreemapChart);
|
|
167
|
+
function registerTreemapChart() {
|
|
168
|
+
if (!customElements.get("ui9000-treemap-chart")) {
|
|
169
|
+
customElements.define("ui9000-treemap-chart", Ui9000TreemapChart);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
registerTreemapChart();
|
|
173
|
+
export {
|
|
174
|
+
Ui9000TreemapChart,
|
|
175
|
+
registerTreemapChart
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=ui9000-treemap-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui9000-treemap-chart.js","sources":["../../../../src/components/treemap-chart/element/ui9000-treemap-chart.ts"],"sourcesContent":["import { html, nothing, type PropertyValues } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { readThemeFromElement } from '../../../context/widget-context.js';\nimport { renderPaletteLegend } from '../../../element/chart-legend-render.js';\nimport { chartShellStyles, Ui9000ChartElement } from '../../../element/ui9000-chart-base.js';\nimport { getTreemapDimensions, parseJsonAttr } from '../../../utils/chart-helpers.js';\nimport { chartPropsChanged } from '../../../utils/lit-draw.js';\nimport { formatValueWithUnit } from '../../../utils/axis-units.js';\nimport { formatCapitalizedText, formatCapitalizedWords } from '../../../utils/format-text.js';\nimport { formatTreemapValue } from '../lib/format.js';\nimport { normalizeTreemapData } from '../lib/normalize.js';\nimport type { TreemapChartData, TreemapModel } from '../lib/types.js';\nimport { renderTreemapChart, type TreemapHoverPayload } from '../render/draw.js';\nimport { treemapChartStyles } from './styles.js';\n\ntype TooltipRow = { key: string; value: string };\n\n@customElement('ui9000-treemap-chart')\nexport class Ui9000TreemapChart extends Ui9000ChartElement {\n static override styles = [treemapChartStyles, chartShellStyles];\n\n @property({ type: Boolean, attribute: 'show-legend' })\n showLegend = true;\n\n @property({ type: Boolean, attribute: 'show-tooltip' })\n showTooltip = true;\n\n @state()\n private _tooltip: { x: number; y: number; title?: string; rows: TooltipRow[] } | null = null;\n\n @state()\n private _empty = false;\n\n @state()\n private _rangeColors: string[] = [];\n\n private _resizeObserver?: ResizeObserver;\n private _raf = 0;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._resizeObserver = new ResizeObserver(() => this.scheduleDraw());\n this._resizeObserver.observe(this);\n }\n\n override disconnectedCallback(): void {\n this._resizeObserver?.disconnect();\n cancelAnimationFrame(this._raf);\n super.disconnectedCallback();\n }\n\n /**\n * The palette legend only appears once the data is known, which shortens the\n * plot — observing the plot box (not just the host) redraws it at the size it\n * actually got.\n */\n override firstUpdated(): void {\n const root = this.shadowRoot?.querySelector('.chart-root');\n if (root) this._resizeObserver?.observe(root);\n }\n\n override updated(changed: PropertyValues): void {\n if (chartPropsChanged(changed)) this.scheduleDraw();\n }\n\n private scheduleDraw(): void {\n cancelAnimationFrame(this._raf);\n this._raf = requestAnimationFrame(() => this.draw());\n }\n\n private parseData(): TreemapModel {\n const raw = parseJsonAttr<TreemapChartData>(this.dataJson, null);\n return normalizeTreemapData(raw);\n }\n\n /** Client tooltip: `Value` plus the dimension the tile encodes. */\n private tooltipFor(model: TreemapModel, payload: TreemapHoverPayload): {\n title?: string;\n rows: TooltipRow[];\n } {\n const { tile, group } = payload;\n const rows: TooltipRow[] = [\n { key: 'Value', value: formatTreemapValue(tile.value, model.mode) },\n ];\n\n if (model.mode === 'grouped') {\n // The tile is a subgroup value, so the second row names the card it sits\n // in — the client labels it with `groupBy[0]` but prints the tile again.\n if (group && model.categoryField) {\n rows.push({ key: formatCapitalizedText(model.categoryField), value: group.label });\n }\n return { title: formatCapitalizedWords(tile.label), rows };\n }\n\n if (model.categoryField) {\n const detail = model.axisDetails?.[model.categoryField];\n rows.push({\n key: detail?.label ?? model.categoryField,\n value: formatValueWithUnit(tile.label, detail),\n });\n }\n return { rows };\n }\n\n private draw(): void {\n const root = this.shadowRoot?.querySelector('.chart-root') as HTMLElement | null;\n if (!root) return;\n\n const model = this.parseData();\n this._empty = model.mode === 'single' ? !model.tiles.length : !model.groups.length;\n // Grouped cards ramp their own colors, so the shared strip is single-mode only.\n this._rangeColors = !this._empty && model.mode === 'single' ? model.rangeColors : [];\n\n if (this._empty) {\n root.replaceChildren();\n return;\n }\n\n const theme = readThemeFromElement(this);\n const { width, height } = getTreemapDimensions(root);\n\n renderTreemapChart(root, {\n model,\n width,\n height,\n theme,\n showTooltip: this.showTooltip,\n onHover: this.showTooltip\n ? (payload) => {\n const rect = this.getBoundingClientRect();\n this._tooltip = {\n x: payload.event.clientX - rect.left,\n y: payload.event.clientY - rect.top,\n ...this.tooltipFor(model, payload),\n };\n }\n : undefined,\n onLeave: this.showTooltip\n ? () => {\n this._tooltip = null;\n }\n : undefined,\n });\n }\n\n private renderLegend() {\n if (!this.showLegend || !this._rangeColors.length) return nothing;\n return renderPaletteLegend(this._rangeColors);\n }\n\n override render() {\n const title = this.headerTitle();\n return html`\n <div class=\"widget-shell\" part=\"shell\">\n ${this.renderShellHeader(title)}\n <div class=\"widget-body\">\n ${this.renderLegend()}\n <div class=\"chart-root\" part=\"chart\" ?hidden=${this._empty}></div>\n ${this._empty ? html`<div class=\"empty\" part=\"empty\">No data</div>` : nothing}\n ${this._tooltip\n ? html`<div\n class=\"tooltip\"\n part=\"tooltip\"\n style=\"left:${this._tooltip.x}px;top:${this._tooltip.y}px\"\n >\n ${this._tooltip.title\n ? html`<div class=\"tooltip-title\">${this._tooltip.title}</div>`\n : nothing}\n ${this._tooltip.rows.map((row) => html`<div>${row.key}: ${row.value}</div>`)}\n </div>`\n : nothing}\n ${this.renderShellLabelTooltip()}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ui9000-treemap-chart': Ui9000TreemapChart;\n }\n}\n\nexport function registerTreemapChart(): void {\n if (!customElements.get('ui9000-treemap-chart')) {\n customElements.define('ui9000-treemap-chart', Ui9000TreemapChart);\n }\n}\n\nregisterTreemapChart();\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAM,qBAAN,cAAiC,mBAAmB;AAAA,EAApD,cAAA;AAAA,UAAA,GAAA,SAAA;AAIL,SAAA,aAAa;AAGb,SAAA,cAAc;AAGd,SAAQ,WAAgF;AAGxF,SAAQ,SAAS;AAGjB,SAAQ,eAAyB,CAAA;AAGjC,SAAQ,OAAO;AAAA,EAAA;AAAA,EAEN,oBAA0B;AACjC,UAAM,kBAAA;AACN,SAAK,kBAAkB,IAAI,eAAe,MAAM,KAAK,cAAc;AACnE,SAAK,gBAAgB,QAAQ,IAAI;AAAA,EACnC;AAAA,EAES,uBAA6B;;AACpC,eAAK,oBAAL,mBAAsB;AACtB,yBAAqB,KAAK,IAAI;AAC9B,UAAM,qBAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOS,eAAqB;;AAC5B,UAAM,QAAO,UAAK,eAAL,mBAAiB,cAAc;AAC5C,QAAI,KAAM,YAAK,oBAAL,mBAAsB,QAAQ;AAAA,EAC1C;AAAA,EAES,QAAQ,SAA+B;AAC9C,QAAI,kBAAkB,OAAO,EAAG,MAAK,aAAA;AAAA,EACvC;AAAA,EAEQ,eAAqB;AAC3B,yBAAqB,KAAK,IAAI;AAC9B,SAAK,OAAO,sBAAsB,MAAM,KAAK,MAAM;AAAA,EACrD;AAAA,EAEQ,YAA0B;AAChC,UAAM,MAAM,cAAgC,KAAK,UAAU,IAAI;AAC/D,WAAO,qBAAqB,GAAG;AAAA,EACjC;AAAA;AAAA,EAGQ,WAAW,OAAqB,SAGtC;;AACA,UAAM,EAAE,MAAM,MAAA,IAAU;AACxB,UAAM,OAAqB;AAAA,MACzB,EAAE,KAAK,SAAS,OAAO,mBAAmB,KAAK,OAAO,MAAM,IAAI,EAAA;AAAA,IAAE;AAGpE,QAAI,MAAM,SAAS,WAAW;AAG5B,UAAI,SAAS,MAAM,eAAe;AAChC,aAAK,KAAK,EAAE,KAAK,sBAAsB,MAAM,aAAa,GAAG,OAAO,MAAM,OAAO;AAAA,MACnF;AACA,aAAO,EAAE,OAAO,uBAAuB,KAAK,KAAK,GAAG,KAAA;AAAA,IACtD;AAEA,QAAI,MAAM,eAAe;AACvB,YAAM,UAAS,WAAM,gBAAN,mBAAoB,MAAM;AACzC,WAAK,KAAK;AAAA,QACR,MAAK,iCAAQ,UAAS,MAAM;AAAA,QAC5B,OAAO,oBAAoB,KAAK,OAAO,MAAM;AAAA,MAAA,CAC9C;AAAA,IACH;AACA,WAAO,EAAE,KAAA;AAAA,EACX;AAAA,EAEQ,OAAa;;AACnB,UAAM,QAAO,UAAK,eAAL,mBAAiB,cAAc;AAC5C,QAAI,CAAC,KAAM;AAEX,UAAM,QAAQ,KAAK,UAAA;AACnB,SAAK,SAAS,MAAM,SAAS,WAAW,CAAC,MAAM,MAAM,SAAS,CAAC,MAAM,OAAO;AAE5E,SAAK,eAAe,CAAC,KAAK,UAAU,MAAM,SAAS,WAAW,MAAM,cAAc,CAAA;AAElF,QAAI,KAAK,QAAQ;AACf,WAAK,gBAAA;AACL;AAAA,IACF;AAEA,UAAM,QAAQ,qBAAqB,IAAI;AACvC,UAAM,EAAE,OAAO,WAAW,qBAAqB,IAAI;AAEnD,uBAAmB,MAAM;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,KAAK;AAAA,MAClB,SAAS,KAAK,cACV,CAAC,YAAY;AACX,cAAM,OAAO,KAAK,sBAAA;AAClB,aAAK,WAAW;AAAA,UACd,GAAG,QAAQ,MAAM,UAAU,KAAK;AAAA,UAChC,GAAG,QAAQ,MAAM,UAAU,KAAK;AAAA,UAChC,GAAG,KAAK,WAAW,OAAO,OAAO;AAAA,QAAA;AAAA,MAErC,IACA;AAAA,MACJ,SAAS,KAAK,cACV,MAAM;AACJ,aAAK,WAAW;AAAA,MAClB,IACA;AAAA,IAAA,CACL;AAAA,EACH;AAAA,EAEQ,eAAe;AACrB,QAAI,CAAC,KAAK,cAAc,CAAC,KAAK,aAAa,OAAQ,QAAO;AAC1D,WAAO,oBAAoB,KAAK,YAAY;AAAA,EAC9C;AAAA,EAES,SAAS;AAChB,UAAM,QAAQ,KAAK,YAAA;AACnB,WAAO;AAAA;AAAA,UAED,KAAK,kBAAkB,KAAK,CAAC;AAAA;AAAA,YAE3B,KAAK,cAAc;AAAA,yDAC0B,KAAK,MAAM;AAAA,YACxD,KAAK,SAAS,sDAAsD,OAAO;AAAA,YAC3E,KAAK,WACH;AAAA;AAAA;AAAA,8BAGgB,KAAK,SAAS,CAAC,UAAU,KAAK,SAAS,CAAC;AAAA;AAAA,kBAEpD,KAAK,SAAS,QACZ,kCAAkC,KAAK,SAAS,KAAK,WACrD,OAAO;AAAA,kBACT,KAAK,SAAS,KAAK,IAAI,CAAC,QAAQ,YAAY,IAAI,GAAG,KAAK,IAAI,KAAK,QAAQ,CAAC;AAAA,wBAE9E,OAAO;AAAA,YACT,KAAK,yBAAyB;AAAA;AAAA;AAAA;AAAA,EAIxC;AACF;AA9Ja,mBACK,SAAS,CAAC,oBAAoB,gBAAgB;AAG9D,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,WAAW,eAAe;AAAA,GAH1C,mBAIX,WAAA,cAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,SAAS,WAAW,gBAAgB;AAAA,GAN3C,mBAOX,WAAA,eAAA,CAAA;AAGQ,gBAAA;AAAA,EADP,MAAA;AAAM,GATI,mBAUH,WAAA,YAAA,CAAA;AAGA,gBAAA;AAAA,EADP,MAAA;AAAM,GAZI,mBAaH,WAAA,UAAA,CAAA;AAGA,gBAAA;AAAA,EADP,MAAA;AAAM,GAfI,mBAgBH,WAAA,gBAAA,CAAA;AAhBG,qBAAN,gBAAA;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB,kBAAA;AAsKN,SAAS,uBAA6B;AAC3C,MAAI,CAAC,eAAe,IAAI,sBAAsB,GAAG;AAC/C,mBAAe,OAAO,wBAAwB,kBAAkB;AAAA,EAClE;AACF;AAEA,qBAAA;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Ui9000TreemapChart, registerTreemapChart, } from './element/ui9000-treemap-chart.js';
|
|
2
|
+
export { renderTreemapChart, type RenderTreemapChartOptions, type TreemapHoverPayload, } from './render/index.js';
|
|
3
|
+
export { formatTreemapValue, hasLightColor, normalizeTreemapData, treemapColorForValue, treemapGridTemplate, treemapRangeColors, treemapValueRanges, type TreemapChartData, type TreemapGridTemplate, type TreemapGroupCard, type TreemapMode, type TreemapModel, type TreemapPoint, type TreemapSeries, type TreemapTile, } from './lib/index.js';
|
|
4
|
+
export { default as treemapChartMetadata } from './metadata.json';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/treemap-chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { registerTreemapChart } from "./element/ui9000-treemap-chart.js";
|
|
2
|
+
import { Ui9000TreemapChart } from "./element/ui9000-treemap-chart.js";
|
|
3
|
+
import { default as default2 } from "./metadata.json.js";
|
|
4
|
+
import { formatTreemapValue } from "./lib/format.js";
|
|
5
|
+
import { hasLightColor, treemapColorForValue, treemapRangeColors, treemapValueRanges } from "./lib/color.js";
|
|
6
|
+
import { normalizeTreemapData } from "./lib/normalize.js";
|
|
7
|
+
import { renderTreemapChart } from "./render/draw.js";
|
|
8
|
+
import { treemapGridTemplate } from "./lib/layout.js";
|
|
9
|
+
export {
|
|
10
|
+
Ui9000TreemapChart,
|
|
11
|
+
formatTreemapValue,
|
|
12
|
+
hasLightColor,
|
|
13
|
+
normalizeTreemapData,
|
|
14
|
+
registerTreemapChart,
|
|
15
|
+
renderTreemapChart,
|
|
16
|
+
default2 as treemapChartMetadata,
|
|
17
|
+
treemapColorForValue,
|
|
18
|
+
treemapGridTemplate,
|
|
19
|
+
treemapRangeColors,
|
|
20
|
+
treemapValueRanges
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Mirrors client `lightenColor` — mix `amount` of white into the color. */
|
|
2
|
+
export declare function lightenColor(color: string, amount: number): string;
|
|
3
|
+
/** Mirrors client `darkenColor` — mix `amount` of black into the color. */
|
|
4
|
+
export declare function darkenColor(color: string, amount: number): string;
|
|
5
|
+
/**
|
|
6
|
+
* Mirrors client `getTreemapRangeColors` — seven shades of the group color,
|
|
7
|
+
* from +55% white (low band) to −35% black (high band).
|
|
8
|
+
*/
|
|
9
|
+
export declare function treemapRangeColors(baseColor: string): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Mirrors client `hasLightColor` — perceived brightness over white,
|
|
12
|
+
* so the label flips to dark text on pale tiles.
|
|
13
|
+
*/
|
|
14
|
+
export declare function hasLightColor(color: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Band edges for the color ramp. Client uses the widget `palette.range` when it
|
|
17
|
+
* carries at least two stops, otherwise `[0, ...generateBreakPoints(sorted)]`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function treemapValueRanges(values: number[], paletteRange?: number[] | null): number[];
|
|
20
|
+
/**
|
|
21
|
+
* Mirrors client `baseGetColorByValue` — the band whose `[start, end)` window
|
|
22
|
+
* holds the value (the last band is inclusive), clamped to the ramp ends.
|
|
23
|
+
*/
|
|
24
|
+
export declare function treemapColorForValue(value: number | undefined, ranges: number[], rangeColors: string[], baseColor: string): string;
|
|
25
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../src/components/treemap-chart/lib/color.ts"],"names":[],"mappings":"AA0BA,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ9D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,EAAE,CAI7F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,MAAM,EAAE,EAChB,WAAW,EAAE,MAAM,EAAE,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAmBR"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { generateBreakPoints } from "../../../utils/fuse-palette.js";
|
|
2
|
+
import { FD } from "../../../utils/fusedash-visual.js";
|
|
3
|
+
function channels(hex) {
|
|
4
|
+
let clean = hex.replace("#", "");
|
|
5
|
+
if (clean.length === 3) {
|
|
6
|
+
clean = clean.split("").map((c) => c + c).join("");
|
|
7
|
+
}
|
|
8
|
+
return [
|
|
9
|
+
parseInt(clean.slice(0, 2), 16) || 0,
|
|
10
|
+
parseInt(clean.slice(2, 4), 16) || 0,
|
|
11
|
+
parseInt(clean.slice(4, 6), 16) || 0
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
function toHex(r, g, b) {
|
|
15
|
+
const part = (v) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, "0");
|
|
16
|
+
return `#${part(r)}${part(g)}${part(b)}`;
|
|
17
|
+
}
|
|
18
|
+
function lightenColor(color, amount) {
|
|
19
|
+
const [r, g, b] = channels(color);
|
|
20
|
+
return toHex(r + (255 - r) * amount, g + (255 - g) * amount, b + (255 - b) * amount);
|
|
21
|
+
}
|
|
22
|
+
function darkenColor(color, amount) {
|
|
23
|
+
const [r, g, b] = channels(color);
|
|
24
|
+
return toHex(r * (1 - amount), g * (1 - amount), b * (1 - amount));
|
|
25
|
+
}
|
|
26
|
+
function treemapRangeColors(baseColor) {
|
|
27
|
+
const steps = FD.treemapRangeSteps;
|
|
28
|
+
const min = FD.treemapRangeMinShift;
|
|
29
|
+
const max = FD.treemapRangeMaxShift;
|
|
30
|
+
return Array.from({ length: steps }, (_, i) => {
|
|
31
|
+
const shift = min + (max - min) * (i / (steps - 1));
|
|
32
|
+
return shift < 0 ? darkenColor(baseColor, Math.abs(shift)) : lightenColor(baseColor, shift);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function hasLightColor(color) {
|
|
36
|
+
const [r, g, b] = channels(color);
|
|
37
|
+
return (r * 299 + g * 587 + b * 114) / 1e3 > 140;
|
|
38
|
+
}
|
|
39
|
+
function treemapValueRanges(values, paletteRange) {
|
|
40
|
+
if (Array.isArray(paletteRange) && paletteRange.length >= 2) return paletteRange;
|
|
41
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
42
|
+
return [0, ...generateBreakPoints(sorted)];
|
|
43
|
+
}
|
|
44
|
+
function treemapColorForValue(value, ranges, rangeColors, baseColor) {
|
|
45
|
+
const fallback = rangeColors[0] ?? baseColor;
|
|
46
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
|
|
47
|
+
if (ranges.length < 2) return fallback;
|
|
48
|
+
const lastIndex = ranges.length - 2;
|
|
49
|
+
const idx = ranges.slice(0, -1).findIndex((start, i) => {
|
|
50
|
+
const end = ranges[i + 1];
|
|
51
|
+
return i === lastIndex ? value >= start && value <= end : value >= start && value < end;
|
|
52
|
+
});
|
|
53
|
+
const lastColorIndex = Math.max(0, rangeColors.length - 1);
|
|
54
|
+
if (idx === -1) {
|
|
55
|
+
return value > ranges[ranges.length - 1] ? rangeColors[lastColorIndex] ?? baseColor : fallback;
|
|
56
|
+
}
|
|
57
|
+
return rangeColors[Math.min(idx, lastColorIndex)] ?? baseColor;
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
darkenColor,
|
|
61
|
+
hasLightColor,
|
|
62
|
+
lightenColor,
|
|
63
|
+
treemapColorForValue,
|
|
64
|
+
treemapRangeColors,
|
|
65
|
+
treemapValueRanges
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sources":["../../../../src/components/treemap-chart/lib/color.ts"],"sourcesContent":["import { generateBreakPoints } from '../../../utils/fuse-palette.js';\nimport { FD } from '../../../utils/fusedash-visual.js';\n\nfunction channels(hex: string): [number, number, number] {\n let clean = hex.replace('#', '');\n if (clean.length === 3) {\n clean = clean\n .split('')\n .map((c) => c + c)\n .join('');\n }\n return [\n parseInt(clean.slice(0, 2), 16) || 0,\n parseInt(clean.slice(2, 4), 16) || 0,\n parseInt(clean.slice(4, 6), 16) || 0,\n ];\n}\n\nfunction toHex(r: number, g: number, b: number): string {\n const part = (v: number) =>\n Math.max(0, Math.min(255, Math.round(v)))\n .toString(16)\n .padStart(2, '0');\n return `#${part(r)}${part(g)}${part(b)}`;\n}\n\n/** Mirrors client `lightenColor` — mix `amount` of white into the color. */\nexport function lightenColor(color: string, amount: number): string {\n const [r, g, b] = channels(color);\n return toHex(r + (255 - r) * amount, g + (255 - g) * amount, b + (255 - b) * amount);\n}\n\n/** Mirrors client `darkenColor` — mix `amount` of black into the color. */\nexport function darkenColor(color: string, amount: number): string {\n const [r, g, b] = channels(color);\n return toHex(r * (1 - amount), g * (1 - amount), b * (1 - amount));\n}\n\n/**\n * Mirrors client `getTreemapRangeColors` — seven shades of the group color,\n * from +55% white (low band) to −35% black (high band).\n */\nexport function treemapRangeColors(baseColor: string): string[] {\n const steps = FD.treemapRangeSteps;\n const min = FD.treemapRangeMinShift;\n const max = FD.treemapRangeMaxShift;\n return Array.from({ length: steps }, (_, i) => {\n const shift = min + (max - min) * (i / (steps - 1));\n return shift < 0 ? darkenColor(baseColor, Math.abs(shift)) : lightenColor(baseColor, shift);\n });\n}\n\n/**\n * Mirrors client `hasLightColor` — perceived brightness over white,\n * so the label flips to dark text on pale tiles.\n */\nexport function hasLightColor(color: string): boolean {\n const [r, g, b] = channels(color);\n return (r * 299 + g * 587 + b * 114) / 1000 > 140;\n}\n\n/**\n * Band edges for the color ramp. Client uses the widget `palette.range` when it\n * carries at least two stops, otherwise `[0, ...generateBreakPoints(sorted)]`.\n */\nexport function treemapValueRanges(values: number[], paletteRange?: number[] | null): number[] {\n if (Array.isArray(paletteRange) && paletteRange.length >= 2) return paletteRange;\n const sorted = [...values].sort((a, b) => a - b);\n return [0, ...generateBreakPoints(sorted)];\n}\n\n/**\n * Mirrors client `baseGetColorByValue` — the band whose `[start, end)` window\n * holds the value (the last band is inclusive), clamped to the ramp ends.\n */\nexport function treemapColorForValue(\n value: number | undefined,\n ranges: number[],\n rangeColors: string[],\n baseColor: string,\n): string {\n const fallback = rangeColors[0] ?? baseColor;\n if (typeof value !== 'number' || !Number.isFinite(value)) return fallback;\n if (ranges.length < 2) return fallback;\n\n const lastIndex = ranges.length - 2;\n const idx = ranges.slice(0, -1).findIndex((start, i) => {\n const end = ranges[i + 1];\n return i === lastIndex ? value >= start && value <= end : value >= start && value < end;\n });\n const lastColorIndex = Math.max(0, rangeColors.length - 1);\n\n if (idx === -1) {\n return value > ranges[ranges.length - 1]\n ? (rangeColors[lastColorIndex] ?? baseColor)\n : fallback;\n }\n\n return rangeColors[Math.min(idx, lastColorIndex)] ?? baseColor;\n}\n"],"names":[],"mappings":";;AAGA,SAAS,SAAS,KAAuC;AACvD,MAAI,QAAQ,IAAI,QAAQ,KAAK,EAAE;AAC/B,MAAI,MAAM,WAAW,GAAG;AACtB,YAAQ,MACL,MAAM,EAAE,EACR,IAAI,CAAC,MAAM,IAAI,CAAC,EAChB,KAAK,EAAE;AAAA,EACZ;AACA,SAAO;AAAA,IACL,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,KAAK;AAAA,IACnC,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,KAAK;AAAA,IACnC,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,KAAK;AAAA,EAAA;AAEvC;AAEA,SAAS,MAAM,GAAW,GAAW,GAAmB;AACtD,QAAM,OAAO,CAAC,MACZ,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,EACrC,SAAS,EAAE,EACX,SAAS,GAAG,GAAG;AACpB,SAAO,IAAI,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;AACxC;AAGO,SAAS,aAAa,OAAe,QAAwB;AAClE,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI,SAAS,KAAK;AAChC,SAAO,MAAM,KAAK,MAAM,KAAK,QAAQ,KAAK,MAAM,KAAK,QAAQ,KAAK,MAAM,KAAK,MAAM;AACrF;AAGO,SAAS,YAAY,OAAe,QAAwB;AACjE,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI,SAAS,KAAK;AAChC,SAAO,MAAM,KAAK,IAAI,SAAS,KAAK,IAAI,SAAS,KAAK,IAAI,OAAO;AACnE;AAMO,SAAS,mBAAmB,WAA6B;AAC9D,QAAM,QAAQ,GAAG;AACjB,QAAM,MAAM,GAAG;AACf,QAAM,MAAM,GAAG;AACf,SAAO,MAAM,KAAK,EAAE,QAAQ,SAAS,CAAC,GAAG,MAAM;AAC7C,UAAM,QAAQ,OAAO,MAAM,QAAQ,KAAK,QAAQ;AAChD,WAAO,QAAQ,IAAI,YAAY,WAAW,KAAK,IAAI,KAAK,CAAC,IAAI,aAAa,WAAW,KAAK;AAAA,EAC5F,CAAC;AACH;AAMO,SAAS,cAAc,OAAwB;AACpD,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI,SAAS,KAAK;AAChC,UAAQ,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO,MAAO;AAChD;AAMO,SAAS,mBAAmB,QAAkB,cAA0C;AAC7F,MAAI,MAAM,QAAQ,YAAY,KAAK,aAAa,UAAU,EAAG,QAAO;AACpE,QAAM,SAAS,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC;AAC/C,SAAO,CAAC,GAAG,GAAG,oBAAoB,MAAM,CAAC;AAC3C;AAMO,SAAS,qBACd,OACA,QACA,aACA,WACQ;AACR,QAAM,WAAW,YAAY,CAAC,KAAK;AACnC,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACjE,MAAI,OAAO,SAAS,EAAG,QAAO;AAE9B,QAAM,YAAY,OAAO,SAAS;AAClC,QAAM,MAAM,OAAO,MAAM,GAAG,EAAE,EAAE,UAAU,CAAC,OAAO,MAAM;AACtD,UAAM,MAAM,OAAO,IAAI,CAAC;AACxB,WAAO,MAAM,YAAY,SAAS,SAAS,SAAS,MAAM,SAAS,SAAS,QAAQ;AAAA,EACtF,CAAC;AACD,QAAM,iBAAiB,KAAK,IAAI,GAAG,YAAY,SAAS,CAAC;AAEzD,MAAI,QAAQ,IAAI;AACd,WAAO,QAAQ,OAAO,OAAO,SAAS,CAAC,IAClC,YAAY,cAAc,KAAK,YAChC;AAAA,EACN;AAEA,SAAO,YAAY,KAAK,IAAI,KAAK,cAAc,CAAC,KAAK;AACvD;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TreemapMode } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Tile and tooltip value. FuseDash formats the single treemap with
|
|
4
|
+
* `formatCompactNumber(value, 2)` and each grouped card with `toFixed(2)`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatTreemapValue(value: number, mode: TreemapMode): string;
|
|
7
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/components/treemap-chart/lib/format.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,CAG3E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { formatCompactNumber } from "../../../utils/fusedash-visual.js";
|
|
2
|
+
function formatTreemapValue(value, mode) {
|
|
3
|
+
if (!Number.isFinite(value)) return "";
|
|
4
|
+
return mode === "grouped" ? value.toFixed(2) : formatCompactNumber(value, 2);
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
formatTreemapValue
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sources":["../../../../src/components/treemap-chart/lib/format.ts"],"sourcesContent":["import { formatCompactNumber } from '../../../utils/fusedash-visual.js';\nimport type { TreemapMode } from './types.js';\n\n/**\n * Tile and tooltip value. FuseDash formats the single treemap with\n * `formatCompactNumber(value, 2)` and each grouped card with `toFixed(2)`.\n */\nexport function formatTreemapValue(value: number, mode: TreemapMode): string {\n if (!Number.isFinite(value)) return '';\n return mode === 'grouped' ? value.toFixed(2) : formatCompactNumber(value, 2);\n}\n"],"names":[],"mappings":";AAOO,SAAS,mBAAmB,OAAe,MAA2B;AAC3E,MAAI,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACpC,SAAO,SAAS,YAAY,MAAM,QAAQ,CAAC,IAAI,oBAAoB,OAAO,CAAC;AAC7E;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { normalizeTreemapData } from './normalize.js';
|
|
2
|
+
export { darkenColor, hasLightColor, lightenColor, treemapColorForValue, treemapRangeColors, treemapValueRanges, } from './color.js';
|
|
3
|
+
export { treemapGridTemplate, type TreemapGridTemplate } from './layout.js';
|
|
4
|
+
export { formatTreemapValue } from './format.js';
|
|
5
|
+
export type { TreemapChartData, TreemapGroupCard, TreemapLabelValue, TreemapMode, TreemapModel, TreemapPoint, TreemapSeries, TreemapTile, } from './types.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/treemap-chart/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TreemapGridTemplate {
|
|
2
|
+
/** `grid-template-areas` value; cards claim `_1`… in order */
|
|
3
|
+
areas: string;
|
|
4
|
+
/** `grid-template-rows` value — always explicit, so every row gets space */
|
|
5
|
+
rows: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Mirrors client `Treemap/style.ts getGridArea` — the grouped treemap packs 1–5
|
|
9
|
+
* cards into a fixed mosaic and falls back to a single column beyond that.
|
|
10
|
+
* Column count is implied by the areas string, exactly as in the client.
|
|
11
|
+
*
|
|
12
|
+
* Two fixes on top of the client: rows are explicit fractions (the client's
|
|
13
|
+
* `auto` rows collapse around the cards' zero-height plots), and the >5
|
|
14
|
+
* fallback emits one row per card with a height floor instead of a fixed 18,
|
|
15
|
+
* so a long list scrolls instead of being squashed into the top sliver.
|
|
16
|
+
*/
|
|
17
|
+
export declare function treemapGridTemplate(itemsCount: number): TreemapGridTemplate;
|
|
18
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/components/treemap-chart/lib/layout.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,CAW3E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FD } from "../../../utils/fusedash-visual.js";
|
|
2
|
+
function treemapGridTemplate(itemsCount) {
|
|
3
|
+
const areas = gridAreas(itemsCount);
|
|
4
|
+
if (itemsCount > 5) {
|
|
5
|
+
return {
|
|
6
|
+
areas,
|
|
7
|
+
rows: `repeat(${itemsCount}, minmax(${FD.treemapCardMinHeight}px, 1fr))`
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return { areas, rows: `repeat(${areas.split('"').length >> 1}, 1fr)` };
|
|
11
|
+
}
|
|
12
|
+
function gridAreas(itemsCount) {
|
|
13
|
+
switch (itemsCount) {
|
|
14
|
+
case 1:
|
|
15
|
+
return '"_1"';
|
|
16
|
+
case 2:
|
|
17
|
+
return '"_1 _2"';
|
|
18
|
+
case 3:
|
|
19
|
+
return '"_1 _1 _2" "_1 _1 _3"';
|
|
20
|
+
case 4:
|
|
21
|
+
return '"_1 _2" "_1 _2" "_3 _4"';
|
|
22
|
+
case 5:
|
|
23
|
+
return '"_1 _1 _2" "_1 _1 _2" "_3 _4 _5"';
|
|
24
|
+
default:
|
|
25
|
+
return Array.from({ length: itemsCount }, (_, i) => `"_${i + 1}"`).join(" ");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
treemapGridTemplate
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sources":["../../../../src/components/treemap-chart/lib/layout.ts"],"sourcesContent":["import { FD } from '../../../utils/fusedash-visual.js';\n\nexport interface TreemapGridTemplate {\n /** `grid-template-areas` value; cards claim `_1`… in order */\n areas: string;\n /** `grid-template-rows` value — always explicit, so every row gets space */\n rows: string;\n}\n\n/**\n * Mirrors client `Treemap/style.ts getGridArea` — the grouped treemap packs 1–5\n * cards into a fixed mosaic and falls back to a single column beyond that.\n * Column count is implied by the areas string, exactly as in the client.\n *\n * Two fixes on top of the client: rows are explicit fractions (the client's\n * `auto` rows collapse around the cards' zero-height plots), and the >5\n * fallback emits one row per card with a height floor instead of a fixed 18,\n * so a long list scrolls instead of being squashed into the top sliver.\n */\nexport function treemapGridTemplate(itemsCount: number): TreemapGridTemplate {\n const areas = gridAreas(itemsCount);\n if (itemsCount > 5) {\n return {\n areas,\n rows: `repeat(${itemsCount}, minmax(${FD.treemapCardMinHeight}px, 1fr))`,\n };\n }\n // Rows must be explicit fractions: the cards' plots have no intrinsic height,\n // so `auto` tracks collapse the bottom row of the mosaic to its header.\n return { areas, rows: `repeat(${areas.split('\"').length >> 1}, 1fr)` };\n}\n\nfunction gridAreas(itemsCount: number): string {\n switch (itemsCount) {\n case 1:\n return '\"_1\"';\n case 2:\n return '\"_1 _2\"';\n case 3:\n return '\"_1 _1 _2\" \"_1 _1 _3\"';\n case 4:\n return '\"_1 _2\" \"_1 _2\" \"_3 _4\"';\n case 5:\n return '\"_1 _1 _2\" \"_1 _1 _2\" \"_3 _4 _5\"';\n default:\n return Array.from({ length: itemsCount }, (_, i) => `\"_${i + 1}\"`).join(' ');\n }\n}\n"],"names":[],"mappings":";AAmBO,SAAS,oBAAoB,YAAyC;AAC3E,QAAM,QAAQ,UAAU,UAAU;AAClC,MAAI,aAAa,GAAG;AAClB,WAAO;AAAA,MACL;AAAA,MACA,MAAM,UAAU,UAAU,YAAY,GAAG,oBAAoB;AAAA,IAAA;AAAA,EAEjE;AAGA,SAAO,EAAE,OAAO,MAAM,UAAU,MAAM,MAAM,GAAG,EAAE,UAAU,CAAC,SAAA;AAC9D;AAEA,SAAS,UAAU,YAA4B;AAC7C,UAAQ,YAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO,MAAM,KAAK,EAAE,QAAQ,cAAc,CAAC,GAAG,MAAM,KAAK,IAAI,CAAC,GAAG,EAAE,KAAK,GAAG;AAAA,EAAA;AAEjF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/components/treemap-chart/lib/normalize.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,gBAAgB,EAGhB,YAAY,EAIb,MAAM,YAAY,CAAC;AAmOpB,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAkB1E"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { resolveFormattingColor } from "../../../utils/fuse-palette.js";
|
|
2
|
+
import { seriesColor } from "../../../utils/fusedash-visual.js";
|
|
3
|
+
import { isFuseWidgetPayload, firstField, rowsOf } from "../../../utils/fuse-widget.js";
|
|
4
|
+
import { hasLightColor, treemapRangeColors, treemapValueRanges, treemapColorForValue } from "./color.js";
|
|
5
|
+
const EMPTY = { mode: "single", tiles: [], groups: [], rangeColors: [] };
|
|
6
|
+
function normalizeKey(raw) {
|
|
7
|
+
return displayLabel(raw).toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
function displayLabel(raw) {
|
|
10
|
+
return String(raw ?? "").trim().replace(/\s+/g, " ");
|
|
11
|
+
}
|
|
12
|
+
function aggregateByCategory(rows, categoryKey, getValue) {
|
|
13
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
14
|
+
for (const row of rows) {
|
|
15
|
+
const raw = categoryKey ? row == null ? void 0 : row[categoryKey] : "";
|
|
16
|
+
const key = normalizeKey(raw);
|
|
17
|
+
const existing = byKey.get(key);
|
|
18
|
+
if (existing) {
|
|
19
|
+
existing.value += getValue(row);
|
|
20
|
+
} else {
|
|
21
|
+
byKey.set(key, { key, label: displayLabel(raw), value: getValue(row) });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return [...byKey.values()].sort((a, b) => b.value - a.value || a.label.localeCompare(b.label));
|
|
25
|
+
}
|
|
26
|
+
function tilesFrom(entries, baseColor, paletteRange) {
|
|
27
|
+
const rangeColors = treemapRangeColors(baseColor);
|
|
28
|
+
const ranges = treemapValueRanges(
|
|
29
|
+
entries.map((entry) => entry.value),
|
|
30
|
+
paletteRange
|
|
31
|
+
);
|
|
32
|
+
const tiles = entries.map((entry) => {
|
|
33
|
+
const color = treemapColorForValue(entry.value, ranges, rangeColors, baseColor);
|
|
34
|
+
return {
|
|
35
|
+
key: entry.key,
|
|
36
|
+
label: entry.label,
|
|
37
|
+
value: entry.value,
|
|
38
|
+
color,
|
|
39
|
+
lightFill: hasLightColor(color)
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return { tiles, rangeColors };
|
|
43
|
+
}
|
|
44
|
+
function singleBaseColor(formatting) {
|
|
45
|
+
return resolveFormattingColor(formatting, "default", (formatting == null ? void 0 : formatting.length) ?? 1);
|
|
46
|
+
}
|
|
47
|
+
function groupBaseColor(formatting, groupLabel) {
|
|
48
|
+
if (!(formatting == null ? void 0 : formatting.length) || !groupLabel) {
|
|
49
|
+
return resolveFormattingColor([{ key: "default", color: "1" }], "default", 1);
|
|
50
|
+
}
|
|
51
|
+
const matched = formatting.filter((entry) => String(entry.key) === groupLabel);
|
|
52
|
+
if (!matched.length) return resolveFormattingColor(void 0, "default", 1);
|
|
53
|
+
return resolveFormattingColor(matched, String(matched[0].key ?? "default"), 1);
|
|
54
|
+
}
|
|
55
|
+
function toNumber(value) {
|
|
56
|
+
const n = Number(value);
|
|
57
|
+
return Number.isFinite(n) ? n : 0;
|
|
58
|
+
}
|
|
59
|
+
function fromFuseWidget(widget) {
|
|
60
|
+
var _a;
|
|
61
|
+
const categoryField = firstField(widget.groupBy ?? void 0) ?? firstField(widget.xAxe ?? void 0);
|
|
62
|
+
const valueField = firstField(widget.metric ?? void 0) ?? firstField(widget.yAxe ?? void 0);
|
|
63
|
+
const rawSubgroup = widget.subgroup ? String(widget.subgroup) : void 0;
|
|
64
|
+
const subgroupField = rawSubgroup && rawSubgroup !== categoryField ? rawSubgroup : void 0;
|
|
65
|
+
const rows = rowsOf(widget);
|
|
66
|
+
const getValue = (row) => valueField ? toNumber(row == null ? void 0 : row[valueField]) : 0;
|
|
67
|
+
const axisDetails = widget.axisDetails ?? void 0;
|
|
68
|
+
const paletteRange = (_a = widget.palette) == null ? void 0 : _a.range;
|
|
69
|
+
if (!subgroupField) {
|
|
70
|
+
const entries = categoryField ? aggregateByCategory(rows, categoryField, getValue) : (
|
|
71
|
+
// Without a category dimension the client keeps the raw per-row nodes.
|
|
72
|
+
rows.map((row, i) => ({ key: String(i), label: "", value: getValue(row) }))
|
|
73
|
+
);
|
|
74
|
+
const { tiles, rangeColors } = tilesFrom(entries, singleBaseColor(widget.formatting), paletteRange);
|
|
75
|
+
return {
|
|
76
|
+
mode: "single",
|
|
77
|
+
tiles,
|
|
78
|
+
groups: [],
|
|
79
|
+
rangeColors,
|
|
80
|
+
categoryField,
|
|
81
|
+
valueField,
|
|
82
|
+
axisDetails
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
86
|
+
for (const row of rows) {
|
|
87
|
+
if (!categoryField) continue;
|
|
88
|
+
const label = displayLabel(row == null ? void 0 : row[categoryField]);
|
|
89
|
+
if (!label) continue;
|
|
90
|
+
const key = label.toLowerCase();
|
|
91
|
+
const bucket = grouped.get(key);
|
|
92
|
+
if (bucket) bucket.rows.push(row);
|
|
93
|
+
else grouped.set(key, { label, rows: [row] });
|
|
94
|
+
}
|
|
95
|
+
const groups = [...grouped.entries()].sort(([, a], [, b]) => a.label.localeCompare(b.label)).map(([key, { label, rows: groupRows }]) => ({
|
|
96
|
+
key,
|
|
97
|
+
label,
|
|
98
|
+
tiles: tilesFrom(
|
|
99
|
+
aggregateByCategory(groupRows, subgroupField, getValue),
|
|
100
|
+
groupBaseColor(widget.formatting, label),
|
|
101
|
+
paletteRange
|
|
102
|
+
).tiles
|
|
103
|
+
}));
|
|
104
|
+
return {
|
|
105
|
+
mode: "grouped",
|
|
106
|
+
tiles: [],
|
|
107
|
+
groups,
|
|
108
|
+
rangeColors: [],
|
|
109
|
+
categoryField,
|
|
110
|
+
valueField,
|
|
111
|
+
subgroupField,
|
|
112
|
+
axisDetails
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function fromLabelValue(rows) {
|
|
116
|
+
const entries = rows.map((row) => ({
|
|
117
|
+
key: normalizeKey(row.label),
|
|
118
|
+
label: displayLabel(row.label),
|
|
119
|
+
value: Number(row.value)
|
|
120
|
+
})).filter((row) => Number.isFinite(row.value));
|
|
121
|
+
if (!entries.length) return EMPTY;
|
|
122
|
+
const { tiles, rangeColors } = tilesFrom(
|
|
123
|
+
entries.sort((a, b) => b.value - a.value || a.label.localeCompare(b.label)),
|
|
124
|
+
singleBaseColor(void 0)
|
|
125
|
+
);
|
|
126
|
+
const overrides = new Map(
|
|
127
|
+
rows.filter((row) => row.color).map((row) => [normalizeKey(row.label), row.color])
|
|
128
|
+
);
|
|
129
|
+
return {
|
|
130
|
+
mode: "single",
|
|
131
|
+
tiles: tiles.map((tile) => {
|
|
132
|
+
const override = overrides.get(tile.key);
|
|
133
|
+
return override ? { ...tile, color: override, lightFill: hasLightColor(override) } : tile;
|
|
134
|
+
}),
|
|
135
|
+
groups: [],
|
|
136
|
+
rangeColors
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function fromPoints(points) {
|
|
140
|
+
return fromLabelValue(points.map((point) => ({ label: String(point.x), value: Number(point.y) })));
|
|
141
|
+
}
|
|
142
|
+
function fromSeries(series) {
|
|
143
|
+
const groups = series.map((entry, index) => {
|
|
144
|
+
const label = entry.name ?? entry.id;
|
|
145
|
+
const entries = aggregateByCategory(
|
|
146
|
+
entry.points ?? [],
|
|
147
|
+
"x",
|
|
148
|
+
(row) => toNumber(row.y)
|
|
149
|
+
);
|
|
150
|
+
return {
|
|
151
|
+
key: normalizeKey(label),
|
|
152
|
+
label: displayLabel(label),
|
|
153
|
+
tiles: tilesFrom(entries, entry.color ?? seriesColor(index)).tiles
|
|
154
|
+
};
|
|
155
|
+
}).filter((group) => group.tiles.length > 0);
|
|
156
|
+
if (!groups.length) return EMPTY;
|
|
157
|
+
return { mode: "grouped", tiles: [], groups, rangeColors: [] };
|
|
158
|
+
}
|
|
159
|
+
function isLabelValueArray(input) {
|
|
160
|
+
if (!Array.isArray(input) || !input.length) return false;
|
|
161
|
+
const first = input[0];
|
|
162
|
+
return first != null && typeof first === "object" && "label" in first && "value" in first;
|
|
163
|
+
}
|
|
164
|
+
function normalizeTreemapData(input) {
|
|
165
|
+
if (!input) return EMPTY;
|
|
166
|
+
if (Array.isArray(input)) {
|
|
167
|
+
return isLabelValueArray(input) ? fromLabelValue(input) : EMPTY;
|
|
168
|
+
}
|
|
169
|
+
if (isFuseWidgetPayload(input)) return fromFuseWidget(input);
|
|
170
|
+
const shorthand = input;
|
|
171
|
+
if (Array.isArray(shorthand.series) && shorthand.series.length) {
|
|
172
|
+
return fromSeries(shorthand.series);
|
|
173
|
+
}
|
|
174
|
+
if (Array.isArray(shorthand.points) && shorthand.points.length) {
|
|
175
|
+
return fromPoints(shorthand.points);
|
|
176
|
+
}
|
|
177
|
+
return EMPTY;
|
|
178
|
+
}
|
|
179
|
+
export {
|
|
180
|
+
normalizeTreemapData
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=normalize.js.map
|