minerva-design 1.7.0 → 1.8.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/custom-elements.json +10 -2
  3. package/dist/angular/fesm2022/minerva-angular.mjs +40 -5
  4. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  5. package/dist/angular/types/minerva-angular.d.ts +14 -1
  6. package/dist/charts/react/charts.cjs +1 -1
  7. package/dist/charts/react/charts.cjs.map +1 -1
  8. package/dist/charts/react/charts.js +120 -97
  9. package/dist/charts/react/charts.js.map +1 -1
  10. package/dist/charts/react/types.d.cts +8 -0
  11. package/dist/charts/react/types.d.ts +8 -0
  12. package/dist/core/contracts.cjs +1 -1
  13. package/dist/core/contracts.cjs.map +1 -1
  14. package/dist/core/contracts.js +1 -1
  15. package/dist/core/contracts.js.map +1 -1
  16. package/dist/vue/components/Chart/QuadrantChart.vue.d.ts +4 -0
  17. package/dist/vue/components/Chart/QuadrantChart.vue.js.map +1 -1
  18. package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js +48 -37
  19. package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  20. package/dist/vue/components/Chart/cartesian.d.ts +1 -0
  21. package/dist/vue/components/Chart/cartesian.js +1 -0
  22. package/dist/vue/components/Chart/cartesian.js.map +1 -1
  23. package/dist/web-components/components/chart/chart.d.ts +1 -0
  24. package/dist/web-components/components/chart/chart.js +1 -0
  25. package/dist/web-components/components/chart/chart.js.map +1 -1
  26. package/dist/web-components/components/chart/charts.d.ts +6 -1
  27. package/dist/web-components/components/chart/charts.js +31 -15
  28. package/dist/web-components/components/chart/charts.js.map +1 -1
  29. package/dist/web-components/html-custom-data.json +2 -2
  30. package/dist/web-components/types/react.d.ts +2 -0
  31. package/dist/web-components/types/solid.d.ts +2 -0
  32. package/dist/web-components/types/svelte.d.ts +2 -0
  33. package/dist/web-components/types/vue.d.ts +2 -0
  34. package/package.json +1 -1
@@ -81,6 +81,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
81
81
  hover: (event: ChartHoverEvent | null) => any;
82
82
  pointClick: (point: QuadrantPoint, index: number) => any;
83
83
  rendererChange: (renderer: ChartRendererKind) => any;
