@fusedashlabs/widgets 0.2.0 → 0.3.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/CHANGELOG.md +72 -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/index.js.map +1 -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/lib/registry.d.ts.map +1 -1
- package/dist/components/chart-renderer/lib/registry.js +12 -0
- package/dist/components/chart-renderer/lib/registry.js.map +1 -1
- package/dist/components/donut-chart/element/ui9000-donut-chart.d.ts +1 -1
- package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.d.ts +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/gini-impurity-entropy-chart/element/styles.js +72 -0
- 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/ui9000-lollipop.d.ts +1 -1
- 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 +152 -0
- package/dist/components/network-graph/element/styles.js.map +1 -0
- package/dist/components/network-graph/element/ui9000-network-graph.d.ts +43 -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 +230 -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 +5 -0
- package/dist/components/network-graph/lib/index.d.ts.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 +46 -0
- package/dist/components/network-graph/render/draw.d.ts.map +1 -0
- package/dist/components/network-graph/render/draw.js +468 -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/metadata.json.js.map +1 -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/ui9000-pie-chart.d.ts +1 -1
- 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/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 +167 -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 +18 -0
- package/dist/components/polar-area-chart/index.js.map +1 -0
- package/dist/components/polar-area-chart/lib/domain.d.ts +25 -0
- package/dist/components/polar-area-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/polar-area-chart/lib/domain.js +47 -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 +117 -0
- package/dist/components/polar-area-chart/lib/normalize.js.map +1 -0
- package/dist/components/polar-area-chart/lib/types.d.ts +43 -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/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/ui9000-sankey-chart.d.ts +1 -1
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.js +2 -1
- 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/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/ui9000-chart-base.d.ts +2 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -13
- 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 +7 -1
- package/dist/lazy/index.d.ts.map +1 -1
- package/dist/lazy/index.js +48 -0
- package/dist/lazy/index.js.map +1 -1
- 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/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 +21 -0
- package/dist/utils/chart-helpers.d.ts.map +1 -1
- package/dist/utils/chart-helpers.js +54 -0
- package/dist/utils/chart-helpers.js.map +1 -1
- package/dist/utils/format-text.d.ts +17 -0
- package/dist/utils/format-text.d.ts.map +1 -0
- package/dist/utils/format-text.js +26 -0
- package/dist/utils/format-text.js.map +1 -0
- package/dist/utils/fusedash-visual.d.ts +143 -0
- package/dist/utils/fusedash-visual.d.ts.map +1 -1
- package/dist/utils/fusedash-visual.js +114 -1
- package/dist/utils/fusedash-visual.js.map +1 -1
- package/package.json +56 -4
- package/dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive.js +0 -28
- 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 +0 -37
- 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 +0 -231
- package/dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js.map +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { resolveFormattingColor } from "../../../utils/fuse-palette.js";
|
|
2
|
+
import { firstField } from "../../../utils/fuse-widget.js";
|
|
3
|
+
const MAX_PARALLEL_LINES = 2e3;
|
|
4
|
+
function resolveParallelFormatting(formatting) {
|
|
5
|
+
const existing = Array.isArray(formatting) ? formatting : [];
|
|
6
|
+
return ["defaultMin", "defaultMax"].map(
|
|
7
|
+
(key, index) => existing.find((entry) => entry.key === key) ?? { key, color: String(index + 1) }
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
const EMPTY_MODEL = {
|
|
11
|
+
orientation: "horizontal",
|
|
12
|
+
axes: [],
|
|
13
|
+
rows: [],
|
|
14
|
+
idKey: "",
|
|
15
|
+
colorKey: "",
|
|
16
|
+
minColor: "#473DD9",
|
|
17
|
+
maxColor: "#36C4A5",
|
|
18
|
+
lineColor: "#473DD9"
|
|
19
|
+
};
|
|
20
|
+
function toOrientation(value) {
|
|
21
|
+
return value === "vertical" ? "vertical" : "horizontal";
|
|
22
|
+
}
|
|
23
|
+
function toNumber(value) {
|
|
24
|
+
if (value == null || value === "") return null;
|
|
25
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
26
|
+
return Number.isFinite(n) ? n : null;
|
|
27
|
+
}
|
|
28
|
+
function isRecord(value) {
|
|
29
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
30
|
+
}
|
|
31
|
+
function compareAscending(a, b) {
|
|
32
|
+
if (a == null) return b == null ? 0 : 1;
|
|
33
|
+
if (b == null) return -1;
|
|
34
|
+
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
35
|
+
return String(a).localeCompare(String(b), void 0, { numeric: true });
|
|
36
|
+
}
|
|
37
|
+
function axesFromUniqueValues(uniqueValues) {
|
|
38
|
+
const source = Array.isArray(uniqueValues) ? uniqueValues[0] : uniqueValues;
|
|
39
|
+
if (!isRecord(source)) return [];
|
|
40
|
+
const seen = /* @__PURE__ */ new Set();
|
|
41
|
+
const out = [];
|
|
42
|
+
for (const value of Object.values(source)) {
|
|
43
|
+
for (const entry of Array.isArray(value) ? value : [value]) {
|
|
44
|
+
if (typeof entry !== "string" || !entry) continue;
|
|
45
|
+
if (seen.has(entry)) continue;
|
|
46
|
+
seen.add(entry);
|
|
47
|
+
out.push(entry);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
function axesFromRows(rows) {
|
|
53
|
+
const seen = /* @__PURE__ */ new Set();
|
|
54
|
+
const out = [];
|
|
55
|
+
for (const row of rows) {
|
|
56
|
+
for (const [key, value] of Object.entries(row)) {
|
|
57
|
+
if (seen.has(key) || toNumber(value) == null) continue;
|
|
58
|
+
seen.add(key);
|
|
59
|
+
out.push(key);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
function idKeyFromRows(rows, axes) {
|
|
65
|
+
const axisSet = new Set(axes);
|
|
66
|
+
for (const row of rows) {
|
|
67
|
+
for (const key of Object.keys(row)) {
|
|
68
|
+
if (!axisSet.has(key)) return key;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
function buildRows(raw, axes, idKey) {
|
|
74
|
+
const sorted = idKey ? raw.slice().sort((a, b) => compareAscending(a[idKey], b[idKey])) : raw.slice();
|
|
75
|
+
const rows = [];
|
|
76
|
+
for (const row of sorted) {
|
|
77
|
+
const values = {};
|
|
78
|
+
let hasValue = false;
|
|
79
|
+
for (const axis of axes) {
|
|
80
|
+
const value = toNumber(row[axis]);
|
|
81
|
+
values[axis] = value;
|
|
82
|
+
if (value != null) hasValue = true;
|
|
83
|
+
}
|
|
84
|
+
if (!hasValue) continue;
|
|
85
|
+
rows.push({ id: idKey ? String(row[idKey] ?? "") : String(rows.length + 1), values });
|
|
86
|
+
if (rows.length >= MAX_PARALLEL_LINES) break;
|
|
87
|
+
}
|
|
88
|
+
return rows;
|
|
89
|
+
}
|
|
90
|
+
function buildModel(options) {
|
|
91
|
+
const { orientation, axes, rows, idKey } = options;
|
|
92
|
+
if (!axes.length || !rows.length) return { ...EMPTY_MODEL, orientation };
|
|
93
|
+
const formatting = resolveParallelFormatting(options.formatting);
|
|
94
|
+
const minColor = resolveFormattingColor(formatting, "defaultMin", formatting.length);
|
|
95
|
+
const maxColor = resolveFormattingColor(formatting, "defaultMax", formatting.length);
|
|
96
|
+
const hint = options.colorKeyHint;
|
|
97
|
+
const colorKey = hint && axes.includes(hint) ? hint : axes[0];
|
|
98
|
+
return {
|
|
99
|
+
orientation,
|
|
100
|
+
axes,
|
|
101
|
+
rows,
|
|
102
|
+
idKey,
|
|
103
|
+
colorKey,
|
|
104
|
+
minColor,
|
|
105
|
+
maxColor,
|
|
106
|
+
lineColor: minColor
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function fromFuse(payload) {
|
|
110
|
+
const orientation = toOrientation(payload.orientation);
|
|
111
|
+
const axes = axesFromUniqueValues(payload.uniqueValues);
|
|
112
|
+
const raw = payload.data.filter(isRecord);
|
|
113
|
+
const idKey = firstField(payload.xAxe ?? void 0) ?? "";
|
|
114
|
+
if (!axes.length) return { ...EMPTY_MODEL, orientation };
|
|
115
|
+
return buildModel({
|
|
116
|
+
orientation,
|
|
117
|
+
axes,
|
|
118
|
+
rows: buildRows(raw, axes, idKey),
|
|
119
|
+
idKey,
|
|
120
|
+
colorKeyHint: firstField(payload.yAxe ?? void 0),
|
|
121
|
+
formatting: payload.formatting
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function fromRows(payload) {
|
|
125
|
+
var _a;
|
|
126
|
+
const orientation = toOrientation(payload.orientation);
|
|
127
|
+
const raw = payload.rows.filter(isRecord);
|
|
128
|
+
const axes = ((_a = payload.axes) == null ? void 0 : _a.length) ? payload.axes.map(String) : axesFromRows(raw);
|
|
129
|
+
if (!axes.length) return { ...EMPTY_MODEL, orientation };
|
|
130
|
+
const idKey = payload.idKey ? String(payload.idKey) : idKeyFromRows(raw, axes);
|
|
131
|
+
return buildModel({
|
|
132
|
+
orientation,
|
|
133
|
+
axes,
|
|
134
|
+
rows: buildRows(raw, axes, idKey),
|
|
135
|
+
idKey
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function isFusePayload(input) {
|
|
139
|
+
return isRecord(input) && Array.isArray(input.data);
|
|
140
|
+
}
|
|
141
|
+
function isRowsPayload(input) {
|
|
142
|
+
return isRecord(input) && Array.isArray(input.rows);
|
|
143
|
+
}
|
|
144
|
+
function normalizeParallelCoordinatesData(input) {
|
|
145
|
+
if (!input) return { ...EMPTY_MODEL };
|
|
146
|
+
if (Array.isArray(input)) return fromRows({ rows: input });
|
|
147
|
+
if (isRowsPayload(input)) return fromRows(input);
|
|
148
|
+
if (isFusePayload(input)) return fromFuse(input);
|
|
149
|
+
return { ...EMPTY_MODEL };
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
MAX_PARALLEL_LINES,
|
|
153
|
+
normalizeParallelCoordinatesData,
|
|
154
|
+
resolveParallelFormatting
|
|
155
|
+
};
|
|
156
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sources":["../../../../src/components/parallel-coordinates-chart/lib/normalize.ts"],"sourcesContent":["import { resolveFormattingColor, type FuseFormattingEntry } from '../../../utils/fuse-palette.js';\nimport { firstField } from '../../../utils/fuse-widget.js';\nimport type {\n ParallelCoordinatesFusePayload,\n ParallelCoordinatesInput,\n ParallelCoordinatesModel,\n ParallelCoordinatesOrientation,\n ParallelCoordinatesRow,\n ParallelCoordinatesRowsPayload,\n} from './types.js';\n\n/**\n * One SVG path per row, so a raw dataset is capped before it reaches the draw\n * layer. 2000 polylines already saturate the plot at chat sizes.\n */\nexport const MAX_PARALLEL_LINES = 2000;\n\n/**\n * Client `getParallelCoordinatesChartFormatting` — the settings panel writes\n * these two entries onto every parallelCoordinatesChart widget, so a mock that\n * carries no `formatting` still resolves a two-ended ramp instead of one flat\n * colour.\n */\nexport function resolveParallelFormatting(\n formatting: FuseFormattingEntry[] | null | undefined,\n): FuseFormattingEntry[] {\n const existing = Array.isArray(formatting) ? formatting : [];\n return ['defaultMin', 'defaultMax'].map(\n (key, index) =>\n existing.find((entry) => entry.key === key) ?? { key, color: String(index + 1) },\n );\n}\n\nconst EMPTY_MODEL: ParallelCoordinatesModel = {\n orientation: 'horizontal',\n axes: [],\n rows: [],\n idKey: '',\n colorKey: '',\n minColor: '#473DD9',\n maxColor: '#36C4A5',\n lineColor: '#473DD9',\n};\n\nfunction toOrientation(value: unknown): ParallelCoordinatesOrientation {\n return value === 'vertical' ? 'vertical' : 'horizontal';\n}\n\nfunction toNumber(value: unknown): number | null {\n if (value == null || value === '') return null;\n const n = typeof value === 'number' ? value : Number(value);\n return Number.isFinite(n) ? n : null;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n\n/** Mirrors d3-array `ascending`: nullish sorts last, otherwise natural order. */\nfunction compareAscending(a: unknown, b: unknown): number {\n if (a == null) return b == null ? 0 : 1;\n if (b == null) return -1;\n if (typeof a === 'number' && typeof b === 'number') return a - b;\n return String(a).localeCompare(String(b), undefined, { numeric: true });\n}\n\n/**\n * Client axis-key derivation: flatten every `uniqueValues` list and keep the\n * non-empty strings. The widget's `yAxe` names the *field* holding the\n * dimension list, never an axis itself.\n */\nfunction axesFromUniqueValues(\n uniqueValues: ParallelCoordinatesFusePayload['uniqueValues'],\n): string[] {\n const source = Array.isArray(uniqueValues) ? uniqueValues[0] : uniqueValues;\n if (!isRecord(source)) return [];\n const seen = new Set<string>();\n const out: string[] = [];\n for (const value of Object.values(source)) {\n for (const entry of Array.isArray(value) ? value : [value]) {\n if (typeof entry !== 'string' || !entry) continue;\n if (seen.has(entry)) continue;\n seen.add(entry);\n out.push(entry);\n }\n }\n return out;\n}\n\n/** Chat fallback: every key that holds a finite number in at least one row. */\nfunction axesFromRows(rows: Array<Record<string, unknown>>): string[] {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const row of rows) {\n for (const [key, value] of Object.entries(row)) {\n if (seen.has(key) || toNumber(value) == null) continue;\n seen.add(key);\n out.push(key);\n }\n }\n return out;\n}\n\n/** Chat fallback: first key that is never numeric — the natural line label. */\nfunction idKeyFromRows(\n rows: Array<Record<string, unknown>>,\n axes: string[],\n): string {\n const axisSet = new Set(axes);\n for (const row of rows) {\n for (const key of Object.keys(row)) {\n if (!axisSet.has(key)) return key;\n }\n }\n return '';\n}\n\nfunction buildRows(\n raw: Array<Record<string, unknown>>,\n axes: string[],\n idKey: string,\n): ParallelCoordinatesRow[] {\n const sorted = idKey\n ? raw.slice().sort((a, b) => compareAscending(a[idKey], b[idKey]))\n : raw.slice();\n\n const rows: ParallelCoordinatesRow[] = [];\n for (const row of sorted) {\n const values: Record<string, number | null> = {};\n let hasValue = false;\n for (const axis of axes) {\n const value = toNumber(row[axis]);\n values[axis] = value;\n if (value != null) hasValue = true;\n }\n if (!hasValue) continue;\n rows.push({ id: idKey ? String(row[idKey] ?? '') : String(rows.length + 1), values });\n if (rows.length >= MAX_PARALLEL_LINES) break;\n }\n return rows;\n}\n\nfunction buildModel(options: {\n orientation: ParallelCoordinatesOrientation;\n axes: string[];\n rows: ParallelCoordinatesRow[];\n idKey: string;\n colorKeyHint?: string;\n formatting?: FuseFormattingEntry[] | null;\n}): ParallelCoordinatesModel {\n const { orientation, axes, rows, idKey } = options;\n if (!axes.length || !rows.length) return { ...EMPTY_MODEL, orientation };\n\n const formatting = resolveParallelFormatting(options.formatting);\n const minColor = resolveFormattingColor(formatting, 'defaultMin', formatting.length);\n const maxColor = resolveFormattingColor(formatting, 'defaultMax', formatting.length);\n // Client: `yAxe` wins only when it is itself one of the dimensions.\n const hint = options.colorKeyHint;\n const colorKey = hint && axes.includes(hint) ? hint : axes[0];\n\n return {\n orientation,\n axes,\n rows,\n idKey,\n colorKey,\n minColor,\n maxColor,\n lineColor: minColor,\n };\n}\n\nfunction fromFuse(payload: ParallelCoordinatesFusePayload): ParallelCoordinatesModel {\n const orientation = toOrientation(payload.orientation);\n const axes = axesFromUniqueValues(payload.uniqueValues);\n const raw = payload.data.filter(isRecord);\n const idKey = firstField(payload.xAxe ?? undefined) ?? '';\n if (!axes.length) return { ...EMPTY_MODEL, orientation };\n\n return buildModel({\n orientation,\n axes,\n rows: buildRows(raw, axes, idKey),\n idKey,\n colorKeyHint: firstField(payload.yAxe ?? undefined),\n formatting: payload.formatting,\n });\n}\n\nfunction fromRows(payload: ParallelCoordinatesRowsPayload): ParallelCoordinatesModel {\n const orientation = toOrientation(payload.orientation);\n const raw = payload.rows.filter(isRecord);\n const axes = payload.axes?.length ? payload.axes.map(String) : axesFromRows(raw);\n if (!axes.length) return { ...EMPTY_MODEL, orientation };\n const idKey = payload.idKey ? String(payload.idKey) : idKeyFromRows(raw, axes);\n\n return buildModel({\n orientation,\n axes,\n rows: buildRows(raw, axes, idKey),\n idKey,\n });\n}\n\nfunction isFusePayload(input: unknown): input is ParallelCoordinatesFusePayload {\n return isRecord(input) && Array.isArray(input.data);\n}\n\nfunction isRowsPayload(input: unknown): input is ParallelCoordinatesRowsPayload {\n return isRecord(input) && Array.isArray(input.rows);\n}\n\n/**\n * Normalize chat / FuseDash payloads into a ParallelCoordinatesModel.\n * Accepts:\n * 1. `Record<string, unknown>[]` — plain rows, numeric keys become the axes\n * 2. `{ orientation?, axes?, idKey?, rows: [...] }`\n * 3. FuseDash `{ orientation?, xAxe?, yAxe?, uniqueValues, data: [...] }`\n */\nexport function normalizeParallelCoordinatesData(\n input: ParallelCoordinatesInput | null | undefined,\n): ParallelCoordinatesModel {\n if (!input) return { ...EMPTY_MODEL };\n if (Array.isArray(input)) return fromRows({ rows: input });\n if (isRowsPayload(input)) return fromRows(input);\n if (isFusePayload(input)) return fromFuse(input);\n return { ...EMPTY_MODEL };\n}\n"],"names":[],"mappings":";;AAeO,MAAM,qBAAqB;AAQ3B,SAAS,0BACd,YACuB;AACvB,QAAM,WAAW,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAA;AAC1D,SAAO,CAAC,cAAc,YAAY,EAAE;AAAA,IAClC,CAAC,KAAK,UACJ,SAAS,KAAK,CAAC,UAAU,MAAM,QAAQ,GAAG,KAAK,EAAE,KAAK,OAAO,OAAO,QAAQ,CAAC,EAAA;AAAA,EAA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,KAAK;AAAA,IAChC;AAAA,EAAA,CACD;AACH;AAEA,SAAS,cAAc,OAAyD;AAC9E,SAAO,SAAS,KAAK,KAAK,MAAM,QAAQ,MAAM,IAAI;AACpD;AAEA,SAAS,cAAc,OAAyD;AAC9E,SAAO,SAAS,KAAK,KAAK,MAAM,QAAQ,MAAM,IAAI;AACpD;AASO,SAAS,iCACd,OAC0B;AAC1B,MAAI,CAAC,MAAO,QAAO,EAAE,GAAG,YAAA;AACxB,MAAI,MAAM,QAAQ,KAAK,UAAU,SAAS,EAAE,MAAM,OAAO;AACzD,MAAI,cAAc,KAAK,EAAG,QAAO,SAAS,KAAK;AAC/C,MAAI,cAAc,KAAK,EAAG,QAAO,SAAS,KAAK;AAC/C,SAAO,EAAE,GAAG,YAAA;AACd;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type ParallelCoordinatesOrientation = 'horizontal' | 'vertical';
|
|
2
|
+
/** One polyline: a single record crossing every dimension axis. */
|
|
3
|
+
export interface ParallelCoordinatesRow {
|
|
4
|
+
/** Value of the identity field (`xAxe`), used for sort order and tooltips. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Dimension key → numeric value; `null` breaks the polyline at that axis. */
|
|
7
|
+
values: Record<string, number | null>;
|
|
8
|
+
}
|
|
9
|
+
export interface ParallelCoordinatesModel {
|
|
10
|
+
orientation: ParallelCoordinatesOrientation;
|
|
11
|
+
/** Dimension keys in `uniqueValues` order — one axis each. */
|
|
12
|
+
axes: string[];
|
|
13
|
+
rows: ParallelCoordinatesRow[];
|
|
14
|
+
/** Field the rows were sorted and labelled by (client `xAxe`). */
|
|
15
|
+
idKey: string;
|
|
16
|
+
/** Axis whose value drives the line colour until another axis is clicked. */
|
|
17
|
+
colorKey: string;
|
|
18
|
+
/** Low end of the colour ramp (formatting key `defaultMin`). */
|
|
19
|
+
minColor: string;
|
|
20
|
+
/** High end of the colour ramp (formatting key `defaultMax`). */
|
|
21
|
+
maxColor: string;
|
|
22
|
+
/** Fallback for rows whose colour axis has no finite value. */
|
|
23
|
+
lineColor: string;
|
|
24
|
+
}
|
|
25
|
+
/** FuseDash `parallelCoordinatesChart` widget payload. */
|
|
26
|
+
export interface ParallelCoordinatesFusePayload {
|
|
27
|
+
data: Array<Record<string, unknown>>;
|
|
28
|
+
orientation?: string | null;
|
|
29
|
+
xAxe?: string | string[] | null;
|
|
30
|
+
yAxe?: string | string[] | null;
|
|
31
|
+
/** `Object.values()` of this object supplies the axis keys. */
|
|
32
|
+
uniqueValues?: Record<string, string[]> | Array<Record<string, string[]>> | null;
|
|
33
|
+
formatting?: Array<{
|
|
34
|
+
key?: string;
|
|
35
|
+
color?: string | number;
|
|
36
|
+
}> | null;
|
|
37
|
+
}
|
|
38
|
+
/** Chat payload that names its own axes. */
|
|
39
|
+
export interface ParallelCoordinatesRowsPayload {
|
|
40
|
+
orientation?: string | null;
|
|
41
|
+
/** Omit to infer from the numeric keys of the first row. */
|
|
42
|
+
axes?: string[] | null;
|
|
43
|
+
/** Field to label lines by; defaults to the first non-numeric key. */
|
|
44
|
+
idKey?: string | null;
|
|
45
|
+
rows: Array<Record<string, unknown>>;
|
|
46
|
+
}
|
|
47
|
+
export type ParallelCoordinatesInput = Array<Record<string, unknown>> | ParallelCoordinatesRowsPayload | ParallelCoordinatesFusePayload;
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/parallel-coordinates-chart/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,8BAA8B,GAAG,YAAY,GAAG,UAAU,CAAC;AAEvE,mEAAmE;AACnE,MAAM,WAAW,sBAAsB;IACrC,8EAA8E;IAC9E,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,wBAAwB;IACv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MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,wBAAwB,GAChC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAC9B,8BAA8B,GAC9B,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"id": "parallel-coordinates-chart",
|
|
3
|
+
"tag": "ui9000-parallel-coordinates-chart",
|
|
4
|
+
"title": "Parallel Coordinates Chart",
|
|
5
|
+
"description": "Chat-optimized parallel coordinates rewritten in D3 (client d3-axis/d3-scale + Redux → props-only Lit element). One linear axis per dimension, a polyline per record, coloured by the active axis; click an axis to move the colour ramp onto it.",
|
|
6
|
+
"chartTypeKeys": ["parallelCoordinatesChart"],
|
|
7
|
+
"source": "client/libs/shared/components/src/Widgets/ParallelCoordinatesChart/",
|
|
8
|
+
"stack": "d3",
|
|
9
|
+
"lazyImport": "@fusedashlabs/widgets/lazy/parallel-coordinates-chart",
|
|
10
|
+
"entry": "@fusedashlabs/widgets/parallel-coordinates-chart",
|
|
11
|
+
"usageConditions": {
|
|
12
|
+
"host": "mcp-chat",
|
|
13
|
+
"notFor": "fusedash-editor",
|
|
14
|
+
"mapsExcluded": true
|
|
15
|
+
},
|
|
16
|
+
"allowedActions": ["hover", "select", "resize"],
|
|
17
|
+
"divergences": [
|
|
18
|
+
{
|
|
19
|
+
"rule": "Legend is HTML in the shell, above the plot",
|
|
20
|
+
"deviation": "The colour ramp renders as an SVG gutter legend inside the plot's reserved bottom (horizontal) or right (vertical) band, not as HTML above it.",
|
|
21
|
+
"why": "The ramp is a continuous scale keyed to the active axis and reads as part of the axis furniture; the client draws it the same way, so keeping it in SVG preserves the layout hosts already expect. Discrete series legends still follow the house rule."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"rule": "Ports match the client 1:1",
|
|
25
|
+
"deviation": "Vertical orientation maps the axis maximum to the top of the plot; the client's VerticalParallelCoordinatesChart maps it to the bottom.",
|
|
26
|
+
"why": "The client transposed the horizontal variant without flipping the SVG y range, leaving its axes inverted and contradicting its own colour ramp. Horizontal is the acceptance path; the vertical fix is deliberate."
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"propsSchema": {
|
|
30
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"data": {
|
|
34
|
+
"oneOf": [
|
|
35
|
+
{
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": { "type": "object" },
|
|
38
|
+
"description": "Plain rows; every key holding a finite number becomes an axis."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "object",
|
|
42
|
+
"required": ["rows"],
|
|
43
|
+
"properties": {
|
|
44
|
+
"rows": { "type": "array", "items": { "type": "object" } },
|
|
45
|
+
"axes": { "type": "array", "items": { "type": "string" } },
|
|
46
|
+
"idKey": { "type": "string" },
|
|
47
|
+
"orientation": { "enum": ["horizontal", "vertical"] }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "object",
|
|
52
|
+
"required": ["data"],
|
|
53
|
+
"properties": {
|
|
54
|
+
"data": { "type": "array", "items": { "type": "object" } },
|
|
55
|
+
"orientation": { "enum": ["horizontal", "vertical"] },
|
|
56
|
+
"xAxe": {
|
|
57
|
+
"oneOf": [
|
|
58
|
+
{ "type": "string" },
|
|
59
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
60
|
+
],
|
|
61
|
+
"description": "Identity field — rows sort by it and tooltips label by it."
|
|
62
|
+
},
|
|
63
|
+
"yAxe": {
|
|
64
|
+
"oneOf": [
|
|
65
|
+
{ "type": "string" },
|
|
66
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
67
|
+
],
|
|
68
|
+
"description": "Colour axis hint; used only when it names one of the dimensions."
|
|
69
|
+
},
|
|
70
|
+
"uniqueValues": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"description": "Flattened values supply the dimension axes, in order.",
|
|
73
|
+
"additionalProperties": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": { "type": "string" }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"formatting": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"key": { "type": "string" },
|
|
84
|
+
"color": { "type": ["string", "number"] }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"description": "`defaultMin` / `defaultMax` set the two ends of the colour ramp."
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"orientation": { "enum": ["horizontal", "vertical"] },
|
|
94
|
+
"showLegend": { "type": "boolean", "default": true },
|
|
95
|
+
"showTooltip": { "type": "boolean", "default": true },
|
|
96
|
+
"colorKey": { "type": "string" }
|
|
97
|
+
},
|
|
98
|
+
"required": ["data"]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
;
|
|
102
|
+
|
|
103
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const id = "parallel-coordinates-chart";
|
|
2
|
+
const tag = "ui9000-parallel-coordinates-chart";
|
|
3
|
+
const title = "Parallel Coordinates Chart";
|
|
4
|
+
const description = "Chat-optimized parallel coordinates rewritten in D3 (client d3-axis/d3-scale + Redux → props-only Lit element). One linear axis per dimension, a polyline per record, coloured by the active axis; click an axis to move the colour ramp onto it.";
|
|
5
|
+
const chartTypeKeys = ["parallelCoordinatesChart"];
|
|
6
|
+
const source = "client/libs/shared/components/src/Widgets/ParallelCoordinatesChart/";
|
|
7
|
+
const stack = "d3";
|
|
8
|
+
const lazyImport = "@fusedashlabs/widgets/lazy/parallel-coordinates-chart";
|
|
9
|
+
const entry = "@fusedashlabs/widgets/parallel-coordinates-chart";
|
|
10
|
+
const usageConditions = { "host": "mcp-chat", "notFor": "fusedash-editor", "mapsExcluded": true };
|
|
11
|
+
const allowedActions = ["hover", "select", "resize"];
|
|
12
|
+
const divergences = [{ "rule": "Legend is HTML in the shell, above the plot", "deviation": "The colour ramp renders as an SVG gutter legend inside the plot's reserved bottom (horizontal) or right (vertical) band, not as HTML above it.", "why": "The ramp is a continuous scale keyed to the active axis and reads as part of the axis furniture; the client draws it the same way, so keeping it in SVG preserves the layout hosts already expect. Discrete series legends still follow the house rule." }, { "rule": "Ports match the client 1:1", "deviation": "Vertical orientation maps the axis maximum to the top of the plot; the client's VerticalParallelCoordinatesChart maps it to the bottom.", "why": "The client transposed the horizontal variant without flipping the SVG y range, leaving its axes inverted and contradicting its own colour ramp. Horizontal is the acceptance path; the vertical fix is deliberate." }];
|
|
13
|
+
const propsSchema = { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "data": { "oneOf": [{ "type": "array", "items": { "type": "object" }, "description": "Plain rows; every key holding a finite number becomes an axis." }, { "type": "object", "required": ["rows"], "properties": { "rows": { "type": "array", "items": { "type": "object" } }, "axes": { "type": "array", "items": { "type": "string" } }, "idKey": { "type": "string" }, "orientation": { "enum": ["horizontal", "vertical"] } } }, { "type": "object", "required": ["data"], "properties": { "data": { "type": "array", "items": { "type": "object" } }, "orientation": { "enum": ["horizontal", "vertical"] }, "xAxe": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }], "description": "Identity field — rows sort by it and tooltips label by it." }, "yAxe": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }], "description": "Colour axis hint; used only when it names one of the dimensions." }, "uniqueValues": { "type": "object", "description": "Flattened values supply the dimension axes, in order.", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "formatting": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "color": { "type": ["string", "number"] } } }, "description": "`defaultMin` / `defaultMax` set the two ends of the colour ramp." } } }] }, "orientation": { "enum": ["horizontal", "vertical"] }, "showLegend": { "type": "boolean", "default": true }, "showTooltip": { "type": "boolean", "default": true }, "colorKey": { "type": "string" } }, "required": ["data"] };
|
|
14
|
+
const parallelCoordinatesMeta = {
|
|
15
|
+
id,
|
|
16
|
+
tag,
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
chartTypeKeys,
|
|
20
|
+
source,
|
|
21
|
+
stack,
|
|
22
|
+
lazyImport,
|
|
23
|
+
entry,
|
|
24
|
+
usageConditions,
|
|
25
|
+
allowedActions,
|
|
26
|
+
divergences,
|
|
27
|
+
propsSchema
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
allowedActions,
|
|
31
|
+
chartTypeKeys,
|
|
32
|
+
parallelCoordinatesMeta as default,
|
|
33
|
+
description,
|
|
34
|
+
divergences,
|
|
35
|
+
entry,
|
|
36
|
+
id,
|
|
37
|
+
lazyImport,
|
|
38
|
+
propsSchema,
|
|
39
|
+
source,
|
|
40
|
+
stack,
|
|
41
|
+
tag,
|
|
42
|
+
title,
|
|
43
|
+
usageConditions
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=metadata.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChartDimensions, WidgetTheme } from '../../../types/index.js';
|
|
2
|
+
import { AxisLabelTooltipHandlers } from '../../../utils/axis-labels.js';
|
|
3
|
+
import { ParallelCoordinatesModel, ParallelCoordinatesOrientation, ParallelCoordinatesRow } from '../lib/index.js';
|
|
4
|
+
export interface ParallelCoordinatesHover {
|
|
5
|
+
row: ParallelCoordinatesRow;
|
|
6
|
+
event: MouseEvent;
|
|
7
|
+
}
|
|
8
|
+
export interface RenderParallelCoordinatesOptions extends AxisLabelTooltipHandlers {
|
|
9
|
+
model: ParallelCoordinatesModel;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
margin: ChartDimensions['margin'];
|
|
13
|
+
theme: WidgetTheme;
|
|
14
|
+
orientation: ParallelCoordinatesOrientation;
|
|
15
|
+
/** Draws the colour ramp for the active axis in the right gutter. */
|
|
16
|
+
showLegend: boolean;
|
|
17
|
+
/** Axis driving line colour; falls back to `model.colorKey`. */
|
|
18
|
+
colorKey?: string;
|
|
19
|
+
onRowHover?: (payload: ParallelCoordinatesHover) => void;
|
|
20
|
+
onRowLeave?: () => void;
|
|
21
|
+
/** Fired when a click on an axis promotes it to the colour axis. */
|
|
22
|
+
onColorKeyChange?: (key: string) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* FuseDash ParallelCoordinatesChart plot — one linear axis per dimension with a
|
|
26
|
+
* polyline per record, coloured by the value on the active axis. Click any axis
|
|
27
|
+
* to move the colour ramp onto it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function renderParallelCoordinatesChart(container: HTMLElement, options: RenderParallelCoordinatesOptions): void;
|
|
30
|
+
//# sourceMappingURL=draw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../../../src/components/parallel-coordinates-chart/render/draw.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAA2B,KAAK,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEvG,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC5B,MAAM,iBAAiB,CAAC;AAQzB,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,sBAAsB,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,gCAAiC,SAAQ,wBAAwB;IAChF,KAAK,EAAE,wBAAwB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAClC,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,EAAE,8BAA8B,CAAC;IAC5C,qEAAqE;IACrE,UAAU,EAAE,OAAO,CAAC;IACpB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACzD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAgCD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,gCAAgC,GACxC,IAAI,CAgPN"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { axisLeft, axisRight, axisBottom } from "d3-axis";
|
|
2
|
+
import { scaleLinear, scalePoint } from "d3-scale";
|
|
3
|
+
import { select } from "d3-selection";
|
|
4
|
+
import { line } from "d3-shape";
|
|
5
|
+
import { decorateManualAxisLabel } from "../../../utils/axis-labels.js";
|
|
6
|
+
import { FD } from "../../../utils/fusedash-visual.js";
|
|
7
|
+
import { axisExtents, tickCountForSpan } from "../lib/domain.js";
|
|
8
|
+
import { formatAxisTick, AXIS_TITLE_MAX } from "../lib/format.js";
|
|
9
|
+
const MIN_WIDTH = 120;
|
|
10
|
+
const MIN_HEIGHT = 60;
|
|
11
|
+
let gradientSeq = 0;
|
|
12
|
+
const PLOT_CSS = `
|
|
13
|
+
.line-path { pointer-events: visibleStroke; transition: stroke-opacity .2s, stroke-width .2s; }
|
|
14
|
+
.plot.is-hovering .line-path { stroke-opacity: ${FD.parallelLineOpacityDimmed}; }
|
|
15
|
+
.plot.is-hovering .line-path.is-hovered { stroke-opacity: 1; stroke-width: ${FD.parallelLineWidthHovered}px; }
|
|
16
|
+
.x-axis .tick:first-of-type text { text-anchor: start; }
|
|
17
|
+
.x-axis .tick:last-of-type text { text-anchor: end; }
|
|
18
|
+
/* Ticks render in ascending domain order: first is now the bottom edge. */
|
|
19
|
+
.y-axis .tick:first-of-type text { dominant-baseline: ideographic; }
|
|
20
|
+
.y-axis .tick:last-of-type text { dominant-baseline: central; }
|
|
21
|
+
`;
|
|
22
|
+
function styleAxis(group) {
|
|
23
|
+
group.select(".domain").attr("stroke", FD.parallelAxisStroke);
|
|
24
|
+
group.selectAll(".tick line").attr("stroke", FD.parallelAxisStroke);
|
|
25
|
+
group.selectAll("text").attr("fill", FD.parallelAxisLabelFill).attr("font-size", FD.axisLabelSize);
|
|
26
|
+
}
|
|
27
|
+
function renderParallelCoordinatesChart(container, options) {
|
|
28
|
+
const {
|
|
29
|
+
model,
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
margin,
|
|
33
|
+
theme,
|
|
34
|
+
orientation,
|
|
35
|
+
showLegend,
|
|
36
|
+
onRowHover,
|
|
37
|
+
onRowLeave,
|
|
38
|
+
onColorKeyChange
|
|
39
|
+
} = options;
|
|
40
|
+
container.replaceChildren();
|
|
41
|
+
const { axes, rows } = model;
|
|
42
|
+
if (!axes.length || !rows.length || width < MIN_WIDTH || height < MIN_HEIGHT) return;
|
|
43
|
+
const requested = options.colorKey ?? model.colorKey;
|
|
44
|
+
let colorKey = axes.includes(requested) ? requested : axes[0];
|
|
45
|
+
const gutter = showLegend ? FD.parallelLegendOffsetRight + FD.parallelLegendWidth + FD.parallelLegendTickLabelWidth : 0;
|
|
46
|
+
const innerWidth = width - margin.left - margin.right;
|
|
47
|
+
const plotWidth = innerWidth - gutter;
|
|
48
|
+
const plotRight = Math.max(margin.left, plotWidth - margin.right);
|
|
49
|
+
const vertical = orientation === "vertical";
|
|
50
|
+
const coordinateHeight = FD.parallelAxisSpacing * axes.length;
|
|
51
|
+
const innerHeight = height - margin.top - margin.bottom;
|
|
52
|
+
const plotBottom = vertical ? innerHeight - margin.bottom - FD.parallelColorScaleHeight : coordinateHeight - margin.bottom;
|
|
53
|
+
const svgHeight = vertical ? height : coordinateHeight + margin.top + margin.bottom * 2;
|
|
54
|
+
if (plotBottom <= margin.top) return;
|
|
55
|
+
const extents = axisExtents(rows, axes);
|
|
56
|
+
const valueScales = /* @__PURE__ */ new Map();
|
|
57
|
+
for (const axis of axes) {
|
|
58
|
+
valueScales.set(
|
|
59
|
+
axis,
|
|
60
|
+
scaleLinear().domain(extents.get(axis)).range(vertical ? [plotBottom, margin.top] : [margin.left, plotRight])
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
const bandScale = scalePoint().domain(axes).range(vertical ? [margin.left, plotRight] : [margin.top, plotBottom]);
|
|
64
|
+
const svg = select(container).append("svg").attr("width", width).attr("height", svgHeight).attr("viewBox", `0 0 ${width} ${svgHeight}`).attr("role", "img").attr("aria-label", "Parallel coordinates chart").style("display", "block").style("font-family", theme.fontFamily);
|
|
65
|
+
svg.append("style").text(PLOT_CSS);
|
|
66
|
+
const root = svg.append("g").attr("transform", `translate(${margin.left},${margin.top})`);
|
|
67
|
+
const lastIndex = axes.length - 1;
|
|
68
|
+
const axisSpan = vertical ? plotBottom - margin.top : plotRight - margin.left;
|
|
69
|
+
const tickCount = tickCountForSpan(axisSpan);
|
|
70
|
+
const bandStep = axes.length > 1 ? Math.abs(Number(bandScale.step())) : plotRight;
|
|
71
|
+
const titleSlot = vertical ? Math.max(0, bandStep - 8) : plotWidth;
|
|
72
|
+
const axisGroups = root.append("g").selectAll("g").data(axes).join("g").attr("class", vertical ? "y-axis" : "x-axis").attr(
|
|
73
|
+
"transform",
|
|
74
|
+
(key) => vertical ? `translate(${bandScale(key)}, 0)` : `translate(0, ${bandScale(key)})`
|
|
75
|
+
).style("cursor", "pointer").on("click", (_event, key) => setColorKey(key));
|
|
76
|
+
axisGroups.each(function(key, index) {
|
|
77
|
+
const group = select(this);
|
|
78
|
+
const scale = valueScales.get(key);
|
|
79
|
+
const axisFn = vertical ? index === lastIndex ? axisLeft(scale) : axisRight(scale) : axisBottom(scale);
|
|
80
|
+
group.call(
|
|
81
|
+
axisFn.ticks(tickCount).tickSize(4).tickPadding(8).tickFormat(
|
|
82
|
+
(d) => formatAxisTick(Number(d))
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
styleAxis(group);
|
|
86
|
+
});
|
|
87
|
+
const axisTitles = axisGroups.append("text").attr("class", "axis-title").attr("x", margin.left).attr("y", vertical ? 0 : -10).attr(
|
|
88
|
+
"text-anchor",
|
|
89
|
+
(_key, index) => vertical && index === lastIndex ? "end" : "start"
|
|
90
|
+
).attr("fill", FD.parallelAxisLabelFill);
|
|
91
|
+
axisTitles.each(function(key) {
|
|
92
|
+
decorateManualAxisLabel(select(this), key, {
|
|
93
|
+
maxLength: AXIS_TITLE_MAX,
|
|
94
|
+
slotWidth: titleSlot,
|
|
95
|
+
onAxisLabelHover: options.onAxisLabelHover,
|
|
96
|
+
onAxisLabelLeave: options.onAxisLabelLeave
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
const plot = root.append("g").attr("class", "plot").attr("fill", "none");
|
|
100
|
+
const valueAt = ([key, value]) => valueScales.get(key)(value ?? 0);
|
|
101
|
+
const bandAt = ([key]) => Number(bandScale(key));
|
|
102
|
+
const lineFn = line().defined(([, value]) => value != null).x(vertical ? bandAt : valueAt).y(vertical ? valueAt : bandAt);
|
|
103
|
+
const paths = plot.selectAll("path").data(rows).join("path").attr("class", "line-path").attr("stroke-width", FD.parallelLineWidth).attr("stroke-opacity", FD.parallelLineOpacity).attr("stroke-linejoin", "round").attr("stroke-linecap", "round").attr(
|
|
104
|
+
"d",
|
|
105
|
+
(row) => lineFn(axes.map((key) => [key, row.values[key]]))
|
|
106
|
+
);
|
|
107
|
+
paths.on("mouseenter", function(event, row) {
|
|
108
|
+
plot.classed("is-hovering", true);
|
|
109
|
+
select(this).classed("is-hovered", true);
|
|
110
|
+
onRowHover == null ? void 0 : onRowHover({ row, event });
|
|
111
|
+
}).on("mousemove", (event, row) => onRowHover == null ? void 0 : onRowHover({ row, event })).on("mouseleave", function() {
|
|
112
|
+
plot.classed("is-hovering", false);
|
|
113
|
+
select(this).classed("is-hovered", false);
|
|
114
|
+
onRowLeave == null ? void 0 : onRowLeave();
|
|
115
|
+
});
|
|
116
|
+
const gradientId = `ui9000-parallel-ramp-${gradientSeq += 1}`;
|
|
117
|
+
const legendGroup = showLegend ? root.append("g").attr("class", "color-legend") : null;
|
|
118
|
+
if (legendGroup) {
|
|
119
|
+
const defs = svg.append("defs");
|
|
120
|
+
const gradient = defs.append("linearGradient").attr("id", gradientId).attr("x1", "0%").attr("x2", "0%").attr("y1", "100%").attr("y2", "0%");
|
|
121
|
+
gradient.append("stop").attr("offset", "0%").attr("stop-color", model.minColor);
|
|
122
|
+
gradient.append("stop").attr("offset", "100%").attr("stop-color", model.maxColor);
|
|
123
|
+
}
|
|
124
|
+
function applyColorKey() {
|
|
125
|
+
const scale = valueScales.get(colorKey);
|
|
126
|
+
const domain = scale.domain();
|
|
127
|
+
const ramp = scaleLinear().domain(domain).range([model.minColor, model.maxColor]).clamp(true);
|
|
128
|
+
paths.attr("stroke", (row) => {
|
|
129
|
+
const value = row.values[colorKey];
|
|
130
|
+
return value == null ? model.lineColor : ramp(value);
|
|
131
|
+
});
|
|
132
|
+
axisTitles.attr(
|
|
133
|
+
"font-size",
|
|
134
|
+
(key) => key === colorKey ? FD.parallelTitleSizeActive : FD.parallelTitleSize
|
|
135
|
+
).attr("font-weight", (key) => key === colorKey ? 600 : 400);
|
|
136
|
+
if (!legendGroup) return;
|
|
137
|
+
legendGroup.selectAll("*").remove();
|
|
138
|
+
const legendX = Math.max(0, plotWidth - margin.right + FD.parallelLegendOffsetRight);
|
|
139
|
+
const legendHeight = Math.max(0, plotBottom - margin.top);
|
|
140
|
+
legendGroup.append("rect").attr("x", legendX).attr("y", margin.top).attr("width", FD.parallelLegendWidth).attr("height", legendHeight).attr("rx", FD.parallelLegendRadius).attr("fill", `url(#${gradientId})`);
|
|
141
|
+
const legendScale = scaleLinear().domain(domain).range([legendHeight, 0]);
|
|
142
|
+
const ticks = legendGroup.append("g").attr("transform", `translate(${legendX + FD.parallelLegendWidth}, ${margin.top})`).call(
|
|
143
|
+
axisRight(legendScale).ticks(tickCountForSpan(legendHeight)).tickSize(0).tickPadding(6).tickFormat((d) => formatAxisTick(Number(d)))
|
|
144
|
+
);
|
|
145
|
+
ticks.select(".domain").remove();
|
|
146
|
+
ticks.selectAll(".tick line").remove();
|
|
147
|
+
ticks.selectAll("text").attr("fill", FD.parallelAxisLabelFill).attr("font-size", FD.axisLabelSize);
|
|
148
|
+
}
|
|
149
|
+
function setColorKey(key) {
|
|
150
|
+
if (key === colorKey) return;
|
|
151
|
+
colorKey = key;
|
|
152
|
+
applyColorKey();
|
|
153
|
+
onColorKeyChange == null ? void 0 : onColorKeyChange(key);
|
|
154
|
+
}
|
|
155
|
+
applyColorKey();
|
|
156
|
+
}
|
|
157
|
+
export {
|
|
158
|
+
renderParallelCoordinatesChart
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=draw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw.js","sources":["../../../../src/components/parallel-coordinates-chart/render/draw.ts"],"sourcesContent":["import { axisBottom, axisLeft, axisRight } from 'd3-axis';\nimport { scaleLinear, scalePoint, type ScaleLinear } from 'd3-scale';\nimport { select, type Selection } from 'd3-selection';\nimport { line } from 'd3-shape';\n\nimport type { ChartDimensions, WidgetTheme } from '../../../types/index.js';\nimport { decorateManualAxisLabel, type AxisLabelTooltipHandlers } from '../../../utils/axis-labels.js';\nimport { FD } from '../../../utils/fusedash-visual.js';\nimport {\n AXIS_TITLE_MAX,\n axisExtents,\n formatAxisTick,\n tickCountForSpan,\n type ParallelCoordinatesModel,\n type ParallelCoordinatesOrientation,\n type ParallelCoordinatesRow,\n} from '../lib/index.js';\n\n/** Below this the axes have no room for ticks — the element shows empty state. */\nconst MIN_WIDTH = 120;\nconst MIN_HEIGHT = 60;\n\nlet gradientSeq = 0;\n\nexport interface ParallelCoordinatesHover {\n row: ParallelCoordinatesRow;\n event: MouseEvent;\n}\n\nexport interface RenderParallelCoordinatesOptions extends AxisLabelTooltipHandlers {\n model: ParallelCoordinatesModel;\n width: number;\n height: number;\n margin: ChartDimensions['margin'];\n theme: WidgetTheme;\n orientation: ParallelCoordinatesOrientation;\n /** Draws the colour ramp for the active axis in the right gutter. */\n showLegend: boolean;\n /** Axis driving line colour; falls back to `model.colorKey`. */\n colorKey?: string;\n onRowHover?: (payload: ParallelCoordinatesHover) => void;\n onRowLeave?: () => void;\n /** Fired when a click on an axis promotes it to the colour axis. */\n onColorKeyChange?: (key: string) => void;\n}\n\n/**\n * Scoped to the SVG so hover stays a class flip rather than an attribute pass\n * over every polyline. Mirrors the client `SVGStyled` rules.\n */\nconst PLOT_CSS = `\n.line-path { pointer-events: visibleStroke; transition: stroke-opacity .2s, stroke-width .2s; }\n.plot.is-hovering .line-path { stroke-opacity: ${FD.parallelLineOpacityDimmed}; }\n.plot.is-hovering .line-path.is-hovered { stroke-opacity: 1; stroke-width: ${FD.parallelLineWidthHovered}px; }\n.x-axis .tick:first-of-type text { text-anchor: start; }\n.x-axis .tick:last-of-type text { text-anchor: end; }\n/* Ticks render in ascending domain order: first is now the bottom edge. */\n.y-axis .tick:first-of-type text { dominant-baseline: ideographic; }\n.y-axis .tick:last-of-type text { dominant-baseline: central; }\n`;\n\ntype AxisScale = ScaleLinear<number, number>;\n/** One polyline vertex: the axis it crosses and the row's value there. */\ntype Vertex = [string, number | null];\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnySelection = Selection<any, any, any, any>;\n\nfunction styleAxis(group: AnySelection): void {\n group.select('.domain').attr('stroke', FD.parallelAxisStroke);\n group.selectAll('.tick line').attr('stroke', FD.parallelAxisStroke);\n group\n .selectAll('text')\n .attr('fill', FD.parallelAxisLabelFill)\n .attr('font-size', FD.axisLabelSize);\n}\n\n/**\n * FuseDash ParallelCoordinatesChart plot — one linear axis per dimension with a\n * polyline per record, coloured by the value on the active axis. Click any axis\n * to move the colour ramp onto it.\n */\nexport function renderParallelCoordinatesChart(\n container: HTMLElement,\n options: RenderParallelCoordinatesOptions,\n): void {\n const {\n model,\n width,\n height,\n margin,\n theme,\n orientation,\n showLegend,\n onRowHover,\n onRowLeave,\n onColorKeyChange,\n } = options;\n\n container.replaceChildren();\n const { axes, rows } = model;\n if (!axes.length || !rows.length || width < MIN_WIDTH || height < MIN_HEIGHT) return;\n\n const requested = options.colorKey ?? model.colorKey;\n let colorKey = axes.includes(requested) ? requested : axes[0];\n\n const gutter = showLegend\n ? FD.parallelLegendOffsetRight + FD.parallelLegendWidth + FD.parallelLegendTickLabelWidth\n : 0;\n const innerWidth = width - margin.left - margin.right;\n const plotWidth = innerWidth - gutter;\n const plotRight = Math.max(margin.left, plotWidth - margin.right);\n\n const vertical = orientation === 'vertical';\n // Horizontal grows one band per axis and scrolls; vertical fits the frame.\n const coordinateHeight = FD.parallelAxisSpacing * axes.length;\n const innerHeight = height - margin.top - margin.bottom;\n const plotBottom = vertical\n ? innerHeight - margin.bottom - FD.parallelColorScaleHeight\n : coordinateHeight - margin.bottom;\n const svgHeight = vertical ? height : coordinateHeight + margin.top + margin.bottom * 2;\n if (plotBottom <= margin.top) return;\n\n const extents = axisExtents(rows, axes);\n const valueScales = new Map<string, AxisScale>();\n for (const axis of axes) {\n valueScales.set(\n axis,\n scaleLinear()\n .domain(extents.get(axis) as [number, number])\n // SVG y grows downward, so a vertical axis has to run bottom → top for\n // the maximum to sit at the top. The client's VerticalParallelCoordinates\n // transposed the horizontal variant without that flip, leaving its axes\n // mirrored and contradicting its own colour ramp; this is the one place\n // the port deliberately diverges from it.\n .range(vertical ? [plotBottom, margin.top] : [margin.left, plotRight]),\n );\n }\n const bandScale = scalePoint<string>()\n .domain(axes)\n .range(vertical ? [margin.left, plotRight] : [margin.top, plotBottom]);\n\n const svg = select(container)\n .append('svg')\n .attr('width', width)\n .attr('height', svgHeight)\n .attr('viewBox', `0 0 ${width} ${svgHeight}`)\n .attr('role', 'img')\n .attr('aria-label', 'Parallel coordinates chart')\n .style('display', 'block')\n .style('font-family', theme.fontFamily);\n svg.append('style').text(PLOT_CSS);\n\n const root = svg\n .append('g')\n .attr('transform', `translate(${margin.left},${margin.top})`);\n\n // --- axes -----------------------------------------------------------------\n const lastIndex = axes.length - 1;\n const axisSpan = vertical ? plotBottom - margin.top : plotRight - margin.left;\n const tickCount = tickCountForSpan(axisSpan);\n // Vertical titles must fit the gap to the neighbouring axis.\n const bandStep = axes.length > 1 ? Math.abs(Number(bandScale.step())) : plotRight;\n const titleSlot = vertical ? Math.max(0, bandStep - 8) : plotWidth;\n\n const axisGroups = root\n .append('g')\n .selectAll<SVGGElement, string>('g')\n .data(axes)\n .join('g')\n .attr('class', vertical ? 'y-axis' : 'x-axis')\n .attr('transform', (key) =>\n vertical ? `translate(${bandScale(key)}, 0)` : `translate(0, ${bandScale(key)})`,\n )\n .style('cursor', 'pointer')\n .on('click', (_event: MouseEvent, key) => setColorKey(key));\n\n axisGroups.each(function (key, index) {\n const group = select(this);\n const scale = valueScales.get(key) as AxisScale;\n // Vertical hangs ticks to the right, except the last axis which would\n // otherwise push its labels outside the plot.\n const axisFn = vertical\n ? (index === lastIndex ? axisLeft(scale) : axisRight(scale))\n : axisBottom(scale);\n group.call(\n axisFn.ticks(tickCount).tickSize(4).tickPadding(8).tickFormat((d) =>\n formatAxisTick(Number(d)),\n ),\n );\n styleAxis(group);\n });\n\n const axisTitles = axisGroups\n .append('text')\n .attr('class', 'axis-title')\n .attr('x', margin.left)\n .attr('y', vertical ? 0 : -10)\n .attr('text-anchor', (_key, index) =>\n vertical && index === lastIndex ? 'end' : 'start',\n )\n .attr('fill', FD.parallelAxisLabelFill);\n\n axisTitles.each(function (key) {\n decorateManualAxisLabel(select(this), key, {\n maxLength: AXIS_TITLE_MAX,\n slotWidth: titleSlot,\n onAxisLabelHover: options.onAxisLabelHover,\n onAxisLabelLeave: options.onAxisLabelLeave,\n });\n });\n\n // --- polylines ------------------------------------------------------------\n const plot = root.append('g').attr('class', 'plot').attr('fill', 'none');\n\n const valueAt = ([key, value]: Vertex): number =>\n (valueScales.get(key) as AxisScale)(value ?? 0);\n const bandAt = ([key]: Vertex): number => Number(bandScale(key));\n\n const lineFn = line<Vertex>()\n .defined(([, value]) => value != null)\n .x(vertical ? bandAt : valueAt)\n .y(vertical ? valueAt : bandAt);\n\n const paths = plot\n .selectAll<SVGPathElement, ParallelCoordinatesRow>('path')\n .data(rows)\n .join('path')\n .attr('class', 'line-path')\n .attr('stroke-width', FD.parallelLineWidth)\n .attr('stroke-opacity', FD.parallelLineOpacity)\n .attr('stroke-linejoin', 'round')\n .attr('stroke-linecap', 'round')\n .attr('d', (row) =>\n lineFn(axes.map((key) => [key, row.values[key]] as Vertex)),\n );\n\n paths\n .on('mouseenter', function (event: MouseEvent, row) {\n plot.classed('is-hovering', true);\n select(this).classed('is-hovered', true);\n onRowHover?.({ row, event });\n })\n .on('mousemove', (event: MouseEvent, row) => onRowHover?.({ row, event }))\n .on('mouseleave', function () {\n plot.classed('is-hovering', false);\n select(this).classed('is-hovered', false);\n onRowLeave?.();\n });\n\n // --- colour ramp ----------------------------------------------------------\n const gradientId = `ui9000-parallel-ramp-${(gradientSeq += 1)}`;\n const legendGroup = showLegend ? root.append('g').attr('class', 'color-legend') : null;\n\n if (legendGroup) {\n const defs = svg.append('defs');\n const gradient = defs\n .append('linearGradient')\n .attr('id', gradientId)\n .attr('x1', '0%')\n .attr('x2', '0%')\n .attr('y1', '100%')\n .attr('y2', '0%');\n gradient.append('stop').attr('offset', '0%').attr('stop-color', model.minColor);\n gradient.append('stop').attr('offset', '100%').attr('stop-color', model.maxColor);\n }\n\n function applyColorKey(): void {\n const scale = valueScales.get(colorKey) as AxisScale;\n const domain = scale.domain() as [number, number];\n const ramp = scaleLinear<string>()\n .domain(domain)\n .range([model.minColor, model.maxColor])\n .clamp(true);\n\n paths.attr('stroke', (row) => {\n const value = row.values[colorKey];\n return value == null ? model.lineColor : ramp(value);\n });\n axisTitles\n .attr('font-size', (key) =>\n key === colorKey ? FD.parallelTitleSizeActive : FD.parallelTitleSize,\n )\n .attr('font-weight', (key) => (key === colorKey ? 600 : 400));\n\n if (!legendGroup) return;\n legendGroup.selectAll('*').remove();\n const legendX = Math.max(0, plotWidth - margin.right + FD.parallelLegendOffsetRight);\n const legendHeight = Math.max(0, plotBottom - margin.top);\n legendGroup\n .append('rect')\n .attr('x', legendX)\n .attr('y', margin.top)\n .attr('width', FD.parallelLegendWidth)\n .attr('height', legendHeight)\n .attr('rx', FD.parallelLegendRadius)\n .attr('fill', `url(#${gradientId})`);\n\n const legendScale = scaleLinear().domain(domain).range([legendHeight, 0]);\n const ticks = legendGroup\n .append('g')\n .attr('transform', `translate(${legendX + FD.parallelLegendWidth}, ${margin.top})`)\n .call(\n axisRight(legendScale)\n .ticks(tickCountForSpan(legendHeight))\n .tickSize(0)\n .tickPadding(6)\n .tickFormat((d) => formatAxisTick(Number(d))),\n );\n ticks.select('.domain').remove();\n ticks.selectAll('.tick line').remove();\n ticks\n .selectAll('text')\n .attr('fill', FD.parallelAxisLabelFill)\n .attr('font-size', FD.axisLabelSize);\n }\n\n function setColorKey(key: string): void {\n if (key === colorKey) return;\n colorKey = key;\n applyColorKey();\n onColorKeyChange?.(key);\n }\n\n applyColorKey();\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA,MAAM,YAAY;AAClB,MAAM,aAAa;AAEnB,IAAI,cAAc;AA4BlB,MAAM,WAAW;AAAA;AAAA,iDAEgC,GAAG,yBAAyB;AAAA,6EACA,GAAG,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcxG,SAAS,UAAU,OAA2B;AAC5C,QAAM,OAAO,SAAS,EAAE,KAAK,UAAU,GAAG,kBAAkB;AAC5D,QAAM,UAAU,YAAY,EAAE,K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tC,QAAI,QAAQ,SAAU;AACtB,eAAW;AACX,kBAAA;AACA,yDAAmB;AAAA,EACrB;AAEA,gBAAA;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/parallel-coordinates-chart/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,GACtC,MAAM,WAAW,CAAC"}
|