@unovis/ts 1.7.0-Phoenix.0 → 1.7.0-mcp.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/annotations/config.d.ts +2 -0
- package/components/annotations/config.js +1 -1
- package/components/annotations/config.js.map +1 -1
- package/components/annotations/index.d.ts +1 -0
- package/components/annotations/index.js +25 -10
- package/components/annotations/index.js.map +1 -1
- package/components/annotations/style.d.ts +2 -0
- package/components/annotations/style.js +8 -1
- package/components/annotations/style.js.map +1 -1
- package/components/area/config.d.ts +16 -1
- package/components/area/config.js +1 -1
- package/components/area/config.js.map +1 -1
- package/components/area/index.d.ts +6 -0
- package/components/area/index.js +99 -11
- package/components/area/index.js.map +1 -1
- package/components/area/style.d.ts +1 -0
- package/components/area/style.js +10 -2
- package/components/area/style.js.map +1 -1
- package/components/axis/config.d.ts +10 -7
- package/components/axis/config.js +1 -1
- package/components/axis/config.js.map +1 -1
- package/components/axis/index.d.ts +3 -1
- package/components/axis/index.js +95 -106
- package/components/axis/index.js.map +1 -1
- package/components/axis/style.d.ts +2 -38
- package/components/axis/style.js +28 -24
- package/components/axis/style.js.map +1 -1
- package/components/boxplot/config.d.ts +31 -0
- package/components/boxplot/config.js +6 -0
- package/components/boxplot/config.js.map +1 -0
- package/components/boxplot/index.d.ts +21 -0
- package/components/boxplot/index.js +216 -0
- package/components/boxplot/index.js.map +1 -0
- package/components/boxplot/style.d.ts +11 -0
- package/components/boxplot/style.js +56 -0
- package/components/boxplot/style.js.map +1 -0
- package/components/boxplot/types.d.ts +10 -0
- package/components/brush/config.d.ts +3 -0
- package/components/brush/config.js +1 -1
- package/components/brush/config.js.map +1 -1
- package/components/brush/index.d.ts +1 -0
- package/components/brush/index.js +7 -3
- package/components/brush/index.js.map +1 -1
- package/components/brush/style.js.map +1 -1
- package/components/bullet-legend/config.d.ts +4 -1
- package/components/bullet-legend/config.js.map +1 -1
- package/components/bullet-legend/index.d.ts +2 -0
- package/components/bullet-legend/index.js +10 -6
- package/components/bullet-legend/index.js.map +1 -1
- package/components/bullet-legend/modules/shape.d.ts +2 -2
- package/components/bullet-legend/modules/shape.js +18 -6
- package/components/bullet-legend/modules/shape.js.map +1 -1
- package/components/bullet-legend/style.js +2 -1
- package/components/bullet-legend/style.js.map +1 -1
- package/components/bullet-legend/types.d.ts +4 -0
- package/components/bullet-legend/types.js.map +1 -1
- package/components/chord-diagram/config.d.ts +5 -0
- package/components/chord-diagram/config.js +1 -1
- package/components/chord-diagram/config.js.map +1 -1
- package/components/chord-diagram/index.js +1 -1
- package/components/chord-diagram/index.js.map +1 -1
- package/components/chord-diagram/modules/label.js +2 -1
- package/components/chord-diagram/modules/label.js.map +1 -1
- package/components/chord-diagram/modules/layout.js.map +1 -1
- package/components/chord-diagram/modules/link.js +3 -1
- package/components/chord-diagram/modules/link.js.map +1 -1
- package/components/chord-diagram/modules/node.js +3 -1
- package/components/chord-diagram/modules/node.js.map +1 -1
- package/components/chord-diagram/style.js +3 -2
- package/components/chord-diagram/style.js.map +1 -1
- package/components/chord-diagram/types.js.map +1 -1
- package/components/crosshair/config.d.ts +24 -1
- package/components/crosshair/config.js +2 -1
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/constants.d.ts +7 -0
- package/components/crosshair/constants.js +12 -0
- package/components/crosshair/constants.js.map +1 -0
- package/components/crosshair/index.d.ts +10 -1
- package/components/crosshair/index.js +84 -19
- package/components/crosshair/index.js.map +1 -1
- package/components/crosshair/style.d.ts +5 -1
- package/components/crosshair/style.js +28 -18
- package/components/crosshair/style.js.map +1 -1
- package/components/donut/config.d.ts +5 -1
- package/components/donut/config.js +1 -1
- package/components/donut/config.js.map +1 -1
- package/components/donut/index.js.map +1 -1
- package/components/donut/modules/arc.js +6 -1
- package/components/donut/modules/arc.js.map +1 -1
- package/components/donut/style.js +2 -1
- package/components/donut/style.js.map +1 -1
- package/components/flow-legend/config.d.ts +10 -0
- package/components/flow-legend/config.js +4 -0
- package/components/flow-legend/config.js.map +1 -1
- package/components/flow-legend/index.d.ts +6 -2
- package/components/flow-legend/index.js +34 -16
- package/components/flow-legend/index.js.map +1 -1
- package/components/flow-legend/style.d.ts +3 -3
- package/components/flow-legend/style.js +32 -27
- package/components/flow-legend/style.js.map +1 -1
- package/components/free-brush/config.js.map +1 -1
- package/components/free-brush/index.js.map +1 -1
- package/components/free-brush/style.js +2 -1
- package/components/free-brush/style.js.map +1 -1
- package/components/free-brush/types.js +1 -0
- package/components/free-brush/types.js.map +1 -1
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +1 -0
- package/components/graph/index.js +37 -14
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/layout-helpers.js.map +1 -1
- package/components/graph/modules/layout.js.map +1 -1
- package/components/graph/modules/link/helper.js +1 -1
- package/components/graph/modules/link/helper.js.map +1 -1
- package/components/graph/modules/link/index.js +3 -3
- package/components/graph/modules/link/index.js.map +1 -1
- package/components/graph/modules/link/style.js +3 -2
- package/components/graph/modules/link/style.js.map +1 -1
- package/components/graph/modules/node/helper.js +1 -1
- package/components/graph/modules/node/helper.js.map +1 -1
- package/components/graph/modules/node/index.js +3 -2
- package/components/graph/modules/node/index.js.map +1 -1
- package/components/graph/modules/node/style.js +3 -2
- package/components/graph/modules/node/style.js.map +1 -1
- package/components/graph/modules/panel/helper.js.map +1 -1
- package/components/graph/modules/panel/index.js.map +1 -1
- package/components/graph/modules/panel/style.js +2 -1
- package/components/graph/modules/panel/style.js.map +1 -1
- package/components/graph/modules/shape.js.map +1 -1
- package/components/graph/style.js.map +1 -1
- package/components/graph/types.js.map +1 -1
- package/components/grouped-bar/config.d.ts +4 -1
- package/components/grouped-bar/config.js +1 -1
- package/components/grouped-bar/config.js.map +1 -1
- package/components/grouped-bar/index.js +7 -2
- package/components/grouped-bar/index.js.map +1 -1
- package/components/grouped-bar/style.js +2 -1
- package/components/grouped-bar/style.js.map +1 -1
- package/components/heatmap/config.d.ts +49 -0
- package/components/heatmap/config.js +8 -0
- package/components/heatmap/config.js.map +1 -0
- package/components/heatmap/index.d.ts +39 -0
- package/components/heatmap/index.js +240 -0
- package/components/heatmap/index.js.map +1 -0
- package/components/heatmap/style.d.ts +47 -0
- package/components/heatmap/style.js +69 -0
- package/components/heatmap/style.js.map +1 -0
- package/components/heatmap/types.d.ts +27 -0
- package/components/heatmap/types.js +8 -0
- package/components/heatmap/types.js.map +1 -0
- package/components/heatmap/utils.d.ts +24 -0
- package/components/heatmap/utils.js +48 -0
- package/components/heatmap/utils.js.map +1 -0
- package/components/leaflet-flow-map/config.js.map +1 -1
- package/components/leaflet-flow-map/index.js.map +1 -1
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/index.js +8 -3
- package/components/leaflet-map/index.js.map +1 -1
- package/components/leaflet-map/leaflet.css.js +2 -2
- package/components/leaflet-map/modules/clusterBackground.js.map +1 -1
- package/components/leaflet-map/modules/map.js +2 -2
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/modules/node.js +2 -2
- package/components/leaflet-map/modules/node.js.map +1 -1
- package/components/leaflet-map/modules/selectionRing.js.map +1 -1
- package/components/leaflet-map/modules/utils.js.map +1 -1
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +0 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.js +1 -2
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -1
- package/components/leaflet-map/style.js.map +1 -1
- package/components/leaflet-map/types.js.map +1 -1
- package/components/line/config.d.ts +3 -0
- package/components/line/config.js.map +1 -1
- package/components/line/index.js +15 -6
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/config.d.ts +3 -0
- package/components/nested-donut/config.js +1 -1
- package/components/nested-donut/config.js.map +1 -1
- package/components/nested-donut/index.js +1 -1
- package/components/nested-donut/index.js.map +1 -1
- package/components/nested-donut/modules/arc.js +6 -1
- package/components/nested-donut/modules/arc.js.map +1 -1
- package/components/nested-donut/modules/label.js.map +1 -1
- package/components/nested-donut/style.js.map +1 -1
- package/components/plotband/config.js.map +1 -1
- package/components/plotband/index.js.map +1 -1
- package/components/plotband/style.js +2 -1
- package/components/plotband/style.js.map +1 -1
- package/components/plotline/config.js.map +1 -1
- package/components/plotline/index.js.map +1 -1
- package/components/plotline/style.js +2 -1
- package/components/plotline/style.js.map +1 -1
- package/components/radial-bar/config.d.ts +49 -0
- package/components/radial-bar/config.js +7 -0
- package/components/radial-bar/config.js.map +1 -0
- package/components/radial-bar/index.d.ts +23 -0
- package/components/radial-bar/index.js +197 -0
- package/components/radial-bar/index.js.map +1 -0
- package/components/radial-bar/modules/bar.d.ts +10 -0
- package/components/radial-bar/modules/bar.js +57 -0
- package/components/radial-bar/modules/bar.js.map +1 -0
- package/components/radial-bar/style.d.ts +42 -0
- package/components/radial-bar/style.js +64 -0
- package/components/radial-bar/style.js.map +1 -0
- package/components/radial-bar/types.d.ts +26 -0
- package/components/radial-bar/types.js +2 -0
- package/components/radial-bar/types.js.map +1 -0
- package/components/radial-bar/utils.d.ts +6 -0
- package/components/radial-bar/utils.js +43 -0
- package/components/radial-bar/utils.js.map +1 -0
- package/components/rolling-pin-legend/config.js.map +1 -1
- package/components/rolling-pin-legend/index.js.map +1 -1
- package/components/rolling-pin-legend/style.js.map +1 -1
- package/components/sankey/config.d.ts +35 -10
- package/components/sankey/config.js +2 -2
- package/components/sankey/config.js.map +1 -1
- package/components/sankey/index.d.ts +30 -32
- package/components/sankey/index.js +375 -115
- package/components/sankey/index.js.map +1 -1
- package/components/sankey/modules/label.d.ts +8 -5
- package/components/sankey/modules/label.js +71 -34
- package/components/sankey/modules/label.js.map +1 -1
- package/components/sankey/modules/link.d.ts +1 -0
- package/components/sankey/modules/link.js +26 -42
- package/components/sankey/modules/link.js.map +1 -1
- package/components/sankey/modules/node.d.ts +5 -4
- package/components/sankey/modules/node.js +88 -32
- package/components/sankey/modules/node.js.map +1 -1
- package/components/sankey/style.d.ts +67 -1
- package/components/sankey/style.js +78 -77
- package/components/sankey/style.js.map +1 -1
- package/components/sankey/types.d.ts +9 -2
- package/components/sankey/types.js +14 -2
- package/components/sankey/types.js.map +1 -1
- package/components/scatter/config.d.ts +3 -0
- package/components/scatter/config.js +1 -1
- package/components/scatter/config.js.map +1 -1
- package/components/scatter/index.d.ts +4 -1
- package/components/scatter/index.js +28 -14
- package/components/scatter/index.js.map +1 -1
- package/components/scatter/modules/point.js +6 -1
- package/components/scatter/modules/point.js.map +1 -1
- package/components/scatter/modules/utils.js +3 -4
- package/components/scatter/modules/utils.js.map +1 -1
- package/components/scatter/types.d.ts +1 -0
- package/components/stacked-bar/config.d.ts +4 -1
- package/components/stacked-bar/config.js +1 -1
- package/components/stacked-bar/config.js.map +1 -1
- package/components/stacked-bar/index.d.ts +5 -1
- package/components/stacked-bar/index.js +54 -16
- package/components/stacked-bar/index.js.map +1 -1
- package/components/stacked-bar/style.js +2 -1
- package/components/stacked-bar/style.js.map +1 -1
- package/components/stacked-bar/types.d.ts +6 -4
- package/components/timeline/config.d.ts +11 -2
- package/components/timeline/config.js +3 -3
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/index.d.ts +2 -2
- package/components/timeline/index.js +72 -36
- package/components/timeline/index.js.map +1 -1
- package/components/timeline/style.d.ts +6 -1
- package/components/timeline/style.js +40 -46
- package/components/timeline/style.js.map +1 -1
- package/components/timeline/utils.js.map +1 -1
- package/components/tooltip/config.js.map +1 -1
- package/components/tooltip/index.js +1 -1
- package/components/tooltip/index.js.map +1 -1
- package/components/tooltip/style.js +3 -2
- package/components/tooltip/style.js.map +1 -1
- package/components/topojson-map/config.d.ts +98 -3
- package/components/topojson-map/config.js +6 -2
- package/components/topojson-map/config.js.map +1 -1
- package/components/topojson-map/index.d.ts +47 -3
- package/components/topojson-map/index.js +1026 -103
- package/components/topojson-map/index.js.map +1 -1
- package/components/topojson-map/modules/background.d.ts +2 -0
- package/components/topojson-map/modules/background.js +13 -0
- package/components/topojson-map/modules/background.js.map +1 -0
- package/components/topojson-map/modules/donut.d.ts +3 -0
- package/components/topojson-map/modules/donut.js +29 -0
- package/components/topojson-map/modules/donut.js.map +1 -0
- package/components/topojson-map/modules/flow.d.ts +19 -0
- package/components/topojson-map/modules/flow.js +134 -0
- package/components/topojson-map/modules/flow.js.map +1 -0
- package/components/topojson-map/modules/selectionRing.d.ts +5 -0
- package/components/topojson-map/modules/selectionRing.js +33 -0
- package/components/topojson-map/modules/selectionRing.js.map +1 -0
- package/components/topojson-map/style.d.ts +90 -2
- package/components/topojson-map/style.js +165 -36
- package/components/topojson-map/style.js.map +1 -1
- package/components/topojson-map/types.d.ts +84 -1
- package/components/topojson-map/types.js +8 -1
- package/components/topojson-map/types.js.map +1 -1
- package/components/topojson-map/utils.d.ts +27 -0
- package/components/topojson-map/utils.js +289 -2
- package/components/topojson-map/utils.js.map +1 -1
- package/components/treemap/config.d.ts +7 -1
- package/components/treemap/config.js +1 -1
- package/components/treemap/config.js.map +1 -1
- package/components/treemap/index.d.ts +6 -2
- package/components/treemap/index.js +126 -92
- package/components/treemap/index.js.map +1 -1
- package/components/treemap/style.d.ts +1 -0
- package/components/treemap/style.js +5 -1
- package/components/treemap/style.js.map +1 -1
- package/components/treemap/types.d.ts +4 -0
- package/components/vis-controls/index.js.map +1 -1
- package/components/vis-controls/style.js +2 -1
- package/components/vis-controls/style.js.map +1 -1
- package/components/xy-labels/config.js.map +1 -1
- package/components/xy-labels/index.js +3 -3
- package/components/xy-labels/index.js.map +1 -1
- package/components/xy-labels/modules/label.d.ts +2 -1
- package/components/xy-labels/modules/label.js +5 -4
- package/components/xy-labels/modules/label.js.map +1 -1
- package/components.d.ts +9 -0
- package/components.js +4 -0
- package/components.js.map +1 -1
- package/containers/single-container/config.d.ts +3 -0
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.js +7 -4
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +3 -0
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +1 -0
- package/containers/xy-container/index.js +23 -11
- package/containers/xy-container/index.js.map +1 -1
- package/core/component/config.js.map +1 -1
- package/core/component/index.d.ts +9 -0
- package/core/component/index.js +15 -2
- package/core/component/index.js.map +1 -1
- package/core/container/config.d.ts +6 -0
- package/core/container/config.js +1 -0
- package/core/container/config.js.map +1 -1
- package/core/container/index.js +5 -2
- package/core/container/index.js.map +1 -1
- package/core/xy-component/config.d.ts +4 -0
- package/core/xy-component/config.js.map +1 -1
- package/core/xy-component/index.js.map +1 -1
- package/data-models/graph.js.map +1 -1
- package/data-models/map-graph.js.map +1 -1
- package/data-models/map.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +15 -6
- package/index.js.map +1 -1
- package/package.json +49 -12
- package/styles/colors.js.map +1 -1
- package/styles/index.d.ts +1 -0
- package/styles/index.js +8 -6
- package/styles/index.js.map +1 -1
- package/styles/patterns.d.ts +32 -5
- package/styles/patterns.js +90 -22
- package/styles/patterns.js.map +1 -1
- package/types/accessor.d.ts +2 -1
- package/types/misc.js +2 -0
- package/types/misc.js.map +1 -0
- package/types/style.d.ts +1 -0
- package/types/svg.js.map +1 -1
- package/types/text.d.ts +4 -0
- package/types/text.js.map +1 -1
- package/types.d.ts +3 -0
- package/types.js +5 -2
- package/types.js.map +1 -1
- package/utils/cache.d.ts +1 -0
- package/utils/cache.js +12 -0
- package/utils/cache.js.map +1 -0
- package/utils/color.d.ts +7 -3
- package/utils/color.js +35 -9
- package/utils/color.js.map +1 -1
- package/utils/data.d.ts +9 -0
- package/utils/data.js +54 -1
- package/utils/data.js.map +1 -1
- package/utils/index.d.ts +3 -0
- package/utils/index.js +7 -4
- package/utils/index.js.map +1 -1
- package/utils/map.js.map +1 -1
- package/utils/misc.js +13 -2
- package/utils/misc.js.map +1 -1
- package/utils/path.js.map +1 -1
- package/utils/pattern.d.ts +17 -0
- package/utils/pattern.js +69 -0
- package/utils/pattern.js.map +1 -0
- package/utils/style.d.ts +1 -0
- package/utils/style.js +8 -2
- package/utils/style.js.map +1 -1
- package/utils/svg.js.map +1 -1
- package/utils/text-measure.d.ts +6 -0
- package/utils/text-measure.js +118 -0
- package/utils/text-measure.js.map +1 -0
- package/utils/text-overlap.d.ts +32 -0
- package/utils/text-overlap.js +103 -0
- package/utils/text-overlap.js.map +1 -0
- package/utils/text.d.ts +3 -19
- package/utils/text.js +93 -92
- package/utils/text.js.map +1 -1
- package/utils/theme.d.ts +1 -0
- package/utils/theme.js +4 -0
- package/utils/theme.js.map +1 -0
- package/utils/to-px.d.ts +1 -0
- package/utils/to-px.js +115 -0
- package/utils/to-px.js.map +1 -0
|
@@ -15,5 +15,7 @@ export interface AnnotationsConfigInterface extends ComponentConfigInterface {
|
|
|
15
15
|
* To learn more, see our docs https://unovis.dev/docs/auxiliary/Annotations/
|
|
16
16
|
* Default: `[]` */
|
|
17
17
|
items: AnnotationItem[] | undefined;
|
|
18
|
+
/** Debug option to render bounding boxes around text elements. Default: `false` */
|
|
19
|
+
renderTextBoundingBoxes?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare const AnnotationsDefaultConfig: AnnotationsConfigInterface;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentDefaultConfig } from '../../core/component/config.js';
|
|
2
2
|
|
|
3
|
-
const AnnotationsDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { items: [] });
|
|
3
|
+
const AnnotationsDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { items: [], renderTextBoundingBoxes: false });
|
|
4
4
|
|
|
5
5
|
export { AnnotationsDefaultConfig };
|
|
6
6
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/annotations/config.ts"],"sourcesContent":["import { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\n\n// Types\nimport { AnnotationItem } from './types'\n\nexport interface AnnotationsConfigInterface extends ComponentConfigInterface {\n /** Legend items. Array of `AnnotationItem`:\n * ```\n * {\n * content: string | UnovisText | UnovisText[];\n * subject?: AnnotationSubject;\n * x?: LengthUnit;\n * y?: LengthUnit;\n * width?: LengthUnit;\n * height?: LengthUnit;\n * }\n * ```\n * To learn more, see our docs https://unovis.dev/docs/auxiliary/Annotations/\n * Default: `[]` */\n items: AnnotationItem[] | undefined;\n}\n\nexport const AnnotationsDefaultConfig: AnnotationsConfigInterface = {\n ...ComponentDefaultConfig,\n items: [],\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/annotations/config.ts"],"sourcesContent":["import { ComponentConfigInterface, ComponentDefaultConfig } from '@/core/component/config'\n\n// Types\nimport { AnnotationItem } from './types'\n\nexport interface AnnotationsConfigInterface extends ComponentConfigInterface {\n /** Legend items. Array of `AnnotationItem`:\n * ```\n * {\n * content: string | UnovisText | UnovisText[];\n * subject?: AnnotationSubject;\n * x?: LengthUnit;\n * y?: LengthUnit;\n * width?: LengthUnit;\n * height?: LengthUnit;\n * }\n * ```\n * To learn more, see our docs https://unovis.dev/docs/auxiliary/Annotations/\n * Default: `[]` */\n items: AnnotationItem[] | undefined;\n /** Debug option to render bounding boxes around text elements. Default: `false` */\n renderTextBoundingBoxes?: boolean;\n}\n\nexport const AnnotationsDefaultConfig: AnnotationsConfigInterface = {\n ...ComponentDefaultConfig,\n items: [],\n renderTextBoundingBoxes: false,\n}\n"],"names":[],"mappings":";;AAwBO,MAAM,wBAAwB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAChC,sBAAsB,CACzB,EAAA,EAAA,KAAK,EAAE,EAAE,EACT,uBAAuB,EAAE,KAAK;;;;"}
|
|
@@ -12,6 +12,7 @@ export declare class Annotations extends ComponentCore<unknown[], AnnotationsCon
|
|
|
12
12
|
annotationsSubjectStrokeColor: "--vis-annotations-subject-stroke-color";
|
|
13
13
|
annotationsSubjectFillColor: "--vis-annotations-subject-fill-color";
|
|
14
14
|
annotationsSubjectStrokeDasharray: "--vis-annotations-subject-stroke-dasharray";
|
|
15
|
+
annotationsDebugBoundingBoxStrokeColor: "--vis-annotations-debug-bounding-box-stroke-color";
|
|
15
16
|
darkAnnotationsTextColor: "--vis-dark-annotations-text-color";
|
|
16
17
|
darkAnnotationsConnectorStrokeColor: "--vis-dark-annotations-connector-stroke-color";
|
|
17
18
|
darkAnnotationsSubjectStrokeColor: "--vis-dark-annotations-subject-stroke-color";
|
|
@@ -7,7 +7,7 @@ import { parseUnit } from '../../utils/misc.js';
|
|
|
7
7
|
import { UNOVIS_TEXT_DEFAULT } from '../../styles/index.js';
|
|
8
8
|
import { AnnotationsDefaultConfig } from './config.js';
|
|
9
9
|
import * as style from './style.js';
|
|
10
|
-
import { annotation, annotationContent, annotationSubject, variables } from './style.js';
|
|
10
|
+
import { annotation, annotationContent, debugBoundingBox, annotationSubject, variables } from './style.js';
|
|
11
11
|
|
|
12
12
|
class Annotations extends ComponentCore {
|
|
13
13
|
constructor(config) {
|
|
@@ -29,11 +29,6 @@ class Annotations extends ComponentCore {
|
|
|
29
29
|
.style('opacity', 0);
|
|
30
30
|
// Content
|
|
31
31
|
annotationsEnter.append('g').attr('class', annotationContent);
|
|
32
|
-
// Subject
|
|
33
|
-
const subject = annotationsEnter.append('g')
|
|
34
|
-
.attr('class', annotationSubject);
|
|
35
|
-
subject.append('circle');
|
|
36
|
-
subject.append('line');
|
|
37
32
|
const annotationsMerged = annotationsEnter.merge(annotations)
|
|
38
33
|
.attr('cursor', d => d === null || d === void 0 ? void 0 : d.cursor)
|
|
39
34
|
.each((annotation, i, elements) => {
|
|
@@ -46,10 +41,25 @@ class Annotations extends ComponentCore {
|
|
|
46
41
|
const options = Object.assign(Object.assign({}, annotation), { x, y, width, height });
|
|
47
42
|
const contentGroupElement = select(elements[i]).select(`.${annotationContent}`);
|
|
48
43
|
renderTextIntoFrame(contentGroupElement.node(), content, options);
|
|
44
|
+
// Render debug bounding boxes showing the frame (x, y, width, height)
|
|
45
|
+
contentGroupElement.selectAll(`.${debugBoundingBox}`).remove();
|
|
46
|
+
if (config.renderTextBoundingBoxes) {
|
|
47
|
+
const debugWidth = width !== null && width !== void 0 ? width : 100;
|
|
48
|
+
const debugHeight = height || 0.1;
|
|
49
|
+
contentGroupElement.append('rect')
|
|
50
|
+
.attr('class', debugBoundingBox)
|
|
51
|
+
.attr('x', x)
|
|
52
|
+
.attr('y', y)
|
|
53
|
+
.attr('width', debugWidth)
|
|
54
|
+
.attr('height', debugHeight);
|
|
55
|
+
}
|
|
49
56
|
}
|
|
50
57
|
if (annotation.subject) {
|
|
51
58
|
requestAnimationFrame(() => this._renderSubject(elements[i], annotation.subject));
|
|
52
59
|
}
|
|
60
|
+
else {
|
|
61
|
+
select(elements[i]).select(`.${annotationSubject}`).remove();
|
|
62
|
+
}
|
|
53
63
|
});
|
|
54
64
|
smartTransition(annotationsMerged, duration)
|
|
55
65
|
.style('opacity', 1);
|
|
@@ -59,8 +69,15 @@ class Annotations extends ComponentCore {
|
|
|
59
69
|
}
|
|
60
70
|
_renderSubject(annotationGroupElement, subject) {
|
|
61
71
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
62
|
-
const
|
|
63
|
-
const
|
|
72
|
+
const annotationGroup = select(annotationGroupElement);
|
|
73
|
+
const contentGroup = annotationGroup.select(`.${annotationContent}`);
|
|
74
|
+
// Create subject group if it doesn't exist
|
|
75
|
+
let subjectGroup = annotationGroup.select(`.${annotationSubject}`);
|
|
76
|
+
if (subjectGroup.empty()) {
|
|
77
|
+
subjectGroup = annotationGroup.append('g').attr('class', annotationSubject);
|
|
78
|
+
subjectGroup.append('circle');
|
|
79
|
+
subjectGroup.append('line');
|
|
80
|
+
}
|
|
64
81
|
const subjectX = (_a = parseUnit(typeof (subject === null || subject === void 0 ? void 0 : subject.x) === 'function' ? subject.x() : subject === null || subject === void 0 ? void 0 : subject.x, this._width)) !== null && _a !== void 0 ? _a : null;
|
|
65
82
|
const subjectY = (_b = parseUnit(typeof (subject === null || subject === void 0 ? void 0 : subject.y) === 'function' ? subject.y() : subject === null || subject === void 0 ? void 0 : subject.y, this._height)) !== null && _b !== void 0 ? _b : null;
|
|
66
83
|
const subjectStrokeColor = (_c = subject === null || subject === void 0 ? void 0 : subject.strokeColor) !== null && _c !== void 0 ? _c : null;
|
|
@@ -84,7 +101,6 @@ class Annotations extends ComponentCore {
|
|
|
84
101
|
const x1 = subjectX + Math.cos(angle * Math.PI / 180) * (subjectRadius + padding);
|
|
85
102
|
const y1 = subjectY + Math.sin(angle * Math.PI / 180) * (subjectRadius + padding);
|
|
86
103
|
subjectGroup.select('circle')
|
|
87
|
-
.attr('visibility', subject ? null : 'hidden')
|
|
88
104
|
.attr('cx', subjectX)
|
|
89
105
|
.attr('cy', subjectY)
|
|
90
106
|
.attr('r', subjectRadius)
|
|
@@ -92,7 +108,6 @@ class Annotations extends ComponentCore {
|
|
|
92
108
|
.style('fill', subjectFillColor)
|
|
93
109
|
.style('stroke-dasharray', subjectStrokeDasharray);
|
|
94
110
|
subjectGroup.select('line')
|
|
95
|
-
.attr('visibility', subject ? null : 'hidden')
|
|
96
111
|
.attr('x1', x1)
|
|
97
112
|
.attr('y1', y1)
|
|
98
113
|
.attr('x2', x1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Utils\nimport { isNumber } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { renderTextIntoFrame } from 'utils/text'\nimport { parseUnit } from 'utils/misc'\nimport { UNOVIS_TEXT_DEFAULT } from 'styles'\n\n// Local Types\nimport { AnnotationItem, AnnotationSubject } from './types'\n\n// Config\nimport { AnnotationsDefaultConfig, AnnotationsConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Annotations extends ComponentCore<unknown[], AnnotationsConfigInterface> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = AnnotationsDefaultConfig as AnnotationsConfigInterface\n public config: AnnotationsConfigInterface = this._defaultConfig\n\n g: Selection<SVGGElement, unknown, null, undefined>\n\n events = {}\n\n constructor (config?: AnnotationsConfigInterface) {\n super()\n if (config) this.setConfig(config)\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config } = this\n\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const annotations = this.g.selectAll<SVGGElement, AnnotationItem[]>(`.${s.annotation}`)\n .data(config.items, d => JSON.stringify(d))\n\n const annotationsEnter = annotations.enter().append('g')\n .attr('class', s.annotation)\n .style('opacity', 0)\n\n // Content\n annotationsEnter.append('g').attr('class', s.annotationContent)\n\n // Subject\n const subject = annotationsEnter.append('g')\n .attr('class', s.annotationSubject)\n\n subject.append('circle')\n subject.append('line')\n\n const annotationsMerged = annotationsEnter.merge(annotations)\n .attr('cursor', d => d?.cursor)\n .each((annotation, i, elements) => {\n if (annotation.content) {\n const content = typeof annotation.content === 'string' ? { ...UNOVIS_TEXT_DEFAULT, text: annotation.content } : annotation.content\n const x = parseUnit(annotation.x, this._width)\n const y = parseUnit(annotation.y, this._height)\n const width = parseUnit(annotation.width, this._width)\n const height = parseUnit(annotation.height, this._height)\n const options = { ...annotation, x, y, width, height }\n\n const contentGroupElement = select(elements[i]).select<SVGGElement>(`.${s.annotationContent}`)\n renderTextIntoFrame(contentGroupElement.node(), content, options)\n }\n\n if (annotation.subject) {\n requestAnimationFrame(() => this._renderSubject(elements[i], annotation.subject))\n }\n })\n\n smartTransition(annotationsMerged, duration)\n .style('opacity', 1)\n\n smartTransition(annotations.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n\n private _renderSubject (\n annotationGroupElement: SVGElement,\n subject: AnnotationSubject | undefined\n ): void {\n const contentGroup = select(annotationGroupElement).select<SVGGElement>(`.${s.annotationContent}`)\n const subjectGroup = select(annotationGroupElement).select<SVGGElement>(`.${s.annotationSubject}`)\n\n const subjectX: number | null = parseUnit(typeof subject?.x === 'function' ? subject.x() : subject?.x, this._width) ?? null\n const subjectY: number | null = parseUnit(typeof subject?.y === 'function' ? subject.y() : subject?.y, this._height) ?? null\n\n const subjectStrokeColor: string | null = subject?.strokeColor ?? null\n const subjectFillColor: string | null = subject?.fillColor ?? null\n const subjectStrokeDasharray: string | null = subject?.strokeDasharray ?? null\n const connectorLineColor: string | null = subject?.connectorLineColor ?? null\n const connectorLineStrokeDasharray: string | null = subject?.connectorLineStrokeDasharray ?? null\n const subjectRadius: number | null = subject?.radius ?? 0\n const padding = subject?.padding ?? 5\n\n const contentBbox = contentGroup.node().getBBox()\n const dy = Math.abs(subjectY - (contentBbox.y + contentBbox.height / 2))\n const dx = Math.abs(subjectX - (contentBbox.x + contentBbox.width / 2))\n const annotationPadding = 5\n const x2 = (dx < dy) && ((subjectY < contentBbox.y) || (subjectY > (contentBbox.y + contentBbox.height)))\n ? contentBbox.x + contentBbox.width / 2\n : (subjectX < contentBbox.x) ? contentBbox.x - annotationPadding : contentBbox.x + contentBbox.width + annotationPadding\n\n const y2 = (dx >= dy) || ((subjectY >= contentBbox.y) && (subjectY <= (contentBbox.y + contentBbox.height)))\n ? contentBbox.y + contentBbox.height / 2\n : (subjectY < contentBbox.y) ? contentBbox.y - annotationPadding : contentBbox.y + contentBbox.height + annotationPadding\n\n const angle = Math.atan2(y2 - subjectY, x2 - subjectX) * 180 / Math.PI\n const x1 = subjectX + Math.cos(angle * Math.PI / 180) * (subjectRadius + padding)\n const y1 = subjectY + Math.sin(angle * Math.PI / 180) * (subjectRadius + padding)\n\n subjectGroup.select('circle')\n .attr('visibility', subject ? null : 'hidden')\n .attr('cx', subjectX)\n .attr('cy', subjectY)\n .attr('r', subjectRadius)\n .style('stroke', subjectStrokeColor)\n .style('fill', subjectFillColor)\n .style('stroke-dasharray', subjectStrokeDasharray)\n\n subjectGroup.select('line')\n .attr('visibility', subject ? null : 'hidden')\n .attr('x1', x1)\n .attr('y1', y1)\n .attr('x2', x1)\n .attr('y2', y1)\n .attr('x2', x2)\n .attr('y2', y2)\n .style('stroke', connectorLineColor)\n .style('stroke-dasharray', connectorLineStrokeDasharray)\n }\n}\n"],"names":["s.annotation","s.annotationContent","s.annotationSubject","s","s.variables"],"mappings":";;;;;;;;;;;AAqBM,MAAO,WAAY,SAAQ,aAAoD,CAAA;AAUnF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QARC,IAAc,CAAA,cAAA,GAAG,wBAAsD,CAAA;AAC1E,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QAI/D,IAAM,CAAA,MAAA,GAAG,EAAE,CAAA;AAIT,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACnC;AAED,IAAA,OAAO,CAAE,cAAuB,EAAA;AAC9B,QAAA,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;AAC7B,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;AAEvB,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAA;AAE5E,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAgC,CAAI,CAAA,EAAAA,UAAY,EAAE,CAAC;AACpF,aAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;QAE7C,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC;AACrD,aAAA,IAAI,CAAC,OAAO,EAAEA,UAAY,CAAC;AAC3B,aAAA,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;;AAGtB,QAAA,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAA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n\n// Core\nimport { ComponentCore } from '@/core/component'\n\n// Utils\nimport { isNumber } from '@/utils/data'\nimport { smartTransition } from '@/utils/d3'\nimport { renderTextIntoFrame } from '@/utils/text'\nimport { parseUnit } from '@/utils/misc'\nimport { UNOVIS_TEXT_DEFAULT } from '@/styles'\n\n// Local Types\nimport { AnnotationItem, AnnotationSubject } from './types'\n\n// Config\nimport { AnnotationsDefaultConfig, AnnotationsConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Annotations extends ComponentCore<unknown[], AnnotationsConfigInterface> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = AnnotationsDefaultConfig as AnnotationsConfigInterface\n public config: AnnotationsConfigInterface = this._defaultConfig\n\n g: Selection<SVGGElement, unknown, null, undefined>\n\n events = {}\n\n constructor (config?: AnnotationsConfigInterface) {\n super()\n if (config) this.setConfig(config)\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config } = this\n\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const annotations = this.g.selectAll<SVGGElement, AnnotationItem[]>(`.${s.annotation}`)\n .data(config.items, d => JSON.stringify(d))\n\n const annotationsEnter = annotations.enter().append('g')\n .attr('class', s.annotation)\n .style('opacity', 0)\n\n // Content\n annotationsEnter.append('g').attr('class', s.annotationContent)\n\n const annotationsMerged = annotationsEnter.merge(annotations)\n .attr('cursor', d => d?.cursor)\n .each((annotation, i, elements) => {\n if (annotation.content) {\n const content = typeof annotation.content === 'string' ? { ...UNOVIS_TEXT_DEFAULT, text: annotation.content } : annotation.content\n const x = parseUnit(annotation.x, this._width)\n const y = parseUnit(annotation.y, this._height)\n const width = parseUnit(annotation.width, this._width)\n const height = parseUnit(annotation.height, this._height)\n const options = { ...annotation, x, y, width, height }\n\n const contentGroupElement = select(elements[i]).select<SVGGElement>(`.${s.annotationContent}`)\n renderTextIntoFrame(contentGroupElement.node(), content, options)\n\n // Render debug bounding boxes showing the frame (x, y, width, height)\n contentGroupElement.selectAll(`.${s.debugBoundingBox}`).remove()\n if (config.renderTextBoundingBoxes) {\n const debugWidth = width ?? 100\n const debugHeight = height || 0.1\n contentGroupElement.append('rect')\n .attr('class', s.debugBoundingBox)\n .attr('x', x)\n .attr('y', y)\n .attr('width', debugWidth)\n .attr('height', debugHeight)\n }\n }\n\n if (annotation.subject) {\n requestAnimationFrame(() => this._renderSubject(elements[i], annotation.subject))\n } else {\n select(elements[i]).select(`.${s.annotationSubject}`).remove()\n }\n })\n\n smartTransition(annotationsMerged, duration)\n .style('opacity', 1)\n\n smartTransition(annotations.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n\n private _renderSubject (\n annotationGroupElement: SVGElement,\n subject: AnnotationSubject | undefined\n ): void {\n const annotationGroup = select(annotationGroupElement)\n const contentGroup = annotationGroup.select<SVGGElement>(`.${s.annotationContent}`)\n\n // Create subject group if it doesn't exist\n let subjectGroup = annotationGroup.select<SVGGElement>(`.${s.annotationSubject}`)\n if (subjectGroup.empty()) {\n subjectGroup = annotationGroup.append('g').attr('class', s.annotationSubject)\n subjectGroup.append('circle')\n subjectGroup.append('line')\n }\n\n const subjectX: number | null = parseUnit(typeof subject?.x === 'function' ? subject.x() : subject?.x, this._width) ?? null\n const subjectY: number | null = parseUnit(typeof subject?.y === 'function' ? subject.y() : subject?.y, this._height) ?? null\n\n const subjectStrokeColor: string | null = subject?.strokeColor ?? null\n const subjectFillColor: string | null = subject?.fillColor ?? null\n const subjectStrokeDasharray: string | null = subject?.strokeDasharray ?? null\n const connectorLineColor: string | null = subject?.connectorLineColor ?? null\n const connectorLineStrokeDasharray: string | null = subject?.connectorLineStrokeDasharray ?? null\n const subjectRadius: number | null = subject?.radius ?? 0\n const padding = subject?.padding ?? 5\n\n const contentBbox = contentGroup.node().getBBox()\n const dy = Math.abs(subjectY - (contentBbox.y + contentBbox.height / 2))\n const dx = Math.abs(subjectX - (contentBbox.x + contentBbox.width / 2))\n const annotationPadding = 5\n const x2 = (dx < dy) && ((subjectY < contentBbox.y) || (subjectY > (contentBbox.y + contentBbox.height)))\n ? contentBbox.x + contentBbox.width / 2\n : (subjectX < contentBbox.x) ? contentBbox.x - annotationPadding : contentBbox.x + contentBbox.width + annotationPadding\n\n const y2 = (dx >= dy) || ((subjectY >= contentBbox.y) && (subjectY <= (contentBbox.y + contentBbox.height)))\n ? contentBbox.y + contentBbox.height / 2\n : (subjectY < contentBbox.y) ? contentBbox.y - annotationPadding : contentBbox.y + contentBbox.height + annotationPadding\n\n const angle = Math.atan2(y2 - subjectY, x2 - subjectX) * 180 / Math.PI\n const x1 = subjectX + Math.cos(angle * Math.PI / 180) * (subjectRadius + padding)\n const y1 = subjectY + Math.sin(angle * Math.PI / 180) * (subjectRadius + padding)\n\n subjectGroup.select('circle')\n .attr('cx', subjectX)\n .attr('cy', subjectY)\n .attr('r', subjectRadius)\n .style('stroke', subjectStrokeColor)\n .style('fill', subjectFillColor)\n .style('stroke-dasharray', subjectStrokeDasharray)\n\n subjectGroup.select('line')\n .attr('x1', x1)\n .attr('y1', y1)\n .attr('x2', x1)\n .attr('y2', y1)\n .attr('x2', x2)\n .attr('y2', y2)\n .style('stroke', connectorLineColor)\n .style('stroke-dasharray', connectorLineStrokeDasharray)\n }\n}\n"],"names":["s.annotation","s.annotationContent","s.debugBoundingBox","s.annotationSubject","s","s.variables"],"mappings":";;;;;;;;;;;AAqBM,MAAO,WAAY,SAAQ,aAAoD,CAAA;AAUnF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QARC,IAAc,CAAA,cAAA,GAAG,wBAAsD,CAAA;AAC1E,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QAI/D,IAAM,CAAA,MAAA,GAAG,EAAE,CAAA;AAIT,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACnC;AAED,IAAA,OAAO,CAAE,cAAuB,EAAA;AAC9B,QAAA,KAAK,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AAS,CAAA,SAAA,GAAGC,KAAC,CAAA;AACb,WAAA,CAAA,YAAY,GAAGC,SAAW;;;;"}
|
|
@@ -7,6 +7,7 @@ export declare const variables: {
|
|
|
7
7
|
annotationsSubjectStrokeColor: "--vis-annotations-subject-stroke-color";
|
|
8
8
|
annotationsSubjectFillColor: "--vis-annotations-subject-fill-color";
|
|
9
9
|
annotationsSubjectStrokeDasharray: "--vis-annotations-subject-stroke-dasharray";
|
|
10
|
+
annotationsDebugBoundingBoxStrokeColor: "--vis-annotations-debug-bounding-box-stroke-color";
|
|
10
11
|
darkAnnotationsTextColor: "--vis-dark-annotations-text-color";
|
|
11
12
|
darkAnnotationsConnectorStrokeColor: "--vis-dark-annotations-connector-stroke-color";
|
|
12
13
|
darkAnnotationsSubjectStrokeColor: "--vis-dark-annotations-subject-stroke-color";
|
|
@@ -14,3 +15,4 @@ export declare const variables: {
|
|
|
14
15
|
export declare const annotation: string;
|
|
15
16
|
export declare const annotationSubject: string;
|
|
16
17
|
export declare const annotationContent: string;
|
|
18
|
+
export declare const debugBoundingBox: string;
|
|
@@ -9,6 +9,7 @@ const cssVarDefaults = {
|
|
|
9
9
|
'--vis-annotations-subject-stroke-color': '#444',
|
|
10
10
|
'--vis-annotations-subject-fill-color': 'none',
|
|
11
11
|
'--vis-annotations-subject-stroke-dasharray': 'none',
|
|
12
|
+
'--vis-annotations-debug-bounding-box-stroke-color': '#f00',
|
|
12
13
|
'--vis-dark-annotations-text-color': '#e8e9ef',
|
|
13
14
|
'--vis-dark-annotations-connector-stroke-color': '#fff',
|
|
14
15
|
'--vis-dark-annotations-subject-stroke-color': '#fff',
|
|
@@ -41,7 +42,13 @@ const annotationContent = css `
|
|
|
41
42
|
> text {
|
|
42
43
|
fill: var(--vis-annotations-text-color);
|
|
43
44
|
}
|
|
45
|
+
`;
|
|
46
|
+
const debugBoundingBox = css `
|
|
47
|
+
label: debugBoundingBox;
|
|
48
|
+
fill: none;
|
|
49
|
+
stroke: var(--vis-annotations-debug-bounding-box-stroke-color);
|
|
50
|
+
stroke-width: 1;
|
|
44
51
|
`;
|
|
45
52
|
|
|
46
|
-
export { annotation, annotationContent, annotationSubject, root, variables };
|
|
53
|
+
export { annotation, annotationContent, annotationSubject, debugBoundingBox, root, variables };
|
|
47
54
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/annotations/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from 'utils/style'\n\nconst cssVarDefaults = {\n '--vis-annotations-text-color': '#282C34',\n\n '--vis-annotations-connector-stroke-color': '#444',\n '--vis-annotations-connector-stroke-width': '1px',\n '--vis-annotations-connector-stroke-dasharray': 'none',\n\n '--vis-annotations-subject-stroke-color': '#444',\n '--vis-annotations-subject-fill-color': 'none',\n '--vis-annotations-subject-stroke-dasharray': 'none',\n\n '--vis-dark-annotations-text-color': '#e8e9ef',\n '--vis-dark-annotations-connector-stroke-color': '#fff',\n '--vis-dark-annotations-subject-stroke-color': '#fff',\n}\n\nexport const root = css`\n label: annotations-component;\n`\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const annotation = css`\n label: annotation;\n`\n\nexport const annotationSubject = css`\n label: annotationSubject;\n\n line {\n stroke: var(${variables.annotationsConnectorStrokeColor});\n stroke-width: var(${variables.annotationsConnectorStrokeWidth});\n stroke-dasharray: var(${variables.annotationsConnectorStrokeDasharray});\n }\n\n circle {\n stroke: var(${variables.annotationsSubjectStrokeColor});\n fill: var(${variables.annotationsSubjectFillColor});\n stroke-dasharray: var(${variables.annotationsSubjectStrokeDasharray});\n }\n`\n\nexport const annotationContent = css`\n label: annotationContent;\n > text {\n fill: var(--vis-annotations-text-color);\n }\n`\n"],"names":[],"mappings":";;;AAKA,MAAM,cAAc,GAAG;AACrB,IAAA,8BAA8B,EAAE,SAAS;AAEzC,IAAA,0CAA0C,EAAE,MAAM;AAClD,IAAA,0CAA0C,EAAE,KAAK;AACjD,IAAA,8CAA8C,EAAE,MAAM;AAEtD,IAAA,wCAAwC,EAAE,MAAM;AAChD,IAAA,sCAAsC,EAAE,MAAM;AAC9C,IAAA,4CAA4C,EAAE,MAAM;AAEpD,IAAA,mCAAmC,EAAE,SAAS;AAC9C,IAAA,+CAA+C,EAAE,MAAM;AACvD,IAAA,6CAA6C,EAAE,MAAM;CACtD,CAAA;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;MACY,SAAS,GAAG,cAAc,CAAC,cAAc,EAAC;AACvD,wBAAwB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAEvC,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;EAE5B;AAEM,MAAM,iBAAiB,GAAG,GAAG,CAAA,CAAA;;;;AAIlB,gBAAA,EAAA,SAAS,CAAC,+BAA+B,CAAA;AACnC,sBAAA,EAAA,SAAS,CAAC,+BAA+B,CAAA;AACrC,0BAAA,EAAA,SAAS,CAAC,mCAAmC,CAAA;;;;AAIvD,gBAAA,EAAA,SAAS,CAAC,6BAA6B,CAAA;AACzC,cAAA,EAAA,SAAS,CAAC,2BAA2B,CAAA;AACzB,0BAAA,EAAA,SAAS,CAAC,iCAAiC,CAAA;;EAEtE;AAEM,MAAM,iBAAiB,GAAG,GAAG,CAAA,CAAA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../src/components/annotations/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\n\n// Utils\nimport { getCssVarNames, injectGlobalCssVariables } from '@/utils/style'\n\nconst cssVarDefaults = {\n '--vis-annotations-text-color': '#282C34',\n\n '--vis-annotations-connector-stroke-color': '#444',\n '--vis-annotations-connector-stroke-width': '1px',\n '--vis-annotations-connector-stroke-dasharray': 'none',\n\n '--vis-annotations-subject-stroke-color': '#444',\n '--vis-annotations-subject-fill-color': 'none',\n '--vis-annotations-subject-stroke-dasharray': 'none',\n\n '--vis-annotations-debug-bounding-box-stroke-color': '#f00',\n\n '--vis-dark-annotations-text-color': '#e8e9ef',\n '--vis-dark-annotations-connector-stroke-color': '#fff',\n '--vis-dark-annotations-subject-stroke-color': '#fff',\n}\n\nexport const root = css`\n label: annotations-component;\n`\nexport const variables = getCssVarNames(cssVarDefaults)\ninjectGlobalCssVariables(cssVarDefaults, root)\n\nexport const annotation = css`\n label: annotation;\n`\n\nexport const annotationSubject = css`\n label: annotationSubject;\n\n line {\n stroke: var(${variables.annotationsConnectorStrokeColor});\n stroke-width: var(${variables.annotationsConnectorStrokeWidth});\n stroke-dasharray: var(${variables.annotationsConnectorStrokeDasharray});\n }\n\n circle {\n stroke: var(${variables.annotationsSubjectStrokeColor});\n fill: var(${variables.annotationsSubjectFillColor});\n stroke-dasharray: var(${variables.annotationsSubjectStrokeDasharray});\n }\n`\n\nexport const annotationContent = css`\n label: annotationContent;\n > text {\n fill: var(--vis-annotations-text-color);\n }\n`\n\nexport const debugBoundingBox = css`\n label: debugBoundingBox;\n fill: none;\n stroke: var(--vis-annotations-debug-bounding-box-stroke-color);\n stroke-width: 1;\n`\n"],"names":[],"mappings":";;;AAKA,MAAM,cAAc,GAAG;AACrB,IAAA,8BAA8B,EAAE,SAAS;AAEzC,IAAA,0CAA0C,EAAE,MAAM;AAClD,IAAA,0CAA0C,EAAE,KAAK;AACjD,IAAA,8CAA8C,EAAE,MAAM;AAEtD,IAAA,wCAAwC,EAAE,MAAM;AAChD,IAAA,sCAAsC,EAAE,MAAM;AAC9C,IAAA,4CAA4C,EAAE,MAAM;AAEpD,IAAA,mDAAmD,EAAE,MAAM;AAE3D,IAAA,mCAAmC,EAAE,SAAS;AAC9C,IAAA,+CAA+C,EAAE,MAAM;AACvD,IAAA,6CAA6C,EAAE,MAAM;CACtD,CAAA;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA,CAAA;;EAEtB;MACY,SAAS,GAAG,cAAc,CAAC,cAAc,EAAC;AACvD,wBAAwB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAEvC,MAAM,UAAU,GAAG,GAAG,CAAA,CAAA;;EAE5B;AAEM,MAAM,iBAAiB,GAAG,GAAG,CAAA,CAAA;;;;AAIlB,gBAAA,EAAA,SAAS,CAAC,+BAA+B,CAAA;AACnC,sBAAA,EAAA,SAAS,CAAC,+BAA+B,CAAA;AACrC,0BAAA,EAAA,SAAS,CAAC,mCAAmC,CAAA;;;;AAIvD,gBAAA,EAAA,SAAS,CAAC,6BAA6B,CAAA;AACzC,cAAA,EAAA,SAAS,CAAC,2BAA2B,CAAA;AACzB,0BAAA,EAAA,SAAS,CAAC,iCAAiC,CAAA;;EAEtE;AAEM,MAAM,iBAAiB,GAAG,GAAG,CAAA,CAAA;;;;;EAKnC;AAEM,MAAM,gBAAgB,GAAG,GAAG,CAAA,CAAA;;;;;;;;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { XYComponentConfigInterface } from "../../core/xy-component/config";
|
|
2
2
|
import { CurveType } from "../../types/curve";
|
|
3
|
-
import { ColorAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
3
|
+
import { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
4
|
+
import { FillPatternType, LinePatternType } from "../../styles/patterns";
|
|
4
5
|
export interface AreaConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {
|
|
5
6
|
/** Area color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */
|
|
6
7
|
color?: ColorAccessor<Datum[]>;
|
|
8
|
+
/** Area fill pattern accessor. Resolves to a `FillPatternType`. The whole data array is passed as the first argument. Default: `undefined` */
|
|
9
|
+
pattern?: GenericAccessor<FillPatternType, Datum[]>;
|
|
7
10
|
/** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */
|
|
8
11
|
curveType?: CurveType | string;
|
|
9
12
|
/** Baseline value or accessor function. Default: `undefined` */
|
|
@@ -12,6 +15,16 @@ export interface AreaConfigInterface<Datum> extends XYComponentConfigInterface<D
|
|
|
12
15
|
opacity?: NumericAccessor<Datum[]>;
|
|
13
16
|
/** Optional area cursor. String or accessor function. Default: `null` */
|
|
14
17
|
cursor?: StringAccessor<Datum[]>;
|
|
18
|
+
/** Display a line on the top of the area. Default: `false` */
|
|
19
|
+
line?: boolean;
|
|
20
|
+
/** Line color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */
|
|
21
|
+
lineColor?: ColorAccessor<Datum[]>;
|
|
22
|
+
/** Line width in pixels. Default: `2` */
|
|
23
|
+
lineWidth?: number;
|
|
24
|
+
/** Line dash array, see SVG's stroke-dasharray. Default: `undefined` */
|
|
25
|
+
lineDashArray?: GenericAccessor<number[], Datum[]>;
|
|
26
|
+
/** Pattern accessor for the area's outline. Resolves to a `LinePatternType`. The whole data array is passed as the first argument. Default: `undefined` */
|
|
27
|
+
linePattern?: GenericAccessor<LinePatternType, Datum[]>;
|
|
15
28
|
/** If an area is smaller than 1px, extend it to have 1px height. Default: `false`
|
|
16
29
|
* @deprecated Use minHeight instead
|
|
17
30
|
*/
|
|
@@ -21,5 +34,7 @@ export interface AreaConfigInterface<Datum> extends XYComponentConfigInterface<D
|
|
|
21
34
|
* practically invisible, but you want to show that the data behind them exists and they're not just empty segments.
|
|
22
35
|
* Default: `undefined` */
|
|
23
36
|
minHeight?: number;
|
|
37
|
+
/** Whether to stack min height areas or not. Default: `undefined` */
|
|
38
|
+
stackMinHeight?: boolean;
|
|
24
39
|
}
|
|
25
40
|
export declare const AreaDefaultConfig: AreaConfigInterface<unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { XYComponentDefaultConfig } from '../../core/xy-component/config.js';
|
|
2
2
|
import { CurveType } from '../../types/curve.js';
|
|
3
3
|
|
|
4
|
-
const AreaDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { color: undefined, curveType: CurveType.MonotoneX, baseline: () => 0, opacity: 1, cursor: null, minHeight1Px: false, minHeight: undefined });
|
|
4
|
+
const AreaDefaultConfig = Object.assign(Object.assign({}, XYComponentDefaultConfig), { color: undefined, curveType: CurveType.MonotoneX, baseline: () => 0, opacity: 1, cursor: null, line: false, lineColor: undefined, lineWidth: 2, lineDashArray: undefined, minHeight1Px: false, minHeight: undefined, stackMinHeight: false });
|
|
5
5
|
|
|
6
6
|
export { AreaDefaultConfig };
|
|
7
7
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/area/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from 'core/xy-component/config'\n\n// Types\nimport { CurveType } from 'types/curve'\nimport { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\n\nexport interface AreaConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Area color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */\n color?: ColorAccessor<Datum[]>;\n /** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */\n curveType?: CurveType | string;\n /** Baseline value or accessor function. Default: `undefined` */\n baseline?: NumericAccessor<Datum>;\n /** Opacity value or accessor function. Default: `1` */\n opacity?: NumericAccessor<Datum[]>;\n /** Optional area cursor. String or accessor function. Default: `null` */\n cursor?: StringAccessor<Datum[]>;\n /** If an area is smaller than 1px, extend it to have 1px height. Default: `false`\n * @deprecated Use minHeight instead\n */\n minHeight1Px?: boolean;\n /** Minimum height of the area, use carefully.\n * This setting is useful when some of the area values are zeros or very small so visually they become\n * practically invisible, but you want to show that the data behind them exists and they're not just empty segments.\n * Default: `undefined` */\n minHeight?: number;\n}\n\nexport const AreaDefaultConfig: AreaConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n color: undefined,\n curveType: CurveType.MonotoneX,\n baseline: (): number => 0,\n opacity: 1,\n cursor: null,\n minHeight1Px: false,\n minHeight: undefined,\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/area/config.ts"],"sourcesContent":["import { XYComponentConfigInterface, XYComponentDefaultConfig } from '@/core/xy-component/config'\n\n// Types\nimport { CurveType } from '@/types/curve'\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from '@/types/accessor'\nimport { FillPatternType, LinePatternType } from '@/styles/patterns'\n\nexport interface AreaConfigInterface<Datum> extends XYComponentConfigInterface<Datum> {\n /** Area color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */\n color?: ColorAccessor<Datum[]>;\n /** Area fill pattern accessor. Resolves to a `FillPatternType`. The whole data array is passed as the first argument. Default: `undefined` */\n pattern?: GenericAccessor<FillPatternType, Datum[]>;\n /** Curve type from the CurveType enum. Default: `CurveType.MonotoneX` */\n curveType?: CurveType | string;\n /** Baseline value or accessor function. Default: `undefined` */\n baseline?: NumericAccessor<Datum>;\n /** Opacity value or accessor function. Default: `1` */\n opacity?: NumericAccessor<Datum[]>;\n /** Optional area cursor. String or accessor function. Default: `null` */\n cursor?: StringAccessor<Datum[]>;\n /** Display a line on the top of the area. Default: `false` */\n line?: boolean;\n /** Line color accessor function. The whole data array will be passed as the first argument. Default: `undefined` */\n lineColor?: ColorAccessor<Datum[]>;\n /** Line width in pixels. Default: `2` */\n lineWidth?: number;\n /** Line dash array, see SVG's stroke-dasharray. Default: `undefined` */\n lineDashArray?: GenericAccessor<number[], Datum[]>;\n /** Pattern accessor for the area's outline. Resolves to a `LinePatternType`. The whole data array is passed as the first argument. Default: `undefined` */\n linePattern?: GenericAccessor<LinePatternType, Datum[]>;\n /** If an area is smaller than 1px, extend it to have 1px height. Default: `false`\n * @deprecated Use minHeight instead\n */\n minHeight1Px?: boolean;\n /** Minimum height of the area, use carefully.\n * This setting is useful when some of the area values are zeros or very small so visually they become\n * practically invisible, but you want to show that the data behind them exists and they're not just empty segments.\n * Default: `undefined` */\n minHeight?: number;\n /** Whether to stack min height areas or not. Default: `undefined` */\n stackMinHeight?: boolean;\n}\n\nexport const AreaDefaultConfig: AreaConfigInterface<unknown> = {\n ...XYComponentDefaultConfig,\n color: undefined,\n curveType: CurveType.MonotoneX,\n baseline: (): number => 0,\n opacity: 1,\n cursor: null,\n line: false,\n lineColor: undefined,\n lineWidth: 2,\n lineDashArray: undefined,\n minHeight1Px: false,\n minHeight: undefined,\n stackMinHeight: false,\n}\n"],"names":[],"mappings":";;;AA2Ca,MAAA,iBAAiB,GACzB,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,wBAAwB,CAC3B,EAAA,EAAA,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,SAAS,CAAC,SAAS,EAC9B,QAAQ,EAAE,MAAc,CAAC,EACzB,OAAO,EAAE,CAAC,EACV,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,KAAK,EACX,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,EACZ,aAAa,EAAE,SAAS,EACxB,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,KAAK,EAAA;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { XYComponentCore } from "../../core/xy-component";
|
|
2
|
+
import { Spacing } from "../../types/spacing";
|
|
3
|
+
import { AreaDatum } from './types';
|
|
2
4
|
import { AreaConfigInterface } from './config';
|
|
3
5
|
import * as s from './style';
|
|
4
6
|
export declare class Area<Datum> extends XYComponentCore<Datum, AreaConfigInterface<Datum>> {
|
|
@@ -7,12 +9,16 @@ export declare class Area<Datum> extends XYComponentCore<Datum, AreaConfigInterf
|
|
|
7
9
|
config: AreaConfigInterface<Datum>;
|
|
8
10
|
stacked: boolean;
|
|
9
11
|
private _areaGen;
|
|
12
|
+
private _lineGen;
|
|
10
13
|
private _prevNegative;
|
|
11
14
|
events: {
|
|
12
15
|
[x: string]: {};
|
|
13
16
|
};
|
|
14
17
|
constructor(config?: AreaConfigInterface<Datum>);
|
|
18
|
+
get bleed(): Spacing;
|
|
15
19
|
_render(customDuration?: number): void;
|
|
20
|
+
_renderLines(duration: number, stackedData: AreaDatum[][]): void;
|
|
16
21
|
getYDataExtent(scaleByVisibleData: boolean): number[];
|
|
17
22
|
_emptyPath(): string;
|
|
23
|
+
_emptyLinePath(): string;
|
|
18
24
|
}
|
package/components/area/index.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { select } from 'd3-selection';
|
|
2
|
-
import { area } from 'd3-shape';
|
|
2
|
+
import { area, line } from 'd3-shape';
|
|
3
3
|
import { interpolatePath } from 'd3-interpolate-path';
|
|
4
4
|
import { XYComponentCore } from '../../core/xy-component/index.js';
|
|
5
|
-
import { isNumber, isArray, getNumber, getStackedData, getString, filterDataByRange, getStackedExtent } from '../../utils/data.js';
|
|
5
|
+
import { isNumber, isArray, getNumber, getStackedData, clamp, getString, getValue, filterDataByRange, getStackedExtent } from '../../utils/data.js';
|
|
6
6
|
import { smartTransition } from '../../utils/d3.js';
|
|
7
7
|
import { getColor } from '../../utils/color.js';
|
|
8
|
+
import { UNOVIS_PATTERN_INDEX_ATTR, getFillPatternValue, getPattern, getLinePatternValue } from '../../utils/pattern.js';
|
|
8
9
|
import { Curve } from '../../types/curve.js';
|
|
10
|
+
import { Direction } from '../../types/direction.js';
|
|
9
11
|
import { AreaDefaultConfig } from './config.js';
|
|
10
12
|
import * as style from './style.js';
|
|
11
|
-
import { area as area$1 } from './style.js';
|
|
13
|
+
import { area as area$1, areaLinePath } from './style.js';
|
|
12
14
|
|
|
13
15
|
class Area extends XYComponentCore {
|
|
14
16
|
constructor(config) {
|
|
@@ -24,10 +26,29 @@ class Area extends XYComponentCore {
|
|
|
24
26
|
// Determine if the provided chart should be stacked
|
|
25
27
|
this.stacked = Array.isArray(this.config.y);
|
|
26
28
|
}
|
|
29
|
+
get bleed() {
|
|
30
|
+
const { config: { line, lineWidth } } = this;
|
|
31
|
+
if (!line)
|
|
32
|
+
return { top: 0, bottom: 0, left: 0, right: 0 };
|
|
33
|
+
const yDomain = this.yScale.domain();
|
|
34
|
+
const yDirection = this.yScale.range()[0] > this.yScale.range()[1]
|
|
35
|
+
? Direction.North
|
|
36
|
+
: Direction.South;
|
|
37
|
+
const isYDirectionSouth = yDirection === Direction.South;
|
|
38
|
+
const isLineThick = lineWidth > 3;
|
|
39
|
+
const isLineVeryThick = lineWidth >= 10;
|
|
40
|
+
return {
|
|
41
|
+
top: !isLineVeryThick && ((!isYDirectionSouth && (yDomain[1] === 0)) || (isYDirectionSouth && (yDomain[0] === 0))) ? 0 : lineWidth / 2,
|
|
42
|
+
bottom: !isLineVeryThick && ((!isYDirectionSouth && (yDomain[0] === 0)) || (isYDirectionSouth && (yDomain[1] === 0))) ? 0 : lineWidth / 2,
|
|
43
|
+
left: isLineThick ? lineWidth / 2 : 0,
|
|
44
|
+
right: isLineThick ? lineWidth / 2 : 0,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
27
47
|
_render(customDuration) {
|
|
28
48
|
super._render(customDuration);
|
|
29
49
|
const { config, datamodel: { data } } = this;
|
|
30
50
|
const duration = isNumber(customDuration) ? customDuration : config.duration;
|
|
51
|
+
const colorOptions = { colorFn: this._colorFunction };
|
|
31
52
|
const curveGen = Curve[config.curveType];
|
|
32
53
|
this._areaGen = area()
|
|
33
54
|
.x(d => d.x)
|
|
@@ -40,15 +61,19 @@ class Area extends XYComponentCore {
|
|
|
40
61
|
const areaDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)));
|
|
41
62
|
const stacked = getStackedData(data, config.baseline, yAccessors, this._prevNegative);
|
|
42
63
|
this._prevNegative = stacked.map(s => !!s.isMostlyNegative);
|
|
64
|
+
// Clamp to the visible y range so the area and its fill stay within the container
|
|
65
|
+
const yRange = this.yScale.range();
|
|
66
|
+
const yRangeMin = Math.min(yRange[0], yRange[1]);
|
|
67
|
+
const yRangeMax = Math.max(yRange[0], yRange[1]);
|
|
43
68
|
const minHeightCumulativeArray = [];
|
|
44
69
|
const stackedData = stacked.map(arr => arr.map((d, j) => {
|
|
45
70
|
var _a, _b;
|
|
46
71
|
const x = areaDataX[j];
|
|
47
|
-
const y0 = this.yScale(d[0]);
|
|
48
|
-
const y1 = this.yScale(d[1]);
|
|
72
|
+
const y0 = clamp(this.yScale(d[0]), yRangeMin, yRangeMax);
|
|
73
|
+
const y1 = clamp(this.yScale(d[1]), yRangeMin, yRangeMax);
|
|
49
74
|
const isNegativeArea = y1 > y0;
|
|
50
|
-
//
|
|
51
|
-
const cumulative = minHeightCumulativeArray[j] || 0;
|
|
75
|
+
// Only apply cumulative adjustment if `config.stackMinHeight` is true
|
|
76
|
+
const cumulative = config.stackMinHeight ? (minHeightCumulativeArray[j] || 0) : 0;
|
|
52
77
|
const adjustedY0 = isNegativeArea ? y0 + cumulative : y0 - cumulative;
|
|
53
78
|
const adjustedY1 = isNegativeArea ? y1 + cumulative : y1 - cumulative;
|
|
54
79
|
// Calculate height adjustment if needed
|
|
@@ -56,7 +81,10 @@ class Area extends XYComponentCore {
|
|
|
56
81
|
if ((config.minHeight || config.minHeight1Px) &&
|
|
57
82
|
Math.abs(adjustedY1 - adjustedY0) < ((_a = config.minHeight) !== null && _a !== void 0 ? _a : 1)) {
|
|
58
83
|
heightAdjustment = ((_b = config.minHeight) !== null && _b !== void 0 ? _b : 1) - Math.abs(adjustedY1 - adjustedY0);
|
|
59
|
-
|
|
84
|
+
// Only update cumulative array if we're stacking min heights
|
|
85
|
+
if (config.stackMinHeight) {
|
|
86
|
+
minHeightCumulativeArray[j] = cumulative + heightAdjustment;
|
|
87
|
+
}
|
|
60
88
|
}
|
|
61
89
|
return {
|
|
62
90
|
x,
|
|
@@ -67,21 +95,24 @@ class Area extends XYComponentCore {
|
|
|
67
95
|
// We reverse the data in order to have the first areas to be displayed on top
|
|
68
96
|
// for better visibility when they're close to zero
|
|
69
97
|
const areaMaxIdx = stackedData.length - 1;
|
|
70
|
-
const stackedDataReversed = stackedData.reverse();
|
|
98
|
+
const stackedDataReversed = [...stackedData].reverse();
|
|
71
99
|
const areas = this.g
|
|
72
100
|
.selectAll(`.${area$1}`)
|
|
73
101
|
.data(stackedDataReversed);
|
|
74
102
|
const areasEnter = areas.enter().append('path')
|
|
75
103
|
.attr('class', area$1)
|
|
76
104
|
.attr('d', d => this._areaGen(d) || this._emptyPath())
|
|
105
|
+
.attr(UNOVIS_PATTERN_INDEX_ATTR, (d, i) => areaMaxIdx - i)
|
|
77
106
|
.style('opacity', 0)
|
|
78
|
-
.style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i));
|
|
107
|
+
.style('fill', (d, i) => { var _a; return getColor(data, config.color, areaMaxIdx - i, (_a = config.colorKeys) === null || _a === void 0 ? void 0 : _a[areaMaxIdx - i], colorOptions); })
|
|
108
|
+
.style('mask', (d, i) => getFillPatternValue(getPattern(data, config.pattern, areaMaxIdx - i)));
|
|
79
109
|
const areasMerged = smartTransition(areasEnter.merge(areas), duration)
|
|
80
110
|
.style('opacity', (d, i) => {
|
|
81
111
|
const isDefined = d.some(p => (p.y0 - p.y1) !== 0);
|
|
82
112
|
return isDefined ? getNumber(data, config.opacity, areaMaxIdx - i) : 0;
|
|
83
113
|
})
|
|
84
|
-
.style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))
|
|
114
|
+
.style('fill', (d, i) => { var _a; return getColor(data, config.color, areaMaxIdx - i, (_a = config.colorKeys) === null || _a === void 0 ? void 0 : _a[areaMaxIdx - i], colorOptions); })
|
|
115
|
+
.style('mask', (d, i) => getFillPatternValue(getPattern(data, config.pattern, areaMaxIdx - i)))
|
|
85
116
|
.style('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i));
|
|
86
117
|
if (duration) {
|
|
87
118
|
const transition = areasMerged;
|
|
@@ -97,6 +128,58 @@ class Area extends XYComponentCore {
|
|
|
97
128
|
smartTransition(areas.exit(), duration)
|
|
98
129
|
.style('opacity', 0)
|
|
99
130
|
.remove();
|
|
131
|
+
this._renderLines(duration, config.line ? stackedData : []);
|
|
132
|
+
}
|
|
133
|
+
_renderLines(duration, stackedData) {
|
|
134
|
+
var _a;
|
|
135
|
+
const { config, datamodel: { data } } = this;
|
|
136
|
+
const colorOptions = { colorFn: this._colorFunction };
|
|
137
|
+
const areaMaxIdx = stackedData.length - 1;
|
|
138
|
+
const stackedDataReversed = [...stackedData].reverse();
|
|
139
|
+
const colorAccessor = (_a = config.lineColor) !== null && _a !== void 0 ? _a : config.color;
|
|
140
|
+
const lines = this.g
|
|
141
|
+
.selectAll(`.${areaLinePath}`)
|
|
142
|
+
.data(stackedDataReversed);
|
|
143
|
+
const areas = this.g.selectAll(`.${area$1}`).nodes();
|
|
144
|
+
const getLineColor = (i) => { var _a; return getColor(data, colorAccessor, areaMaxIdx - i, (_a = config.colorKeys) === null || _a === void 0 ? void 0 : _a[areaMaxIdx - i], colorOptions); };
|
|
145
|
+
const getLinePattern = (i, el) => getLinePatternValue(getPattern(data, config.linePattern, areaMaxIdx - i), getLineColor(i), el);
|
|
146
|
+
// Explicit `lineDashArray` takes precedence over the resolved pattern's dash array
|
|
147
|
+
const getLineDashArray = (i) => { var _a, _b, _c, _d; return (_d = (_b = (_a = getValue(data, config.lineDashArray, i)) === null || _a === void 0 ? void 0 : _a.join(' ')) !== null && _b !== void 0 ? _b : (_c = getLinePattern(i)) === null || _c === void 0 ? void 0 : _c.dashArray) !== null && _d !== void 0 ? _d : null; };
|
|
148
|
+
const linesEnter = lines.enter().insert('path', (d, i) => areas[i + 1])
|
|
149
|
+
.attr('class', areaLinePath)
|
|
150
|
+
.attr(UNOVIS_PATTERN_INDEX_ATTR, (d, i) => areaMaxIdx - i)
|
|
151
|
+
.attr('stroke', (d, i) => getLineColor(i))
|
|
152
|
+
.attr('stroke-width', config.lineWidth)
|
|
153
|
+
.attr('stroke-opacity', 0)
|
|
154
|
+
.style('marker', function (d, i) { var _a, _b; return (_b = (_a = getLinePattern(i, this)) === null || _a === void 0 ? void 0 : _a.marker) !== null && _b !== void 0 ? _b : null; });
|
|
155
|
+
const linesMerged = smartTransition(linesEnter.merge(lines), duration)
|
|
156
|
+
.attr('stroke', (d, i) => getLineColor(i))
|
|
157
|
+
.attr('stroke-width', config.lineWidth)
|
|
158
|
+
.attr('stroke-opacity', 1)
|
|
159
|
+
.attr('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i))
|
|
160
|
+
.style('marker', (d, i, nodes) => { var _a, _b; return (_b = (_a = getLinePattern(i, nodes[i])) === null || _a === void 0 ? void 0 : _a.marker) !== null && _b !== void 0 ? _b : null; })
|
|
161
|
+
.style('stroke-dasharray', (d, i) => getLineDashArray(i));
|
|
162
|
+
const curveGen = Curve[config.curveType];
|
|
163
|
+
this._lineGen = line()
|
|
164
|
+
.x(d => d.x)
|
|
165
|
+
.y(d => d.y1)
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
167
|
+
// @ts-ignore
|
|
168
|
+
.curve(curveGen);
|
|
169
|
+
if (duration) {
|
|
170
|
+
const lineTransition = linesMerged;
|
|
171
|
+
lineTransition.attrTween('d', (d, i, el) => {
|
|
172
|
+
const previous = select(el[i]).attr('d') || this._emptyLinePath();
|
|
173
|
+
const next = this._lineGen(d) || this._emptyLinePath();
|
|
174
|
+
return interpolatePath(previous, next);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
linesMerged.attr('d', d => this._lineGen(d) || this._emptyLinePath());
|
|
179
|
+
}
|
|
180
|
+
smartTransition(lines.exit(), duration)
|
|
181
|
+
.style('opacity', 0)
|
|
182
|
+
.remove();
|
|
100
183
|
}
|
|
101
184
|
getYDataExtent(scaleByVisibleData) {
|
|
102
185
|
const { config, datamodel } = this;
|
|
@@ -115,6 +198,11 @@ class Area extends XYComponentCore {
|
|
|
115
198
|
{ y0, y1, x: xRange[1] },
|
|
116
199
|
]);
|
|
117
200
|
}
|
|
201
|
+
_emptyLinePath() {
|
|
202
|
+
const xRange = this.xScale.range();
|
|
203
|
+
const yRange = this.yScale.range();
|
|
204
|
+
return `M${xRange[0]},${yRange[0]} L${xRange[1]},${yRange[0]}`;
|
|
205
|
+
}
|
|
118
206
|
}
|
|
119
207
|
Area.selectors = style;
|
|
120
208
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/area/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\nimport { Transition } from 'd3-transition'\nimport { area, Area as AreaInterface } from 'd3-shape'\nimport { interpolatePath } from 'd3-interpolate-path'\n\n// Core\nimport { XYComponentCore } from 'core/xy-component'\n\n// Utils\nimport { getNumber, getString, isArray, isNumber, getStackedExtent, getStackedData, filterDataByRange } from 'utils/data'\nimport { smartTransition } from 'utils/d3'\nimport { getColor } from 'utils/color'\n\n// Types\nimport { Curve, CurveType } from 'types/curve'\nimport { NumericAccessor } from 'types/accessor'\n\n// Local Types\nimport { AreaDatum } from './types'\n\n// Config\nimport { AreaDefaultConfig, AreaConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Area<Datum> extends XYComponentCore<Datum, AreaConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = AreaDefaultConfig as AreaConfigInterface<Datum>\n public config: AreaConfigInterface<Datum> = this._defaultConfig\n public stacked = true\n private _areaGen: AreaInterface<AreaDatum>\n private _prevNegative: boolean[] | undefined // To help guessing the stack direction when an accessor was set to null or 0\n\n events = {\n [Area.selectors.area]: {},\n }\n\n constructor (config?: AreaConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n\n // Determine if the provided chart should be stacked\n this.stacked = Array.isArray(this.config.y)\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config, datamodel: { data } } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n\n const curveGen = Curve[config.curveType as CurveType]\n this._areaGen = area<AreaDatum>()\n .x(d => d.x)\n .y0(d => d.y0)\n .y1(d => d.y1)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .curve(curveGen)\n\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n const areaDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)))\n\n const stacked = getStackedData(data, config.baseline, yAccessors, this._prevNegative)\n this._prevNegative = stacked.map(s => !!s.isMostlyNegative)\n const minHeightCumulativeArray: number[] = []\n const stackedData: AreaDatum[][] = stacked.map(\n arr => arr.map(\n (d, j) => {\n const x = areaDataX[j]\n const y0 = this.yScale(d[0])\n const y1 = this.yScale(d[1])\n const isNegativeArea = y1 > y0\n\n // Get cumulative adjustment and apply in the correct direction\n const cumulative = minHeightCumulativeArray[j] || 0\n const adjustedY0 = isNegativeArea ? y0 + cumulative : y0 - cumulative\n const adjustedY1 = isNegativeArea ? y1 + cumulative : y1 - cumulative\n\n // Calculate height adjustment if needed\n let heightAdjustment = 0\n if ((config.minHeight || config.minHeight1Px) &&\n Math.abs(adjustedY1 - adjustedY0) < (config.minHeight ?? 1)) {\n heightAdjustment = (config.minHeight ?? 1) - Math.abs(adjustedY1 - adjustedY0)\n minHeightCumulativeArray[j] = cumulative + heightAdjustment\n }\n\n return {\n x,\n y0: adjustedY0,\n y1: isNegativeArea ? adjustedY1 + heightAdjustment : adjustedY1 - heightAdjustment,\n }\n }\n )\n )\n\n // We reverse the data in order to have the first areas to be displayed on top\n // for better visibility when they're close to zero\n const areaMaxIdx = stackedData.length - 1\n const stackedDataReversed = stackedData.reverse()\n const areas = this.g\n .selectAll<SVGPathElement, AreaDatum>(`.${s.area}`)\n .data(stackedDataReversed)\n\n const areasEnter = areas.enter().append('path')\n .attr('class', s.area)\n .attr('d', d => this._areaGen(d) || this._emptyPath())\n .style('opacity', 0)\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))\n\n const areasMerged = smartTransition(areasEnter.merge(areas), duration)\n .style('opacity', (d, i) => {\n const isDefined = d.some(p => (p.y0 - p.y1) !== 0)\n return isDefined ? getNumber(data, config.opacity, areaMaxIdx - i) : 0\n })\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i))\n .style('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i))\n\n if (duration) {\n const transition = areasMerged as Transition<SVGPathElement, AreaDatum[], SVGGElement, AreaDatum[]>\n transition.attrTween('d', (d, i, el) => {\n const previous = select(el[i]).attr('d')\n const next = this._areaGen(d) || this._emptyPath()\n return interpolatePath(previous, next)\n })\n } else {\n areasMerged.attr('d', d => this._areaGen(d) || this._emptyPath())\n }\n\n smartTransition(areas.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n getYDataExtent (scaleByVisibleData: boolean): number[] {\n const { config, datamodel } = this\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n\n const xDomain = this.xScale.domain() as [number, number]\n const data = scaleByVisibleData ? filterDataByRange(datamodel.data, xDomain, config.x, true) : datamodel.data\n return getStackedExtent(data, config.baseline, ...yAccessors)\n }\n\n _emptyPath (): string {\n const xRange = this.xScale.range()\n const yDomain = this.yScale.domain() as number[]\n\n const y0 = this.yScale((yDomain[0] + yDomain[1]) / 2)\n const y1 = y0\n\n return this._areaGen([\n { y0, y1, x: xRange[0] },\n { y0, y1, x: xRange[1] },\n ])\n }\n}\n"],"names":["s.area","s"],"mappings":";;;;;;;;;;;;AA0BM,MAAO,IAAY,SAAQ,eAAkD,CAAA;AAYjF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAXC,IAAc,CAAA,cAAA,GAAG,iBAA+C,CAAA;AACnE,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QACxD,IAAO,CAAA,OAAA,GAAG,IAAI,CAAA;AAIrB,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,EAAE;SAC1B,CAAA;AAIC,QAAA,IAAI,MAAM;AAAE,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;;AAGlC,QAAA,IAAI,CAAC,OAAO,GAAG,KA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ClC,MAAM,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAA6B,CAAA;QAE1F,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAsB,CAAA;QACxD,MAAM,IAAI,GAAG,kBAAkB,GAAG,iBAAiB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAA;QAC7G,OAAO,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,GAAG,UAAU,CAAC,CAAA;KAC9D;IAED,UAAU,GAAA;QACR,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAc,CAAA;QAEhD,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QACrD,MAAM,EAAE,GAAG,EAAE,CAAA;QAEb,OAAO,IAAI,CAAC,QAAQ,CAAC;YACnB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE;YACxB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE;AACzB,SAAA,CAAC,CAAA;KACH;;AA/HM,IAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/area/index.ts"],"sourcesContent":["import { select } from 'd3-selection'\nimport { Transition } from 'd3-transition'\nimport { area, Area as AreaInterface, line, Line as LineInterface } from 'd3-shape'\nimport { interpolatePath } from 'd3-interpolate-path'\n\n// Core\nimport { XYComponentCore } from '@/core/xy-component'\n\n// Utils\nimport { getNumber, getString, isArray, isNumber, getStackedExtent, getStackedData, filterDataByRange, getValue, clamp } from '@/utils/data'\nimport { smartTransition } from '@/utils/d3'\nimport { getColor } from '@/utils/color'\nimport { getPattern, getFillPatternValue, getLinePatternValue, UNOVIS_PATTERN_INDEX_ATTR } from '@/utils/pattern'\n\n// Types\nimport { Curve, CurveType } from '@/types/curve'\nimport { NumericAccessor } from '@/types/accessor'\nimport { Spacing } from '@/types/spacing'\nimport { Direction } from '@/types/direction'\n\n// Local Types\nimport { AreaDatum } from './types'\n\n// Config\nimport { AreaDefaultConfig, AreaConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class Area<Datum> extends XYComponentCore<Datum, AreaConfigInterface<Datum>> {\n static selectors = s\n protected _defaultConfig = AreaDefaultConfig as AreaConfigInterface<Datum>\n public config: AreaConfigInterface<Datum> = this._defaultConfig\n public stacked = true\n private _areaGen: AreaInterface<AreaDatum>\n private _lineGen: LineInterface<AreaDatum>\n private _prevNegative: boolean[] | undefined // To help guessing the stack direction when an accessor was set to null or 0\n\n events = {\n [Area.selectors.area]: {},\n }\n\n constructor (config?: AreaConfigInterface<Datum>) {\n super()\n if (config) this.setConfig(config)\n\n // Determine if the provided chart should be stacked\n this.stacked = Array.isArray(this.config.y)\n }\n\n get bleed (): Spacing {\n const { config: { line, lineWidth } } = this\n if (!line) return { top: 0, bottom: 0, left: 0, right: 0 }\n\n const yDomain = this.yScale.domain() as [number, number]\n const yDirection = this.yScale.range()[0] > this.yScale.range()[1]\n ? Direction.North\n : Direction.South\n const isYDirectionSouth = yDirection === Direction.South\n\n const isLineThick = lineWidth > 3\n const isLineVeryThick = lineWidth >= 10\n return {\n top: !isLineVeryThick && (\n (!isYDirectionSouth && (yDomain[1] === 0)) || (isYDirectionSouth && (yDomain[0] === 0))\n ) ? 0 : lineWidth / 2,\n bottom: !isLineVeryThick && (\n (!isYDirectionSouth && (yDomain[0] === 0)) || (isYDirectionSouth && (yDomain[1] === 0))\n ) ? 0 : lineWidth / 2,\n left: isLineThick ? lineWidth / 2 : 0,\n right: isLineThick ? lineWidth / 2 : 0,\n }\n }\n\n _render (customDuration?: number): void {\n super._render(customDuration)\n const { config, datamodel: { data } } = this\n const duration = isNumber(customDuration) ? customDuration : config.duration\n const colorOptions = { colorFn: this._colorFunction }\n\n const curveGen = Curve[config.curveType as CurveType]\n this._areaGen = area<AreaDatum>()\n .x(d => d.x)\n .y0(d => d.y0)\n .y1(d => d.y1)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .curve(curveGen)\n\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n const areaDataX = data.map((d, i) => this.xScale(getNumber(d, config.x, i)))\n\n const stacked = getStackedData(data, config.baseline, yAccessors, this._prevNegative)\n this._prevNegative = stacked.map(s => !!s.isMostlyNegative)\n\n // Clamp to the visible y range so the area and its fill stay within the container\n const yRange = this.yScale.range()\n const yRangeMin = Math.min(yRange[0], yRange[1])\n const yRangeMax = Math.max(yRange[0], yRange[1])\n\n const minHeightCumulativeArray: number[] = []\n const stackedData: AreaDatum[][] = stacked.map(\n arr => arr.map(\n (d, j) => {\n const x = areaDataX[j]\n const y0 = clamp(this.yScale(d[0]), yRangeMin, yRangeMax)\n const y1 = clamp(this.yScale(d[1]), yRangeMin, yRangeMax)\n const isNegativeArea = y1 > y0\n\n // Only apply cumulative adjustment if `config.stackMinHeight` is true\n const cumulative = config.stackMinHeight ? (minHeightCumulativeArray[j] || 0) : 0\n const adjustedY0 = isNegativeArea ? y0 + cumulative : y0 - cumulative\n const adjustedY1 = isNegativeArea ? y1 + cumulative : y1 - cumulative\n\n // Calculate height adjustment if needed\n let heightAdjustment = 0\n if ((config.minHeight || config.minHeight1Px) &&\n Math.abs(adjustedY1 - adjustedY0) < (config.minHeight ?? 1)) {\n heightAdjustment = (config.minHeight ?? 1) - Math.abs(adjustedY1 - adjustedY0)\n\n // Only update cumulative array if we're stacking min heights\n if (config.stackMinHeight) {\n minHeightCumulativeArray[j] = cumulative + heightAdjustment\n }\n }\n\n return {\n x,\n y0: adjustedY0,\n y1: isNegativeArea ? adjustedY1 + heightAdjustment : adjustedY1 - heightAdjustment,\n }\n }\n )\n )\n\n // We reverse the data in order to have the first areas to be displayed on top\n // for better visibility when they're close to zero\n const areaMaxIdx = stackedData.length - 1\n const stackedDataReversed = [...stackedData].reverse()\n const areas = this.g\n .selectAll<SVGPathElement, AreaDatum>(`.${s.area}`)\n .data(stackedDataReversed)\n\n const areasEnter = areas.enter().append('path')\n .attr('class', s.area)\n .attr('d', d => this._areaGen(d) || this._emptyPath())\n .attr(UNOVIS_PATTERN_INDEX_ATTR, (d, i) => areaMaxIdx - i)\n .style('opacity', 0)\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i, config.colorKeys?.[areaMaxIdx - i], colorOptions))\n .style('mask', (d, i) => getFillPatternValue(getPattern(data, config.pattern, areaMaxIdx - i)))\n\n const areasMerged = smartTransition(areasEnter.merge(areas), duration)\n .style('opacity', (d, i) => {\n const isDefined = d.some(p => (p.y0 - p.y1) !== 0)\n return isDefined ? getNumber(data, config.opacity, areaMaxIdx - i) : 0\n })\n .style('fill', (d, i) => getColor(data, config.color, areaMaxIdx - i, config.colorKeys?.[areaMaxIdx - i], colorOptions))\n .style('mask', (d, i) => getFillPatternValue(getPattern(data, config.pattern, areaMaxIdx - i)))\n .style('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i))\n\n if (duration) {\n const transition = areasMerged as Transition<SVGPathElement, AreaDatum[], SVGGElement, AreaDatum[]>\n transition.attrTween('d', (d, i, el) => {\n const previous = select(el[i]).attr('d')\n const next = this._areaGen(d) || this._emptyPath()\n return interpolatePath(previous, next)\n })\n } else {\n areasMerged.attr('d', d => this._areaGen(d) || this._emptyPath())\n }\n\n smartTransition(areas.exit(), duration)\n .style('opacity', 0)\n .remove()\n\n this._renderLines(duration, config.line ? stackedData : [])\n }\n\n _renderLines (duration: number, stackedData: AreaDatum[][]): void {\n const { config, datamodel: { data } } = this\n const colorOptions = { colorFn: this._colorFunction }\n const areaMaxIdx = stackedData.length - 1\n const stackedDataReversed = [...stackedData].reverse()\n const colorAccessor = config.lineColor ?? config.color\n const lines = this.g\n .selectAll<SVGPathElement, AreaDatum[]>(`.${s.areaLinePath}`)\n .data(stackedDataReversed)\n\n const areas = this.g.selectAll(`.${s.area}`).nodes()\n\n const getLineColor = (i: number): string => getColor(data, colorAccessor, areaMaxIdx - i, config.colorKeys?.[areaMaxIdx - i], colorOptions)\n const getLinePattern = (i: number, el?: SVGPathElement | null): { marker: string | null; dashArray: string | null } | null =>\n getLinePatternValue(getPattern(data, config.linePattern, areaMaxIdx - i), getLineColor(i), el)\n // Explicit `lineDashArray` takes precedence over the resolved pattern's dash array\n const getLineDashArray = (i: number): string | null =>\n getValue<Datum[], number[]>(data, config.lineDashArray, i)?.join(' ') ?? getLinePattern(i)?.dashArray ?? null\n\n const linesEnter = lines.enter().insert('path', (d, i) => areas[i + 1])\n .attr('class', s.areaLinePath)\n .attr(UNOVIS_PATTERN_INDEX_ATTR, (d, i) => areaMaxIdx - i)\n .attr('stroke', (d, i) => getLineColor(i))\n .attr('stroke-width', config.lineWidth)\n .attr('stroke-opacity', 0)\n .style('marker', function (d, i) { return getLinePattern(i, this)?.marker ?? null })\n\n const linesMerged = smartTransition(linesEnter.merge(lines), duration)\n .attr('stroke', (d, i) => getLineColor(i))\n .attr('stroke-width', config.lineWidth)\n .attr('stroke-opacity', 1)\n .attr('cursor', (d, i) => getString(data, config.cursor, areaMaxIdx - i))\n .style('marker', (d, i, nodes) => getLinePattern(i, nodes[i])?.marker ?? null)\n .style('stroke-dasharray', (d, i) => getLineDashArray(i))\n\n const curveGen = Curve[config.curveType as CurveType]\n this._lineGen = line<AreaDatum>()\n .x(d => d.x)\n .y(d => d.y1)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .curve(curveGen)\n\n if (duration) {\n const lineTransition = linesMerged as Transition<SVGPathElement, AreaDatum[], SVGGElement, AreaDatum[]>\n lineTransition.attrTween('d', (d, i, el) => {\n const previous = select(el[i]).attr('d') || this._emptyLinePath()\n const next = this._lineGen(d) || this._emptyLinePath()\n return interpolatePath(previous, next)\n })\n } else {\n linesMerged.attr('d', d => this._lineGen(d) || this._emptyLinePath())\n }\n\n smartTransition(lines.exit(), duration)\n .style('opacity', 0)\n .remove()\n }\n\n getYDataExtent (scaleByVisibleData: boolean): number[] {\n const { config, datamodel } = this\n const yAccessors = (isArray(config.y) ? config.y : [config.y]) as NumericAccessor<Datum>[]\n\n const xDomain = this.xScale.domain() as [number, number]\n const data = scaleByVisibleData ? filterDataByRange(datamodel.data, xDomain, config.x, true) : datamodel.data\n return getStackedExtent(data, config.baseline, ...yAccessors)\n }\n\n _emptyPath (): string {\n const xRange = this.xScale.range()\n const yDomain = this.yScale.domain() as number[]\n\n const y0 = this.yScale((yDomain[0] + yDomain[1]) / 2)\n const y1 = y0\n\n return this._areaGen([\n { y0, y1, x: xRange[0] },\n { y0, y1, x: xRange[1] },\n ])\n }\n\n _emptyLinePath (): string {\n const xRange = this.xScale.range()\n const yRange = this.yScale.range()\n return `M${xRange[0]},${yRange[0]} L${xRange[1]},${yRange[0]}`\n }\n}\n"],"names":["s.area","s.areaLinePath","s"],"mappings":";;;;;;;;;;;;;;AA6BM,MAAO,IAAY,SAAQ,eAAkD,CAAA;AAajF,IAAA,WAAA,CAAa,MAAmC,EAAA;AAC9C,QAAA,KAAK,EAAE,CAAA;QAZC,IAAc,CAAA,cAAA,GAAG,iBAA+C,CAAA;AACnE,QAAA,IAAA,CAAA,MAAM,GAA+B,IAAI,CAAC,cAAc,CAAA;QACxD,IAAO,CAAA,OAAA,GAAG,IAAI,CAAA;AAKrB,QAAA,IAAA,CAAA,MAAM,GAAG;AACP,YAAA,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,EAAE;SAC1B,CAAA;AAI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