@fusedashlabs/widgets 0.3.1 → 0.4.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 +37 -0
- package/README.md +1 -1
- package/dist/components/chart-renderer/element/ui9000-chart-renderer.d.ts +2 -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 +23 -2
- 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 +20 -5
- 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.js +1 -1
- package/dist/components/donut-chart/element/ui9000-donut-chart.js.map +1 -1
- package/dist/components/kpi-widget/element/styles.d.ts.map +1 -1
- package/dist/components/kpi-widget/element/styles.js +268 -5
- package/dist/components/kpi-widget/element/styles.js.map +1 -1
- package/dist/components/kpi-widget/element/ui9000-kpi-widget.d.ts +10 -1
- package/dist/components/kpi-widget/element/ui9000-kpi-widget.d.ts.map +1 -1
- package/dist/components/kpi-widget/element/ui9000-kpi-widget.js +154 -27
- package/dist/components/kpi-widget/element/ui9000-kpi-widget.js.map +1 -1
- package/dist/components/kpi-widget/index.d.ts +1 -1
- package/dist/components/kpi-widget/index.d.ts.map +1 -1
- package/dist/components/kpi-widget/index.js +7 -4
- package/dist/components/kpi-widget/lib/extract.d.ts +5 -1
- package/dist/components/kpi-widget/lib/extract.d.ts.map +1 -1
- package/dist/components/kpi-widget/lib/extract.js +110 -34
- package/dist/components/kpi-widget/lib/extract.js.map +1 -1
- package/dist/components/kpi-widget/lib/format.d.ts +5 -0
- package/dist/components/kpi-widget/lib/format.d.ts.map +1 -1
- package/dist/components/kpi-widget/lib/format.js +10 -1
- package/dist/components/kpi-widget/lib/format.js.map +1 -1
- package/dist/components/kpi-widget/lib/grid.d.ts +5 -0
- package/dist/components/kpi-widget/lib/grid.d.ts.map +1 -1
- package/dist/components/kpi-widget/lib/grid.js +18 -0
- package/dist/components/kpi-widget/lib/grid.js.map +1 -1
- package/dist/components/kpi-widget/lib/index.d.ts +5 -5
- package/dist/components/kpi-widget/lib/index.d.ts.map +1 -1
- package/dist/components/kpi-widget/lib/normalize.d.ts +2 -0
- package/dist/components/kpi-widget/lib/normalize.d.ts.map +1 -1
- package/dist/components/kpi-widget/lib/normalize.js +73 -12
- package/dist/components/kpi-widget/lib/normalize.js.map +1 -1
- package/dist/components/kpi-widget/lib/types.d.ts +41 -0
- package/dist/components/kpi-widget/lib/types.d.ts.map +1 -1
- package/dist/components/kpi-widget/metadata.json.d.ts +1 -1
- package/dist/components/kpi-widget/metadata.json.js +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 +6 -1
- 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 +456 -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/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.map +1 -1
- package/dist/components/network-graph/element/styles.js +177 -57
- package/dist/components/network-graph/element/styles.js.map +1 -1
- package/dist/components/network-graph/element/ui9000-network-graph.d.ts +4 -0
- package/dist/components/network-graph/element/ui9000-network-graph.d.ts.map +1 -1
- package/dist/components/network-graph/element/ui9000-network-graph.js +116 -39
- package/dist/components/network-graph/element/ui9000-network-graph.js.map +1 -1
- package/dist/components/network-graph/lib/domain.d.ts +2 -2
- package/dist/components/network-graph/lib/domain.js.map +1 -1
- package/dist/components/network-graph/lib/index.d.ts +1 -0
- package/dist/components/network-graph/lib/index.d.ts.map +1 -1
- 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/render/draw.d.ts +4 -1
- package/dist/components/network-graph/render/draw.d.ts.map +1 -1
- package/dist/components/network-graph/render/draw.js +34 -9
- package/dist/components/network-graph/render/draw.js.map +1 -1
- package/dist/components/partial-dependence-chart/element/styles.d.ts +2 -0
- package/dist/components/partial-dependence-chart/element/styles.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/element/styles.js +48 -0
- package/dist/components/partial-dependence-chart/element/styles.js.map +1 -0
- package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.d.ts +30 -0
- package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.js +163 -0
- package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.js.map +1 -0
- package/dist/components/partial-dependence-chart/index.d.ts +5 -0
- package/dist/components/partial-dependence-chart/index.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/index.js +18 -0
- package/dist/components/partial-dependence-chart/index.js.map +1 -0
- package/dist/components/partial-dependence-chart/lib/domain.d.ts +6 -0
- package/dist/components/partial-dependence-chart/lib/domain.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/lib/domain.js +16 -0
- package/dist/components/partial-dependence-chart/lib/domain.js.map +1 -0
- package/dist/components/partial-dependence-chart/lib/index.d.ts +5 -0
- package/dist/components/partial-dependence-chart/lib/index.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/lib/normalize.d.ts +4 -0
- package/dist/components/partial-dependence-chart/lib/normalize.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/lib/normalize.js +167 -0
- package/dist/components/partial-dependence-chart/lib/normalize.js.map +1 -0
- package/dist/components/partial-dependence-chart/lib/series.d.ts +15 -0
- package/dist/components/partial-dependence-chart/lib/series.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/lib/series.js +63 -0
- package/dist/components/partial-dependence-chart/lib/series.js.map +1 -0
- package/dist/components/partial-dependence-chart/lib/types.d.ts +50 -0
- package/dist/components/partial-dependence-chart/lib/types.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/metadata.json.d.ts +80 -0
- package/dist/components/partial-dependence-chart/metadata.json.js +42 -0
- package/dist/components/partial-dependence-chart/metadata.json.js.map +1 -0
- package/dist/components/partial-dependence-chart/render/draw.d.ts +34 -0
- package/dist/components/partial-dependence-chart/render/draw.d.ts.map +1 -0
- package/dist/components/partial-dependence-chart/render/draw.js +95 -0
- package/dist/components/partial-dependence-chart/render/draw.js.map +1 -0
- package/dist/components/partial-dependence-chart/render/index.d.ts +2 -0
- package/dist/components/partial-dependence-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 +0 -2
- 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 +1 -1
- package/dist/components/polar-area-chart/element/styles.d.ts.map +1 -1
- package/dist/components/{donut-group-chart → polar-area-chart}/element/styles.js +9 -27
- 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.map +1 -1
- package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.js +4 -3
- package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.js.map +1 -1
- package/dist/components/polar-area-chart/index.d.ts +1 -1
- package/dist/components/polar-area-chart/index.d.ts.map +1 -1
- package/dist/components/polar-area-chart/index.js +2 -1
- package/dist/components/polar-area-chart/lib/domain.d.ts +8 -0
- package/dist/components/polar-area-chart/lib/domain.d.ts.map +1 -1
- package/dist/components/polar-area-chart/lib/domain.js +20 -0
- package/dist/components/polar-area-chart/lib/domain.js.map +1 -1
- package/dist/components/polar-area-chart/lib/index.d.ts +1 -1
- package/dist/components/polar-area-chart/lib/index.d.ts.map +1 -1
- package/dist/components/polar-area-chart/lib/normalize.d.ts.map +1 -1
- package/dist/components/polar-area-chart/lib/normalize.js +72 -6
- package/dist/components/polar-area-chart/lib/normalize.js.map +1 -1
- package/dist/components/polar-area-chart/lib/types.d.ts +6 -1
- package/dist/components/polar-area-chart/lib/types.d.ts.map +1 -1
- package/dist/components/polar-area-chart/metadata.json.d.ts +1 -1
- package/dist/components/polar-area-chart/metadata.json.js +1 -1
- package/dist/components/polar-area-chart/render/draw.d.ts.map +1 -1
- package/dist/components/polar-area-chart/render/draw.js +2 -2
- package/dist/components/polar-area-chart/render/draw.js.map +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/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 +5 -5
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.d.ts.map +1 -1
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.js +37 -35
- package/dist/components/sankey-chart/element/ui9000-sankey-chart.js.map +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/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/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/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -42
- package/dist/index.js.map +1 -1
- package/dist/lazy/index.d.ts +5 -2
- package/dist/lazy/index.d.ts.map +1 -1
- package/dist/lazy/index.js +32 -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/partial-dependence-chart.d.ts +4 -0
- package/dist/lazy/partial-dependence-chart.d.ts.map +1 -0
- package/dist/lazy/partial-dependence-chart.js +5 -0
- package/dist/lazy/partial-dependence-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/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/chart-helpers.d.ts +6 -6
- package/dist/utils/chart-helpers.d.ts.map +1 -1
- package/dist/utils/chart-helpers.js +31 -15
- package/dist/utils/chart-helpers.js.map +1 -1
- package/dist/utils/format-text.d.ts +5 -0
- package/dist/utils/format-text.d.ts.map +1 -1
- package/dist/utils/format-text.js +7 -0
- package/dist/utils/format-text.js.map +1 -1
- 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 +77 -52
- package/dist/utils/fusedash-visual.d.ts.map +1 -1
- package/dist/utils/fusedash-visual.js +55 -29
- package/dist/utils/fusedash-visual.js.map +1 -1
- package/package.json +48 -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/components/{donut-group-chart → matrix-chart}/index.js.map +0 -0
- /package/dist/components/{donut-group-chart → treemap-chart}/metadata.json.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sources":["../../../../src/components/matrix-chart/lib/normalize.ts"],"sourcesContent":["import {\n firstField,\n isFuseWidgetPayload,\n rowsOf,\n type FuseWidgetLike,\n} from '../../../utils/fuse-widget.js';\nimport { sortAxisDomain } from './domain.js';\nimport type {\n MatrixCell,\n MatrixCellsPayload,\n MatrixInput,\n MatrixModel,\n} from './types.js';\n\n/**\n * Zero-filling a dense grid is quadratic in the two domains. Past this many\n * cells the chat host would be asked to paint more rects than it can afford,\n * so the grid stays sparse (real rows only) instead.\n */\nconst MAX_FILLED_CELLS = 10_000;\n\nconst EMPTY: MatrixModel = {\n cells: [],\n xDomain: [],\n yDomain: [],\n rawValues: [],\n categoryKey: '',\n valueKey: '',\n};\n\ntype Row = Record<string, unknown>;\n\nfunction isCell(d: unknown): d is MatrixCell {\n if (!d || typeof d !== 'object') return false;\n const o = d as Row;\n return 'x' in o && 'y' in o && 'value' in o;\n}\n\nfunction toCell(raw: MatrixCell): MatrixCell | null {\n const x = String(raw.x ?? '');\n const y = String(raw.y ?? '');\n const value = Number(raw.value);\n if (!x || !y) return null;\n return { x, y, value: Number.isFinite(value) ? value : 0 };\n}\n\nfunction uniqueInOrder(values: string[]): string[] {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const v of values) {\n if (v && !seen.has(v)) {\n seen.add(v);\n out.push(v);\n }\n }\n return out;\n}\n\nfunction modelFromCells(\n cells: MatrixCell[],\n xDomain?: string[],\n yDomain?: string[],\n): MatrixModel {\n const cleaned = cells.map(toCell).filter((c): c is MatrixCell => c != null);\n return {\n cells: cleaned,\n xDomain: xDomain?.length ? xDomain : uniqueInOrder(cleaned.map((c) => c.x)),\n yDomain: yDomain?.length ? yDomain : uniqueInOrder(cleaned.map((c) => c.y)),\n rawValues: cleaned.map((c) => c.value),\n categoryKey: '',\n valueKey: '',\n };\n}\n\n/** Mirrors client `getAdditionalKeys` — data keys that are not an axis. */\nfunction additionalKeysOf(rows: Row[], xKey: string, valueKey: string): string[] {\n const reserved = new Set([xKey, valueKey]);\n const keys = new Set<string>();\n for (const row of rows) {\n for (const key of Object.keys(row)) {\n if (!reserved.has(key)) keys.add(key);\n }\n }\n return [...keys];\n}\n\n/** Mirrors client `normalizeValue` — the zero-fill join key. */\nfunction joinValue(value: unknown): string | number {\n if (typeof value === 'number') return value;\n return String(value).replace(/\\s+/g, '');\n}\n\n/** Mirrors client `normalizeLocationValue` — \"State, County\" → \"County\". */\nfunction normalizeLocationValue(value: unknown): string | number {\n if (value == null) return '';\n if (typeof value === 'number') return value;\n if (typeof value !== 'string') return String(value);\n\n const trimmed = value.trim();\n if (trimmed === '') return '';\n\n const numValue = Number(trimmed);\n if (Number.isFinite(numValue)) return numValue;\n\n const commaIndex = trimmed.indexOf(', ');\n if (commaIndex !== -1) return trimmed.substring(commaIndex + 2).trim();\n\n return trimmed;\n}\n\n/**\n * Mirrors client `filledArrayWithZeroData`: every (column × row) combination\n * exists, missing ones carrying a zero so the grid paints a \"no data\" cell.\n */\nfunction fillWithZeroData(\n widget: FuseWidgetLike,\n rows: Row[],\n xKey: string,\n valueKey: string,\n fillKey: string,\n): Row[] {\n const uniqueValues = widget.uniqueValues ?? {};\n\n const passthrough = (): Row[] =>\n rows.map((row) => ({\n ...row,\n ...(fillKey ? { [fillKey]: normalizeLocationValue(row[fillKey]) } : {}),\n }));\n\n const xValues = uniqueValues[xKey] ?? [];\n const yValues = fillKey ? (uniqueValues[fillKey] ?? []) : [];\n const total = xValues.length * yValues.length;\n\n if (!total || total === rows.length || total > MAX_FILLED_CELLS) {\n return passthrough();\n }\n\n const byKey = new Map<string, Row>();\n for (const row of rows) {\n byKey.set(`${joinValue(row[xKey])}-${joinValue(row[fillKey])}`, row);\n }\n\n const filled: Row[] = [];\n for (const xValue of xValues) {\n for (const yValue of yValues) {\n const matched = byKey.get(`${joinValue(xValue)}-${joinValue(yValue)}`);\n filled.push(\n matched ?? { [xKey]: xValue, [fillKey]: yValue, [valueKey]: 0 },\n );\n }\n }\n return filled;\n}\n\n/**\n * Row-category field. `groupBy[0]` wins whenever the rows actually carry it —\n * the client instead takes the first non-axis key in `Object.keys` order,\n * which silently picks up a stray field (`datasetId`, a passthrough column)\n * and leaves every cell outside the `uniqueValues[groupBy]` domain, painting\n * an empty grid. Falling back to a key that has a `uniqueValues` entry keeps\n * the domain and the cells on the same field.\n */\nfunction resolveCategoryKey(\n widget: FuseWidgetLike,\n additionalKeys: string[],\n): string {\n const uniqueValues = widget.uniqueValues ?? {};\n const groupField = firstField(widget.groupBy);\n if (groupField && additionalKeys.includes(groupField)) return groupField;\n return (\n additionalKeys.find((key) => uniqueValues[key]) ?? additionalKeys[0] ?? 'y'\n );\n}\n\n/**\n * Mirrors client `MatrixChart` `processedData`:\n * - columns = `xAxe[0]`, ordered by `sortAxisDomain`\n * - rows = `uniqueValues[categoryKey]`, else the categoryKey values on the rows\n * - value = `row.value ?? row[yAxe[0]]`\n */\nfunction fromFuseWidget(widget: FuseWidgetLike): MatrixModel {\n const rows = rowsOf(widget);\n if (!rows.length) return EMPTY;\n\n const xKey = firstField(widget.xAxe) ?? 'x';\n const valueKey = firstField(widget.yAxe) ?? 'y';\n\n const rawValues = rows.map((row) => {\n const value = Number(row.value ?? row[valueKey]);\n return Number.isFinite(value) ? value : 0;\n });\n\n const additionalKeys = additionalKeysOf(rows, xKey, valueKey);\n const categoryKey = resolveCategoryKey(widget, additionalKeys);\n\n const uniqueValues = widget.uniqueValues ?? {};\n // Domain and cells must read the same field, or every cell misses the scale.\n const yValuesRaw = Array.isArray(uniqueValues[categoryKey])\n ? uniqueValues[categoryKey]\n : rows.map((row) => row[categoryKey]);\n\n const yDomain = sortAxisDomain(\n [...new Set(yValuesRaw)].filter(Boolean) as (string | number)[],\n ).map(String);\n\n const xDomain = sortAxisDomain(\n [...new Set(rows.map((row) => row[xKey]))].filter(Boolean) as (\n | string\n | number\n )[],\n ).map(String);\n\n const filled = fillWithZeroData(widget, rows, xKey, valueKey, categoryKey);\n\n const cells: MatrixCell[] = [];\n for (const row of filled) {\n const x = row[xKey];\n const y = row[categoryKey];\n if (x == null || y == null) continue;\n const value = Number(row.value ?? row[valueKey] ?? 0);\n cells.push({\n x: String(x),\n y: String(y),\n value: Number.isFinite(value) ? value : 0,\n });\n }\n\n return {\n cells,\n xDomain,\n yDomain,\n rawValues,\n categoryKey,\n valueKey,\n axisDetails: widget.axisDetails ?? undefined,\n };\n}\n\n/** Normalize chat cells or a FuseDash WidgetItem into a matrix model. */\nexport function normalizeMatrixData(\n input: MatrixInput | FuseWidgetLike | null | undefined,\n): MatrixModel {\n if (!input) return EMPTY;\n\n if (Array.isArray(input)) {\n if (!input.length || !isCell(input[0])) return EMPTY;\n return modelFromCells(input as MatrixCell[]);\n }\n\n const payload = input as MatrixCellsPayload;\n if (Array.isArray(payload.cells)) {\n return modelFromCells(payload.cells, payload.xDomain, payload.yDomain);\n }\n\n if (isFuseWidgetPayload(input)) {\n return fromFuseWidget(input);\n }\n\n return EMPTY;\n}\n"],"names":[],"mappings":";;AAmBA,MAAM,mBAAmB;AAEzB,MAAM,QAAqB;AAAA,EACzB,OAAO,CAAA;AAAA,EACP,SAAS,CAAA;AAAA,EACT,SAAS,CAAA;AAAA,EACT,WAAW,CAAA;AAAA,EACX,aAAa;AAAA,EACb,UAAU;AACZ;AAIA,SAAS,OAAO,GAA6B;AAC3C,MAAI,CAAC,KAAK,OAAO,MAAM,SAAU,QAAO;AACxC,QAAM,IAAI;AACV,SAAO,OAAO,KAAK,OAAO,KAAK,WAAW;AAC5C;AAEA,SAAS,OAAO,KAAoC;AAClD,QAAM,IAAI,OAAO,IAAI,KAAK,EAAE;AAC5B,QAAM,IAAI,OAAO,IAAI,KAAK,EAAE;AAC5B,QAAM,QAAQ,OAAO,IAAI,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SAAS,iBAAiB,QAAQ,MAAM,MAAM,UAAU,WAAW;AAEzE,QAAM,QAAsB,CAAA;AAC5B,aAAW,OAAO,QAAQ;AACxB,UAAM,IAAI,IAAI,IAAI;AAClB,UAAM,IAAI,IAAI,WAAW;AACzB,QAAI,KAAK,QAAQ,KAAK,KAAM;AAC5B,UAAM,QAAQ,OAAO,IAAI,SAAS,IAAI,QAAQ,KAAK,CAAC;AACpD,UAAM,KAAK;AAAA,MACT,GAAG,OAAO,CAAC;AAAA,MACX,GAAG,OAAO,CAAC;AAAA,MACX,OAAO,OAAO,SAAS,KAAK,IAAI,QAAQ;AAAA,IAAA,CACzC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,OAAO,eAAe;AAAA,EAAA;AAEvC;AAGO,SAAS,oBACd,OACa;AACb,MAAI,CAAC,MAAO,QAAO;AAEnB,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,QAAI,CAAC,MAAM,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,EAAG,QAAO;AAC/C,WAAO,eAAe,KAAqB;AAAA,EAC7C;AAEA,QAAM,UAAU;AAChB,MAAI,MAAM,QAAQ,QAAQ,KAAK,GAAG;AAChC,WAAO,eAAe,QAAQ,OAAO,QAAQ,SAAS,QAAQ,OAAO;AAAA,EACvE;AAEA,MAAI,oBAAoB,KAAK,GAAG;AAC9B,WAAO,eAAe,KAAK;AAAA,EAC7B;AAEA,SAAO;AACT;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AxisDetail } from '../../../utils/axis-units.js';
|
|
2
|
+
export interface MatrixCell {
|
|
3
|
+
/** Column category (client `xAxe`) */
|
|
4
|
+
x: string;
|
|
5
|
+
/** Row category (client `groupBy` / first additional data key) */
|
|
6
|
+
y: string;
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
export interface MatrixModel {
|
|
10
|
+
/** Zero-filled grid — mirrors client `filledArrayWithZeroData` */
|
|
11
|
+
cells: MatrixCell[];
|
|
12
|
+
xDomain: string[];
|
|
13
|
+
yDomain: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Values as they came in, before zero-filling. Client `MatrixChart` builds
|
|
16
|
+
* its color ranges from these, so filler cells stay "no data".
|
|
17
|
+
*/
|
|
18
|
+
rawValues: number[];
|
|
19
|
+
/** Row-category field name — the tooltip's first label. */
|
|
20
|
+
categoryKey: string;
|
|
21
|
+
/** Measure field name (client `yAxe[0]`) — picks the value's unit. */
|
|
22
|
+
valueKey: string;
|
|
23
|
+
/** Per-field labels and measure units from the widget. */
|
|
24
|
+
axisDetails?: Record<string, AxisDetail>;
|
|
25
|
+
}
|
|
26
|
+
export interface MatrixCellsPayload {
|
|
27
|
+
cells: MatrixCell[];
|
|
28
|
+
xDomain?: string[];
|
|
29
|
+
yDomain?: string[];
|
|
30
|
+
}
|
|
31
|
+
/** Chat cells or a FuseDash WidgetItem (`data` + `xAxe`/`yAxe`/`groupBy`/`uniqueValues`). */
|
|
32
|
+
export type MatrixInput = MatrixCell[] | MatrixCellsPayload | Record<string, unknown>;
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,CAAC,EAAE,MAAM,CAAC;IACV,kEAAkE;IAClE,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf;AAED,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,6FAA6F;AAC7F,MAAM,MAAM,WAAW,GACnB,UAAU,EAAE,GACZ,kBAAkB,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"id": "matrix-chart",
|
|
3
|
+
"tag": "ui9000-matrix-chart",
|
|
4
|
+
"title": "Matrix Chart",
|
|
5
|
+
"description": "Chat-optimized matrix / heatmap rewritten in D3 (Visx → D3). Sequential-palette cell grid with a pinned column header, no Redux.",
|
|
6
|
+
"chartTypeKeys": ["matrixChart"],
|
|
7
|
+
"source": "client/libs/shared/components/src/Widgets/MatrixChart/",
|
|
8
|
+
"stack": "d3",
|
|
9
|
+
"lazyImport": "@fusedashlabs/widgets/lazy/matrix-chart",
|
|
10
|
+
"entry": "@fusedashlabs/widgets/matrix-chart",
|
|
11
|
+
"usageConditions": {
|
|
12
|
+
"host": "mcp-chat",
|
|
13
|
+
"notFor": "fusedash-editor",
|
|
14
|
+
"mapsExcluded": true
|
|
15
|
+
},
|
|
16
|
+
"allowedActions": ["hover", "resize", "scroll"],
|
|
17
|
+
"propsSchema": {
|
|
18
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
19
|
+
"type": "object",
|
|
20
|
+
"properties": {
|
|
21
|
+
"data": {
|
|
22
|
+
"oneOf": [
|
|
23
|
+
{
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"required": ["x", "y", "value"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"x": { "type": "string" },
|
|
30
|
+
"y": { "type": "string" },
|
|
31
|
+
"value": { "type": "number" }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "object",
|
|
37
|
+
"required": ["cells"],
|
|
38
|
+
"properties": {
|
|
39
|
+
"cells": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"required": ["x", "y", "value"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"x": { "type": "string" },
|
|
46
|
+
"y": { "type": "string" },
|
|
47
|
+
"value": { "type": "number" }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"xDomain": { "type": "array", "items": { "type": "string" } },
|
|
52
|
+
"yDomain": { "type": "array", "items": { "type": "string" } }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": ["data"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"data": { "type": "array", "items": { "type": "object" } },
|
|
60
|
+
"xAxe": {
|
|
61
|
+
"oneOf": [
|
|
62
|
+
{ "type": "string" },
|
|
63
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"yAxe": {
|
|
67
|
+
"oneOf": [
|
|
68
|
+
{ "type": "string" },
|
|
69
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"groupBy": {
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{ "type": "string" },
|
|
75
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"uniqueValues": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": { "type": "string" }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"axisDetails": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"description": "Per-field label and measure unit, used for tooltip rows.",
|
|
88
|
+
"additionalProperties": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"properties": {
|
|
91
|
+
"label": { "type": "string" },
|
|
92
|
+
"measure_unit_type": { "type": "string" },
|
|
93
|
+
"measure_unit": { "type": "string" },
|
|
94
|
+
"measure_unit_symbol": { "type": "string" }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"showLegend": { "type": "boolean", "default": true },
|
|
103
|
+
"showTooltip": { "type": "boolean", "default": true }
|
|
104
|
+
},
|
|
105
|
+
"required": ["data"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
;
|
|
109
|
+
|
|
110
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const id = "matrix-chart";
|
|
2
|
+
const tag = "ui9000-matrix-chart";
|
|
3
|
+
const title = "Matrix Chart";
|
|
4
|
+
const description = "Chat-optimized matrix / heatmap rewritten in D3 (Visx → D3). Sequential-palette cell grid with a pinned column header, no Redux.";
|
|
5
|
+
const chartTypeKeys = ["matrixChart"];
|
|
6
|
+
const source = "client/libs/shared/components/src/Widgets/MatrixChart/";
|
|
7
|
+
const stack = "d3";
|
|
8
|
+
const lazyImport = "@fusedashlabs/widgets/lazy/matrix-chart";
|
|
9
|
+
const entry = "@fusedashlabs/widgets/matrix-chart";
|
|
10
|
+
const usageConditions = { "host": "mcp-chat", "notFor": "fusedash-editor", "mapsExcluded": true };
|
|
11
|
+
const allowedActions = ["hover", "resize", "scroll"];
|
|
12
|
+
const propsSchema = { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "data": { "oneOf": [{ "type": "array", "items": { "type": "object", "required": ["x", "y", "value"], "properties": { "x": { "type": "string" }, "y": { "type": "string" }, "value": { "type": "number" } } } }, { "type": "object", "required": ["cells"], "properties": { "cells": { "type": "array", "items": { "type": "object", "required": ["x", "y", "value"], "properties": { "x": { "type": "string" }, "y": { "type": "string" }, "value": { "type": "number" } } } }, "xDomain": { "type": "array", "items": { "type": "string" } }, "yDomain": { "type": "array", "items": { "type": "string" } } } }, { "type": "object", "required": ["data"], "properties": { "data": { "type": "array", "items": { "type": "object" } }, "xAxe": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "yAxe": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "groupBy": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "uniqueValues": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "axisDetails": { "type": "object", "description": "Per-field label and measure unit, used for tooltip rows.", "additionalProperties": { "type": "object", "properties": { "label": { "type": "string" }, "measure_unit_type": { "type": "string" }, "measure_unit": { "type": "string" }, "measure_unit_symbol": { "type": "string" } } } } } }] }, "showLegend": { "type": "boolean", "default": true }, "showTooltip": { "type": "boolean", "default": true } }, "required": ["data"] };
|
|
13
|
+
const matrixMeta = {
|
|
14
|
+
id,
|
|
15
|
+
tag,
|
|
16
|
+
title,
|
|
17
|
+
description,
|
|
18
|
+
chartTypeKeys,
|
|
19
|
+
source,
|
|
20
|
+
stack,
|
|
21
|
+
lazyImport,
|
|
22
|
+
entry,
|
|
23
|
+
usageConditions,
|
|
24
|
+
allowedActions,
|
|
25
|
+
propsSchema
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
allowedActions,
|
|
29
|
+
chartTypeKeys,
|
|
30
|
+
matrixMeta as default,
|
|
31
|
+
description,
|
|
32
|
+
entry,
|
|
33
|
+
id,
|
|
34
|
+
lazyImport,
|
|
35
|
+
propsSchema,
|
|
36
|
+
source,
|
|
37
|
+
stack,
|
|
38
|
+
tag,
|
|
39
|
+
title,
|
|
40
|
+
usageConditions
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=metadata.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { WidgetTheme } from '../../../types/index.js';
|
|
2
|
+
import { AxisLabelTooltipHandlers } from '../../../utils/axis-labels.js';
|
|
3
|
+
import { SequentialColorRange } from '../../../utils/fuse-palette.js';
|
|
4
|
+
import { MatrixCell, MatrixModel } from '../lib/index.js';
|
|
5
|
+
export interface MatrixLayout {
|
|
6
|
+
/** Rows > `FD.matrixSeparateAxisRowLimit` → header pinned, rows scroll. */
|
|
7
|
+
separateTopAxis: boolean;
|
|
8
|
+
/** Height reserved for the column header. */
|
|
9
|
+
topAxisHeight: number;
|
|
10
|
+
/** Height of the row band stack alone. */
|
|
11
|
+
rowsHeight: number;
|
|
12
|
+
/** Full drawn height — taller than the viewport when the rows overflow. */
|
|
13
|
+
contentHeight: number;
|
|
14
|
+
needsScroll: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface RenderMatrixOptions extends AxisLabelTooltipHandlers {
|
|
17
|
+
model: MatrixModel;
|
|
18
|
+
width: number;
|
|
19
|
+
/** Height of the scroll viewport the plot lives in. */
|
|
20
|
+
height: number;
|
|
21
|
+
/**
|
|
22
|
+
* Stable outer height the pinned header's budget is measured against —
|
|
23
|
+
* the body box that holds both the header and the scroll area.
|
|
24
|
+
*
|
|
25
|
+
* It must NOT be the scroll viewport (`height`): the header sits above the
|
|
26
|
+
* scroll area, so sizing the header from the viewport makes the header
|
|
27
|
+
* resize itself on every redraw and settle into a visible up/down cycle.
|
|
28
|
+
*/
|
|
29
|
+
bodyHeight?: number;
|
|
30
|
+
margin?: {
|
|
31
|
+
top: number;
|
|
32
|
+
right: number;
|
|
33
|
+
bottom: number;
|
|
34
|
+
left: number;
|
|
35
|
+
};
|
|
36
|
+
theme: WidgetTheme;
|
|
37
|
+
themeMode?: 'light' | 'dark';
|
|
38
|
+
/** Pinned header host — only used when the layout separates the top axis. */
|
|
39
|
+
topAxisContainer?: HTMLElement | null;
|
|
40
|
+
onCellHover?: (payload: {
|
|
41
|
+
cell: MatrixCell;
|
|
42
|
+
event: MouseEvent;
|
|
43
|
+
}) => void;
|
|
44
|
+
onCellLeave?: () => void;
|
|
45
|
+
}
|
|
46
|
+
export declare function matrixColorRanges(model: MatrixModel): SequentialColorRange[];
|
|
47
|
+
/** Mirrors client `calculateHorizontalLabelAngle`. */
|
|
48
|
+
export declare function horizontalLabelAngle(labelWidth: number, availableWidth: number, labelHeight: number): number;
|
|
49
|
+
/**
|
|
50
|
+
* Client `MatrixChart` frame: `topAxisHeight` reserves font + tick + spacing,
|
|
51
|
+
* rows never fall under `minCellHeight`, and the plot grows past the viewport
|
|
52
|
+
* instead of squeezing.
|
|
53
|
+
*/
|
|
54
|
+
export declare function matrixLayout(model: MatrixModel, viewportHeight: number, margin: {
|
|
55
|
+
top: number;
|
|
56
|
+
bottom: number;
|
|
57
|
+
}): MatrixLayout;
|
|
58
|
+
/**
|
|
59
|
+
* FuseDash MatrixChart — a sequential-palette grid with a pinned column header
|
|
60
|
+
* once the rows overflow. Plot-local coordinates translated by the margin.
|
|
61
|
+
*/
|
|
62
|
+
export declare function renderMatrixChart(container: HTMLElement, options: RenderMatrixOptions): void;
|
|
63
|
+
//# sourceMappingURL=draw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/render/draw.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,+BA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AE,MAAM,GAClB,MAAM,CAYR;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,EAClB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtC,YAAY,CAuBd;AAsJD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,mBAAmB,GAC3B,IAAI,CAgJN"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { scaleBand } from "d3-scale";
|
|
2
|
+
import { select } from "d3-selection";
|
|
3
|
+
import { decorateManualAxisLabel } from "../../../utils/axis-labels.js";
|
|
4
|
+
import { generateSequentialColorRanges, sequentialColorForValue, SEQUENTIAL_1 } from "../../../utils/fuse-palette.js";
|
|
5
|
+
import { FD } from "../../../utils/fusedash-visual.js";
|
|
6
|
+
const NO_DATA_PATTERN_ID = "ui9000-matrix-no-data";
|
|
7
|
+
const LABEL_ROTATION_COMPENSATION = 4;
|
|
8
|
+
const TOP_AXIS_MAX_HEIGHT = 160;
|
|
9
|
+
const TOP_AXIS_MAX_HEIGHT_RATIO = 0.35;
|
|
10
|
+
function matrixColorRanges(model) {
|
|
11
|
+
return generateSequentialColorRanges(
|
|
12
|
+
model.rawValues.filter((v) => Number.isFinite(v)),
|
|
13
|
+
SEQUENTIAL_1
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function cellFill(value, ranges) {
|
|
17
|
+
if (value < 0) return FD.matrixNegativeFill;
|
|
18
|
+
if (!value) return `url(#${NO_DATA_PATTERN_ID})`;
|
|
19
|
+
return sequentialColorForValue(value, ranges) ?? `url(#${NO_DATA_PATTERN_ID})`;
|
|
20
|
+
}
|
|
21
|
+
function horizontalLabelAngle(labelWidth, availableWidth, labelHeight) {
|
|
22
|
+
if (availableWidth <= 0 || labelWidth <= 0 || labelWidth <= availableWidth) {
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
if (labelHeight >= availableWidth) return -90;
|
|
26
|
+
const ratio = Math.max(-1, Math.min(1, availableWidth * 0.8 / labelWidth));
|
|
27
|
+
const angle = Math.acos(ratio) * (180 / Math.PI) * -1;
|
|
28
|
+
const rounded = Math.ceil(angle / 5) * 5;
|
|
29
|
+
if (rounded > 0) return 0;
|
|
30
|
+
if (rounded < -90) return -90;
|
|
31
|
+
return rounded;
|
|
32
|
+
}
|
|
33
|
+
function matrixLayout(model, viewportHeight, margin) {
|
|
34
|
+
const topAxisHeight = Math.max(
|
|
35
|
+
margin.top,
|
|
36
|
+
FD.axisLabelSize + FD.matrixTopTickLength + FD.matrixTopLabelsSpacing + 10
|
|
37
|
+
);
|
|
38
|
+
const separateTopAxis = model.yDomain.length > FD.matrixSeparateAxisRowLimit;
|
|
39
|
+
const chrome = separateTopAxis ? 0 : topAxisHeight + margin.bottom + 10;
|
|
40
|
+
const rowsCount = model.yDomain.length;
|
|
41
|
+
const rowsHeight = Math.max(viewportHeight - chrome, 0);
|
|
42
|
+
const perRow = rowsCount ? Math.max(Math.floor(rowsHeight / rowsCount), FD.matrixMinCellHeight) : 0;
|
|
43
|
+
const stack = perRow * rowsCount;
|
|
44
|
+
const contentHeight = stack + chrome;
|
|
45
|
+
return {
|
|
46
|
+
separateTopAxis,
|
|
47
|
+
topAxisHeight,
|
|
48
|
+
rowsHeight: stack,
|
|
49
|
+
contentHeight,
|
|
50
|
+
needsScroll: contentHeight > viewportHeight
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function appendNoDataPattern(defs, themeMode) {
|
|
54
|
+
const pattern = defs.append("pattern").attr("id", NO_DATA_PATTERN_ID).attr("width", 5).attr("height", 5).attr("patternUnits", "userSpaceOnUse").attr("patternTransform", "rotate(45)");
|
|
55
|
+
pattern.append("rect").attr("width", 5).attr("height", 5).attr(
|
|
56
|
+
"fill",
|
|
57
|
+
themeMode === "dark" ? FD.matrixNoDataDark : FD.matrixNoDataLight
|
|
58
|
+
);
|
|
59
|
+
pattern.append("rect").attr("width", 2).attr("height", 5).attr(
|
|
60
|
+
"fill",
|
|
61
|
+
themeMode === "dark" ? FD.matrixNoDataStripeDark : FD.matrixNoDataStripeLight
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function renderTopAxis(group, xDomain, xScale, axisWidth, maxExtent, axisLabels) {
|
|
65
|
+
const available = axisWidth / Math.max(xDomain.length, 1);
|
|
66
|
+
const baselineY = -8;
|
|
67
|
+
const labels = xDomain.map((category) => {
|
|
68
|
+
const band = xScale(category);
|
|
69
|
+
const text = group.append("text").attr("y", baselineY).attr("font-size", FD.axisLabelSize).attr("fill", FD.axisLabelFill).attr("text-anchor", "middle");
|
|
70
|
+
decorateManualAxisLabel(text, category, {
|
|
71
|
+
maxLength: FD.matrixTopLabelMaxChars,
|
|
72
|
+
...axisLabels
|
|
73
|
+
});
|
|
74
|
+
return { text, full: category, x: (band ?? 0) + xScale.bandwidth() / 2 };
|
|
75
|
+
});
|
|
76
|
+
const widthOf = (text) => {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
return ((_b = (_a = text.node()) == null ? void 0 : _a.getComputedTextLength) == null ? void 0 : _b.call(_a)) || text.text().length * FD.axisLabelSize * 0.55;
|
|
79
|
+
};
|
|
80
|
+
const longest = labels.reduce(
|
|
81
|
+
(max, { text }) => Math.max(max, widthOf(text)),
|
|
82
|
+
0
|
|
83
|
+
);
|
|
84
|
+
const angle = horizontalLabelAngle(
|
|
85
|
+
longest + FD.matrixTopLabelsSpacing,
|
|
86
|
+
available,
|
|
87
|
+
FD.axisLabelSize
|
|
88
|
+
);
|
|
89
|
+
if (angle === 0) {
|
|
90
|
+
for (const { text, x } of labels) text.attr("x", x);
|
|
91
|
+
return FD.axisLabelSize + FD.matrixTopTickLength;
|
|
92
|
+
}
|
|
93
|
+
const radians = Math.PI / 180 * angle;
|
|
94
|
+
const sin = Math.abs(Math.sin(radians));
|
|
95
|
+
const chrome = FD.matrixTopTickLength + 4;
|
|
96
|
+
if (sin > 0 && sin * longest + chrome > maxExtent) {
|
|
97
|
+
const slotWidth = Math.max((maxExtent - chrome) / sin, FD.axisLabelSize);
|
|
98
|
+
for (const { text, full } of labels) {
|
|
99
|
+
decorateManualAxisLabel(text, full, {
|
|
100
|
+
maxLength: FD.matrixTopLabelMaxChars,
|
|
101
|
+
slotWidth,
|
|
102
|
+
...axisLabels
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const shift = FD.axisLabelSize * 0.5 - LABEL_ROTATION_COMPENSATION;
|
|
107
|
+
const groupDx = Math.cos(radians) ** 2 * shift;
|
|
108
|
+
const textDx = Math.sin(radians) ** 2 * shift;
|
|
109
|
+
let extent = 0;
|
|
110
|
+
for (const { text, x } of labels) {
|
|
111
|
+
text.attr("x", 0).attr("dx", textDx).attr("text-anchor", "start").attr(
|
|
112
|
+
"transform",
|
|
113
|
+
`translate(${x - available / 2 + groupDx},${baselineY + Math.abs(angle) * 0.1}) rotate(${angle})`
|
|
114
|
+
).attr("y", 0);
|
|
115
|
+
extent = Math.max(extent, widthOf(text));
|
|
116
|
+
}
|
|
117
|
+
return sin * extent + chrome;
|
|
118
|
+
}
|
|
119
|
+
function renderYAxis(group, yDomain, yScale, gutter, axisLabels) {
|
|
120
|
+
for (const category of yDomain) {
|
|
121
|
+
const band = yScale(category);
|
|
122
|
+
if (band == null) continue;
|
|
123
|
+
const text = group.append("text").attr("x", -gutter).attr("y", band + yScale.bandwidth() / 2 + 3).attr("font-size", FD.axisLabelSize).attr("fill", FD.axisLabelFill).attr("text-anchor", "start").style("dominant-baseline", "middle");
|
|
124
|
+
decorateManualAxisLabel(text, category, {
|
|
125
|
+
maxLength: FD.matrixYLabelMaxChars,
|
|
126
|
+
...axisLabels
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function renderMatrixChart(container, options) {
|
|
131
|
+
const {
|
|
132
|
+
model,
|
|
133
|
+
width,
|
|
134
|
+
height,
|
|
135
|
+
bodyHeight = height,
|
|
136
|
+
margin = { ...FD.matrixMargin },
|
|
137
|
+
theme,
|
|
138
|
+
themeMode = "light",
|
|
139
|
+
topAxisContainer,
|
|
140
|
+
onCellHover,
|
|
141
|
+
onCellLeave,
|
|
142
|
+
onAxisLabelHover,
|
|
143
|
+
onAxisLabelLeave
|
|
144
|
+
} = options;
|
|
145
|
+
const axisLabels = {
|
|
146
|
+
onAxisLabelHover,
|
|
147
|
+
onAxisLabelLeave
|
|
148
|
+
};
|
|
149
|
+
container.replaceChildren();
|
|
150
|
+
topAxisContainer == null ? void 0 : topAxisContainer.replaceChildren();
|
|
151
|
+
if (!model.cells.length || width <= 0 || height <= 0) return;
|
|
152
|
+
const layout = matrixLayout(model, height, margin);
|
|
153
|
+
const xMax = width - margin.left - margin.right;
|
|
154
|
+
const plotTop = layout.separateTopAxis ? 0 : layout.topAxisHeight;
|
|
155
|
+
if (xMax < 8 || layout.rowsHeight < 8) return;
|
|
156
|
+
const xScale = scaleBand().domain(model.xDomain).range([0, xMax]).paddingInner(0).paddingOuter(0);
|
|
157
|
+
const yScale = scaleBand().domain(model.yDomain).range([0, layout.rowsHeight]).paddingInner(0).paddingOuter(0);
|
|
158
|
+
const svgHeight = Math.max(layout.contentHeight, height);
|
|
159
|
+
const svg = select(container).append("svg").attr("width", width).attr("height", svgHeight).attr("role", "img").attr("aria-label", "Matrix chart").style("display", "block").style("font-family", theme.fontFamily);
|
|
160
|
+
appendNoDataPattern(svg.append("defs"), themeMode);
|
|
161
|
+
const plot = svg.append("g").attr("class", "plot").attr("transform", `translate(${margin.left},${plotTop})`);
|
|
162
|
+
const ranges = matrixColorRanges(model);
|
|
163
|
+
const cellPad = FD.matrixCellPadding;
|
|
164
|
+
const cellWidth = Math.max(xScale.bandwidth() - cellPad, 1);
|
|
165
|
+
const cellHeight = Math.max(yScale.bandwidth() - cellPad, 1);
|
|
166
|
+
const layer = plot.append("g").attr("class", "cells");
|
|
167
|
+
for (const cell of model.cells) {
|
|
168
|
+
const bx = xScale(cell.x);
|
|
169
|
+
const by = yScale(cell.y);
|
|
170
|
+
if (bx == null || by == null) continue;
|
|
171
|
+
const rect = layer.append("rect").attr("class", "matrix-cell").attr("x", bx).attr("y", by + cellPad / 2).attr("width", cellWidth).attr("height", cellHeight).attr("rx", FD.matrixCellRadius).attr("fill", cellFill(cell.value, ranges));
|
|
172
|
+
if (onCellHover) {
|
|
173
|
+
rect.on("mouseenter", (event) => onCellHover({ cell, event })).on("mousemove", (event) => onCellHover({ cell, event })).on("mouseleave", () => onCellLeave == null ? void 0 : onCellLeave());
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
renderYAxis(
|
|
177
|
+
plot.append("g").attr("class", "y-axis"),
|
|
178
|
+
model.yDomain,
|
|
179
|
+
yScale,
|
|
180
|
+
margin.left,
|
|
181
|
+
axisLabels
|
|
182
|
+
);
|
|
183
|
+
if (!layout.separateTopAxis) {
|
|
184
|
+
renderTopAxis(
|
|
185
|
+
plot.append("g").attr("class", "x-axis"),
|
|
186
|
+
model.xDomain,
|
|
187
|
+
xScale,
|
|
188
|
+
xMax,
|
|
189
|
+
layout.topAxisHeight,
|
|
190
|
+
axisLabels
|
|
191
|
+
);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (!topAxisContainer) return;
|
|
195
|
+
const axisSvg = select(topAxisContainer).append("svg").attr("width", width).attr("height", layout.topAxisHeight).style("display", "block").style("font-family", theme.fontFamily);
|
|
196
|
+
const axisGroup = axisSvg.append("g").attr("transform", `translate(${margin.left},${layout.topAxisHeight})`);
|
|
197
|
+
const maxExtent = Math.max(
|
|
198
|
+
layout.topAxisHeight,
|
|
199
|
+
Math.min(
|
|
200
|
+
TOP_AXIS_MAX_HEIGHT,
|
|
201
|
+
Math.round(bodyHeight * TOP_AXIS_MAX_HEIGHT_RATIO)
|
|
202
|
+
)
|
|
203
|
+
);
|
|
204
|
+
const needed = renderTopAxis(
|
|
205
|
+
axisGroup,
|
|
206
|
+
model.xDomain,
|
|
207
|
+
xScale,
|
|
208
|
+
width,
|
|
209
|
+
maxExtent,
|
|
210
|
+
axisLabels
|
|
211
|
+
);
|
|
212
|
+
const axisHeight = Math.min(
|
|
213
|
+
Math.max(layout.topAxisHeight, Math.ceil(needed)),
|
|
214
|
+
maxExtent
|
|
215
|
+
);
|
|
216
|
+
axisSvg.attr("height", axisHeight);
|
|
217
|
+
axisGroup.attr("transform", `translate(${margin.left},${axisHeight})`);
|
|
218
|
+
}
|
|
219
|
+
export {
|
|
220
|
+
horizontalLabelAngle,
|
|
221
|
+
matrixColorRanges,
|
|
222
|
+
matrixLayout,
|
|
223
|
+
renderMatrixChart
|
|
224
|
+
};
|
|
225
|
+
//# sourceMappingURL=draw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw.js","sources":["../../../../src/components/matrix-chart/render/draw.ts"],"sourcesContent":["import { scaleBand } from 'd3-scale';\nimport { select, type Selection } from 'd3-selection';\n\nimport type { WidgetTheme } from '../../../types/index.js';\nimport {\n decorateManualAxisLabel,\n type AxisLabelTooltipHandlers,\n} from '../../../utils/axis-labels.js';\nimport {\n generateSequentialColorRanges,\n sequentialColorForValue,\n SEQUENTIAL_1,\n type SequentialColorRange,\n} from '../../../utils/fuse-palette.js';\nimport { FD } from '../../../utils/fusedash-visual.js';\nimport type { MatrixCell, MatrixModel } from '../lib/index.js';\n\nconst NO_DATA_PATTERN_ID = 'ui9000-matrix-no-data';\n\n/** Client `DynamicAxisLabel` background-rect compensation. */\nconst LABEL_ROTATION_COMPENSATION = 4;\n\n/** Rotated header labels may grow the pinned axis, but never past this. */\nconst TOP_AXIS_MAX_HEIGHT = 160;\n/** …nor past this share of the widget, however long the categories are. */\nconst TOP_AXIS_MAX_HEIGHT_RATIO = 0.35;\n\nexport interface MatrixLayout {\n /** Rows > `FD.matrixSeparateAxisRowLimit` → header pinned, rows scroll. */\n separateTopAxis: boolean;\n /** Height reserved for the column header. */\n topAxisHeight: number;\n /** Height of the row band stack alone. */\n rowsHeight: number;\n /** Full drawn height — taller than the viewport when the rows overflow. */\n contentHeight: number;\n needsScroll: boolean;\n}\n\nexport interface RenderMatrixOptions extends AxisLabelTooltipHandlers {\n model: MatrixModel;\n width: number;\n /** Height of the scroll viewport the plot lives in. */\n height: number;\n /**\n * Stable outer height the pinned header's budget is measured against —\n * the body box that holds both the header and the scroll area.\n *\n * It must NOT be the scroll viewport (`height`): the header sits above the\n * scroll area, so sizing the header from the viewport makes the header\n * resize itself on every redraw and settle into a visible up/down cycle.\n */\n bodyHeight?: number;\n margin?: { top: number; right: number; bottom: number; left: number };\n theme: WidgetTheme;\n themeMode?: 'light' | 'dark';\n /** Pinned header host — only used when the layout separates the top axis. */\n topAxisContainer?: HTMLElement | null;\n onCellHover?: (payload: { cell: MatrixCell; event: MouseEvent }) => void;\n onCellLeave?: () => void;\n}\n\nexport function matrixColorRanges(model: MatrixModel): SequentialColorRange[] {\n return generateSequentialColorRanges(\n model.rawValues.filter((v) => Number.isFinite(v)),\n SEQUENTIAL_1,\n );\n}\n\n/** Client `getColor` + the negative / no-data special cases. */\nfunction cellFill(value: number, ranges: SequentialColorRange[]): string {\n if (value < 0) return FD.matrixNegativeFill;\n if (!value) return `url(#${NO_DATA_PATTERN_ID})`;\n return sequentialColorForValue(value, ranges) ?? `url(#${NO_DATA_PATTERN_ID})`;\n}\n\n/** Mirrors client `calculateHorizontalLabelAngle`. */\nexport function horizontalLabelAngle(\n labelWidth: number,\n availableWidth: number,\n labelHeight: number,\n): number {\n if (availableWidth <= 0 || labelWidth <= 0 || labelWidth <= availableWidth) {\n return 0;\n }\n if (labelHeight >= availableWidth) return -90;\n\n const ratio = Math.max(-1, Math.min(1, (availableWidth * 0.8) / labelWidth));\n const angle = Math.acos(ratio) * (180 / Math.PI) * -1;\n const rounded = Math.ceil(angle / 5) * 5;\n if (rounded > 0) return 0;\n if (rounded < -90) return -90;\n return rounded;\n}\n\n/**\n * Client `MatrixChart` frame: `topAxisHeight` reserves font + tick + spacing,\n * rows never fall under `minCellHeight`, and the plot grows past the viewport\n * instead of squeezing.\n */\nexport function matrixLayout(\n model: MatrixModel,\n viewportHeight: number,\n margin: { top: number; bottom: number },\n): MatrixLayout {\n const topAxisHeight = Math.max(\n margin.top,\n FD.axisLabelSize + FD.matrixTopTickLength + FD.matrixTopLabelsSpacing + 10,\n );\n const separateTopAxis = model.yDomain.length > FD.matrixSeparateAxisRowLimit;\n const chrome = separateTopAxis ? 0 : topAxisHeight + margin.bottom + 10;\n\n const rowsCount = model.yDomain.length;\n const rowsHeight = Math.max(viewportHeight - chrome, 0);\n const perRow = rowsCount\n ? Math.max(Math.floor(rowsHeight / rowsCount), FD.matrixMinCellHeight)\n : 0;\n\n const stack = perRow * rowsCount;\n const contentHeight = stack + chrome;\n return {\n separateTopAxis,\n topAxisHeight,\n rowsHeight: stack,\n contentHeight,\n needsScroll: contentHeight > viewportHeight,\n };\n}\n\nfunction appendNoDataPattern(\n defs: Selection<SVGDefsElement, unknown, null, undefined>,\n themeMode: 'light' | 'dark',\n): void {\n const pattern = defs\n .append('pattern')\n .attr('id', NO_DATA_PATTERN_ID)\n .attr('width', 5)\n .attr('height', 5)\n .attr('patternUnits', 'userSpaceOnUse')\n .attr('patternTransform', 'rotate(45)');\n pattern\n .append('rect')\n .attr('width', 5)\n .attr('height', 5)\n .attr(\n 'fill',\n themeMode === 'dark' ? FD.matrixNoDataDark : FD.matrixNoDataLight,\n );\n pattern\n .append('rect')\n .attr('width', 2)\n .attr('height', 5)\n .attr(\n 'fill',\n themeMode === 'dark'\n ? FD.matrixNoDataStripeDark\n : FD.matrixNoDataStripeLight,\n );\n}\n\n/**\n * Column header. Labels are measured, then rotated the way client\n * `useVisxDynamicAxisLabel` does once they stop fitting their band.\n */\nfunction renderTopAxis(\n group: Selection<SVGGElement, unknown, null, undefined>,\n xDomain: string[],\n xScale: ReturnType<typeof scaleBand<string>>,\n axisWidth: number,\n maxExtent: number,\n axisLabels: AxisLabelTooltipHandlers,\n): number {\n const available = axisWidth / Math.max(xDomain.length, 1);\n const baselineY = -FD.matrixTopTickLength;\n\n const labels = xDomain.map((category) => {\n const band = xScale(category);\n const text = group\n .append('text')\n .attr('y', baselineY)\n .attr('font-size', FD.axisLabelSize)\n .attr('fill', FD.axisLabelFill)\n .attr('text-anchor', 'middle');\n decorateManualAxisLabel(text, category, {\n maxLength: FD.matrixTopLabelMaxChars,\n ...axisLabels,\n });\n return { text, full: category, x: (band ?? 0) + xScale.bandwidth() / 2 };\n });\n\n // jsdom has no layout engine — fall back to the FuseDash char estimate.\n const widthOf = (text: (typeof labels)[number]['text']): number =>\n text.node()?.getComputedTextLength?.() ||\n text.text().length * FD.axisLabelSize * 0.55;\n\n const longest = labels.reduce(\n (max, { text }) => Math.max(max, widthOf(text)),\n 0,\n );\n\n const angle = horizontalLabelAngle(\n longest + FD.matrixTopLabelsSpacing,\n available,\n FD.axisLabelSize,\n );\n\n if (angle === 0) {\n for (const { text, x } of labels) text.attr('x', x);\n return FD.axisLabelSize + FD.matrixTopTickLength;\n }\n\n const radians = (Math.PI / 180) * angle;\n const sin = Math.abs(Math.sin(radians));\n const chrome = FD.matrixTopTickLength + 4;\n\n // Rotated labels grow the header vertically — shorten them to the space the\n // header is allowed to take rather than letting them clip against its edge.\n if (sin > 0 && sin * longest + chrome > maxExtent) {\n const slotWidth = Math.max((maxExtent - chrome) / sin, FD.axisLabelSize);\n for (const { text, full } of labels) {\n decorateManualAxisLabel(text, full, {\n maxLength: FD.matrixTopLabelMaxChars,\n slotWidth,\n ...axisLabels,\n });\n }\n }\n\n const shift = FD.axisLabelSize * 0.5 - LABEL_ROTATION_COMPENSATION;\n const groupDx = Math.cos(radians) ** 2 * shift;\n const textDx = Math.sin(radians) ** 2 * shift;\n\n let extent = 0;\n for (const { text, x } of labels) {\n text\n .attr('x', 0)\n .attr('dx', textDx)\n .attr('text-anchor', 'start')\n .attr(\n 'transform',\n `translate(${x - available / 2 + groupDx},${\n baselineY + Math.abs(angle) * 0.1\n }) rotate(${angle})`,\n )\n .attr('y', 0);\n extent = Math.max(extent, widthOf(text));\n }\n\n return sin * extent + chrome;\n}\n\n/** Client AxisLeft: labels sit in the left gutter, truncated to 9 characters. */\nfunction renderYAxis(\n group: Selection<SVGGElement, unknown, null, undefined>,\n yDomain: string[],\n yScale: ReturnType<typeof scaleBand<string>>,\n gutter: number,\n axisLabels: AxisLabelTooltipHandlers,\n): void {\n for (const category of yDomain) {\n const band = yScale(category);\n if (band == null) continue;\n const text = group\n .append('text')\n .attr('x', -gutter)\n .attr('y', band + yScale.bandwidth() / 2 + 3)\n .attr('font-size', FD.axisLabelSize)\n .attr('fill', FD.axisLabelFill)\n .attr('text-anchor', 'start')\n .style('dominant-baseline', 'middle');\n decorateManualAxisLabel(text, category, {\n maxLength: FD.matrixYLabelMaxChars,\n ...axisLabels,\n });\n }\n}\n\n/**\n * FuseDash MatrixChart — a sequential-palette grid with a pinned column header\n * once the rows overflow. Plot-local coordinates translated by the margin.\n */\nexport function renderMatrixChart(\n container: HTMLElement,\n options: RenderMatrixOptions,\n): void {\n const {\n model,\n width,\n height,\n bodyHeight = height,\n margin = { ...FD.matrixMargin },\n theme,\n themeMode = 'light',\n topAxisContainer,\n onCellHover,\n onCellLeave,\n onAxisLabelHover,\n onAxisLabelLeave,\n } = options;\n\n const axisLabels: AxisLabelTooltipHandlers = {\n onAxisLabelHover,\n onAxisLabelLeave,\n };\n\n container.replaceChildren();\n topAxisContainer?.replaceChildren();\n if (!model.cells.length || width <= 0 || height <= 0) return;\n\n const layout = matrixLayout(model, height, margin);\n const xMax = width - margin.left - margin.right;\n const plotTop = layout.separateTopAxis ? 0 : layout.topAxisHeight;\n if (xMax < 8 || layout.rowsHeight < 8) return;\n\n const xScale = scaleBand<string>()\n .domain(model.xDomain)\n .range([0, xMax])\n .paddingInner(0)\n .paddingOuter(0);\n\n const yScale = scaleBand<string>()\n .domain(model.yDomain)\n .range([0, layout.rowsHeight])\n .paddingInner(0)\n .paddingOuter(0);\n\n const svgHeight = Math.max(layout.contentHeight, height);\n const svg = select(container)\n .append('svg')\n .attr('width', width)\n .attr('height', svgHeight)\n .attr('role', 'img')\n .attr('aria-label', 'Matrix chart')\n .style('display', 'block')\n .style('font-family', theme.fontFamily);\n\n appendNoDataPattern(svg.append('defs'), themeMode);\n\n const plot = svg\n .append('g')\n .attr('class', 'plot')\n .attr('transform', `translate(${margin.left},${plotTop})`);\n\n const ranges = matrixColorRanges(model);\n const cellPad = FD.matrixCellPadding;\n const cellWidth = Math.max(xScale.bandwidth() - cellPad, 1);\n const cellHeight = Math.max(yScale.bandwidth() - cellPad, 1);\n\n const layer = plot.append('g').attr('class', 'cells');\n for (const cell of model.cells) {\n const bx = xScale(cell.x);\n const by = yScale(cell.y);\n if (bx == null || by == null) continue;\n\n const rect = layer\n .append('rect')\n .attr('class', 'matrix-cell')\n .attr('x', bx)\n .attr('y', by + cellPad / 2)\n .attr('width', cellWidth)\n .attr('height', cellHeight)\n .attr('rx', FD.matrixCellRadius)\n .attr('fill', cellFill(cell.value, ranges));\n\n if (onCellHover) {\n rect\n .on('mouseenter', (event: MouseEvent) => onCellHover({ cell, event }))\n .on('mousemove', (event: MouseEvent) => onCellHover({ cell, event }))\n .on('mouseleave', () => onCellLeave?.());\n }\n }\n\n renderYAxis(\n plot.append('g').attr('class', 'y-axis'),\n model.yDomain,\n yScale,\n margin.left,\n axisLabels,\n );\n\n if (!layout.separateTopAxis) {\n renderTopAxis(\n plot.append('g').attr('class', 'x-axis'),\n model.xDomain,\n xScale,\n xMax,\n layout.topAxisHeight,\n axisLabels,\n );\n return;\n }\n\n if (!topAxisContainer) return;\n\n // Pinned header: drawn once, measured, then grown to fit rotated labels —\n // the client's fixed 41px header clips them when the rows scroll.\n const axisSvg = select(topAxisContainer)\n .append('svg')\n .attr('width', width)\n .attr('height', layout.topAxisHeight)\n .style('display', 'block')\n .style('font-family', theme.fontFamily);\n\n const axisGroup = axisSvg\n .append('g')\n .attr('transform', `translate(${margin.left},${layout.topAxisHeight})`);\n\n const maxExtent = Math.max(\n layout.topAxisHeight,\n Math.min(\n TOP_AXIS_MAX_HEIGHT,\n Math.round(bodyHeight * TOP_AXIS_MAX_HEIGHT_RATIO),\n ),\n );\n const needed = renderTopAxis(\n axisGroup,\n model.xDomain,\n xScale,\n width,\n maxExtent,\n axisLabels,\n );\n const axisHeight = Math.min(\n Math.max(layout.topAxisHeight, Math.ceil(needed)),\n maxExtent,\n );\n axisSvg.attr('height', axisHeight);\n axisGroup.attr('transform', `translate(${margin.left},${axisHeight})`);\n}\n"],"names":[],"mappings":";;;;;AAiBA,MAAM,qBAAqB;AAG3B,MAAM,8BAA8B;AAGpC,MAAM,sBAAsB;AAE5B,MAAM,4BAA4B;AAqC3B,SAAS,kBAAkB,OAA4C;AAC5E,SAAO;AAAA,IACL,MAAM,UAAU,OAAO,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAAA,IAChD;AAAA,EAAA;AAEJ;AAGA,SAAS,SAAS,OAAe,QAAwC;AACvE,MAAI,QAAQ,EAAG,QAAO,GAAG;AACzB,MAAI,CAAC,MAAO,QAAO,QAAQ,kBAAkB;AAC7C,SAAO,wBAAwB,OAAO,MAAM,KAAK,QAAQ,kBAAkB;AAC7E;AAGO,SAAS,qBACd,YACA,gBACA,aACQ;AACR,MAAI,kBAAkB,KAAK,cAAc,KAAK,cAAc,gBAAgB;AAC1E,WAAO;AAAA,EACT;AACA,MAAI,eAAe,eAAgB,QAAO;AAE1C,QAAM,QAAQ,KAAK,IAAI,IAAI,KAAK,IAAI,GAAI,iBAAiB,MAAO,UAAU,CAAC;AAC3E,QAAM,QAAQ,KAAK,KAAK,KAAK,KAAK,MAAM,KAAK,MAAM;AACnD,QAAM,UAAU,KAAK,KAAK,QAAQ,CAAC,IAAI;AACvC,MAAI,UAAU,EAAG,QAAO;AACxB,MAAI,UAAU,IAAK,QAAO;AAC1B,SAAO;AACT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,EACnD;AAEF,QAAM,SAAS;AAAA,IACb;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF,QAAM,aAAa,KAAK;AAAA,IACtB,KAAK,IAAI,OAAO,eAAe,KAAK,KAAK,MAAM,CAAC;AAAA,IAChD;AAAA,EAAA;AAEF,UAAQ,KAAK,UAAU,UAAU;AACjC,YAAU,KAAK,aAAa,aAAa,OAAO,IAAI,IAAI,UAAU,GAAG;AACvE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/network-graph/element/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/network-graph/element/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,yBA0Q9B,CAAC"}
|