84
+ pointDoubleClick: (point: QuadrantPoint, index: number) => any;
85
+ pointDrag: (point: QuadrantPoint, index: number, target: QuadrantDropTarget) => any;
84
86
  quadrantClick: (quadrant: keyof QuadrantRegions, position: {
85
87
  x: number;
86
88
  y: number;
@@ -166,6 +168,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
166
168
  onHover?: ((event: ChartHoverEvent | null) => any) | undefined;
167
169
  onPointClick?: ((point: QuadrantPoint, index: number) => any) | undefined;
168
170
  onRendererChange?: ((renderer: ChartRendererKind) => any) | undefined;
171
+ onPointDoubleClick?: ((point: QuadrantPoint, index: number) => any) | undefined;
172
+ onPointDrag?: ((point: QuadrantPoint, index: number, target: QuadrantDropTarget) => any) | undefined;
169
173
  onQuadrantClick?: ((quadrant: keyof QuadrantRegions, position: {
170
174
  x: number;
171
175
  y: number;
@@ -1 +1 @@
1
- {"version":3,"file":"QuadrantChart.vue.js","names":["_sfc_main","QuadrantChart_vue_vue_type_script_setup_true_lang_default","QuadrantChart_default"],"sources":["../../../../../vue/src/components/Chart/QuadrantChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCurrentInstance, type PropType } from \"vue\";\nimport {\n quadrantChartOptions,\n quadrantOf,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantAxisLabels,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantRegions,\n} from \"minerva-design/charts/core\";\nimport { engineOptions, useCartesianChart } from \"./cartesian\";\nimport { raw } from \"./engine\";\nimport { chartCommonProps } from \"./props\";\nimport type { QuadrantDropTarget } from \"./types\";\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\ndefineOptions({ name: \"QuadrantChart\" });\nconst props = defineProps({\n ...chartCommonProps,\n /** Points to place (replace the array to update the chart) */\n points: { type: Array as PropType<readonly QuadrantPoint[]>, required: true },\n /** Range of the horizontal axis (default `[0, 10]`) */\n xDomain: Array as unknown as PropType<[number, number]>,\n /** Range of the vertical axis (default `[0, 10]`) */\n yDomain: Array as unknown as PropType<[number, number]>,\n /** X value of the vertical divider (the middle of `xDomain` by default) */\n xSplit: Number,\n /** Y value of the horizontal divider (the middle of `yDomain` by default) */\n ySplit: Number,\n /** Titles and colors of the quadrants */\n quadrants: Object as PropType<QuadrantRegions>,\n /** Title of the horizontal axis */\n xLabel: String,\n /** Title of the vertical axis */\n yLabel: String,\n /** Texts at the ends of the dividers, drawn inside the plot */\n axisLabels: Object as PropType<QuadrantAxisLabels>,\n /** Shows the numeric ticks of the axes (default `true`) */\n showTicks: { type: Boolean, default: undefined },\n /** Reverses the horizontal axis (e.g. \"urgent\" on the left) */\n reverseX: { type: Boolean, default: undefined },\n /** Draws the labels next to the dots (default `true`) */\n showLabels: { type: Boolean, default: undefined },\n /** Dot diameter in pixels (default 12) */\n pointSize: Number,\n /** Name of the points in the tooltip */\n name: String,\n /** Lets the user drag the dots (default: when a `pointDrop` listener is set) */\n draggable: { type: Boolean, default: undefined },\n});\nconst emit = defineEmits<{\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked */\n pointClick: [point: QuadrantPoint, index: number];\n /** The empty area of a quadrant was clicked */\n quadrantClick: [quadrant: QuadrantCorner, position: { x: number; y: number }];\n /** A dragged point was released (the chart does not move it: update `points`) */\n pointDrop: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\nconst vnode = getCurrentInstance()?.vnode;\nconst geometry = () => ({\n xDomain: raw(props.xDomain),\n yDomain: raw(props.yDomain),\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\nconst { setContainer, rootStyle, handle } = useCartesianChart(\n props,\n () =>\n quadrantChartOptions(\n {\n ...geometry(),\n points: raw(props.points).map(raw),\n quadrants: raw(props.quadrants),\n xLabel: props.xLabel,\n yLabel: props.yLabel,\n axisLabels: raw(props.axisLabels),\n showTicks: props.showTicks,\n showLabels: props.showLabels,\n pointSize: props.pointSize,\n name: props.name,\n draggable: props.draggable ?? !!vnode?.props?.onPointDrop,\n },\n (({ series: _series, ...rest }) => rest)(engineOptions(props, [])),\n ),\n {\n hover: (event) => emit(\"hover\", event),\n click: (event) => {\n const index = event.items[0]?.index;\n const point = index === undefined ? undefined : props.points[index];\n if (point && index !== undefined) emit(\"pointClick\", point, index);\n },\n plotClick: (at) =>\n emit(\"quadrantClick\", quadrantOf(geometry(), at.x, at.y), {\n x: at.x,\n y: at.y,\n }),\n drop: (event) => {\n const index = event.item.index;\n const point = props.points[index];\n if (!point) return;\n emit(\"pointDrop\", point, index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry(), event.x, event.y),\n });\n },\n zoom: (view) => emit(\"zoom\", view),\n renderer: (renderer) => emit(\"rendererChange\", renderer),\n },\n);\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n class=\"mn-chart mn-quadrant-chart\"\n data-minerva=\"chart\"\n :style=\"rootStyle\"\n >\n <div :ref=\"setContainer\" style=\"position: absolute; inset: 0\"></div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"QuadrantChart.vue.js","names":["_sfc_main","QuadrantChart_vue_vue_type_script_setup_true_lang_default","QuadrantChart_default"],"sources":["../../../../../vue/src/components/Chart/QuadrantChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCurrentInstance, type PropType } from \"vue\";\nimport {\n quadrantChartOptions,\n quadrantOf,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantAxisLabels,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantRegions,\n} from \"minerva-design/charts/core\";\nimport { engineOptions, useCartesianChart } from \"./cartesian\";\nimport { raw } from \"./engine\";\nimport { chartCommonProps } from \"./props\";\nimport type { QuadrantDropTarget } from \"./types\";\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\ndefineOptions({ name: \"QuadrantChart\" });\nconst props = defineProps({\n ...chartCommonProps,\n /** Points to place (replace the array to update the chart) */\n points: { type: Array as PropType<readonly QuadrantPoint[]>, required: true },\n /** Range of the horizontal axis (default `[0, 10]`) */\n xDomain: Array as unknown as PropType<[number, number]>,\n /** Range of the vertical axis (default `[0, 10]`) */\n yDomain: Array as unknown as PropType<[number, number]>,\n /** X value of the vertical divider (the middle of `xDomain` by default) */\n xSplit: Number,\n /** Y value of the horizontal divider (the middle of `yDomain` by default) */\n ySplit: Number,\n /** Titles and colors of the quadrants */\n quadrants: Object as PropType<QuadrantRegions>,\n /** Title of the horizontal axis */\n xLabel: String,\n /** Title of the vertical axis */\n yLabel: String,\n /** Texts at the ends of the dividers, drawn inside the plot */\n axisLabels: Object as PropType<QuadrantAxisLabels>,\n /** Shows the numeric ticks of the axes (default `true`) */\n showTicks: { type: Boolean, default: undefined },\n /** Reverses the horizontal axis (e.g. \"urgent\" on the left) */\n reverseX: { type: Boolean, default: undefined },\n /** Draws the labels next to the dots (default `true`) */\n showLabels: { type: Boolean, default: undefined },\n /** Dot diameter in pixels (default 12) */\n pointSize: Number,\n /** Name of the points in the tooltip */\n name: String,\n /** Lets the user drag the dots (default: when a `pointDrop` listener is set) */\n draggable: { type: Boolean, default: undefined },\n});\nconst emit = defineEmits<{\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked */\n pointClick: [point: QuadrantPoint, index: number];\n /** The same point was clicked twice in quick succession */\n pointDoubleClick: [point: QuadrantPoint, index: number];\n /** A point is being dragged (on every move, with the quadrant under the pointer) */\n pointDrag: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The empty area of a quadrant was clicked */\n quadrantClick: [quadrant: QuadrantCorner, position: { x: number; y: number }];\n /** A dragged point was released (the chart does not move it: update `points`) */\n pointDrop: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\nconst vnode = getCurrentInstance()?.vnode;\n/** Two clicks on the same point within this delay count as a double click */\nconst DOUBLE_CLICK_MS = 400;\nlet lastClick: { index: number; time: number } | null = null;\nconst geometry = () => ({\n xDomain: raw(props.xDomain),\n yDomain: raw(props.yDomain),\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\nconst dropAt = (event: ChartDragEvent): QuadrantDropTarget => ({\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry(), event.x, event.y),\n});\nconst { setContainer, rootStyle, handle } = useCartesianChart(\n props,\n () =>\n quadrantChartOptions(\n {\n ...geometry(),\n points: raw(props.points).map(raw),\n quadrants: raw(props.quadrants),\n xLabel: props.xLabel,\n yLabel: props.yLabel,\n axisLabels: raw(props.axisLabels),\n showTicks: props.showTicks,\n showLabels: props.showLabels,\n pointSize: props.pointSize,\n name: props.name,\n draggable:\n props.draggable ??\n !!(vnode?.props?.onPointDrop || vnode?.props?.onPointDrag),\n },\n (({ series: _series, ...rest }) => rest)(engineOptions(props, [])),\n ),\n {\n hover: (event) => emit(\"hover\", event),\n click: (event) => {\n const index = event.items[0]?.index;\n const point = index === undefined ? undefined : props.points[index];\n if (!point || index === undefined) return;\n const now = Date.now();\n const double =\n lastClick?.index === index && now - lastClick.time < DOUBLE_CLICK_MS;\n lastClick = double ? null : { index, time: now };\n emit(\"pointClick\", point, index);\n if (double) emit(\"pointDoubleClick\", point, index);\n },\n plotClick: (at) =>\n emit(\"quadrantClick\", quadrantOf(geometry(), at.x, at.y), {\n x: at.x,\n y: at.y,\n }),\n drag: (event) => {\n const point = props.points[event.item.index];\n if (point) emit(\"pointDrag\", point, event.item.index, dropAt(event));\n },\n drop: (event) => {\n const point = props.points[event.item.index];\n if (point) emit(\"pointDrop\", point, event.item.index, dropAt(event));\n },\n zoom: (view) => emit(\"zoom\", view),\n renderer: (renderer) => emit(\"rendererChange\", renderer),\n },\n);\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n class=\"mn-chart mn-quadrant-chart\"\n data-minerva=\"chart\"\n :style=\"rootStyle\"\n >\n <div :ref=\"setContainer\" style=\"position: absolute; inset: 0\"></div>\n </div>\n</template>\n"],"mappings":""}
@@ -4,7 +4,7 @@ import { chartCommonProps as r } from "./props.js";
4
4
  import { createElementBlock as i, createElementVNode as a, defineComponent as o, getCurrentInstance as s, normalizeStyle as c, openBlock as l, unref as u } from "vue";
5
5
  import { quadrantChartOptions as d, quadrantOf as f } from "../../../charts/core.js";
6
6
  //#region src/components/Chart/QuadrantChart.vue?vue&type=script&setup=true&lang.ts
7
- var p = /*@__PURE__*/ o({
7
+ var p = 400, m = /*@__PURE__*/ o({
8
8
  name: "QuadrantChart",
9
9
  __name: "QuadrantChart",
10
10
  props: {
@@ -43,57 +43,68 @@ var p = /*@__PURE__*/ o({
43
43
  emits: [
44
44
  "hover",
45
45
  "pointClick",
46
+ "pointDoubleClick",
47
+ "pointDrag",
46
48
  "quadrantClick",
47
49
  "pointDrop",
48
50
  "zoom",
49
51
  "rendererChange"
50
52
  ],
51
- setup(r, { expose: o, emit: p }) {
52
- let m = r, h = p, g = s()?.vnode, _ = () => ({
53
- xDomain: e(m.xDomain),
54
- yDomain: e(m.yDomain),
55
- xSplit: m.xSplit,
56
- ySplit: m.ySplit,
57
- reverseX: m.reverseX
58
- }), { setContainer: v, rootStyle: y, handle: b } = n(m, () => d({
59
- ..._(),
60
- points: e(m.points).map(e),
61
- quadrants: e(m.quadrants),
62
- xLabel: m.xLabel,
63
- yLabel: m.yLabel,
64
- axisLabels: e(m.axisLabels),
65
- showTicks: m.showTicks,
66
- showLabels: m.showLabels,
67
- pointSize: m.pointSize,
68
- name: m.name,
69
- draggable: m.draggable ?? !!g?.props?.onPointDrop
70
- }, (({ series: e, ...t }) => t)(t(m, []))), {
71
- hover: (e) => h("hover", e),
53
+ setup(r, { expose: o, emit: m }) {
54
+ let h = r, g = m, _ = s()?.vnode, v = null, y = () => ({
55
+ xDomain: e(h.xDomain),
56
+ yDomain: e(h.yDomain),
57
+ xSplit: h.xSplit,
58
+ ySplit: h.ySplit,
59
+ reverseX: h.reverseX
60
+ }), b = (e) => ({
61
+ x: e.x,
62
+ y: e.y,
63
+ quadrant: f(y(), e.x, e.y)
64
+ }), { setContainer: x, rootStyle: S, handle: C } = n(h, () => d({
65
+ ...y(),
66
+ points: e(h.points).map(e),
67
+ quadrants: e(h.quadrants),
68
+ xLabel: h.xLabel,
69
+ yLabel: h.yLabel,
70
+ axisLabels: e(h.axisLabels),
71
+ showTicks: h.showTicks,
72
+ showLabels: h.showLabels,
73
+ pointSize: h.pointSize,
74
+ name: h.name,
75
+ draggable: h.draggable ?? !!(_?.props?.onPointDrop || _?.props?.onPointDrag)
76
+ }, (({ series: e, ...t }) => t)(t(h, []))), {
77
+ hover: (e) => g("hover", e),
72
78
  click: (e) => {
73
- let t = e.items[0]?.index, n = t === void 0 ? void 0 : m.points[t];
74
- n && t !== void 0 && h("pointClick", n, t);
79
+ let t = e.items[0]?.index, n = t === void 0 ? void 0 : h.points[t];
80
+ if (!n || t === void 0) return;
81
+ let r = Date.now(), i = v?.index === t && r - v.time < p;
82
+ v = i ? null : {
83
+ index: t,
84
+ time: r
85
+ }, g("pointClick", n, t), i && g("pointDoubleClick", n, t);
75
86
  },
76
- plotClick: (e) => h("quadrantClick", f(_(), e.x, e.y), {
87
+ plotClick: (e) => g("quadrantClick", f(y(), e.x, e.y), {
77
88
  x: e.x,
78
89
  y: e.y
79
90
  }),
91
+ drag: (e) => {
92
+ let t = h.points[e.item.index];
93
+ t && g("pointDrag", t, e.item.index, b(e));
94
+ },
80
95
  drop: (e) => {
81
- let t = e.item.index, n = m.points[t];
82
- n && h("pointDrop", n, t, {
83
- x: e.x,
84
- y: e.y,
85
- quadrant: f(_(), e.x, e.y)
86
- });
96
+ let t = h.points[e.item.index];
97
+ t && g("pointDrop", t, e.item.index, b(e));
87
98
  },
88
- zoom: (e) => h("zoom", e),
89
- renderer: (e) => h("rendererChange", e)
99
+ zoom: (e) => g("zoom", e),
100
+ renderer: (e) => g("rendererChange", e)
90
101
  });
91
- return o(b), (e, t) => (l(), i("div", {
102
+ return o(C), (e, t) => (l(), i("div", {
92
103
  class: "mn-chart mn-quadrant-chart",
93
104
  "data-minerva": "chart",
94
- style: c(u(y))
105
+ style: c(u(S))
95
106
  }, [a("div", {
96
- ref: u(v),
107
+ ref: u(x),
97
108
  style: {
98
109
  position: "absolute",
99
110
  inset: "0"
@@ -102,6 +113,6 @@ var p = /*@__PURE__*/ o({
102
113
  }
103
114
  });
104
115
  //#endregion
105
- export { p as default };
116
+ export { m as default };
106
117
 
107
118
  //# sourceMappingURL=QuadrantChart.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuadrantChart.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_unref","_createElementVNode","QuadrantChart_vue_vue_type_script_setup_true_lang_default","chartCommonProps","__expose","__emit","props","__props","emit","vnode","getCurrentInstance","geometry","raw","useCartesianChart","quadrantChartOptions","_series","rest","engineOptions","event","index","point","quadrantOf","at","view","renderer","handle","openBlock","createElementBlock","normalizeStyle","unref","rootStyle","createElementVNode","setContainer","\"position\"","\"inset\""],"sources":["../../../../../vue/src/components/Chart/QuadrantChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCurrentInstance, type PropType } from \"vue\";\nimport {\n quadrantChartOptions,\n quadrantOf,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantAxisLabels,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantRegions,\n} from \"minerva-design/charts/core\";\nimport { engineOptions, useCartesianChart } from \"./cartesian\";\nimport { raw } from \"./engine\";\nimport { chartCommonProps } from \"./props\";\nimport type { QuadrantDropTarget } from \"./types\";\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\ndefineOptions({ name: \"QuadrantChart\" });\nconst props = defineProps({\n ...chartCommonProps,\n /** Points to place (replace the array to update the chart) */\n points: { type: Array as PropType<readonly QuadrantPoint[]>, required: true },\n /** Range of the horizontal axis (default `[0, 10]`) */\n xDomain: Array as unknown as PropType<[number, number]>,\n /** Range of the vertical axis (default `[0, 10]`) */\n yDomain: Array as unknown as PropType<[number, number]>,\n /** X value of the vertical divider (the middle of `xDomain` by default) */\n xSplit: Number,\n /** Y value of the horizontal divider (the middle of `yDomain` by default) */\n ySplit: Number,\n /** Titles and colors of the quadrants */\n quadrants: Object as PropType<QuadrantRegions>,\n /** Title of the horizontal axis */\n xLabel: String,\n /** Title of the vertical axis */\n yLabel: String,\n /** Texts at the ends of the dividers, drawn inside the plot */\n axisLabels: Object as PropType<QuadrantAxisLabels>,\n /** Shows the numeric ticks of the axes (default `true`) */\n showTicks: { type: Boolean, default: undefined },\n /** Reverses the horizontal axis (e.g. \"urgent\" on the left) */\n reverseX: { type: Boolean, default: undefined },\n /** Draws the labels next to the dots (default `true`) */\n showLabels: { type: Boolean, default: undefined },\n /** Dot diameter in pixels (default 12) */\n pointSize: Number,\n /** Name of the points in the tooltip */\n name: String,\n /** Lets the user drag the dots (default: when a `pointDrop` listener is set) */\n draggable: { type: Boolean, default: undefined },\n});\nconst emit = defineEmits<{\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked */\n pointClick: [point: QuadrantPoint, index: number];\n /** The empty area of a quadrant was clicked */\n quadrantClick: [quadrant: QuadrantCorner, position: { x: number; y: number }];\n /** A dragged point was released (the chart does not move it: update `points`) */\n pointDrop: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\nconst vnode = getCurrentInstance()?.vnode;\nconst geometry = () => ({\n xDomain: raw(props.xDomain),\n yDomain: raw(props.yDomain),\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\nconst { setContainer, rootStyle, handle } = useCartesianChart(\n props,\n () =>\n quadrantChartOptions(\n {\n ...geometry(),\n points: raw(props.points).map(raw),\n quadrants: raw(props.quadrants),\n xLabel: props.xLabel,\n yLabel: props.yLabel,\n axisLabels: raw(props.axisLabels),\n showTicks: props.showTicks,\n showLabels: props.showLabels,\n pointSize: props.pointSize,\n name: props.name,\n draggable: props.draggable ?? !!vnode?.props?.onPointDrop,\n },\n (({ series: _series, ...rest }) => rest)(engineOptions(props, [])),\n ),\n {\n hover: (event) => emit(\"hover\", event),\n click: (event) => {\n const index = event.items[0]?.index;\n const point = index === undefined ? undefined : props.points[index];\n if (point && index !== undefined) emit(\"pointClick\", point, index);\n },\n plotClick: (at) =>\n emit(\"quadrantClick\", quadrantOf(geometry(), at.x, at.y), {\n x: at.x,\n y: at.y,\n }),\n drop: (event) => {\n const index = event.item.index;\n const point = props.points[index];\n if (!point) return;\n emit(\"pointDrop\", point, index, {\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry(), event.x, event.y),\n });\n },\n zoom: (view) => emit(\"zoom\", view),\n renderer: (renderer) => emit(\"rendererChange\", renderer),\n },\n);\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n class=\"mn-chart mn-quadrant-chart\"\n data-minerva=\"chart\"\n :style=\"rootStyle\"\n >\n <div :ref=\"setContainer\" style=\"position: absolute; inset: 0\"></div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,IAAMS,IAAQC,GAiCRC,IAAOH,GAcPI,IAAQC,EAAmB,CAAC,EAAE,OAC9BC,WAAkB;GACtB,SAASC,EAAIN,EAAM,OAAO;GAC1B,SAASM,EAAIN,EAAM,OAAO;GAC1B,QAAQA,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,IACM,EAAE,iBAAc,cAAW,cAAWO,EAC1CP,SAEEQ,EACE;GACE,GAAGH,EAAS;GACZ,QAAQC,EAAIN,EAAM,MAAM,CAAC,CAAC,IAAIM,CAAG;GACjC,WAAWA,EAAIN,EAAM,SAAS;GAC9B,QAAQA,EAAM;GACd,QAAQA,EAAM;GACd,YAAYM,EAAIN,EAAM,UAAU;GAChC,WAAWA,EAAM;GACjB,YAAYA,EAAM;GAClB,WAAWA,EAAM;GACjB,MAAMA,EAAM;GACZ,WAAWA,EAAM,aAAa,CAAC,CAACG,GAAO,OAAO;EAChD,KACE,EAAE,QAAQM,GAAS,GAAGC,QAAWA,EAAA,CAAMC,EAAcX,GAAO,CAAC,CAAC,CAAC,CACnE,GACF;GACE,QAAQ,MAAUE,EAAK,SAASU,CAAK;GACrC,QAAQ,MAAU;IAChB,IAAMC,IAAQD,EAAM,MAAM,EAAE,EAAE,OACxBE,IAAQD,MAAU,KAAA,IAAY,KAAA,IAAYb,EAAM,OAAOa;IAC7D,AAAIC,KAASD,MAAU,KAAA,KAAWX,EAAK,cAAcY,GAAOD,CAAK;GACnE;GACA,YAAY,MACVX,EAAK,iBAAiBa,EAAWV,EAAS,GAAGW,EAAG,GAAGA,EAAG,CAAC,GAAG;IACxD,GAAGA,EAAG;IACN,GAAGA,EAAG;GACR,CAAC;GACH,OAAO,MAAU;IACf,IAAMH,IAAQD,EAAM,KAAK,OACnBE,IAAQd,EAAM,OAAOa;IAC3B,AAAKC,KACLZ,EAAK,aAAaY,GAAOD,GAAO;KAC9B,GAAGD,EAAM;KACT,GAAGA,EAAM;KACT,UAAUG,EAAWV,EAAS,GAAGO,EAAM,GAAGA,EAAM,CAAC;IACnD,CAAC;GACH;GACA,OAAO,MAASV,EAAK,QAAQe,CAAI;GACjC,WAAW,MAAaf,EAAK,kBAAkBgB,CAAQ;EACzD,CACF;SACApB,EAAaqB,CAAM,cAIjB5B,EAAA,GAAAC,EAMM,OAAA;GALJ,OAAM;GACN,gBAAa;GACZ,OAAKC,EAAEC,EAAA8B,CAAA,CAAS;EAEjB7B,GAAAA,CAAAA,EAAoE,OAAA;GAA9D,KAAKD,EAAAgC,CAAA;GAAc,OAAA;IAAAC,UAAA;IAAAC,OAAA;GAAA"}
1
+ {"version":3,"file":"QuadrantChart.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_unref","_createElementVNode","DOUBLE_CLICK_MS","QuadrantChart_vue_vue_type_script_setup_true_lang_default","chartCommonProps","__expose","__emit","props","__props","emit","vnode","getCurrentInstance","lastClick","geometry","raw","dropAt","event","quadrantOf","useCartesianChart","quadrantChartOptions","_series","rest","engineOptions","index","point","now","double","at","view","renderer","handle","openBlock","createElementBlock","normalizeStyle","unref","rootStyle","createElementVNode","setContainer","\"position\"","\"inset\""],"sources":["../../../../../vue/src/components/Chart/QuadrantChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getCurrentInstance, type PropType } from \"vue\";\nimport {\n quadrantChartOptions,\n quadrantOf,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartRendererKind,\n type ChartView,\n type QuadrantAxisLabels,\n type QuadrantCorner,\n type QuadrantPoint,\n type QuadrantRegions,\n} from \"minerva-design/charts/core\";\nimport { engineOptions, useCartesianChart } from \"./cartesian\";\nimport { raw } from \"./engine\";\nimport { chartCommonProps } from \"./props\";\nimport type { QuadrantDropTarget } from \"./types\";\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG, ...): tinted\n * quadrants with titles, dividers, and labelled dots placed without\n * overlapping labels. Dots can be dragged to another quadrant.\n */\ndefineOptions({ name: \"QuadrantChart\" });\nconst props = defineProps({\n ...chartCommonProps,\n /** Points to place (replace the array to update the chart) */\n points: { type: Array as PropType<readonly QuadrantPoint[]>, required: true },\n /** Range of the horizontal axis (default `[0, 10]`) */\n xDomain: Array as unknown as PropType<[number, number]>,\n /** Range of the vertical axis (default `[0, 10]`) */\n yDomain: Array as unknown as PropType<[number, number]>,\n /** X value of the vertical divider (the middle of `xDomain` by default) */\n xSplit: Number,\n /** Y value of the horizontal divider (the middle of `yDomain` by default) */\n ySplit: Number,\n /** Titles and colors of the quadrants */\n quadrants: Object as PropType<QuadrantRegions>,\n /** Title of the horizontal axis */\n xLabel: String,\n /** Title of the vertical axis */\n yLabel: String,\n /** Texts at the ends of the dividers, drawn inside the plot */\n axisLabels: Object as PropType<QuadrantAxisLabels>,\n /** Shows the numeric ticks of the axes (default `true`) */\n showTicks: { type: Boolean, default: undefined },\n /** Reverses the horizontal axis (e.g. \"urgent\" on the left) */\n reverseX: { type: Boolean, default: undefined },\n /** Draws the labels next to the dots (default `true`) */\n showLabels: { type: Boolean, default: undefined },\n /** Dot diameter in pixels (default 12) */\n pointSize: Number,\n /** Name of the points in the tooltip */\n name: String,\n /** Lets the user drag the dots (default: when a `pointDrop` listener is set) */\n draggable: { type: Boolean, default: undefined },\n});\nconst emit = defineEmits<{\n /** The hovered (or keyboard-focused) point changed (`null`: none) */\n hover: [event: ChartHoverEvent | null];\n /** A point was clicked */\n pointClick: [point: QuadrantPoint, index: number];\n /** The same point was clicked twice in quick succession */\n pointDoubleClick: [point: QuadrantPoint, index: number];\n /** A point is being dragged (on every move, with the quadrant under the pointer) */\n pointDrag: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The empty area of a quadrant was clicked */\n quadrantClick: [quadrant: QuadrantCorner, position: { x: number; y: number }];\n /** A dragged point was released (the chart does not move it: update `points`) */\n pointDrop: [point: QuadrantPoint, index: number, target: QuadrantDropTarget];\n /** The user zoomed or panned */\n zoom: [view: ChartView];\n /** The backend is ready (or fell back after a GPU loss) */\n rendererChange: [renderer: ChartRendererKind];\n}>();\nconst vnode = getCurrentInstance()?.vnode;\n/** Two clicks on the same point within this delay count as a double click */\nconst DOUBLE_CLICK_MS = 400;\nlet lastClick: { index: number; time: number } | null = null;\nconst geometry = () => ({\n xDomain: raw(props.xDomain),\n yDomain: raw(props.yDomain),\n xSplit: props.xSplit,\n ySplit: props.ySplit,\n reverseX: props.reverseX,\n});\nconst dropAt = (event: ChartDragEvent): QuadrantDropTarget => ({\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry(), event.x, event.y),\n});\nconst { setContainer, rootStyle, handle } = useCartesianChart(\n props,\n () =>\n quadrantChartOptions(\n {\n ...geometry(),\n points: raw(props.points).map(raw),\n quadrants: raw(props.quadrants),\n xLabel: props.xLabel,\n yLabel: props.yLabel,\n axisLabels: raw(props.axisLabels),\n showTicks: props.showTicks,\n showLabels: props.showLabels,\n pointSize: props.pointSize,\n name: props.name,\n draggable:\n props.draggable ??\n !!(vnode?.props?.onPointDrop || vnode?.props?.onPointDrag),\n },\n (({ series: _series, ...rest }) => rest)(engineOptions(props, [])),\n ),\n {\n hover: (event) => emit(\"hover\", event),\n click: (event) => {\n const index = event.items[0]?.index;\n const point = index === undefined ? undefined : props.points[index];\n if (!point || index === undefined) return;\n const now = Date.now();\n const double =\n lastClick?.index === index && now - lastClick.time < DOUBLE_CLICK_MS;\n lastClick = double ? null : { index, time: now };\n emit(\"pointClick\", point, index);\n if (double) emit(\"pointDoubleClick\", point, index);\n },\n plotClick: (at) =>\n emit(\"quadrantClick\", quadrantOf(geometry(), at.x, at.y), {\n x: at.x,\n y: at.y,\n }),\n drag: (event) => {\n const point = props.points[event.item.index];\n if (point) emit(\"pointDrag\", point, event.item.index, dropAt(event));\n },\n drop: (event) => {\n const point = props.points[event.item.index];\n if (point) emit(\"pointDrop\", point, event.item.index, dropAt(event));\n },\n zoom: (view) => emit(\"zoom\", view),\n renderer: (renderer) => emit(\"rendererChange\", renderer),\n },\n);\ndefineExpose(handle);\n</script>\n\n<template>\n <div\n class=\"mn-chart mn-quadrant-chart\"\n data-minerva=\"chart\"\n :style=\"rootStyle\"\n >\n <div :ref=\"setContainer\" style=\"position: absolute; inset: 0\"></div>\n </div>\n</template>\n"],"mappings":";;;;;;AA8EA,IAAMK,IAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EArDxB,IAAMK,IAAQC,GAiCRC,IAAOH,GAkBPI,IAAQC,EAAmB,CAAC,EAAE,OAGhCC,IAAoD,MAClDC,WAAkB;GACtB,SAASC,EAAIP,EAAM,OAAO;GAC1B,SAASO,EAAIP,EAAM,OAAO;GAC1B,QAAQA,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,IACMQ,KAAU,OAA+C;GAC7D,GAAGC,EAAM;GACT,GAAGA,EAAM;GACT,UAAUC,EAAWJ,EAAS,GAAGG,EAAM,GAAGA,EAAM,CAAC;EACnD,IACM,EAAE,iBAAc,cAAW,cAAWE,EAC1CX,SAEEY,EACE;GACE,GAAGN,EAAS;GACZ,QAAQC,EAAIP,EAAM,MAAM,CAAC,CAAC,IAAIO,CAAG;GACjC,WAAWA,EAAIP,EAAM,SAAS;GAC9B,QAAQA,EAAM;GACd,QAAQA,EAAM;GACd,YAAYO,EAAIP,EAAM,UAAU;GAChC,WAAWA,EAAM;GACjB,YAAYA,EAAM;GAClB,WAAWA,EAAM;GACjB,MAAMA,EAAM;GACZ,WACEA,EAAM,aACN,CAAC,EAAEG,GAAO,OAAO,eAAeA,GAAO,OAAO;EAClD,KACE,EAAE,QAAQU,GAAS,GAAGC,QAAWA,EAAA,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GAAA"}
@@ -32,6 +32,7 @@ export interface CartesianHandlers {
32
32
  plotClick?: (event: ChartPlotClickEvent) => void;
33
33
  zoom?: (view: ChartView) => void;
34
34
  renderer?: (renderer: ChartRendererKind) => void;
35
+ drag?: (event: ChartDragEvent) => void;
35
36
  drop?: (event: ChartDragEvent) => void;
36
37
  }
37
38
  /** Engine (`createChart`), root style and template handle of a cartesian chart */
@@ -36,6 +36,7 @@ function o(e, i, a, o = 320) {
36
36
  e.on("plotClick", (e) => a.plotClick?.(e)),
37
37
  e.on("zoom", (e) => a.zoom?.(e)),
38
38
  e.on("renderer", (e) => a.renderer?.(e)),
39
+ e.on("drag", (e) => a.drag?.(e)),
39
40
  e.on("drop", (e) => a.drop?.(e))
40
41
  ]);
41
42
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"cartesian.js","names":["engineOptions","raw","props","withSeriesType","series","s","item","t","type","stack","curve","useCartesianChart","useChartEngine","createChart","build","chart","handlers","event","view","renderer","useRootStyle","defaultHeight","instance"],"sources":["../../../../../vue/src/components/Chart/cartesian.ts"],"sourcesContent":["import {\n createChart,\n type ChartAnnotation,\n type ChartAxisOptions,\n type ChartCurve,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartInteractionOptions,\n type ChartLegendOptions,\n type ChartOptions,\n type ChartPadding,\n type ChartPlotClickEvent,\n type ChartRendererKind,\n type ChartRendererPreference,\n type ChartSeries,\n type ChartSeriesType,\n type ChartTooltipOptions,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { raw, useChartEngine, useRootStyle } from \"./engine\";\nimport type { ChartHandle } from \"./types\";\n\n/** The common props read by `engineOptions` */\ninterface CommonProps {\n xAxis?: ChartAxisOptions;\n yAxis?: ChartAxisOptions;\n renderer?: ChartRendererPreference;\n legend?: boolean | ChartLegendOptions;\n tooltip?: boolean | ChartTooltipOptions;\n crosshair?: boolean;\n annotations?: readonly ChartAnnotation[];\n interaction?: boolean | ChartInteractionOptions;\n padding?: ChartPadding;\n palette?: readonly string[];\n ariaLabel?: string;\n locale?: string;\n labels?: ChartOptions[\"labels\"] | boolean;\n yAxis2?: ChartAxisOptions;\n orientation?: ChartOptions[\"orientation\"];\n}\n\n/** Engine options of the common props */\nexport const engineOptions = (\n props: CommonProps,\n series: readonly ChartSeries[],\n stackMode?: ChartOptions[\"stackMode\"],\n): ChartOptions => ({\n series,\n xAxis: raw(props.xAxis),\n yAxis: raw(props.yAxis),\n renderer: props.renderer,\n legend: raw(props.legend),\n tooltip: raw(props.tooltip),\n crosshair: props.crosshair,\n annotations: raw(props.annotations),\n interaction: raw(props.interaction),\n padding: raw(props.padding),\n palette: raw(props.palette),\n ariaLabel: props.ariaLabel,\n locale: props.locale,\n // BarChart / WaterfallChart: `labels` writes the values (a boolean)\n labels: typeof props.labels === \"object\" ? raw(props.labels) : undefined,\n yAxis2: raw(props.yAxis2),\n orientation: props.orientation,\n stackMode,\n});\n\n/**\n * Gives the series without a `type` the type of the component: `stack` /\n * `curve` apply to the series of that type that do not set their own.\n */\nexport const withSeriesType = (\n series: readonly ChartSeries[],\n type: ChartSeriesType,\n stack?: string,\n curve?: ChartCurve,\n): ChartSeries[] =>\n raw(series).map((item) => {\n const s = raw(item);\n const t = s.type ?? type;\n return {\n ...s,\n data: raw(s.data),\n type: t,\n ...(stack !== undefined && t === type ? { stack: s.stack ?? stack } : {}),\n ...(curve !== undefined && (t === \"line\" || t === \"area\")\n ? { curve: s.curve ?? curve }\n : {}),\n };\n });\n\n/** Engine events forwarded by a cartesian chart */\nexport interface CartesianHandlers {\n hover?: (event: ChartHoverEvent | null) => void;\n click?: (event: ChartHoverEvent) => void;\n plotClick?: (event: ChartPlotClickEvent) => void;\n zoom?: (view: ChartView) => void;\n renderer?: (renderer: ChartRendererKind) => void;\n drop?: (event: ChartDragEvent) => void;\n}\n\n/** Engine (`createChart`), root style and template handle of a cartesian chart */\nexport function useCartesianChart(\n props: object & {\n deep?: boolean;\n width?: number | string;\n height?: number | string;\n },\n build: () => ChartOptions | null,\n handlers: CartesianHandlers,\n defaultHeight = 320,\n) {\n const { setContainer, instance } = useChartEngine<\n ChartOptions,\n ChartInstance\n >(createChart, props, build, (chart) => [\n chart.on(\"hover\", (event) => handlers.hover?.(event)),\n chart.on(\"click\", (event) => handlers.click?.(event)),\n chart.on(\"plotClick\", (event) => handlers.plotClick?.(event)),\n chart.on(\"zoom\", (view) => handlers.zoom?.(view)),\n chart.on(\"renderer\", (renderer) => handlers.renderer?.(renderer)),\n chart.on(\"drop\", (event) => handlers.drop?.(event)),\n ]);\n const handle: ChartHandle = {\n resetZoom: () => instance.value?.resetZoom(),\n getView: () => instance.value?.getView() ?? null,\n setView: (view) => instance.value?.setView(view),\n getRenderer: () => instance.value?.getRenderer() ?? null,\n getInstance: () => instance.value,\n };\n return {\n setContainer,\n rootStyle: useRootStyle(props, defaultHeight),\n handle,\n };\n}\n"],"mappings":";;;AA2CA,IAAaA,KACX,GACA,GACA,OACkB;CAClB;CACA,OAAOC,EAAIC,EAAM,KAAK;CACtB,OAAOD,EAAIC,EAAM,KAAK;CACtB,UAAUA,EAAM;CAChB,QAAQD,EAAIC,EAAM,MAAM;CACxB,SAASD,EAAIC,EAAM,OAAO;CAC1B,WAAWA,EAAM;CACjB,aAAaD,EAAIC,EAAM,WAAW;CAClC,aAAaD,EAAIC,EAAM,WAAW;CAClC,SAASD,EAAIC,EAAM,OAAO;CAC1B,SAASD,EAAIC,EAAM,OAAO;CAC1B,WAAWA,EAAM;CACjB,QAAQA,EAAM;CAEd,QAAQ,OAAOA,EAAM,UAAW,WAAWD,EAAIC,EAAM,MAAM,IAAI,KAAA;CAC/D,QAAQD,EAAIC,EAAM,MAAM;CACxB,aAAaA,EAAM;CACnB;AACF,IAMaC,KACX,GACA,GACA,GACA,MAEAF,EAAIG,CAAM,CAAC,CAAC,KAAK,MAAS;CACxB,IAAMC,IAAIJ,EAAIK,CAAI,GACZC,IAAIF,EAAE,QAAQG;CACpB,OAAO;EACL,GAAGH;EACH,MAAMJ,EAAII,EAAE,IAAI;EAChB,MAAME;EACN,GAAIE,MAAU,KAAA,KAAaF,MAAMC,IAAO,EAAE,OAAOH,EAAE,SAASI,EAAM,IAAI,CAAC;EACvE,GAAIC,MAAU,KAAA,MAAcH,MAAM,UAAUA,MAAM,UAC9C,EAAE,OAAOF,EAAE,SAASK,EAAM,IAC1B,CAAC;CACP;AACF,CAAC;AAaH,SAAgBC,EACd,GAKA,GACA,GACA,IAAgB,KAChB;CACA,IAAM,EAAE,iBAAc,gBAAaC,EAGjCC,GAAaX,GAAOY,IAAQ,MAAU;EACtCC,EAAM,GAAG,UAAU,MAAUC,EAAS,QAAQC,CAAK,CAAC;EACpDF,EAAM,GAAG,UAAU,MAAUC,EAAS,QAAQC,CAAK,CAAC;EACpDF,EAAM,GAAG,cAAc,MAAUC,EAAS,YAAYC,CAAK,CAAC;EAC5DF,EAAM,GAAG,SAAS,MAASC,EAAS,OAAOE,CAAI,CAAC;EAChDH,EAAM,GAAG,aAAa,MAAaC,EAAS,WAAWG,CAAQ,CAAC;EAChEJ,EAAM,GAAG,SAAS,MAAUC,EAAS,OAAOC,CAAK,CAAC;CACpD,CAAC;CAQD,OAAO;EACL;EACA,WAAWG,EAAalB,GAAOmB,CAAa;EAC5C,QAAA;GATA,iBAAiBC,EAAS,OAAO,UAAU;GAC3C,eAAeA,EAAS,OAAO,QAAQ,KAAK;GAC5C,UAAU,MAASA,EAAS,OAAO,QAAQJ,CAAI;GAC/C,mBAAmBI,EAAS,OAAO,YAAY,KAAK;GACpD,mBAAmBA,EAAS;EAK5B;CACF;AACF"}
1
+ {"version":3,"file":"cartesian.js","names":["engineOptions","raw","props","withSeriesType","series","s","item","t","type","stack","curve","useCartesianChart","useChartEngine","createChart","build","chart","handlers","event","view","renderer","useRootStyle","defaultHeight","instance"],"sources":["../../../../../vue/src/components/Chart/cartesian.ts"],"sourcesContent":["import {\n createChart,\n type ChartAnnotation,\n type ChartAxisOptions,\n type ChartCurve,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartInteractionOptions,\n type ChartLegendOptions,\n type ChartOptions,\n type ChartPadding,\n type ChartPlotClickEvent,\n type ChartRendererKind,\n type ChartRendererPreference,\n type ChartSeries,\n type ChartSeriesType,\n type ChartTooltipOptions,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { raw, useChartEngine, useRootStyle } from \"./engine\";\nimport type { ChartHandle } from \"./types\";\n\n/** The common props read by `engineOptions` */\ninterface CommonProps {\n xAxis?: ChartAxisOptions;\n yAxis?: ChartAxisOptions;\n renderer?: ChartRendererPreference;\n legend?: boolean | ChartLegendOptions;\n tooltip?: boolean | ChartTooltipOptions;\n crosshair?: boolean;\n annotations?: readonly ChartAnnotation[];\n interaction?: boolean | ChartInteractionOptions;\n padding?: ChartPadding;\n palette?: readonly string[];\n ariaLabel?: string;\n locale?: string;\n labels?: ChartOptions[\"labels\"] | boolean;\n yAxis2?: ChartAxisOptions;\n orientation?: ChartOptions[\"orientation\"];\n}\n\n/** Engine options of the common props */\nexport const engineOptions = (\n props: CommonProps,\n series: readonly ChartSeries[],\n stackMode?: ChartOptions[\"stackMode\"],\n): ChartOptions => ({\n series,\n xAxis: raw(props.xAxis),\n yAxis: raw(props.yAxis),\n renderer: props.renderer,\n legend: raw(props.legend),\n tooltip: raw(props.tooltip),\n crosshair: props.crosshair,\n annotations: raw(props.annotations),\n interaction: raw(props.interaction),\n padding: raw(props.padding),\n palette: raw(props.palette),\n ariaLabel: props.ariaLabel,\n locale: props.locale,\n // BarChart / WaterfallChart: `labels` writes the values (a boolean)\n labels: typeof props.labels === \"object\" ? raw(props.labels) : undefined,\n yAxis2: raw(props.yAxis2),\n orientation: props.orientation,\n stackMode,\n});\n\n/**\n * Gives the series without a `type` the type of the component: `stack` /\n * `curve` apply to the series of that type that do not set their own.\n */\nexport const withSeriesType = (\n series: readonly ChartSeries[],\n type: ChartSeriesType,\n stack?: string,\n curve?: ChartCurve,\n): ChartSeries[] =>\n raw(series).map((item) => {\n const s = raw(item);\n const t = s.type ?? type;\n return {\n ...s,\n data: raw(s.data),\n type: t,\n ...(stack !== undefined && t === type ? { stack: s.stack ?? stack } : {}),\n ...(curve !== undefined && (t === \"line\" || t === \"area\")\n ? { curve: s.curve ?? curve }\n : {}),\n };\n });\n\n/** Engine events forwarded by a cartesian chart */\nexport interface CartesianHandlers {\n hover?: (event: ChartHoverEvent | null) => void;\n click?: (event: ChartHoverEvent) => void;\n plotClick?: (event: ChartPlotClickEvent) => void;\n zoom?: (view: ChartView) => void;\n renderer?: (renderer: ChartRendererKind) => void;\n drag?: (event: ChartDragEvent) => void;\n drop?: (event: ChartDragEvent) => void;\n}\n\n/** Engine (`createChart`), root style and template handle of a cartesian chart */\nexport function useCartesianChart(\n props: object & {\n deep?: boolean;\n width?: number | string;\n height?: number | string;\n },\n build: () => ChartOptions | null,\n handlers: CartesianHandlers,\n defaultHeight = 320,\n) {\n const { setContainer, instance } = useChartEngine<\n ChartOptions,\n ChartInstance\n >(createChart, props, build, (chart) => [\n chart.on(\"hover\", (event) => handlers.hover?.(event)),\n chart.on(\"click\", (event) => handlers.click?.(event)),\n chart.on(\"plotClick\", (event) => handlers.plotClick?.(event)),\n chart.on(\"zoom\", (view) => handlers.zoom?.(view)),\n chart.on(\"renderer\", (renderer) => handlers.renderer?.(renderer)),\n chart.on(\"drag\", (event) => handlers.drag?.(event)),\n chart.on(\"drop\", (event) => handlers.drop?.(event)),\n ]);\n const handle: ChartHandle = {\n resetZoom: () => instance.value?.resetZoom(),\n getView: () => instance.value?.getView() ?? null,\n setView: (view) => instance.value?.setView(view),\n getRenderer: () => instance.value?.getRenderer() ?? null,\n getInstance: () => instance.value,\n };\n return {\n setContainer,\n rootStyle: useRootStyle(props, defaultHeight),\n handle,\n };\n}\n"],"mappings":";;;AA2CA,IAAaA,KACX,GACA,GACA,OACkB;CAClB;CACA,OAAOC,EAAIC,EAAM,KAAK;CACtB,OAAOD,EAAIC,EAAM,KAAK;CACtB,UAA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AAS,MAAUC,EAAS,OAAOC,CAAK,CAAC;EAClDF,EAAM,GAAG,SAAS,MAAUC,EAAS,OAAOC,CAAK,CAAC;CACpD,CAAC;CAQD,OAAO;EACL;EACA,WAAWG,EAAalB,GAAOmB,CAAa;EAC5C,QAAA;GATA,iBAAiBC,EAAS,OAAO,UAAU;GAC3C,eAAeA,EAAS,OAAO,QAAQ,KAAK;GAC5C,UAAU,MAASA,EAAS,OAAO,QAAQJ,CAAI;GAC/C,mBAAmBI,EAAS,OAAO,YAAY,KAAK;GACpD,mBAAmBA,EAAS;EAK5B;CACF;AACF"}
@@ -17,6 +17,7 @@ export declare abstract class MinervaCartesianChartElement extends MinervaEngine
17
17
  protected bindEngine(chart: ChartInstance): Array<() => void>;
18
18
  protected pointClicked(event: ChartHoverEvent): void;
19
19
  protected plotClicked(event: ChartPlotClickEvent): void;
20
+ protected pointDragged?(event: ChartDragEvent): void;
20
21
  protected pointDropped?(event: ChartDragEvent): void;
21
22
  /** Shows the whole data range */
22
23
  resetZoom(): void;
@@ -17,6 +17,7 @@ var i = class extends t {
17
17
  e.on("plotClick", (e) => this.plotClicked(e)),
18
18
  e.on("zoom", (e) => this.emit("minerva-zoom", e)),
19
19
  e.on("renderer", (e) => this.emit("minerva-renderer-change", { renderer: e })),
20
+ e.on("drag", (e) => this.pointDragged?.(e)),
20
21
  e.on("drop", (e) => this.pointDropped?.(e))
21
22
  ];
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","names":["_decorate","__decorate","MinervaCartesianChartElement","MinervaEngineElement","_args","createChart","container","options","chart","event","view","property","MinervaChart"],"sources":["../../../../../web-components/src/components/chart/chart.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport {\n createChart,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartOptions,\n type ChartPlotClickEvent,\n type ChartRendererKind,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { MinervaEngineElement } from \"./engine-element\";\n\n/**\n * Base of the cartesian chart elements (engine `createChart`): forwards the\n * engine events as `minerva-*` events and exposes the zoom methods.\n *\n * @fires minerva-hover - The hovered (or keyboard-focused) points changed; detail: { x, xLabel, items }, `null` when nothing is hovered\n * @fires minerva-point-click - A point or a bar was clicked; detail: { x, xLabel, items }\n * @fires minerva-plot-click - The plot area was clicked where there is no point; detail: { x, y }\n * @fires minerva-zoom - The user zoomed or panned; detail: { x, y } (the visible ranges)\n * @fires minerva-renderer-change - The backend is ready (or fell back after a GPU loss); detail: { renderer }\n */\nexport abstract class MinervaCartesianChartElement extends MinervaEngineElement<\n ChartOptions,\n ChartInstance\n> {\n /** Height of the chart, the legend included: pixels or any CSS length */\n @property()\n override height?: string | number = 320;\n\n protected createEngine(\n container: HTMLElement,\n options: ChartOptions,\n ): ChartInstance {\n return createChart(container, options);\n }\n\n protected override bindEngine(chart: ChartInstance): Array<() => void> {\n return [\n chart.on(\"hover\", (event) => this.emit(\"minerva-hover\", event)),\n chart.on(\"click\", (event) => this.pointClicked(event)),\n chart.on(\"plotClick\", (event) => this.plotClicked(event)),\n chart.on(\"zoom\", (view) => this.emit(\"minerva-zoom\", view)),\n chart.on(\"renderer\", (renderer) =>\n this.emit(\"minerva-renderer-change\", { renderer }),\n ),\n chart.on(\"drop\", (event) => this.pointDropped?.(event)),\n ];\n }\n\n protected pointClicked(event: ChartHoverEvent): void {\n this.emit(\"minerva-point-click\", event);\n }\n\n protected plotClicked(event: ChartPlotClickEvent): void {\n this.emit(\"minerva-plot-click\", event);\n }\n\n protected pointDropped?(event: ChartDragEvent): void;\n\n /** Shows the whole data range */\n resetZoom(): void {\n this.instance?.resetZoom();\n }\n\n /** Visible range, `null` before the engine is created */\n getView(): ChartView | null {\n return this.instance?.getView() ?? null;\n }\n\n /** Sets the visible range */\n setView(view: Partial<ChartView>): void {\n this.instance?.setView(view);\n }\n\n /** Backend in use (`webgpu`, `webgl2`, `webgl`, `canvas2d`), `null` until ready */\n getRenderer(): ChartRendererKind | null {\n return this.instance?.getRenderer() ?? null;\n }\n}\n\n/**\n * GPU chart of `minerva-design/charts/core` (WebGPU, then WebGL2, WebGL,\n * Canvas2D) mixing line, area, bar, scatter, candlestick and heatmap\n * series: the `<Chart>` of React. Set the engine options (`ChartOptions`:\n * `series`, `xAxis`, `yAxis`, `legend`, `tooltip`, `annotations`...) as\n * the `options` property; replace the object (or a `data` array) to update\n * the chart. Zoomable, keyboard accessible and themed by the Minerva CSS\n * variables of its scope.\n *\n * Published as the optional entry `minerva-design/web-components/chart`\n * (not part of the all-in-one entry nor the CDN bundle: it loads the chart\n * engine `minerva-design/charts/core`).\n *\n * @summary GPU chart of any mix of series, configured by the engine options.\n * @tag minerva-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-chart\";\n\n /** Engine options (`ChartOptions` of minerva-design/charts/core); property only */\n @property({ attribute: false })\n options?: ChartOptions;\n\n protected engineOptions(): ChartOptions | null {\n return this.options ?? null;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-chart\": MinervaChart;\n }\n}\n"],"mappings":";;;;;AAuBA,IAAsBE,IAAtB,cAA2DC,EAGzD;;EAGoC,aAAA,KAAA,SAAA;;CAEpC,aACE,GACA,GACe;EACf,OAAOE,EAAYC,GAAWC,CAAO;CACvC;CAEA,WAA8B,GAAyC;EACrE,OAAO;GACLC,EAAM,GAAG,UAAU,MAAU,KAAK,KAAK,iBAAiBC,CAAK,CAAC;GAC9DD,EAAM,GAAG,UAAU,MAAU,KAAK,aAAaC,CAAK,CAAC;GACrDD,EAAM,GAAG,cAAc,MAAU,KAAK,YAAYC,CAAK,CAAC;GACxDD,EAAM,GAAG,SAAS,MAAS,KAAK,KAAK,gBAAgBE,CAAI,CAAC;GAC1DF,EAAM,GAAG,aAAa,MACpB,KAAK,KAAK,2BAA2B,EAAE,YAAS,CAAC,CACnD;GACAA,EAAM,GAAG,SAAS,MAAU,KAAK,eAAeC,CAAK,CAAC;EACxD;CACF;CAEA,aAAuB,GAA8B;EACnD,KAAK,KAAK,uBAAuBA,CAAK;CACxC;CAEA,YAAsB,GAAkC;EACtD,KAAK,KAAK,sBAAsBA,CAAK;CACvC;CAKA,YAAkB;EAChB,KAAK,UAAU,UAAU;CAC3B;CAGA,UAA4B;EAC1B,OAAO,KAAK,UAAU,QAAQ,KAAK;CACrC;CAGA,QAAQ,GAAgC;EACtC,KAAK,UAAU,QAAQC,CAAI;CAC7B;CAGA,cAAwC;EACtC,OAAO,KAAK,UAAU,YAAY,KAAK;CACzC;AACF;AApDGV,EAAA,CAAAW,EAAS,CAAA,GAAAT,EAAA,WAAA,UAAA,KAAA,CAAA;AAwEZ,IAAaU,IAAb,cAAkCV,EAA6B;;EACnC,KAAA,UAAA;;CAM1B,gBAA+C;EAC7C,OAAO,KAAK,WAAW;CACzB;AACF;AANGF,EAAA,CAAAW,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAAC,EAAA,WAAA,WAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"chart.js","names":["_decorate","__decorate","MinervaCartesianChartElement","MinervaEngineElement","_args","createChart","container","options","chart","event","view","property","MinervaChart"],"sources":["../../../../../web-components/src/components/chart/chart.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport {\n createChart,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartInstance,\n type ChartOptions,\n type ChartPlotClickEvent,\n type ChartRendererKind,\n type ChartView,\n} from \"minerva-design/charts/core\";\nimport { MinervaEngineElement } from \"./engine-element\";\n\n/**\n * Base of the cartesian chart elements (engine `createChart`): forwards the\n * engine events as `minerva-*` events and exposes the zoom methods.\n *\n * @fires minerva-hover - The hovered (or keyboard-focused) points changed; detail: { x, xLabel, items }, `null` when nothing is hovered\n * @fires minerva-point-click - A point or a bar was clicked; detail: { x, xLabel, items }\n * @fires minerva-plot-click - The plot area was clicked where there is no point; detail: { x, y }\n * @fires minerva-zoom - The user zoomed or panned; detail: { x, y } (the visible ranges)\n * @fires minerva-renderer-change - The backend is ready (or fell back after a GPU loss); detail: { renderer }\n */\nexport abstract class MinervaCartesianChartElement extends MinervaEngineElement<\n ChartOptions,\n ChartInstance\n> {\n /** Height of the chart, the legend included: pixels or any CSS length */\n @property()\n override height?: string | number = 320;\n\n protected createEngine(\n container: HTMLElement,\n options: ChartOptions,\n ): ChartInstance {\n return createChart(container, options);\n }\n\n protected override bindEngine(chart: ChartInstance): Array<() => void> {\n return [\n chart.on(\"hover\", (event) => this.emit(\"minerva-hover\", event)),\n chart.on(\"click\", (event) => this.pointClicked(event)),\n chart.on(\"plotClick\", (event) => this.plotClicked(event)),\n chart.on(\"zoom\", (view) => this.emit(\"minerva-zoom\", view)),\n chart.on(\"renderer\", (renderer) =>\n this.emit(\"minerva-renderer-change\", { renderer }),\n ),\n chart.on(\"drag\", (event) => this.pointDragged?.(event)),\n chart.on(\"drop\", (event) => this.pointDropped?.(event)),\n ];\n }\n\n protected pointClicked(event: ChartHoverEvent): void {\n this.emit(\"minerva-point-click\", event);\n }\n\n protected plotClicked(event: ChartPlotClickEvent): void {\n this.emit(\"minerva-plot-click\", event);\n }\n\n protected pointDragged?(event: ChartDragEvent): void;\n\n protected pointDropped?(event: ChartDragEvent): void;\n\n /** Shows the whole data range */\n resetZoom(): void {\n this.instance?.resetZoom();\n }\n\n /** Visible range, `null` before the engine is created */\n getView(): ChartView | null {\n return this.instance?.getView() ?? null;\n }\n\n /** Sets the visible range */\n setView(view: Partial<ChartView>): void {\n this.instance?.setView(view);\n }\n\n /** Backend in use (`webgpu`, `webgl2`, `webgl`, `canvas2d`), `null` until ready */\n getRenderer(): ChartRendererKind | null {\n return this.instance?.getRenderer() ?? null;\n }\n}\n\n/**\n * GPU chart of `minerva-design/charts/core` (WebGPU, then WebGL2, WebGL,\n * Canvas2D) mixing line, area, bar, scatter, candlestick and heatmap\n * series: the `<Chart>` of React. Set the engine options (`ChartOptions`:\n * `series`, `xAxis`, `yAxis`, `legend`, `tooltip`, `annotations`...) as\n * the `options` property; replace the object (or a `data` array) to update\n * the chart. Zoomable, keyboard accessible and themed by the Minerva CSS\n * variables of its scope.\n *\n * Published as the optional entry `minerva-design/web-components/chart`\n * (not part of the all-in-one entry nor the CDN bundle: it loads the chart\n * engine `minerva-design/charts/core`).\n *\n * @summary GPU chart of any mix of series, configured by the engine options.\n * @tag minerva-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-chart\";\n\n /** Engine options (`ChartOptions` of minerva-design/charts/core); property only */\n @property({ attribute: false })\n options?: ChartOptions;\n\n protected engineOptions(): ChartOptions | null {\n return this.options ?? null;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-chart\": MinervaChart;\n }\n}\n"],"mappings":";;;;;AAuBA,IAAsBE,IAAtB,cAA2DC,EAGzD;;EAGoC,aAAA,KAAA,SAAA;;CAEpC,aACE,GACA,GACe;EACf,OAAOE,EAAYC,GAAWC,CAAO;CACvC;CAEA,WAA8B,GAAyC;EACrE,OAAO;GACLC,EAAM,GAAG,UAAU,MAAU,KAAK,KAAK,iBAAiBC,CAAK,CAAC;GAC9DD,EAAM,GAAG,UAAU,MAAU,KAAK,aAAaC,CAAK,CAAC;GACrDD,EAAM,GAAG,cAAc,MAAU,KAAK,YAAYC,CAAK,CAAC;GACxDD,EAAM,GAAG,SAAS,MAAS,KAAK,KAAK,gBAAgBE,CAAI,CAAC;GAC1DF,EAAM,GAAG,aAAa,MACpB,KAAK,KAAK,2BAA2B,EAAE,YAAS,CAAC,CACnD;GACAA,EAAM,GAAG,SAAS,MAAU,KAAK,eAAeC,CAAK,CAAC;GACtDD,EAAM,GAAG,SAAS,MAAU,KAAK,eAAeC,CAAK,CAAC;EACxD;CACF;CAEA,aAAuB,GAA8B;EACnD,KAAK,KAAK,uBAAuBA,CAAK;CACxC;CAEA,YAAsB,GAAkC;EACtD,KAAK,KAAK,sBAAsBA,CAAK;CACvC;CAOA,YAAkB;EAChB,KAAK,UAAU,UAAU;CAC3B;CAGA,UAA4B;EAC1B,OAAO,KAAK,UAAU,QAAQ,KAAK;CACrC;CAGA,QAAQ,GAAgC;EACtC,KAAK,UAAU,QAAQC,CAAI;CAC7B;CAGA,cAAwC;EACtC,OAAO,KAAK,UAAU,YAAY,KAAK;CACzC;AACF;AAvDGV,EAAA,CAAAW,EAAS,CAAA,GAAAT,EAAA,WAAA,UAAA,KAAA,CAAA;AA2EZ,IAAaU,IAAb,cAAkCV,EAA6B;;EACnC,KAAA,UAAA;;CAM1B,gBAA+C;EAC7C,OAAO,KAAK,WAAW;CACzB;AACF;AANGF,EAAA,CAAAW,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAAC,EAAA,WAAA,WAAA,KAAA,CAAA"}
@@ -199,7 +199,9 @@ export declare class MinervaSparkline extends MinervaCartesianChartElement {
199
199
  * @csspart root - The sized box of the chart
200
200
  * @csspart surface - The element the engine renders into
201
201
  * @fires minerva-point-click - A dot was clicked; detail: { point, index }
202
+ * @fires minerva-point-double-click - The same dot was clicked twice in quick succession; detail: { point, index }
202
203
  * @fires minerva-quadrant-click - The empty area of a quadrant was clicked; detail: { quadrant, x, y }
204
+ * @fires minerva-point-drag - A dot is being dragged (on every move); detail: { point, index, x, y, quadrant }
203
205
  * @fires minerva-point-drop - A dragged dot was released; detail: { point, index, x, y, quadrant }
204
206
  */
205
207
  export declare class MinervaQuadrantChart extends MinervaCartesianChartElement {
@@ -230,14 +232,17 @@ export declare class MinervaQuadrantChart extends MinervaCartesianChartElement {
230
232
  hideLabels: boolean;
231
233
  /** Dot diameter in pixels */
232
234
  pointSize: number;
233
- /** Lets the user drag the dots (`minerva-point-drop`) */
235
+ /** Lets the user drag the dots (`minerva-point-drag`, `minerva-point-drop`) */
234
236
  dragPoints: boolean;
235
237
  /** Other engine options (legend, tooltip, padding, palette...); property only */
236
238
  options?: Omit<ChartOptions, "series">;
239
+ private lastClick;
237
240
  private geometry;
238
241
  protected engineOptions(): ChartOptions | null;
239
242
  protected pointClicked(event: ChartHoverEvent): void;
240
243
  protected plotClicked(event: ChartPlotClickEvent): void;
244
+ private dropDetail;
245
+ protected pointDragged(event: ChartDragEvent): void;
241
246
  protected pointDropped(event: ChartDragEvent): void;
242
247
  }
243
248
  declare global {
@@ -125,9 +125,9 @@ var h = class extends t {
125
125
  }
126
126
  };
127
127
  e([r()], h.prototype, "height", void 0), e([r({ attribute: !1 })], h.prototype, "data", void 0), e([r()], h.prototype, "type", void 0), e([r()], h.prototype, "color", void 0), e([r()], h.prototype, "curve", void 0), e([r({ type: Number })], h.prototype, "reference", void 0), e([r({ attribute: "value-name" })], h.prototype, "valueName", void 0), e([r({ attribute: !1 })], h.prototype, "format", void 0), e([r({ attribute: !1 })], h.prototype, "options", void 0);
128
- var g = class extends t {
128
+ var g = 400, _ = class extends t {
129
129
  constructor(...e) {
130
- super(...e), this.reverseX = !1, this.hideTicks = !1, this.hideLabels = !1, this.pointSize = 12, this.dragPoints = !1;
130
+ super(...e), this.reverseX = !1, this.hideTicks = !1, this.hideLabels = !1, this.pointSize = 12, this.dragPoints = !1, this.lastClick = null;
131
131
  }
132
132
  static {
133
133
  this.tagName = "minerva-quadrant-chart";
@@ -157,7 +157,15 @@ var g = class extends t {
157
157
  }
158
158
  pointClicked(e) {
159
159
  let t = e.items[0]?.index, n = t === void 0 ? void 0 : this.points?.[t];
160
- n && this.emit("minerva-point-click", {
160
+ if (!n || t === void 0) return;
161
+ let r = Date.now(), i = this.lastClick, a = i?.index === t && r - i.time < g;
162
+ this.lastClick = a ? null : {
163
+ index: t,
164
+ time: r
165
+ }, this.emit("minerva-point-click", {
166
+ point: n,
167
+ index: t
168
+ }), a && this.emit("minerva-point-double-click", {
161
169
  point: n,
162
170
  index: t
163
171
  });
@@ -169,40 +177,48 @@ var g = class extends t {
169
177
  y: e.y
170
178
  });
171
179
  }
172
- pointDropped(e) {
180
+ dropDetail(e) {
173
181
  let t = e.item.index, n = this.points?.[t];
174
- n && this.emit("minerva-point-drop", {
182
+ return n ? {
175
183
  point: n,
176
184
  index: t,
177
185
  x: e.x,
178
186
  y: e.y,
179
187
  quadrant: o(this.geometry(), e.x, e.y)
180
- });
188
+ } : null;
189
+ }
190
+ pointDragged(e) {
191
+ let t = this.dropDetail(e);
192
+ t && this.emit("minerva-point-drag", t);
193
+ }
194
+ pointDropped(e) {
195
+ let t = this.dropDetail(e);
196
+ t && this.emit("minerva-point-drop", t);
181
197
  }
182
198
  };
183
- e([r({ attribute: !1 })], g.prototype, "points", void 0), e([r({ attribute: !1 })], g.prototype, "quadrants", void 0), e([r({ attribute: "x-label" })], g.prototype, "xLabel", void 0), e([r({ attribute: "y-label" })], g.prototype, "yLabel", void 0), e([r({ attribute: !1 })], g.prototype, "axisLabels", void 0), e([r({ attribute: !1 })], g.prototype, "xDomain", void 0), e([r({ attribute: !1 })], g.prototype, "yDomain", void 0), e([r({
199
+ e([r({ attribute: !1 })], _.prototype, "points", void 0), e([r({ attribute: !1 })], _.prototype, "quadrants", void 0), e([r({ attribute: "x-label" })], _.prototype, "xLabel", void 0), e([r({ attribute: "y-label" })], _.prototype, "yLabel", void 0), e([r({ attribute: !1 })], _.prototype, "axisLabels", void 0), e([r({ attribute: !1 })], _.prototype, "xDomain", void 0), e([r({ attribute: !1 })], _.prototype, "yDomain", void 0), e([r({
184
200
  type: Number,
185
201
  attribute: "x-split"
186
- })], g.prototype, "xSplit", void 0), e([r({
202
+ })], _.prototype, "xSplit", void 0), e([r({
187
203
  type: Number,
188
204
  attribute: "y-split"
189
- })], g.prototype, "ySplit", void 0), e([r({
205
+ })], _.prototype, "ySplit", void 0), e([r({
190
206
  type: Boolean,
191
207
  attribute: "reverse-x"
192
- })], g.prototype, "reverseX", void 0), e([r({
208
+ })], _.prototype, "reverseX", void 0), e([r({
193
209
  type: Boolean,
194
210
  attribute: "hide-ticks"
195
- })], g.prototype, "hideTicks", void 0), e([r({
211
+ })], _.prototype, "hideTicks", void 0), e([r({
196
212
  type: Boolean,
197
213
  attribute: "hide-labels"
198
- })], g.prototype, "hideLabels", void 0), e([r({
214
+ })], _.prototype, "hideLabels", void 0), e([r({
199
215
  type: Number,
200
216
  attribute: "point-size"
201
- })], g.prototype, "pointSize", void 0), e([r({
217
+ })], _.prototype, "pointSize", void 0), e([r({
202
218
  type: Boolean,
203
219
  attribute: "drag-points"
204
- })], g.prototype, "dragPoints", void 0), e([r({ attribute: !1 })], g.prototype, "options", void 0);
220
+ })], _.prototype, "dragPoints", void 0), e([r({ attribute: !1 })], _.prototype, "options", void 0);
205
221
  //#endregion
206
- export { u as MinervaAreaChart, d as MinervaBarChart, p as MinervaCandlestickChart, m as MinervaHeatmapChart, l as MinervaLineChart, g as MinervaQuadrantChart, f as MinervaScatterChart, h as MinervaSparkline, c as SeriesChartElement };
222
+ export { u as MinervaAreaChart, d as MinervaBarChart, p as MinervaCandlestickChart, m as MinervaHeatmapChart, l as MinervaLineChart, _ as MinervaQuadrantChart, f as MinervaScatterChart, h as MinervaSparkline, c as SeriesChartElement };
207
223
 
208
224
  //# sourceMappingURL=charts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"charts.js","names":["_decorate","__decorate","SeriesChartElement","MinervaCartesianChartElement","series","property","MinervaLineChart","_args","withSeriesType","MinervaAreaChart","_args2","MinervaBarChart","_args3","s","MinervaScatterChart","MinervaCandlestickChart","MinervaHeatmapChart","_args4","heatmapChartOptions","MinervaSparkline","_args5","sparklineOptions","MinervaQuadrantChart","_args6","quadrantChartOptions","index","event","point","quadrantOf"],"sources":["../../../../../web-components/src/components/chart/charts.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport {\n heatmapChartOptions,\n quadrantChartOptions,\n quadrantOf,\n sparklineOptions,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartOptions,\n type ChartPlotClickEvent,\n type ChartSeries,\n type HeatmapCell,\n type QuadrantAxisLabels,\n type QuadrantConfig,\n type QuadrantPoint,\n type QuadrantRegions,\n} from \"minerva-design/charts/core\";\nimport { MinervaCartesianChartElement } from \"./chart\";\nimport { withSeriesType } from \"./series\";\n\n/** Engine options other than the series (axes, legend, tooltip, annotations...) */\nexport type ChartBaseOptions = Partial<ChartOptions>;\n\n/** Base of the elements drawing `series` with a default series type */\nexport abstract class SeriesChartElement extends MinervaCartesianChartElement {\n /** Data series (`ChartSeries[]`); each may set its own `type`. Replace the array (or a `data` array) to update the chart; property only */\n @property({ attribute: false })\n series?: readonly ChartSeries[];\n\n /** Other engine options (`ChartOptions` of minerva-design/charts/core: axes, legend, tooltip, annotations...); property only */\n @property({ attribute: false })\n options?: ChartBaseOptions;\n\n protected abstract typed(series: readonly ChartSeries[]): ChartSeries[];\n\n protected stackMode(): ChartOptions[\"stackMode\"] {\n return this.options?.stackMode;\n }\n\n protected engineOptions(): ChartOptions | null {\n const series = this.series ?? this.options?.series;\n if (!series) return null;\n return {\n ...this.options,\n series: this.typed(series),\n stackMode: this.stackMode(),\n };\n }\n}\n\n/**\n * Line chart (or area chart with `area`) of `minerva-design/charts/core`,\n * handling millions of points on the GPU: the `<LineChart>` of React. The\n * series without a `type` are drawn as lines.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU line chart: straight, smooth or stepped, stacked or 100%.\n * @tag minerva-line-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaLineChart extends SeriesChartElement {\n static override tagName = \"minerva-line-chart\";\n\n /** Fills the area under the lines */\n @property({ type: Boolean })\n area = false;\n\n /** Shape of the lines: straight, smooth (monotone) or steps */\n @property()\n curve: \"linear\" | \"smooth\" | \"step\" = \"linear\";\n\n /** Stacks the series on top of each other */\n @property({ type: Boolean })\n stacked = false;\n\n /** Scales the stacks to 100% (implies `stacked`) */\n @property({ type: Boolean })\n percent = false;\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(\n series,\n this.area ? \"area\" : \"line\",\n this.stacked || this.percent ? \"stack\" : undefined,\n this.curve,\n );\n }\n\n protected override stackMode(): ChartOptions[\"stackMode\"] {\n return this.percent ? \"percent\" : super.stackMode();\n }\n}\n\n/**\n * Area chart of `minerva-design/charts/core`: smooth by default, stacked or\n * 100% stacked (the `<AreaChart>` of React). The series without a `type`\n * are drawn as areas.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU area chart: smooth, stacked or 100% stacked.\n * @tag minerva-area-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaAreaChart extends SeriesChartElement {\n static override tagName = \"minerva-area-chart\";\n\n /** Shape of the edges: straight, smooth (monotone) or steps */\n @property()\n curve: \"linear\" | \"smooth\" | \"step\" = \"smooth\";\n\n /** Stacks the areas on top of each other */\n @property({ type: Boolean })\n stacked = false;\n\n /** Scales the stacks to 100% (implies `stacked`) */\n @property({ type: Boolean })\n percent = false;\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(\n series,\n \"area\",\n this.stacked || this.percent ? \"stack\" : undefined,\n this.curve,\n );\n }\n\n protected override stackMode(): ChartOptions[\"stackMode\"] {\n return this.percent ? \"percent\" : super.stackMode();\n }\n}\n\n/**\n * Bar chart of `minerva-design/charts/core`: grouped side by side, stacked\n * or 100% stacked, with optional value labels (the `<BarChart>` of React).\n * The series without a `type` are drawn as bars (set `type: \"line\"` on a\n * series for an overlay).\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU bar chart: grouped, stacked or 100%, with value labels.\n * @tag minerva-bar-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaBarChart extends SeriesChartElement {\n static override tagName = \"minerva-bar-chart\";\n\n /** Stacks the bars of every series (otherwise they are grouped side by side) */\n @property({ type: Boolean })\n stacked = false;\n\n /** Scales the stacks to 100% (implies `stacked`) */\n @property({ type: Boolean })\n percent = false;\n\n /** Writes the value above every bar */\n @property({ type: Boolean })\n labels = false;\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(\n series,\n \"bar\",\n this.stacked || this.percent ? \"stack\" : undefined,\n ).map((s) =>\n this.labels && s.type === \"bar\"\n ? { ...s, showLabels: s.showLabels ?? true }\n : s,\n );\n }\n\n protected override stackMode(): ChartOptions[\"stackMode\"] {\n return this.percent ? \"percent\" : super.stackMode();\n }\n}\n\n/**\n * Scatter chart of `minerva-design/charts/core`: zooms on both axes, hit\n * testing through a spatial index (the `<ScatterChart>` of React). The\n * series without a `type` are drawn as dots.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU scatter chart zooming on both axes.\n * @tag minerva-scatter-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaScatterChart extends SeriesChartElement {\n static override tagName = \"minerva-scatter-chart\";\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(series, \"scatter\");\n }\n}\n\n/**\n * Candlestick (OHLC) chart of `minerva-design/charts/core` (the\n * `<CandlestickChart>` of React): data points carry `open`, `high`, `low`\n * and `y` (the close). The series without a `type` are drawn as candles\n * (e.g. add a moving average with `type: \"line\"`).\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU candlestick chart of rising and falling candles.\n * @tag minerva-candlestick-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaCandlestickChart extends SeriesChartElement {\n static override tagName = \"minerva-candlestick-chart\";\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(series, \"candlestick\");\n }\n}\n\n/**\n * Heatmap of `minerva-design/charts/core` (the `<HeatmapChart>` of React):\n * a grid of cells colored by value, categories (or numbers) on both axes.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU heatmap: a grid of cells colored by value.\n * @tag minerva-heatmap-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaHeatmapChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-heatmap-chart\";\n\n /** Cells `{ x, y, value }`; property only */\n @property({ attribute: false })\n data?: readonly HeatmapCell[];\n\n /** Column names in order (collected from the data when omitted); property only */\n @property({ attribute: false })\n xCategories?: readonly string[];\n\n /** Row names from bottom to top (collected from the data when omitted); property only */\n @property({ attribute: false })\n yCategories?: readonly string[];\n\n /** Colors from the lowest to the highest value (interpolated in OKLab), or a built-in theme-aware ramp of the first palette color (`sequential` by default, or `diverging`); an array is property only */\n @property({ attribute: \"color-scale\" })\n colorScale: readonly string[] | \"sequential\" | \"diverging\" = \"sequential\";\n\n /** Values at the ends of the color scale (the data range by default); property only */\n @property({ attribute: false })\n valueRange?: readonly [number, number];\n\n /** Value at the middle of the color scale (diverging data; 0 for `diverging` ramps spanning it, else the middle of the range, by default) */\n @property({ type: Number, attribute: \"color-midpoint\" })\n colorMidpoint?: number;\n\n /** Name of the value in the tooltip */\n @property({ attribute: \"value-name\" })\n valueName?: string;\n\n /** Corner radius of the cells, in pixels */\n @property({ type: Number })\n radius?: number;\n\n /** Formats the values in the tooltip; property only */\n @property({ attribute: false })\n format?: (value: number) => string;\n\n /** Other engine options (axes, legend, tooltip, padding...); property only */\n @property({ attribute: false })\n options?: ChartBaseOptions;\n\n protected engineOptions(): ChartOptions | null {\n if (!this.data) return null;\n return heatmapChartOptions(\n {\n data: this.data,\n xCategories: this.xCategories,\n yCategories: this.yCategories,\n colorScale: this.colorScale,\n valueRange: this.valueRange,\n colorMidpoint: this.colorMidpoint,\n name: this.valueName,\n radius: this.radius,\n format: this.format,\n },\n this.options,\n );\n }\n}\n\n/**\n * Word-sized chart without axes (a trend in a table cell, a KPI card...) of\n * `minerva-design/charts/core`: the `<Sparkline>` of React.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary Small line, area or bar trend without axes.\n * @tag minerva-sparkline\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaSparkline extends MinervaCartesianChartElement {\n static override tagName = \"minerva-sparkline\";\n\n /** Height of the sparkline: pixels or any CSS length */\n @property()\n override height?: string | number = 48;\n\n /** Values (or `[x, y]` pairs, typed arrays...); property only */\n @property({ attribute: false })\n data?: ChartSeries[\"data\"];\n\n /** How the values are drawn */\n @property()\n type: \"line\" | \"area\" | \"bar\" = \"line\";\n\n /** Color (any CSS color); the first palette color by default */\n @property()\n color?: string;\n\n /** Shape of the line */\n @property()\n curve: \"linear\" | \"smooth\" | \"step\" = \"smooth\";\n\n /** Draws a dashed reference line at this value (a target, the average...) */\n @property({ type: Number })\n reference?: number;\n\n /** Name of the value in the tooltip */\n @property({ attribute: \"value-name\" })\n valueName?: string;\n\n /** Formats the value in the tooltip; property only */\n @property({ attribute: false })\n format?: (value: number) => string;\n\n /** Other engine options (tooltip, palette, renderer...); property only */\n @property({ attribute: false })\n options?: ChartBaseOptions;\n\n protected engineOptions(): ChartOptions | null {\n if (!this.data) return null;\n return sparklineOptions(\n {\n data: this.data,\n type: this.type,\n color: this.color,\n curve: this.curve,\n name: this.valueName,\n reference: this.reference,\n format: this.format,\n },\n this.options,\n );\n }\n}\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG...) of\n * `minerva-design/charts/core` (the `<QuadrantChart>` of React): tinted\n * quadrants with titles, dividers and labelled dots placed without\n * overlapping labels. With `drag-points`, dots can be dragged to another\n * quadrant (`minerva-point-drop`; update `points` to move them).\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary Four-quadrant matrix of labelled, draggable dots.\n * @tag minerva-quadrant-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n * @fires minerva-point-click - A dot was clicked; detail: { point, index }\n * @fires minerva-quadrant-click - The empty area of a quadrant was clicked; detail: { quadrant, x, y }\n * @fires minerva-point-drop - A dragged dot was released; detail: { point, index, x, y, quadrant }\n */\nexport class MinervaQuadrantChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-quadrant-chart\";\n\n /** Points `{ x, y, label, color, size }` to place; property only */\n @property({ attribute: false })\n points?: readonly QuadrantPoint[];\n\n /** Titles and colors of the quadrants (`topLeft`, `topRight`, `bottomLeft`, `bottomRight`); property only */\n @property({ attribute: false })\n quadrants?: QuadrantRegions;\n\n /** Title of the horizontal axis */\n @property({ attribute: \"x-label\" })\n xLabel?: string;\n\n /** Title of the vertical axis */\n @property({ attribute: \"y-label\" })\n yLabel?: string;\n\n /** Texts at the ends of the dividers, drawn inside the plot; property only */\n @property({ attribute: false })\n axisLabels?: QuadrantAxisLabels;\n\n /** Range of the horizontal axis (default [0, 10]); property only */\n @property({ attribute: false })\n xDomain?: [number, number];\n\n /** Range of the vertical axis (default [0, 10]); property only */\n @property({ attribute: false })\n yDomain?: [number, number];\n\n /** X value of the vertical divider (the middle of the x domain by default) */\n @property({ type: Number, attribute: \"x-split\" })\n xSplit?: number;\n\n /** Y value of the horizontal divider (the middle of the y domain by default) */\n @property({ type: Number, attribute: \"y-split\" })\n ySplit?: number;\n\n /** Reverses the horizontal axis (e.g. \"urgent\" on the left) */\n @property({ type: Boolean, attribute: \"reverse-x\" })\n reverseX = false;\n\n /** Hides the numeric ticks of the axes (only the matrix remains) */\n @property({ type: Boolean, attribute: \"hide-ticks\" })\n hideTicks = false;\n\n /** Hides the labels next to the dots */\n @property({ type: Boolean, attribute: \"hide-labels\" })\n hideLabels = false;\n\n /** Dot diameter in pixels */\n @property({ type: Number, attribute: \"point-size\" })\n pointSize = 12;\n\n /** Lets the user drag the dots (`minerva-point-drop`) */\n @property({ type: Boolean, attribute: \"drag-points\" })\n dragPoints = false;\n\n /** Other engine options (legend, tooltip, padding, palette...); property only */\n @property({ attribute: false })\n options?: Omit<ChartOptions, \"series\">;\n\n private geometry(): Pick<\n QuadrantConfig,\n \"xDomain\" | \"yDomain\" | \"xSplit\" | \"ySplit\" | \"reverseX\"\n > {\n return {\n xDomain: this.xDomain,\n yDomain: this.yDomain,\n xSplit: this.xSplit,\n ySplit: this.ySplit,\n reverseX: this.reverseX,\n };\n }\n\n protected engineOptions(): ChartOptions | null {\n if (!this.points) return null;\n return quadrantChartOptions(\n {\n ...this.geometry(),\n points: this.points,\n quadrants: this.quadrants,\n xLabel: this.xLabel,\n yLabel: this.yLabel,\n axisLabels: this.axisLabels,\n showTicks: !this.hideTicks,\n showLabels: !this.hideLabels,\n pointSize: this.pointSize,\n draggable: this.dragPoints,\n },\n this.options,\n );\n }\n\n protected override pointClicked(event: ChartHoverEvent): void {\n const index = event.items[0]?.index;\n const point = index === undefined ? undefined : this.points?.[index];\n if (point) this.emit(\"minerva-point-click\", { point, index });\n }\n\n protected override plotClicked(event: ChartPlotClickEvent): void {\n this.emit(\"minerva-quadrant-click\", {\n quadrant: quadrantOf(this.geometry(), event.x, event.y),\n x: event.x,\n y: event.y,\n });\n }\n\n protected override pointDropped(event: ChartDragEvent): void {\n const index = event.item.index;\n const point = this.points?.[index];\n if (!point) return;\n this.emit(\"minerva-point-drop\", {\n point,\n index,\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(this.geometry(), event.x, event.y),\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-line-chart\": MinervaLineChart;\n \"minerva-area-chart\": MinervaAreaChart;\n \"minerva-bar-chart\": MinervaBarChart;\n \"minerva-scatter-chart\": MinervaScatterChart;\n \"minerva-candlestick-chart\": MinervaCandlestickChart;\n \"minerva-heatmap-chart\": MinervaHeatmapChart;\n \"minerva-sparkline\": MinervaSparkline;\n \"minerva-quadrant-chart\": MinervaQuadrantChart;\n }\n}\n"],"mappings":";;;;;;AAwBA,IAAsBE,IAAtB,cAAiDC,EAA6B;CAW5E,YAAiD;EAC/C,OAAO,KAAK,SAAS;CACvB;CAEA,gBAA+C;EAC7C,IAAMC,IAAS,KAAK,UAAU,KAAK,SAAS;EAE5C,OADKA,IACE;GACL,GAAG,KAAK;GACR,QAAQ,KAAK,MAAMA,CAAM;GACzB,W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AAAc,CAAC,CAAA,GAAAiB,EAAA,WAAA,cAAA,KAAA,CAAA,GAIpDtB,EAAA,CAAAK,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAAiB,EAAA,WAAA,WAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"charts.js","names":["_decorate","__decorate","SeriesChartElement","MinervaCartesianChartElement","series","property","MinervaLineChart","_args","withSeriesType","MinervaAreaChart","_args2","MinervaBarChart","_args3","s","MinervaScatterChart","MinervaCandlestickChart","MinervaHeatmapChart","_args4","heatmapChartOptions","MinervaSparkline","_args5","sparklineOptions","DOUBLE_CLICK_MS","MinervaQuadrantChart","_args6","quadrantChartOptions","index","event","point","now","last","double","quadrantOf","detail"],"sources":["../../../../../web-components/src/components/chart/charts.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport {\n heatmapChartOptions,\n quadrantChartOptions,\n quadrantOf,\n sparklineOptions,\n type ChartDragEvent,\n type ChartHoverEvent,\n type ChartOptions,\n type ChartPlotClickEvent,\n type ChartSeries,\n type HeatmapCell,\n type QuadrantAxisLabels,\n type QuadrantConfig,\n type QuadrantPoint,\n type QuadrantRegions,\n} from \"minerva-design/charts/core\";\nimport { MinervaCartesianChartElement } from \"./chart\";\nimport { withSeriesType } from \"./series\";\n\n/** Engine options other than the series (axes, legend, tooltip, annotations...) */\nexport type ChartBaseOptions = Partial<ChartOptions>;\n\n/** Base of the elements drawing `series` with a default series type */\nexport abstract class SeriesChartElement extends MinervaCartesianChartElement {\n /** Data series (`ChartSeries[]`); each may set its own `type`. Replace the array (or a `data` array) to update the chart; property only */\n @property({ attribute: false })\n series?: readonly ChartSeries[];\n\n /** Other engine options (`ChartOptions` of minerva-design/charts/core: axes, legend, tooltip, annotations...); property only */\n @property({ attribute: false })\n options?: ChartBaseOptions;\n\n protected abstract typed(series: readonly ChartSeries[]): ChartSeries[];\n\n protected stackMode(): ChartOptions[\"stackMode\"] {\n return this.options?.stackMode;\n }\n\n protected engineOptions(): ChartOptions | null {\n const series = this.series ?? this.options?.series;\n if (!series) return null;\n return {\n ...this.options,\n series: this.typed(series),\n stackMode: this.stackMode(),\n };\n }\n}\n\n/**\n * Line chart (or area chart with `area`) of `minerva-design/charts/core`,\n * handling millions of points on the GPU: the `<LineChart>` of React. The\n * series without a `type` are drawn as lines.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU line chart: straight, smooth or stepped, stacked or 100%.\n * @tag minerva-line-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaLineChart extends SeriesChartElement {\n static override tagName = \"minerva-line-chart\";\n\n /** Fills the area under the lines */\n @property({ type: Boolean })\n area = false;\n\n /** Shape of the lines: straight, smooth (monotone) or steps */\n @property()\n curve: \"linear\" | \"smooth\" | \"step\" = \"linear\";\n\n /** Stacks the series on top of each other */\n @property({ type: Boolean })\n stacked = false;\n\n /** Scales the stacks to 100% (implies `stacked`) */\n @property({ type: Boolean })\n percent = false;\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(\n series,\n this.area ? \"area\" : \"line\",\n this.stacked || this.percent ? \"stack\" : undefined,\n this.curve,\n );\n }\n\n protected override stackMode(): ChartOptions[\"stackMode\"] {\n return this.percent ? \"percent\" : super.stackMode();\n }\n}\n\n/**\n * Area chart of `minerva-design/charts/core`: smooth by default, stacked or\n * 100% stacked (the `<AreaChart>` of React). The series without a `type`\n * are drawn as areas.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU area chart: smooth, stacked or 100% stacked.\n * @tag minerva-area-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaAreaChart extends SeriesChartElement {\n static override tagName = \"minerva-area-chart\";\n\n /** Shape of the edges: straight, smooth (monotone) or steps */\n @property()\n curve: \"linear\" | \"smooth\" | \"step\" = \"smooth\";\n\n /** Stacks the areas on top of each other */\n @property({ type: Boolean })\n stacked = false;\n\n /** Scales the stacks to 100% (implies `stacked`) */\n @property({ type: Boolean })\n percent = false;\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(\n series,\n \"area\",\n this.stacked || this.percent ? \"stack\" : undefined,\n this.curve,\n );\n }\n\n protected override stackMode(): ChartOptions[\"stackMode\"] {\n return this.percent ? \"percent\" : super.stackMode();\n }\n}\n\n/**\n * Bar chart of `minerva-design/charts/core`: grouped side by side, stacked\n * or 100% stacked, with optional value labels (the `<BarChart>` of React).\n * The series without a `type` are drawn as bars (set `type: \"line\"` on a\n * series for an overlay).\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU bar chart: grouped, stacked or 100%, with value labels.\n * @tag minerva-bar-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaBarChart extends SeriesChartElement {\n static override tagName = \"minerva-bar-chart\";\n\n /** Stacks the bars of every series (otherwise they are grouped side by side) */\n @property({ type: Boolean })\n stacked = false;\n\n /** Scales the stacks to 100% (implies `stacked`) */\n @property({ type: Boolean })\n percent = false;\n\n /** Writes the value above every bar */\n @property({ type: Boolean })\n labels = false;\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(\n series,\n \"bar\",\n this.stacked || this.percent ? \"stack\" : undefined,\n ).map((s) =>\n this.labels && s.type === \"bar\"\n ? { ...s, showLabels: s.showLabels ?? true }\n : s,\n );\n }\n\n protected override stackMode(): ChartOptions[\"stackMode\"] {\n return this.percent ? \"percent\" : super.stackMode();\n }\n}\n\n/**\n * Scatter chart of `minerva-design/charts/core`: zooms on both axes, hit\n * testing through a spatial index (the `<ScatterChart>` of React). The\n * series without a `type` are drawn as dots.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU scatter chart zooming on both axes.\n * @tag minerva-scatter-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaScatterChart extends SeriesChartElement {\n static override tagName = \"minerva-scatter-chart\";\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(series, \"scatter\");\n }\n}\n\n/**\n * Candlestick (OHLC) chart of `minerva-design/charts/core` (the\n * `<CandlestickChart>` of React): data points carry `open`, `high`, `low`\n * and `y` (the close). The series without a `type` are drawn as candles\n * (e.g. add a moving average with `type: \"line\"`).\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU candlestick chart of rising and falling candles.\n * @tag minerva-candlestick-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaCandlestickChart extends SeriesChartElement {\n static override tagName = \"minerva-candlestick-chart\";\n\n protected typed(series: readonly ChartSeries[]): ChartSeries[] {\n return withSeriesType(series, \"candlestick\");\n }\n}\n\n/**\n * Heatmap of `minerva-design/charts/core` (the `<HeatmapChart>` of React):\n * a grid of cells colored by value, categories (or numbers) on both axes.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary GPU heatmap: a grid of cells colored by value.\n * @tag minerva-heatmap-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaHeatmapChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-heatmap-chart\";\n\n /** Cells `{ x, y, value }`; property only */\n @property({ attribute: false })\n data?: readonly HeatmapCell[];\n\n /** Column names in order (collected from the data when omitted); property only */\n @property({ attribute: false })\n xCategories?: readonly string[];\n\n /** Row names from bottom to top (collected from the data when omitted); property only */\n @property({ attribute: false })\n yCategories?: readonly string[];\n\n /** Colors from the lowest to the highest value (interpolated in OKLab), or a built-in theme-aware ramp of the first palette color (`sequential` by default, or `diverging`); an array is property only */\n @property({ attribute: \"color-scale\" })\n colorScale: readonly string[] | \"sequential\" | \"diverging\" = \"sequential\";\n\n /** Values at the ends of the color scale (the data range by default); property only */\n @property({ attribute: false })\n valueRange?: readonly [number, number];\n\n /** Value at the middle of the color scale (diverging data; 0 for `diverging` ramps spanning it, else the middle of the range, by default) */\n @property({ type: Number, attribute: \"color-midpoint\" })\n colorMidpoint?: number;\n\n /** Name of the value in the tooltip */\n @property({ attribute: \"value-name\" })\n valueName?: string;\n\n /** Corner radius of the cells, in pixels */\n @property({ type: Number })\n radius?: number;\n\n /** Formats the values in the tooltip; property only */\n @property({ attribute: false })\n format?: (value: number) => string;\n\n /** Other engine options (axes, legend, tooltip, padding...); property only */\n @property({ attribute: false })\n options?: ChartBaseOptions;\n\n protected engineOptions(): ChartOptions | null {\n if (!this.data) return null;\n return heatmapChartOptions(\n {\n data: this.data,\n xCategories: this.xCategories,\n yCategories: this.yCategories,\n colorScale: this.colorScale,\n valueRange: this.valueRange,\n colorMidpoint: this.colorMidpoint,\n name: this.valueName,\n radius: this.radius,\n format: this.format,\n },\n this.options,\n );\n }\n}\n\n/**\n * Word-sized chart without axes (a trend in a table cell, a KPI card...) of\n * `minerva-design/charts/core`: the `<Sparkline>` of React.\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary Small line, area or bar trend without axes.\n * @tag minerva-sparkline\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n */\nexport class MinervaSparkline extends MinervaCartesianChartElement {\n static override tagName = \"minerva-sparkline\";\n\n /** Height of the sparkline: pixels or any CSS length */\n @property()\n override height?: string | number = 48;\n\n /** Values (or `[x, y]` pairs, typed arrays...); property only */\n @property({ attribute: false })\n data?: ChartSeries[\"data\"];\n\n /** How the values are drawn */\n @property()\n type: \"line\" | \"area\" | \"bar\" = \"line\";\n\n /** Color (any CSS color); the first palette color by default */\n @property()\n color?: string;\n\n /** Shape of the line */\n @property()\n curve: \"linear\" | \"smooth\" | \"step\" = \"smooth\";\n\n /** Draws a dashed reference line at this value (a target, the average...) */\n @property({ type: Number })\n reference?: number;\n\n /** Name of the value in the tooltip */\n @property({ attribute: \"value-name\" })\n valueName?: string;\n\n /** Formats the value in the tooltip; property only */\n @property({ attribute: false })\n format?: (value: number) => string;\n\n /** Other engine options (tooltip, palette, renderer...); property only */\n @property({ attribute: false })\n options?: ChartBaseOptions;\n\n protected engineOptions(): ChartOptions | null {\n if (!this.data) return null;\n return sparklineOptions(\n {\n data: this.data,\n type: this.type,\n color: this.color,\n curve: this.curve,\n name: this.valueName,\n reference: this.reference,\n format: this.format,\n },\n this.options,\n );\n }\n}\n\n/** Two clicks on the same dot within this delay count as a double click */\nconst DOUBLE_CLICK_MS = 400;\n\n/**\n * Four-quadrant matrix (priority matrix, Eisenhower, BCG...) of\n * `minerva-design/charts/core` (the `<QuadrantChart>` of React): tinted\n * quadrants with titles, dividers and labelled dots placed without\n * overlapping labels. With `drag-points`, dots can be dragged to another\n * quadrant (`minerva-point-drop`; update `points` to move them).\n *\n * Published as the optional entry `minerva-design/web-components/chart`.\n *\n * @summary Four-quadrant matrix of labelled, draggable dots.\n * @tag minerva-quadrant-chart\n * @csspart root - The sized box of the chart\n * @csspart surface - The element the engine renders into\n * @fires minerva-point-click - A dot was clicked; detail: { point, index }\n * @fires minerva-point-double-click - The same dot was clicked twice in quick succession; detail: { point, index }\n * @fires minerva-quadrant-click - The empty area of a quadrant was clicked; detail: { quadrant, x, y }\n * @fires minerva-point-drag - A dot is being dragged (on every move); detail: { point, index, x, y, quadrant }\n * @fires minerva-point-drop - A dragged dot was released; detail: { point, index, x, y, quadrant }\n */\nexport class MinervaQuadrantChart extends MinervaCartesianChartElement {\n static override tagName = \"minerva-quadrant-chart\";\n\n /** Points `{ x, y, label, color, size }` to place; property only */\n @property({ attribute: false })\n points?: readonly QuadrantPoint[];\n\n /** Titles and colors of the quadrants (`topLeft`, `topRight`, `bottomLeft`, `bottomRight`); property only */\n @property({ attribute: false })\n quadrants?: QuadrantRegions;\n\n /** Title of the horizontal axis */\n @property({ attribute: \"x-label\" })\n xLabel?: string;\n\n /** Title of the vertical axis */\n @property({ attribute: \"y-label\" })\n yLabel?: string;\n\n /** Texts at the ends of the dividers, drawn inside the plot; property only */\n @property({ attribute: false })\n axisLabels?: QuadrantAxisLabels;\n\n /** Range of the horizontal axis (default [0, 10]); property only */\n @property({ attribute: false })\n xDomain?: [number, number];\n\n /** Range of the vertical axis (default [0, 10]); property only */\n @property({ attribute: false })\n yDomain?: [number, number];\n\n /** X value of the vertical divider (the middle of the x domain by default) */\n @property({ type: Number, attribute: \"x-split\" })\n xSplit?: number;\n\n /** Y value of the horizontal divider (the middle of the y domain by default) */\n @property({ type: Number, attribute: \"y-split\" })\n ySplit?: number;\n\n /** Reverses the horizontal axis (e.g. \"urgent\" on the left) */\n @property({ type: Boolean, attribute: \"reverse-x\" })\n reverseX = false;\n\n /** Hides the numeric ticks of the axes (only the matrix remains) */\n @property({ type: Boolean, attribute: \"hide-ticks\" })\n hideTicks = false;\n\n /** Hides the labels next to the dots */\n @property({ type: Boolean, attribute: \"hide-labels\" })\n hideLabels = false;\n\n /** Dot diameter in pixels */\n @property({ type: Number, attribute: \"point-size\" })\n pointSize = 12;\n\n /** Lets the user drag the dots (`minerva-point-drag`, `minerva-point-drop`) */\n @property({ type: Boolean, attribute: \"drag-points\" })\n dragPoints = false;\n\n /** Other engine options (legend, tooltip, padding, palette...); property only */\n @property({ attribute: false })\n options?: Omit<ChartOptions, \"series\">;\n\n private lastClick: { index: number; time: number } | null = null;\n\n private geometry(): Pick<\n QuadrantConfig,\n \"xDomain\" | \"yDomain\" | \"xSplit\" | \"ySplit\" | \"reverseX\"\n > {\n return {\n xDomain: this.xDomain,\n yDomain: this.yDomain,\n xSplit: this.xSplit,\n ySplit: this.ySplit,\n reverseX: this.reverseX,\n };\n }\n\n protected engineOptions(): ChartOptions | null {\n if (!this.points) return null;\n return quadrantChartOptions(\n {\n ...this.geometry(),\n points: this.points,\n quadrants: this.quadrants,\n xLabel: this.xLabel,\n yLabel: this.yLabel,\n axisLabels: this.axisLabels,\n showTicks: !this.hideTicks,\n showLabels: !this.hideLabels,\n pointSize: this.pointSize,\n draggable: this.dragPoints,\n },\n this.options,\n );\n }\n\n protected override pointClicked(event: ChartHoverEvent): void {\n const index = event.items[0]?.index;\n const point = index === undefined ? undefined : this.points?.[index];\n if (!point || index === undefined) return;\n const now = Date.now();\n const last = this.lastClick;\n const double = last?.index === index && now - last.time < DOUBLE_CLICK_MS;\n this.lastClick = double ? null : { index, time: now };\n this.emit(\"minerva-point-click\", { point, index });\n if (double) this.emit(\"minerva-point-double-click\", { point, index });\n }\n\n protected override plotClicked(event: ChartPlotClickEvent): void {\n this.emit(\"minerva-quadrant-click\", {\n quadrant: quadrantOf(this.geometry(), event.x, event.y),\n x: event.x,\n y: event.y,\n });\n }\n\n private dropDetail(event: ChartDragEvent) {\n const index = event.item.index;\n const point = this.points?.[index];\n if (!point) return null;\n return {\n point,\n index,\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(this.geometry(), event.x, event.y),\n };\n }\n\n protected override pointDragged(event: ChartDragEvent): void {\n const detail = this.dropDetail(event);\n if (detail) this.emit(\"minerva-point-drag\", detail);\n }\n\n protected override pointDropped(event: ChartDragEvent): void {\n const detail = this.dropDetail(event);\n if (detail) this.emit(\"minerva-point-drop\", detail);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"minerva-line-chart\": MinervaLineChart;\n \"minerva-area-chart\": MinervaAreaChart;\n \"minerva-bar-chart\": MinervaBarChart;\n \"minerva-scatter-chart\": MinervaScatterChart;\n \"minerva-candlestick-chart\": MinervaCandlestickChart;\n \"minerva-heatmap-chart\": MinervaHeatmapChart;\n \"minerva-sparkline\": MinervaSparkline;\n \"minerva-quadrant-chart\": MinervaQuadrantChart;\n }\n}\n"],"mappings":";;;;;;AAwBA,IAAsBE,IAAtB,cAAiDC,EAA6B;CAW5E,YAAiD;EAC/C,OAAO,KAAK,SAAS;CACvB;CAEA,gBAA+C;EAC7C,IAAMC,IAAS,KAAK,UAAU,KAAK,SAAS;EAE5C,OADKA,IACE;GACL,GAAG,KAAK;GACR,QAAQ,KAAK,MAAMA,CAAM;GACzB,WAAW,KAAK,UAAU;EAC5B,IALoB;CAMtB;AACF;AAtBGJ,EA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,WAAW;AAAY,CAAC,CAAA,GAAAkB,EAAA,WAAA,YAAA,KAAA,CAAA,GAIlDvB,EAAA,CAAAK,EAAS;CAAE,MAAM;CAAS,WAAW;AAAa,CAAC,CAAA,GAAAkB,EAAA,WAAA,aAAA,KAAA,CAAA,GAInDvB,EAAA,CAAAK,EAAS;CAAE,MAAM;CAAS,WAAW;AAAc,CAAC,CAAA,GAAAkB,EAAA,WAAA,cAAA,KAAA,CAAA,GAIpDvB,EAAA,CAAAK,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAa,CAAC,CAAA,GAAAkB,EAAA,WAAA,aAAA,KAAA,CAAA,GAIlDvB,EAAA,CAAAK,EAAS;CAAE,MAAM;CAAS,WAAW;AAAc,CAAC,CAAA,GAAAkB,EAAA,WAAA,cAAA,KAAA,CAAA,GAIpDvB,EAAA,CAAAK,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAAkB,EAAA,WAAA,WAAA,KAAA,CAAA"}
@@ -4499,7 +4499,7 @@
4499
4499
  },
4500
4500
  {
4501
4501
  "name": "minerva-quadrant-chart",
4502
- "description": "Four-quadrant matrix of labelled, draggable dots.\n\nEvents: `minerva-point-click`, `minerva-quadrant-click`, `minerva-point-drop`, `minerva-hover`, `minerva-plot-click`, `minerva-zoom`, `minerva-renderer-change`",
4502
+ "description": "Four-quadrant matrix of labelled, draggable dots.\n\nEvents: `minerva-point-click`, `minerva-point-double-click`, `minerva-quadrant-click`, `minerva-point-drag`, `minerva-point-drop`, `minerva-hover`, `minerva-plot-click`, `minerva-zoom`, `minerva-renderer-change`",
4503
4503
  "attributes": [
4504
4504
  {
4505
4505
  "name": "x-label",
@@ -4538,7 +4538,7 @@
4538
4538
  },
4539
4539
  {
4540
4540
  "name": "drag-points",
4541
- "description": "Lets the user drag the dots (`minerva-point-drop`)\n\nDefault: false",
4541
+ "description": "Lets the user drag the dots (`minerva-point-drag`, `minerva-point-drop`)\n\nDefault: false",
4542
4542
  "valueSet": "v"
4543
4543
  },
4544
4544
  {
@@ -950,7 +950,9 @@ declare module "react" {
950
950
  Partial<Pick<MinervaQuadrantChart, "points" | "quadrants" | "xLabel" | "yLabel" | "axisLabels" | "xDomain" | "yDomain" | "xSplit" | "ySplit" | "reverseX" | "hideTicks" | "hideLabels" | "pointSize" | "dragPoints" | "options" | "height">>,
951
951
  {
952
952
  "onminerva-point-click"?: (event: CustomEvent) => void;
953
+ "onminerva-point-double-click"?: (event: CustomEvent) => void;
953
954
  "onminerva-quadrant-click"?: (event: CustomEvent) => void;
955
+ "onminerva-point-drag"?: (event: CustomEvent) => void;
954
956
  "onminerva-point-drop"?: (event: CustomEvent) => void;
955
957
  "onminerva-hover"?: (event: CustomEvent) => void;
956
958
  "onminerva-plot-click"?: (event: CustomEvent) => void;