minerva-design 1.17.2 → 1.18.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 (69) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/angular/fesm2022/minerva-angular.mjs +27 -25
  3. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  4. package/dist/angular/types/minerva-angular.d.ts +1 -1
  5. package/dist/charts/engine/chart.cjs +1 -1
  6. package/dist/charts/engine/chart.cjs.map +1 -1
  7. package/dist/charts/engine/chart.js +309 -301
  8. package/dist/charts/engine/chart.js.map +1 -1
  9. package/dist/charts/engine/overlay.cjs +1 -1
  10. package/dist/charts/engine/overlay.cjs.map +1 -1
  11. package/dist/charts/engine/overlay.d.cts +5 -0
  12. package/dist/charts/engine/overlay.d.ts +5 -0
  13. package/dist/charts/engine/overlay.js +87 -69
  14. package/dist/charts/engine/overlay.js.map +1 -1
  15. package/dist/charts/engine/scene.cjs +1 -1
  16. package/dist/charts/engine/scene.cjs.map +1 -1
  17. package/dist/charts/engine/scene.d.cts +5 -0
  18. package/dist/charts/engine/scene.d.ts +5 -0
  19. package/dist/charts/engine/scene.js +32 -32
  20. package/dist/charts/engine/scene.js.map +1 -1
  21. package/dist/charts/engine/types.d.cts +14 -0
  22. package/dist/charts/engine/types.d.ts +14 -0
  23. package/dist/charts/react/Chart.cjs +1 -1
  24. package/dist/charts/react/Chart.cjs.map +1 -1
  25. package/dist/charts/react/Chart.d.cts +4 -2
  26. package/dist/charts/react/Chart.d.ts +4 -2
  27. package/dist/charts/react/Chart.js +42 -42
  28. package/dist/charts/react/Chart.js.map +1 -1
  29. package/dist/charts/react/charts.cjs +1 -1
  30. package/dist/charts/react/charts.cjs.map +1 -1
  31. package/dist/charts/react/charts.js +320 -231
  32. package/dist/charts/react/charts.js.map +1 -1
  33. package/dist/charts/react/types.d.cts +8 -2
  34. package/dist/charts/react/types.d.ts +8 -2
  35. package/dist/core/contracts.cjs +1 -1
  36. package/dist/core/contracts.cjs.map +1 -1
  37. package/dist/core/contracts.js +1 -1
  38. package/dist/core/contracts.js.map +1 -1
  39. package/dist/native/charts/src/engine/overlay.cjs +1 -1
  40. package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
  41. package/dist/native/charts/src/engine/overlay.js +82 -65
  42. package/dist/native/charts/src/engine/overlay.js.map +1 -1
  43. package/dist/native/charts/src/engine/scene.cjs +1 -1
  44. package/dist/native/charts/src/engine/scene.cjs.map +1 -1
  45. package/dist/native/charts/src/engine/scene.js +32 -32
  46. package/dist/native/charts/src/engine/scene.js.map +1 -1
  47. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.cjs +1 -1
  48. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.cjs.map +1 -1
  49. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.js +14 -8
  50. package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.js.map +1 -1
  51. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.cjs +1 -1
  52. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.cjs.map +1 -1
  53. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.js +16 -15
  54. package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.js.map +1 -1
  55. package/dist/react/style.css +1 -1
  56. package/dist/react/styles/quadrant-task-board.css +1 -1
  57. package/dist/taro/index.js +1514 -1496
  58. package/dist/taro/style.css +22 -0
  59. package/dist/uni/style.css +22 -0
  60. package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue.js.map +1 -1
  61. package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js +14 -8
  62. package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/weapp/charts/canvas.js +35 -7
  64. package/dist/weapp/controls.wxss +22 -0
  65. package/dist/web-components/components/quadrant-task-board/quadrant-task-board.js +7 -7
  66. package/dist/web-components/components/quadrant-task-board/quadrant-task-board.js.map +1 -1
  67. package/dist/web-components/styles/QuadrantTaskBoard/quadrantTaskBoard.css.js +1 -1
  68. package/dist/web-components/styles/QuadrantTaskBoard/quadrantTaskBoard.css.js.map +1 -1
  69. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"charts.cjs","names":["useMemo","lineSeries","ChartBase","engineOptions","areaSeries","barSeries","candlestickSeries","heatmapChartOptions","sparklineOptions","scatterSeries","QUADRANT_CORNERS","useState","useRef","useId","quadrantLabels","quadrantGroups","quadrantName","nameOfQuadrant","quadrantPointName","quadrantHoverEvent","quadrantOf","quadrantChartOptions","QUADRANT_MOVE_SHORTCUTS","isQuadrantMoveKey","quadrantNavTarget","quadrantKeyTarget","quadrantMoveDrop","quadrantMovedText","DEFAULT_QUADRANT_COLORS","_Fragment","rangeAreaSeries","Chart","bubbleSeries","resolveLocale","histogramSeries","presetLabels","boxplotSeries","boxplotData","waterfallSeries","ganttSeries","require_tooltip","require_locale","require_Chart","require_presets","require_quadrant_keyboard","react","react_jsx_runtime","frameProps","props","LineChart","input","series","area","stacked","percent","curve","AreaChart","BarChart","labels","CandlestickChart","HeatmapChart","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","base","Sparkline","options","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","CORNERS","DOUBLE_CLICK_MS","VISUALLY_HIDDEN","createPositionEmitter","listeners","listener","position","CARD_GAP","headerStyle","top","corner","left","cornerStyle","split","plot","QuadrantChart","geometry","dragging","setDragging","hovered","setHovered","selection","setSelection","selected","selectedIndex","lastClick","focusedIndex","setFocusedIndex","announcement","setAnnouncement","pendingFocus","layerRef","cardRef","cardQuadrantRef","cardSwatchRef","cardThemed","dragAt","placeCard","positions","hintId","texts","movable","onPointDrop","draggable","groups","points","xDomain","yDomain","xSplit","ySplit","reverseX","quadrantName$1","pointName","point","index","order","focusHover","layer","pending","button","dropAt","event","onPointDrag","renderQuadrantHeader","showCounts","accessiblePoints","i","a","x0","x1","y0","y1","fraction","v","b","pointButton","label","selectedIndices","current","onPointClick","next","target","activeIndex","cardIndex","cardPoint","el","live","at","fx","visualX","gap","side","quadrants","win","frame","off","overlay","xs","ys","fy","quadrantContent","group","header","getPointProps","now","last","double","onPointDoubleClick","onQuadrantClick","renderTooltip","HorizontalBarChart","RangeAreaChart","MixedChart","BubbleChart","minSize","maxSize","maxValue","HistogramChart","extra","lang","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","s","outlierShape","outlierSize","whisker","WaterfallChart","steps","upColor","downColor","totalColor","start","connector","GanttChart","gantt","tasks","colors","taskName","progressName","milestoneName","formatProgress","dependenciesName","dependencyArrows","dependencyColor","barLabels","mountedAt","today","lines","todayLabel","xAxis","yAxis","annotations","interaction","legend"],"sources":["../../../../charts/src/react/charts.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\";\nimport {\n areaSeries,\n barSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n lineSeries,\n DEFAULT_QUADRANT_COLORS,\n presetLabels,\n quadrantChartOptions,\n quadrantGroups,\n quadrantLabels,\n quadrantOf,\n rangeAreaSeries,\n scatterSeries,\n sparklineOptions,\n waterfallSeries,\n type QuadrantCorner,\n type QuadrantPoint,\n} from \"../engine/presets\";\nimport {\n QUADRANT_CORNERS,\n QUADRANT_MOVE_SHORTCUTS,\n isQuadrantMoveKey,\n quadrantHoverEvent,\n quadrantKeyTarget,\n quadrantMoveDrop,\n quadrantMovedText,\n quadrantName as nameOfQuadrant,\n quadrantNavTarget,\n quadrantPointName,\n} from \"../engine/quadrant-keyboard\";\nimport { resolveLocale } from \"../engine/locale\";\nimport { styleTooltip, themeTooltip } from \"../engine/tooltip\";\nimport type {\n ChartAnnotation,\n ChartDragEvent,\n ChartRect,\n} from \"../engine/types\";\nimport { Chart, ChartBase, engineOptions } from \"./Chart\";\nimport type {\n AreaChartProps,\n BarChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n ChartCommonProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n MixedChartProps,\n QuadrantChartProps,\n QuadrantDropTarget,\n RangeAreaChartProps,\n ScatterChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n className: props.className,\n style: props.style,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n onRendererChange: props.onRendererChange,\n renderTooltip: props.renderTooltip,\n});\n\n/** Line (or area) chart; handles millions of points on the GPU */\nexport function LineChart(props: LineChartProps) {\n const {\n series: input,\n area = false,\n curve,\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => lineSeries(input, area, { curve, stacked: stacked || percent }),\n [input, area, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Area chart: smooth by default, stacked or 100% stacked */\nexport function AreaChart(props: AreaChartProps) {\n const {\n series: input,\n curve = \"smooth\",\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => areaSeries(input, { curve, stacked: stacked || percent }),\n [input, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Bar chart: grouped side by side, stacked or 100% stacked, with optional value labels */\nexport function BarChart(props: BarChartProps) {\n const {\n series: input,\n stacked = false,\n percent = false,\n labels = false,\n } = props;\n const series = useMemo(\n () => barSeries(input, stacked || percent, labels),\n [input, stacked, percent, labels],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, zoomable on the GPU */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const series = useMemo(() => candlestickSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Heatmap: a grid of cells colored by value (categories or numbers on both axes) */\nexport function HeatmapChart(props: HeatmapChartProps) {\n const {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n } = props;\n const series = useMemo(\n () =>\n heatmapChartOptions({\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n }).series,\n [\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n ],\n );\n const base = engineOptions({ ...props, series });\n return (\n <ChartBase\n options={{\n ...heatmapChartOptions(\n { data, xCategories, yCategories },\n {\n ...base,\n legend: props.legend,\n interaction: props.interaction,\n tooltip: props.tooltip,\n },\n ),\n series,\n }}\n {...frameProps(props)}\n />\n );\n}\n\n/** Word-sized chart without axes: a trend in a table cell, a KPI card, ... */\nexport function Sparkline(props: SparklineProps) {\n const {\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n height = 48,\n width,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n className,\n style,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { renderer, tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n return (\n <ChartBase\n options={options}\n height={height}\n width={width}\n className={className}\n style={style}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/** Scatter chart: zooms on both axes, hit testing through a spatial index */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\nconst CORNERS = QUADRANT_CORNERS;\n\n/** Two clicks on the same point within this delay count as a double click */\nconst DOUBLE_CLICK_MS = 400;\n\nconst VISUALLY_HIDDEN: CSSProperties = {\n position: \"absolute\",\n width: 1,\n height: 1,\n margin: -1,\n padding: 0,\n border: 0,\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n};\n\n/** Data position of a dragged point, pushed to its info card on every move */\ninterface CardPosition {\n x: number;\n y: number;\n}\n\n/** Minimal event emitter: the card subscribes, the drag handler emits */\nconst createPositionEmitter = () => {\n const listeners = new Set<(position: CardPosition) => void>();\n return {\n on(listener: (position: CardPosition) => void) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n emit(position: CardPosition) {\n listeners.forEach((listener) => listener(position));\n },\n };\n};\n\n/** Gap between a point and its info card */\nconst CARD_GAP = 14;\n\n/** Header slot in the outer corner of a quadrant */\nconst headerStyle = (corner: QuadrantCorner): CSSProperties => {\n const top = corner.startsWith(\"top\");\n const left = corner.endsWith(\"Left\");\n return {\n position: \"absolute\",\n [top ? \"top\" : \"bottom\"]: 0,\n [left ? \"left\" : \"right\"]: 0,\n maxWidth: \"100%\",\n boxSizing: \"border-box\",\n padding: 8,\n display: \"flex\",\n justifyContent: left ? \"flex-start\" : \"flex-end\",\n pointerEvents: \"auto\",\n };\n};\n\nconst cornerStyle = (\n corner: QuadrantCorner,\n plot: ChartRect,\n split: { x: number; y: number },\n): CSSProperties => {\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return {\n position: \"absolute\",\n left: left ? 0 : split.x - plot.x,\n top: top ? 0 : split.y - plot.y,\n width: left ? split.x - plot.x : plot.x + plot.width - split.x,\n height: top ? split.y - plot.y : plot.y + plot.height - split.y,\n pointerEvents: \"none\",\n };\n};\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 */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDoubleClick,\n onPointDrag,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n showCounts,\n selectedIndex,\n selectedIndices,\n renderQuadrantHeader,\n accessiblePoints = true,\n getPointProps,\n locale,\n } = props;\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n // the engine draws the dragged dot and its label under the pointer: the\n // options stay the same during a drag (no re-render on every move)\n const [dragging, setDragging] = useState<number | null>(null);\n const [hovered, setHovered] = useState<number | null>(null);\n const [selection, setSelection] = useState<number | null>(null);\n const selected = selectedIndex !== undefined ? selectedIndex : selection;\n const lastClick = useRef<{ index: number; time: number } | null>(null);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [announcement, setAnnouncement] = useState(\"\");\n // point moved with the keyboard: its button gets the focus back once the\n // new `points` render it in the list of its new quadrant\n const pendingFocus = useRef<{\n index: number;\n points: readonly QuadrantPoint[];\n } | null>(null);\n const layerRef = useRef<HTMLDivElement>(null);\n // info card of the active point: placed on the DOM (and fed the drag\n // positions through an emitter), so a drag renders no React per move\n const cardRef = useRef<HTMLDivElement>(null);\n const cardQuadrantRef = useRef<HTMLSpanElement>(null);\n const cardSwatchRef = useRef<HTMLSpanElement>(null);\n const cardThemed = useRef<number | null>(null);\n const dragAt = useRef<CardPosition | null>(null);\n const placeCard = useRef<() => void>(() => {});\n const positions = useMemo(() => createPositionEmitter(), []);\n const hintId = useId();\n const texts = quadrantLabels(locale);\n const movable = !!onPointDrop && draggable !== false;\n const groups = useMemo(\n () =>\n quadrantGroups({\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n reverseX,\n }),\n [points, xDomain, yDomain, xSplit, ySplit, reverseX],\n );\n const quadrantName = (corner: QuadrantCorner) =>\n nameOfQuadrant(corner, { quadrants }, texts);\n const pointName = (point: QuadrantPoint, index: number) =>\n quadrantPointName(point, index, texts);\n // the accessible buttons in list order (arrow navigation)\n const order = CORNERS.flatMap((corner) => groups[corner].indices);\n const focusHover = (index: number | null) =>\n props.onHover?.(\n quadrantHoverEvent(\n { points, ...geometry, quadrants, xLabel, yLabel, name },\n index,\n locale,\n ),\n );\n\n useEffect(() => {\n const layer = layerRef.current;\n const pending = pendingFocus.current;\n if (pending && pending.points !== points) {\n pendingFocus.current = null;\n const button = layer?.querySelector<HTMLButtonElement>(\n `button[data-point-index=\"${pending.index}\"]`,\n );\n if (button && document.activeElement !== button) button.focus();\n }\n // a focused button removed by a re-render does not report its blur\n if (\n focusedIndex !== null &&\n !pendingFocus.current &&\n !layer?.contains(document.activeElement)\n )\n setFocusedIndex(null);\n }, [points, focusedIndex]);\n\n const dropAt = (event: ChartDragEvent): QuadrantDropTarget => ({\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n\n const options = quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: draggable ?? !!(onPointDrop || onPointDrag),\n showCounts: renderQuadrantHeader ? undefined : showCounts,\n selectedIndex: selected,\n selectedIndices,\n },\n engineOptions({ ...props, series: [] }),\n { focusedIndex: accessiblePoints ? focusedIndex : null },\n );\n // the info card follows a dragged point and names it: no label pill\n if (typeof options.interaction === \"object\")\n options.interaction = { ...options.interaction, dragLabel: false };\n if (renderQuadrantHeader)\n // the React headers replace the drawn titles (the first four areas)\n options.annotations = options.annotations?.map((a, i) =>\n i < 4 && a.type === \"rect\"\n ? {\n ...a,\n label: undefined,\n badge: undefined,\n description: undefined,\n detail: undefined,\n }\n : a,\n );\n\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const fraction = (v: number, a: number, b: number) => (v - a) / (b - a || 1);\n\n const pointButton = (corner: QuadrantCorner, index: number) => {\n const point = points[index]!;\n const label = pointName(point, index);\n const selected =\n selectedIndex === index || !!selectedIndices?.includes(index);\n return (\n <div key={index} role=\"listitem\">\n <button\n type=\"button\"\n data-point-index={index}\n aria-label={`${label}, ${quadrantName(corner)}`}\n aria-current={selected ? \"true\" : undefined}\n aria-keyshortcuts={movable ? QUADRANT_MOVE_SHORTCUTS : undefined}\n aria-describedby={movable ? hintId : undefined}\n onFocus={() => {\n setFocusedIndex(index);\n focusHover(index);\n }}\n onBlur={(event) => {\n setFocusedIndex((current) => (current === index ? null : current));\n if (event.relatedTarget) pendingFocus.current = null;\n const next = event.relatedTarget as Element | null;\n if (\n !next?.closest?.(\"button[data-point-index]\") &&\n !pendingFocus.current\n )\n focusHover(null);\n }}\n onClick={() => {\n setSelection(index);\n onPointClick?.(point, index);\n }}\n onKeyDown={(event) => {\n if (!(movable && isQuadrantMoveKey(event))) {\n const next = quadrantNavTarget(event, order, index);\n if (next === null) return;\n event.preventDefault();\n layerRef.current\n ?.querySelector<HTMLButtonElement>(\n `button[data-point-index=\"${next}\"]`,\n )\n ?.focus();\n return;\n }\n event.preventDefault();\n const target = quadrantKeyTarget(event, corner);\n if (!target) return;\n pendingFocus.current = { index, points };\n onPointDrop!(point, index, quadrantMoveDrop(geometry, target));\n setAnnouncement(\n quadrantMovedText(texts, label, quadrantName(target)),\n );\n }}\n >\n {label}\n </button>\n </div>\n );\n };\n\n // nothing is attached to a point while it is dragged\n const activeIndex =\n dragging !== null ? null : (hovered ?? focusedIndex ?? selected);\n // the info card: the dragged point (following it), else the focused or\n // selected one while no point is hovered (the tooltip shows that one)\n const cardIndex =\n dragging !== null\n ? dragging\n : hovered === null && activeIndex != null && points[activeIndex]\n ? activeIndex\n : null;\n const cardPoint = cardIndex === null ? null : (points[cardIndex] ?? null);\n\n // after every render (new points, plot size, active point)\n useLayoutEffect(() => {\n placeCard.current = () => {\n const el = cardRef.current;\n // the overlay holding the card covers the plot area\n const plot = el?.parentElement;\n if (!el || !plot || !cardPoint || cardIndex === null) return;\n // the colors of the theme, read again when another point shows it\n if (cardThemed.current !== cardIndex) {\n cardThemed.current = cardIndex;\n themeTooltip(el, el);\n }\n const live = dragging !== null ? dragAt.current : null;\n const at = live ?? cardPoint;\n const fx = fraction(at.x, x0, x1);\n const visualX = reverseX ? 1 - fx : fx;\n const left = visualX * (parseFloat(plot.style.width) || plot.clientWidth);\n const top =\n (1 - fraction(at.y, y0, y1)) *\n (parseFloat(plot.style.height) || plot.clientHeight);\n // beside the dot (the lifted dot of a drag is larger), on the side\n // with room\n const gap = live ? CARD_GAP + 4 : CARD_GAP;\n const side = visualX > 0.6 ? `calc(-100% - ${gap}px)` : `${gap}px`;\n el.style.transform = `translate(${left}px, ${top}px) translate(${side}, -50%)`;\n const corner = quadrantOf(geometry, at.x, at.y);\n const name = quadrantName(corner);\n const label = cardQuadrantRef.current;\n if (label && label.textContent !== name) label.textContent = name;\n if (cardSwatchRef.current)\n cardSwatchRef.current.style.background =\n cardPoint.color ??\n quadrants?.[corner]?.color ??\n DEFAULT_QUADRANT_COLORS[corner];\n };\n if (cardIndex === null) cardThemed.current = null;\n placeCard.current();\n });\n\n // drag positions move the card directly, once per frame\n useEffect(() => {\n const win = typeof window === \"undefined\" ? null : window;\n let frame = 0;\n const off = positions.on((position) => {\n dragAt.current = position;\n if (!win?.requestAnimationFrame) return placeCard.current();\n if (!frame)\n frame = win.requestAnimationFrame(() => {\n frame = 0;\n placeCard.current();\n });\n });\n return () => {\n off();\n if (frame) win?.cancelAnimationFrame(frame);\n };\n }, [positions]);\n\n const overlay = (plot: ChartRect) => {\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = fraction(xs, x0, x1);\n const fy = fraction(ys, y0, y1);\n const split = {\n x: plot.x + plot.width * (reverseX ? 1 - fx : fx),\n y: plot.y + plot.height * (1 - fy),\n };\n return [\n ...CORNERS.map((corner) =>\n quadrantContent?.[corner] ? (\n <div\n key={corner}\n className={`minerva-chart-quadrant minerva-chart-quadrant-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n {quadrantContent[corner]}\n </div>\n ) : null,\n ),\n ...CORNERS.map((corner) => {\n if (!renderQuadrantHeader) return null;\n const group = groups[corner];\n const header = renderQuadrantHeader(corner, {\n count: group.points.length,\n points: group.points,\n indices: group.indices,\n region: quadrants?.[corner],\n });\n return header === null ||\n header === undefined ||\n header === false ? null : (\n <div\n key={`header-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n <div\n className={`minerva-chart-quadrant-header minerva-chart-quadrant-header-${corner}`}\n style={headerStyle(corner)}\n >\n {header}\n </div>\n </div>\n );\n }),\n <div\n key=\"points\"\n ref={layerRef}\n className=\"minerva-chart-quadrant-points\"\n style={{ position: \"absolute\", inset: 0, pointerEvents: \"none\" }}\n >\n {points.map((point, index) => {\n if (!Number.isFinite(point.x) || !Number.isFinite(point.y))\n return null;\n const fx = fraction(point.x, x0, x1);\n return (\n <div\n key={index}\n {...getPointProps?.(point, index)}\n aria-hidden={props.renderPointActions ? undefined : true}\n className=\"minerva-chart-quadrant-point\"\n data-point-index={index}\n data-label={point.label}\n style={{\n position: \"absolute\",\n left: `${100 * (reverseX ? 1 - fx : fx)}%`,\n top: `${100 * (1 - fraction(point.y, y0, y1))}%`,\n width: 0,\n height: 0,\n pointerEvents: \"none\",\n }}\n >\n {index === activeIndex\n ? props.renderPointActions?.(points[index], index)\n : null}\n </div>\n );\n })}\n {accessiblePoints ? (\n <>\n {CORNERS.map((corner) =>\n groups[corner].indices.length ? (\n <div\n key={corner}\n role=\"list\"\n data-quadrant={corner}\n aria-label={quadrantName(corner)}\n style={VISUALLY_HIDDEN}\n >\n {groups[corner].indices.map((index) =>\n pointButton(corner, index),\n )}\n </div>\n ) : null,\n )}\n {movable ? (\n <span id={hintId} style={VISUALLY_HIDDEN}>\n {texts.moveHint}\n </span>\n ) : null}\n <div role=\"status\" aria-live=\"polite\" style={VISUALLY_HIDDEN}>\n {announcement}\n </div>\n </>\n ) : null}\n </div>,\n cardPoint ? (\n <div\n key=\"point-card\"\n ref={(el) => {\n if (el && !el.dataset.styled) {\n el.dataset.styled = \"\";\n styleTooltip(el, {\n zIndex: \"3\",\n boxSizing: \"border-box\",\n maxWidth: \"220px\",\n padding: \"8px 12px\",\n borderRadius: \"10px\",\n fontSize: \"12px\",\n lineHeight: \"18px\",\n });\n // the colors of the theme around it\n themeTooltip(el, el);\n }\n cardRef.current = el;\n // the overlay re-renders alone when the plot moves or resizes\n if (el) placeCard.current();\n }}\n aria-hidden=\"true\"\n className=\"minerva-chart-quadrant-card\"\n data-point-preview={cardIndex}\n data-dragging={dragging !== null ? \"\" : undefined}\n >\n <strong\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n fontWeight: 600,\n }}\n >\n {cardPoint.label}\n </strong>\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: \"var(--text-secondary-color, #6b7280)\",\n whiteSpace: \"nowrap\",\n }}\n >\n <span\n ref={cardSwatchRef}\n style={{\n flex: \"none\",\n width: 8,\n height: 8,\n borderRadius: \"50%\",\n }}\n />\n <span ref={cardQuadrantRef} />\n </span>\n </div>\n ) : null,\n ];\n };\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onPointClick={(event) => {\n const index = event.items[0]?.index;\n if (index === undefined || !points[index]) return;\n const now = Date.now();\n const last = lastClick.current;\n const double =\n last?.index === index && now - last.time < DOUBLE_CLICK_MS;\n lastClick.current = double ? null : { index, time: now };\n setSelection(index);\n onPointClick?.(points[index], index);\n if (double) onPointDoubleClick?.(points[index], index);\n }}\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onHover={(event) => {\n setHovered(event?.items[0]?.index ?? null);\n props.onHover?.(event);\n }}\n onDragStart={(event) => {\n dragAt.current = { x: event.x, y: event.y };\n setDragging(event.item.index);\n }}\n onDragEnd={() => {\n dragAt.current = null;\n setDragging(null);\n }}\n onDrag={(event) => {\n const index = event.item.index;\n positions.emit({ x: event.x, y: event.y });\n if (points[index] && onPointDrag)\n onPointDrag(points[index], index, dropAt(event));\n }}\n onDrop={(event) => {\n pendingFocus.current = null;\n const index = event.item.index;\n if (points[index] && onPointDrop)\n onPointDrop(points[index], index, dropAt(event));\n }}\n renderTooltip={\n renderTooltip\n ? (event) => {\n const index = event.items[0]?.index;\n return index !== undefined && points[index]\n ? renderTooltip(points[index], index)\n : null;\n }\n : undefined\n }\n />\n );\n}\n\n/**\n * Horizontal bar chart: categories down the left side, values from the\n * left (rankings, long names, diverging surveys, stacked progress)\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n return <BarChart {...props} orientation=\"horizontal\" />;\n}\n\n/**\n * Range area chart: bands between a lower (`y0`) and an upper edge\n * (confidence intervals, min-max ranges), mixable with lines\n */\nexport function RangeAreaChart(props: RangeAreaChartProps) {\n const { series: input, curve = \"smooth\" } = props;\n const series = useMemo(() => rangeAreaSeries(input, curve), [input, curve]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Combination chart: bars, lines and areas on one or two value axes\n * (`yAxis: \"right\"` series use `yAxis2`, aligned on the left grid)\n */\nexport function MixedChart(props: MixedChartProps) {\n return <Chart {...props} />;\n}\n\n/** Bubble chart: x, y and a value sized by area (√value diameters) */\nexport function BubbleChart(props: BubbleChartProps) {\n const { series: input, minSize, maxSize, maxValue } = props;\n const series = useMemo(\n () => bubbleSeries(input, { minSize, maxSize, maxValue }),\n [input, minSize, maxSize, maxValue],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count); millions of samples are binned\n * in milliseconds\n */\nexport function HistogramChart(props: HistogramChartProps) {\n const {\n values,\n bins,\n domain,\n nice,\n name,\n color,\n formatBin,\n series: extra,\n locale,\n } = props;\n // page language read at every render: a language switch renames the series\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: lang,\n }),\n ...(extra ?? []),\n ],\n [values, bins, domain, nice, name, color, formatBin, extra, lang],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Box plot: medians, quartiles, whiskers and outliers of samples, from raw\n * values (`groups`) or computed statistics (`series`)\n */\nexport function BoxPlotChart(props: BoxPlotChartProps) {\n const {\n series: input,\n groups,\n name,\n whisker,\n orientation,\n locale,\n outlierShape,\n outlierSize,\n } = props;\n const groupName = name ?? presetLabels(resolveLocale(locale)).values;\n const series = useMemo(\n () =>\n boxplotSeries([\n ...(groups?.length\n ? [\n {\n id: \"boxplot\",\n name: groupName,\n data: boxplotData(groups, { whisker }),\n },\n ]\n : []),\n ...(input ?? []),\n ]).map((s) =>\n s.type === \"boxplot\"\n ? {\n ...s,\n outlierShape: s.outlierShape ?? outlierShape,\n outlierSize: s.outlierSize ?? outlierSize,\n }\n : s,\n ),\n [input, groups, groupName, whisker, outlierShape, outlierSize],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series, orientation })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Waterfall (bridge) chart: how changes take a value from a start to an\n * end, with subtotals and totals (P&L bridges, budget variances)\n */\nexport function WaterfallChart(props: WaterfallChartProps) {\n const {\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels = true,\n format,\n connector,\n orientation,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n locale: lang,\n }),\n ],\n [\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n lang,\n ],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n orientation,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; zooms and pans along the time\n */\nexport function GanttChart(props: GanttChartProps) {\n const {\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n barLabels,\n today = false,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const gantt = useMemo(\n () =>\n ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n barLabels,\n locale: lang,\n }),\n [\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n barLabels,\n lang,\n ],\n );\n const [mountedAt] = useState(() => Date.now());\n const now =\n today === false\n ? null\n : today === true\n ? mountedAt\n : today instanceof Date\n ? today.getTime()\n : today;\n const lines: ChartAnnotation[] =\n now === null\n ? []\n : [\n {\n type: \"line\",\n axis: \"y\",\n value: now,\n color: \"var(--danger-color, #dc2626)\",\n dash: [4, 3],\n label: todayLabel,\n },\n ];\n return (\n <ChartBase\n options={{\n ...engineOptions({\n ...props,\n series: gantt.series,\n orientation: \"horizontal\",\n }),\n xAxis: {\n type: \"category\",\n categories: gantt.categories,\n ...xAxis,\n },\n yAxis: {\n type: \"time\",\n min: gantt.domain[0],\n max: gantt.domain[1],\n ...yAxis,\n },\n annotations: [...(annotations ?? []), ...lines],\n dependencies: gantt.dependencies,\n interaction: interaction ?? { zoom: \"y\" },\n legend: legend ?? gantt.series.length > 1,\n }}\n {...frameProps(props)}\n />\n );\n}\n"],"mappings":"uPA0EA,IAAM+C,EAAc,IAA6C,CAC/D,OAAQC,EAAM,OACd,MAAOA,EAAM,MACb,UAAWA,EAAM,UACjB,MAAOA,EAAM,MACb,UAAWA,EAAM,IACjB,QAASA,EAAM,QACf,aAAcA,EAAM,aACpB,YAAaA,EAAM,YACnB,OAAQA,EAAM,OACd,iBAAkBA,EAAM,iBACxB,cAAeA,EAAM,aACvB,GAGA,SAAgBC,EAAU,EAAuB,CAC/C,GAAM,CACJ,OAAQC,EACR,OAAO,GACP,QACA,UAAU,GACV,UAAU,IACRF,EACEG,GAAA,EAASnD,EAAAA,QAAAA,KACPC,EAAAA,WAAWiD,EAAOE,EAAM,CAAE,QAAO,QAASC,GAAWC,CAAQ,CAAC,EACpE,CAACJ,EAAOE,EAAMG,EAAOF,EAASC,CAAO,CACvC,EACA,OACE,EAAAR,EAAA,IAAA,CAAC5C,EAAAA,UAAD,CACE,QAASC,EAAAA,cAAc,CACrB,GAAG6C,EACH,SACA,UAAWM,EAAU,UAAY,IAAA,EACnC,CAAC,EACD,GAAIP,EAAWC,CAAK,CACrB,CAAA,CAEL,CAGA,SAAgBQ,EAAU,EAAuB,CAC/C,GAAM,CACJ,OAAQN,EACR,QAAQ,SACR,UAAU,GACV,UAAU,IACRF,EACEG,GAAA,EAASnD,EAAAA,QAAAA,KACPI,EAAAA,WAAW8C,EAAO,CAAE,QAAO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A,iBACA,mBACA,mBACA,kBACA,YACA,QAAQ,GACR,aACA,QACA,SACA,cACA,cACA,SACA,UACE7K,EACE0J,EAAOzK,EAAAA,cAAc+C,CAAM,EAC3B8I,GAAA,EAAQ9N,EAAAA,QAAAA,KAEVuC,EAAAA,YAAYwL,EAAO,CACjB,SACA,WACA,eACA,gBACA,iBACA,mBACA,mBACA,kBACA,YACA,OAAQrB,CACV,CAAC,EACH,CACEqB,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACA9B,CACF,CACF,EACM,CAAC+B,IAAA,EAAa9N,EAAAA,SAAAA,KAAe,KAAK,IAAI,CAAC,EACvCgL,EACJ+C,IAAU,GACN,KACAA,IAAU,GACRD,EACAC,aAAiB,KACfA,EAAM,QAAQ,EACdA,EACJC,EACJhD,IAAQ,KACJ,CAAC,EACD,CACE,CACE,KAAM,OACN,KAAM,IACN,MAAOA,EACP,MAAO,+BACP,KAAM,CAAC,EAAG,CAAC,EACX,MAAOiD,CACT,CACF,EACN,OACE,EAAA9L,EAAA,IAAA,CAAC5C,EAAAA,UAAD,CACE,QAAS,CACP,GAAGC,EAAAA,cAAc,CACf,GAAG6C,EACH,OAAQ8K,EAAM,OACd,YAAa,YACf,CAAC,EACD,MAAO,CACL,KAAM,WACN,WAAYA,EAAM,WAClB,GAAGe,CACL,EACA,MAAO,CACL,KAAM,OACN,IAAKf,EAAM,OAAO,GAClB,IAAKA,EAAM,OAAO,GAClB,GAAGgB,EACL,EACA,YAAa,CAAC,GAAIC,GAAe,CAAC,EAAI,GAAGJ,CAAK,EAC9C,aAAcb,EAAM,aACpB,YAAakB,GAAe,CAAE,KAAM,GAAI,EACxC,OAAQC,GAAUnB,EAAM,OAAO,OAAS,CAC1C,EACA,GAAI/K,EAAWC,CAAK,CACrB,CAAA,CAEL"}
1
+ {"version":3,"file":"charts.cjs","names":["useMemo","lineSeries","ChartBase","engineOptions","areaSeries","barSeries","candlestickSeries","heatmapChartOptions","sparklineOptions","scatterSeries","QUADRANT_CORNERS","useState","useRef","useId","quadrantLabels","quadrantGroups","quadrantName","nameOfQuadrant","quadrantPointName","quadrantHoverEvent","quadrantOf","quadrantChartOptions","QUADRANT_MOVE_SHORTCUTS","isQuadrantMoveKey","quadrantNavTarget","quadrantKeyTarget","quadrantMoveDrop","quadrantMovedText","DEFAULT_QUADRANT_COLORS","_Fragment","rangeAreaSeries","Chart","bubbleSeries","resolveLocale","histogramSeries","presetLabels","boxplotSeries","boxplotData","waterfallSeries","ganttSeries","require_tooltip","require_locale","require_Chart","require_presets","require_quadrant_keyboard","react","react_jsx_runtime","frameProps","props","LineChart","input","series","area","stacked","percent","curve","AreaChart","BarChart","labels","CandlestickChart","HeatmapChart","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","base","Sparkline","options","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","CORNERS","DOUBLE_CLICK_MS","VISUALLY_HIDDEN","createPositionEmitter","listeners","listener","position","CARD_PAD_X","CARD_PAD_Y","CARD_DOT_GAP","CARD_ROW","CARD_ACTIONS_ROW","CARD_OVERHANG","CARD_LINGER_MS","headerStyle","top","corner","left","cornerStyle","split","plot","QuadrantChart","geometry","dragging","setDragging","hoveredRef","setHoveredRef","heldRef","setHeldRef","hovered","points","held","hoverTimer","holdTimer","engineRef","selection","setSelection","selected","selectedIndex","lastClick","focusedIndex","setFocusedIndex","announcement","setAnnouncement","pendingFocus","layerRef","cardRef","cardQuadrantRef","cardDotRef","cardContentRef","cardThemed","dragAt","placeCard","positions","hintId","texts","movable","onPointDrop","draggable","groups","xDomain","yDomain","xSplit","ySplit","reverseX","quadrantName$1","pointName","point","index","order","focusHover","layer","pending","button","dropAt","event","onPointDrag","renderQuadrantHeader","showCounts","accessiblePoints","i","a","x0","x1","y0","y1","fraction","v","b","pointButton","label","selectedIndices","current","onPointClick","next","target","hoverCard","activeIndex","cardIndex","cardPoint","cardActions","hasActions","cardCustom","renderTooltip","cardRow","cardDot","pointSize","clickPoint","now","last","double","onPointDoubleClick","hold","el","fresh","live","at","fx","visualX","plotWidth","plotHeight","reach","width","height","mirrored","overRight","overLeft","was","cardTop","side","layout","lead","trail","content","region","quadrants","dot","win","frame","off","overlay","xs","ys","fy","quadrantContent","group","header","getPointProps","chart","onQuadrantClick","HorizontalBarChart","RangeAreaChart","MixedChart","BubbleChart","minSize","maxSize","maxValue","HistogramChart","extra","lang","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","s","outlierShape","outlierSize","whisker","WaterfallChart","steps","upColor","downColor","totalColor","start","connector","GanttChart","gantt","tasks","colors","taskName","progressName","milestoneName","formatProgress","dependenciesName","dependencyArrows","dependencyColor","barLabels","mountedAt","today","lines","todayLabel","xAxis","yAxis","annotations","interaction","legend"],"sources":["../../../../charts/src/react/charts.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\";\nimport {\n areaSeries,\n barSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n lineSeries,\n DEFAULT_QUADRANT_COLORS,\n presetLabels,\n quadrantChartOptions,\n quadrantGroups,\n quadrantLabels,\n quadrantOf,\n rangeAreaSeries,\n scatterSeries,\n sparklineOptions,\n waterfallSeries,\n type QuadrantCorner,\n type QuadrantPoint,\n} from \"../engine/presets\";\nimport {\n QUADRANT_CORNERS,\n QUADRANT_MOVE_SHORTCUTS,\n isQuadrantMoveKey,\n quadrantHoverEvent,\n quadrantKeyTarget,\n quadrantMoveDrop,\n quadrantMovedText,\n quadrantName as nameOfQuadrant,\n quadrantNavTarget,\n quadrantPointName,\n} from \"../engine/quadrant-keyboard\";\nimport { resolveLocale } from \"../engine/locale\";\nimport { styleTooltip, themeTooltip } from \"../engine/tooltip\";\nimport type {\n ChartAnnotation,\n ChartDragEvent,\n ChartInstance,\n ChartRect,\n} from \"../engine/types\";\nimport { Chart, ChartBase, engineOptions } from \"./Chart\";\nimport type {\n AreaChartProps,\n BarChartProps,\n BoxPlotChartProps,\n BubbleChartProps,\n CandlestickChartProps,\n ChartCommonProps,\n GanttChartProps,\n HeatmapChartProps,\n HistogramChartProps,\n HorizontalBarChartProps,\n LineChartProps,\n MixedChartProps,\n QuadrantChartProps,\n QuadrantDropTarget,\n RangeAreaChartProps,\n ScatterChartProps,\n SparklineProps,\n WaterfallChartProps,\n} from \"./types\";\n\nconst frameProps = (props: Omit<ChartCommonProps, \"labels\">) => ({\n height: props.height,\n width: props.width,\n className: props.className,\n style: props.style,\n handleRef: props.ref,\n onHover: props.onHover,\n onPointClick: props.onPointClick,\n onPlotClick: props.onPlotClick,\n onZoom: props.onZoom,\n onRendererChange: props.onRendererChange,\n renderTooltip: props.renderTooltip,\n});\n\n/** Line (or area) chart; handles millions of points on the GPU */\nexport function LineChart(props: LineChartProps) {\n const {\n series: input,\n area = false,\n curve,\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => lineSeries(input, area, { curve, stacked: stacked || percent }),\n [input, area, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Area chart: smooth by default, stacked or 100% stacked */\nexport function AreaChart(props: AreaChartProps) {\n const {\n series: input,\n curve = \"smooth\",\n stacked = false,\n percent = false,\n } = props;\n const series = useMemo(\n () => areaSeries(input, { curve, stacked: stacked || percent }),\n [input, curve, stacked, percent],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Bar chart: grouped side by side, stacked or 100% stacked, with optional value labels */\nexport function BarChart(props: BarChartProps) {\n const {\n series: input,\n stacked = false,\n percent = false,\n labels = false,\n } = props;\n const series = useMemo(\n () => barSeries(input, stacked || percent, labels),\n [input, stacked, percent, labels],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n stackMode: percent ? \"percent\" : undefined,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Candlestick (OHLC) chart: rising and falling candles, zoomable on the GPU */\nexport function CandlestickChart(props: CandlestickChartProps) {\n const { series: input } = props;\n const series = useMemo(() => candlestickSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/** Heatmap: a grid of cells colored by value (categories or numbers on both axes) */\nexport function HeatmapChart(props: HeatmapChartProps) {\n const {\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n } = props;\n const series = useMemo(\n () =>\n heatmapChartOptions({\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n }).series,\n [\n data,\n xCategories,\n yCategories,\n colorScale,\n valueRange,\n colorMidpoint,\n name,\n radius,\n format,\n ],\n );\n const base = engineOptions({ ...props, series });\n return (\n <ChartBase\n options={{\n ...heatmapChartOptions(\n { data, xCategories, yCategories },\n {\n ...base,\n legend: props.legend,\n interaction: props.interaction,\n tooltip: props.tooltip,\n },\n ),\n series,\n }}\n {...frameProps(props)}\n />\n );\n}\n\n/** Word-sized chart without axes: a trend in a table cell, a KPI card, ... */\nexport function Sparkline(props: SparklineProps) {\n const {\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n height = 48,\n width,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n className,\n style,\n ref,\n onHover,\n renderTooltip,\n } = props;\n const options = useMemo(\n () =>\n sparklineOptions(\n { data, type, color, curve, name, reference, format },\n { renderer, tooltip, palette, ariaLabel, locale, labels },\n ),\n [\n data,\n type,\n color,\n curve,\n name,\n reference,\n format,\n renderer,\n tooltip,\n palette,\n ariaLabel,\n locale,\n labels,\n ],\n );\n return (\n <ChartBase\n options={options}\n height={height}\n width={width}\n className={className}\n style={style}\n handleRef={ref}\n onHover={onHover}\n renderTooltip={renderTooltip}\n />\n );\n}\n\n/** Scatter chart: zooms on both axes, hit testing through a spatial index */\nexport function ScatterChart(props: ScatterChartProps) {\n const { series: input } = props;\n const series = useMemo(() => scatterSeries(input), [input]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\nconst CORNERS = QUADRANT_CORNERS;\n\n/** Two clicks on the same point within this delay count as a double click */\nconst DOUBLE_CLICK_MS = 400;\n\nconst VISUALLY_HIDDEN: CSSProperties = {\n position: \"absolute\",\n width: 1,\n height: 1,\n margin: -1,\n padding: 0,\n border: 0,\n overflow: \"hidden\",\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n whiteSpace: \"nowrap\",\n};\n\n/** Data position of a dragged point, pushed to its info card on every move */\ninterface CardPosition {\n x: number;\n y: number;\n}\n\n/**\n * A point index valid for one `points` array: a stale index (the points\n * changed, e.g. a task was deleted) names no point\n */\ninterface PointRef {\n index: number;\n points: readonly QuadrantPoint[];\n}\n\n/** Minimal event emitter: the card subscribes, the drag handler emits */\nconst createPositionEmitter = () => {\n const listeners = new Set<(position: CardPosition) => void>();\n return {\n on(listener: (position: CardPosition) => void) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n emit(position: CardPosition) {\n listeners.forEach((listener) => listener(position));\n },\n };\n};\n\n/** Room between the edge of the point card and its dot, CSS pixels */\nconst CARD_PAD_X = 8;\nconst CARD_PAD_Y = 5;\n/** Room between the dot of the card and its text */\nconst CARD_DOT_GAP = 7;\n/** Height of the first row of the card: the name, or the name and actions */\nconst CARD_ROW = 18;\nconst CARD_ACTIONS_ROW = 24;\n/** How far the card may reach past the plot edges */\nconst CARD_OVERHANG = 6;\n/**\n * The card stays this long after the pointer leaves its dot: time to reach\n * its actions\n */\nconst CARD_LINGER_MS = 180;\n\n/** Header slot in the outer corner of a quadrant */\nconst headerStyle = (corner: QuadrantCorner): CSSProperties => {\n const top = corner.startsWith(\"top\");\n const left = corner.endsWith(\"Left\");\n return {\n position: \"absolute\",\n [top ? \"top\" : \"bottom\"]: 0,\n [left ? \"left\" : \"right\"]: 0,\n maxWidth: \"100%\",\n boxSizing: \"border-box\",\n padding: 8,\n display: \"flex\",\n justifyContent: left ? \"flex-start\" : \"flex-end\",\n pointerEvents: \"auto\",\n };\n};\n\nconst cornerStyle = (\n corner: QuadrantCorner,\n plot: ChartRect,\n split: { x: number; y: number },\n): CSSProperties => {\n const left = corner.endsWith(\"Left\");\n const top = corner.startsWith(\"top\");\n return {\n position: \"absolute\",\n left: left ? 0 : split.x - plot.x,\n top: top ? 0 : split.y - plot.y,\n width: left ? split.x - plot.x : plot.x + plot.width - split.x,\n height: top ? split.y - plot.y : plot.y + plot.height - split.y,\n pointerEvents: \"none\",\n };\n};\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 */\nexport function QuadrantChart(props: QuadrantChartProps) {\n const {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable,\n onPointClick,\n onPointDoubleClick,\n onPointDrag,\n onPointDrop,\n onQuadrantClick,\n renderTooltip,\n quadrantContent,\n showCounts,\n selectedIndex,\n selectedIndices,\n renderQuadrantHeader,\n accessiblePoints = true,\n getPointProps,\n locale,\n } = props;\n const geometry = { xDomain, yDomain, xSplit, ySplit, reverseX };\n // the engine draws the dragged dot and its label under the pointer: the\n // options stay the same during a drag (no re-render on every move)\n const [dragging, setDragging] = useState<number | null>(null);\n const [hoveredRef, setHoveredRef] = useState<PointRef | null>(null);\n // pointer (or focus) in the point card: its point stays active\n const [heldRef, setHeldRef] = useState<PointRef | null>(null);\n const hovered = hoveredRef?.points === points ? hoveredRef.index : null;\n const held = heldRef?.points === points ? heldRef.index : null;\n const hoverTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const holdTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const engineRef = useRef<ChartInstance | null>(null);\n const [selection, setSelection] = useState<number | null>(null);\n const selected = selectedIndex !== undefined ? selectedIndex : selection;\n const lastClick = useRef<{ index: number; time: number } | null>(null);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [announcement, setAnnouncement] = useState(\"\");\n // point moved with the keyboard: its button gets the focus back once the\n // new `points` render it in the list of its new quadrant\n const pendingFocus = useRef<{\n index: number;\n points: readonly QuadrantPoint[];\n } | null>(null);\n const layerRef = useRef<HTMLDivElement>(null);\n // info card of the active point: placed on the DOM (and fed the drag\n // positions through an emitter), so a drag renders no React per move\n const cardRef = useRef<HTMLDivElement>(null);\n const cardQuadrantRef = useRef<HTMLSpanElement>(null);\n const cardDotRef = useRef<HTMLSpanElement>(null);\n const cardContentRef = useRef<HTMLDivElement>(null);\n const cardThemed = useRef<number | null>(null);\n const dragAt = useRef<CardPosition | null>(null);\n const placeCard = useRef<() => void>(() => {});\n const positions = useMemo(() => createPositionEmitter(), []);\n const hintId = useId();\n const texts = quadrantLabels(locale);\n const movable = !!onPointDrop && draggable !== false;\n const groups = useMemo(\n () =>\n quadrantGroups({\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n reverseX,\n }),\n [points, xDomain, yDomain, xSplit, ySplit, reverseX],\n );\n const quadrantName = (corner: QuadrantCorner) =>\n nameOfQuadrant(corner, { quadrants }, texts);\n const pointName = (point: QuadrantPoint, index: number) =>\n quadrantPointName(point, index, texts);\n // the accessible buttons in list order (arrow navigation)\n const order = CORNERS.flatMap((corner) => groups[corner].indices);\n const focusHover = (index: number | null) =>\n props.onHover?.(\n quadrantHoverEvent(\n { points, ...geometry, quadrants, xLabel, yLabel, name },\n index,\n locale,\n ),\n );\n\n useEffect(() => {\n const layer = layerRef.current;\n const pending = pendingFocus.current;\n if (pending && pending.points !== points) {\n pendingFocus.current = null;\n const button = layer?.querySelector<HTMLButtonElement>(\n `button[data-point-index=\"${pending.index}\"]`,\n );\n if (button && document.activeElement !== button) button.focus();\n }\n // a focused button removed by a re-render does not report its blur\n if (\n focusedIndex !== null &&\n !pendingFocus.current &&\n !layer?.contains(document.activeElement)\n )\n setFocusedIndex(null);\n }, [points, focusedIndex]);\n\n const dropAt = (event: ChartDragEvent): QuadrantDropTarget => ({\n x: event.x,\n y: event.y,\n quadrant: quadrantOf(geometry, event.x, event.y),\n });\n\n const options = quadrantChartOptions(\n {\n points,\n xDomain,\n yDomain,\n xSplit,\n ySplit,\n quadrants,\n xLabel,\n yLabel,\n axisLabels,\n showTicks,\n reverseX,\n showLabels,\n pointSize,\n name,\n draggable: draggable ?? !!(onPointDrop || onPointDrag),\n showCounts: renderQuadrantHeader ? undefined : showCounts,\n selectedIndex: selected,\n selectedIndices,\n },\n engineOptions({ ...props, series: [] }),\n { focusedIndex: accessiblePoints ? focusedIndex : null },\n );\n // the point card names the hovered, focused, selected or dragged point:\n // no tooltip, no label chip and no drag pill of the engine beside it\n options.tooltip = false;\n if (typeof options.interaction === \"object\")\n options.interaction = {\n ...options.interaction,\n dragLabel: false,\n hoverLabel: false,\n };\n if (renderQuadrantHeader)\n // the React headers replace the drawn titles (the first four areas)\n options.annotations = options.annotations?.map((a, i) =>\n i < 4 && a.type === \"rect\"\n ? {\n ...a,\n label: undefined,\n badge: undefined,\n description: undefined,\n detail: undefined,\n }\n : a,\n );\n\n const [x0, x1] = xDomain ?? [0, 10];\n const [y0, y1] = yDomain ?? [0, 10];\n const fraction = (v: number, a: number, b: number) => (v - a) / (b - a || 1);\n\n const pointButton = (corner: QuadrantCorner, index: number) => {\n const point = points[index]!;\n const label = pointName(point, index);\n const selected =\n selectedIndex === index || !!selectedIndices?.includes(index);\n return (\n <div key={index} role=\"listitem\">\n <button\n type=\"button\"\n data-point-index={index}\n aria-label={`${label}, ${quadrantName(corner)}`}\n aria-current={selected ? \"true\" : undefined}\n aria-keyshortcuts={movable ? QUADRANT_MOVE_SHORTCUTS : undefined}\n aria-describedby={movable ? hintId : undefined}\n onFocus={() => {\n setFocusedIndex(index);\n focusHover(index);\n }}\n onBlur={(event) => {\n setFocusedIndex((current) => (current === index ? null : current));\n if (event.relatedTarget) pendingFocus.current = null;\n const next = event.relatedTarget as Element | null;\n if (\n !next?.closest?.(\"button[data-point-index]\") &&\n !pendingFocus.current\n )\n focusHover(null);\n }}\n onClick={() => {\n setSelection(index);\n onPointClick?.(point, index);\n }}\n onKeyDown={(event) => {\n if (!(movable && isQuadrantMoveKey(event))) {\n const next = quadrantNavTarget(event, order, index);\n if (next === null) return;\n event.preventDefault();\n layerRef.current\n ?.querySelector<HTMLButtonElement>(\n `button[data-point-index=\"${next}\"]`,\n )\n ?.focus();\n return;\n }\n event.preventDefault();\n const target = quadrantKeyTarget(event, corner);\n if (!target) return;\n pendingFocus.current = { index, points };\n onPointDrop!(point, index, quadrantMoveDrop(geometry, target));\n setAnnouncement(\n quadrantMovedText(texts, label, quadrantName(target)),\n );\n }}\n >\n {label}\n </button>\n </div>\n );\n };\n\n // nothing is attached to a point while it is dragged; the hovered point\n // shows its card unless the tooltip is off\n const hoverCard = props.tooltip !== false;\n const activeIndex =\n dragging !== null\n ? null\n : (held ?? (hoverCard ? hovered : null) ?? focusedIndex ?? selected);\n // one card for the point: hovered, focused, selected or dragged (it\n // follows the pointer then)\n const cardIndex =\n dragging !== null\n ? dragging\n : activeIndex != null && points[activeIndex]\n ? activeIndex\n : null;\n const cardPoint = cardIndex === null ? null : (points[cardIndex] ?? null);\n const cardActions =\n cardPoint && cardIndex !== null && dragging === null\n ? (props.renderPointActions?.(cardPoint, cardIndex) ?? null)\n : null;\n const hasActions =\n cardActions !== null && cardActions !== undefined && cardActions !== false;\n const cardCustom =\n cardPoint && cardIndex !== null && dragging === null && renderTooltip\n ? renderTooltip(cardPoint, cardIndex)\n : null;\n const cardRow = hasActions ? CARD_ACTIONS_ROW : CARD_ROW;\n const cardDot = cardPoint?.size ?? pointSize ?? 12;\n\n // a click on a dot or on its card: selects it, two quick ones in a row\n // count as a double click\n const clickPoint = (index: number) => {\n const point = points[index];\n if (!point) return;\n const now = Date.now();\n const last = lastClick.current;\n const double = last?.index === index && now - last.time < DOUBLE_CLICK_MS;\n lastClick.current = double ? null : { index, time: now };\n setSelection(index);\n onPointClick?.(point, index);\n if (double) onPointDoubleClick?.(point, index);\n };\n\n const hold = (index: number | null) => {\n if (holdTimer.current) clearTimeout(holdTimer.current);\n holdTimer.current = null;\n if (index !== null) return setHeldRef({ index, points });\n holdTimer.current = setTimeout(() => setHeldRef(null), CARD_LINGER_MS);\n };\n\n useEffect(\n () => () => {\n if (hoverTimer.current) clearTimeout(hoverTimer.current);\n if (holdTimer.current) clearTimeout(holdTimer.current);\n },\n [],\n );\n\n // the card names the point: its drawn label gives way (keeping its place)\n useEffect(() => {\n engineRef.current?.setLabelHidden(\n cardIndex !== null && dragging === null\n ? { seriesIndex: 0, index: cardIndex }\n : null,\n );\n }, [cardIndex, dragging]);\n\n // after every render (new points, plot size, active point)\n useLayoutEffect(() => {\n placeCard.current = () => {\n const el = cardRef.current;\n // the overlay holding the card covers the plot area\n const plot = el?.parentElement;\n if (!el || !plot || !cardPoint || cardIndex === null) return;\n // the colors of the theme, read again when another point shows it\n const fresh = cardThemed.current !== cardIndex;\n if (fresh) {\n cardThemed.current = cardIndex;\n themeTooltip(el, el);\n }\n const live = dragging !== null ? dragAt.current : null;\n const at = live ?? cardPoint;\n const fx = fraction(at.x, x0, x1);\n const visualX = reverseX ? 1 - fx : fx;\n const plotWidth = parseFloat(plot.style.width) || plot.clientWidth;\n const plotHeight = parseFloat(plot.style.height) || plot.clientHeight;\n const left = visualX * plotWidth;\n const top = (1 - fraction(at.y, y0, y1)) * plotHeight;\n // the dot of the card lies on the point (the border is 1px); the\n // lifted dot of a drag is larger: the card keeps off it\n const reach = 1 + CARD_PAD_X + cardDot / 2 + (live ? 8 : 0);\n const width = el.offsetWidth;\n const height = el.offsetHeight;\n // the text on the side with room (mirrored near the right edge); a\n // side that still fits is kept (no flipping back and forth in a drag)\n let mirrored = visualX > 0.6;\n if (width) {\n const overRight = left - reach + width - plotWidth;\n const overLeft = width - reach - left;\n const was = fresh ? undefined : el.dataset.side;\n mirrored =\n was === \"start\" && overRight <= CARD_OVERHANG\n ? false\n : was === \"end\" && overLeft <= CARD_OVERHANG\n ? true\n : overRight > 0 && overLeft < overRight;\n }\n // the dot on the first row, the card kept in the plot near its edges\n let cardTop = top - (1 + CARD_PAD_Y + cardRow / 2);\n if (height)\n cardTop = Math.max(\n -CARD_OVERHANG,\n Math.min(cardTop, plotHeight + CARD_OVERHANG - height),\n );\n const side = mirrored ? \"end\" : \"start\";\n const layout = `${side}|${hasActions}|${cardDot}`;\n el.dataset.side = side;\n if (el.dataset.layout !== layout) {\n el.dataset.layout = layout;\n const lead = `${CARD_PAD_X + cardDot + CARD_DOT_GAP}px`;\n const trail = hasActions ? \"4px\" : \"12px\";\n el.style.paddingLeft = mirrored ? trail : lead;\n el.style.paddingRight = mirrored ? lead : trail;\n el.style.textAlign = mirrored ? \"right\" : \"left\";\n const content = cardContentRef.current;\n if (content)\n content.style.gridTemplateAreas = mirrored\n ? '\"actions label\" \". meta\"'\n : '\"label actions\" \"meta .\"';\n if (content)\n content.style.gridTemplateColumns = mirrored\n ? \"auto minmax(0, 1fr)\"\n : \"minmax(0, 1fr) auto\";\n }\n el.style.transform = `translate(${left}px, ${cardTop}px) translate(${\n mirrored ? `calc(-100% + ${reach}px)` : `${-reach}px`\n }, 0)`;\n const corner = quadrantOf(geometry, at.x, at.y);\n const region = quadrants?.[corner];\n const name = region?.badge\n ? `${region.badge} · ${quadrantName(corner)}`\n : quadrantName(corner);\n const label = cardQuadrantRef.current;\n if (label && label.textContent !== name) label.textContent = name;\n const dot = cardDotRef.current;\n if (dot) {\n const color =\n cardPoint.color ??\n region?.color ??\n DEFAULT_QUADRANT_COLORS[\n quadrantOf(geometry, cardPoint.x, cardPoint.y)\n ];\n dot.style.display = live ? \"none\" : \"block\";\n dot.style.left = mirrored ? \"auto\" : `${CARD_PAD_X}px`;\n dot.style.right = mirrored ? `${CARD_PAD_X}px` : \"auto\";\n dot.style.top = `${top - cardTop - 1 - cardDot / 2}px`;\n dot.style.background = color;\n dot.style.boxShadow = `0 0 0 2px var(--surface-color, var(--background-color, #fff)), 0 0 0 4px color-mix(in srgb, ${color} 45%, transparent)`;\n }\n };\n if (cardIndex === null) cardThemed.current = null;\n placeCard.current();\n });\n\n // drag positions move the card directly, once per frame\n useEffect(() => {\n const win = typeof window === \"undefined\" ? null : window;\n let frame = 0;\n const off = positions.on((position) => {\n dragAt.current = position;\n if (!win?.requestAnimationFrame) return placeCard.current();\n if (!frame)\n frame = win.requestAnimationFrame(() => {\n frame = 0;\n placeCard.current();\n });\n });\n return () => {\n off();\n if (frame) win?.cancelAnimationFrame(frame);\n };\n }, [positions]);\n\n const overlay = (plot: ChartRect) => {\n const xs = xSplit ?? (x0 + x1) / 2;\n const ys = ySplit ?? (y0 + y1) / 2;\n const fx = fraction(xs, x0, x1);\n const fy = fraction(ys, y0, y1);\n const split = {\n x: plot.x + plot.width * (reverseX ? 1 - fx : fx),\n y: plot.y + plot.height * (1 - fy),\n };\n return [\n ...CORNERS.map((corner) =>\n quadrantContent?.[corner] ? (\n <div\n key={corner}\n className={`minerva-chart-quadrant minerva-chart-quadrant-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n {quadrantContent[corner]}\n </div>\n ) : null,\n ),\n ...CORNERS.map((corner) => {\n if (!renderQuadrantHeader) return null;\n const group = groups[corner];\n const header = renderQuadrantHeader(corner, {\n count: group.points.length,\n points: group.points,\n indices: group.indices,\n region: quadrants?.[corner],\n });\n return header === null ||\n header === undefined ||\n header === false ? null : (\n <div\n key={`header-${corner}`}\n style={cornerStyle(corner, plot, split)}\n >\n <div\n className={`minerva-chart-quadrant-header minerva-chart-quadrant-header-${corner}`}\n style={headerStyle(corner)}\n >\n {header}\n </div>\n </div>\n );\n }),\n <div\n key=\"points\"\n ref={layerRef}\n className=\"minerva-chart-quadrant-points\"\n style={{ position: \"absolute\", inset: 0, pointerEvents: \"none\" }}\n >\n {points.map((point, index) => {\n if (!Number.isFinite(point.x) || !Number.isFinite(point.y))\n return null;\n const fx = fraction(point.x, x0, x1);\n return (\n <div\n key={index}\n {...getPointProps?.(point, index)}\n aria-hidden=\"true\"\n className=\"minerva-chart-quadrant-point\"\n data-point-index={index}\n data-label={point.label}\n data-active={index === activeIndex ? \"\" : undefined}\n style={{\n position: \"absolute\",\n left: `${100 * (reverseX ? 1 - fx : fx)}%`,\n top: `${100 * (1 - fraction(point.y, y0, y1))}%`,\n width: 0,\n height: 0,\n pointerEvents: \"none\",\n }}\n />\n );\n })}\n {accessiblePoints ? (\n <>\n {CORNERS.map((corner) =>\n groups[corner].indices.length ? (\n <div\n key={corner}\n role=\"list\"\n data-quadrant={corner}\n aria-label={quadrantName(corner)}\n style={VISUALLY_HIDDEN}\n >\n {groups[corner].indices.map((index) =>\n pointButton(corner, index),\n )}\n </div>\n ) : null,\n )}\n {movable ? (\n <span id={hintId} style={VISUALLY_HIDDEN}>\n {texts.moveHint}\n </span>\n ) : null}\n <div role=\"status\" aria-live=\"polite\" style={VISUALLY_HIDDEN}>\n {announcement}\n </div>\n </>\n ) : null}\n </div>,\n cardPoint && cardIndex !== null ? (\n <div\n key=\"point-card\"\n ref={(el) => {\n if (el && !el.dataset.styled) {\n el.dataset.styled = \"\";\n styleTooltip(el, {\n zIndex: \"3\",\n boxSizing: \"border-box\",\n maxWidth: \"min(280px, calc(100% + 12px))\",\n paddingTop: `${CARD_PAD_Y}px`,\n paddingBottom: `${CARD_PAD_Y}px`,\n borderRadius: \"12px\",\n fontSize: \"12px\",\n lineHeight: \"18px\",\n });\n // the colors of the theme around it\n themeTooltip(el, el);\n }\n cardRef.current = el;\n // the overlay re-renders alone when the plot moves or resizes\n if (el) placeCard.current();\n }}\n className=\"minerva-chart-quadrant-card\"\n data-point-preview={cardIndex}\n data-dragging={dragging !== null ? \"\" : undefined}\n >\n <span\n ref={cardDotRef}\n aria-hidden=\"true\"\n data-card-dot=\"\"\n style={{\n position: \"absolute\",\n width: cardDot,\n height: cardDot,\n borderRadius: \"50%\",\n pointerEvents: \"none\",\n }}\n />\n {/* the dot lets the pointer through to the chart (hover, drag);\n the text and the actions hold the card */}\n <div\n ref={cardContentRef}\n data-card-content=\"\"\n onPointerEnter={() => hold(cardIndex)}\n onPointerLeave={() => hold(null)}\n onFocus={() => hold(cardIndex)}\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node))\n hold(null);\n }}\n style={{\n display: \"grid\",\n columnGap: 6,\n alignItems: \"center\",\n minHeight: cardRow,\n pointerEvents: dragging !== null ? \"none\" : \"auto\",\n }}\n >\n {/* a click on the name acts like a click on the dot (a native\n listener: the actions are the controls of the card) */}\n <div\n aria-hidden=\"true\"\n ref={(el) => {\n if (el) el.onclick = () => clickPoint(cardIndex);\n }}\n style={{\n gridArea: \"label\",\n minWidth: 0,\n cursor: \"pointer\",\n }}\n >\n {cardCustom ?? (\n <strong\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n fontWeight: 600,\n }}\n >\n {cardPoint.label}\n </strong>\n )}\n </div>\n {hasActions ? (\n <div\n data-card-actions=\"\"\n style={{\n gridArea: \"actions\",\n alignSelf: \"start\",\n display: \"flex\",\n alignItems: \"center\",\n height: CARD_ACTIONS_ROW,\n }}\n >\n {cardActions}\n </div>\n ) : null}\n <span\n ref={cardQuadrantRef}\n aria-hidden=\"true\"\n style={{\n gridArea: \"meta\",\n display: cardCustom ? \"none\" : \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n color: \"var(--text-secondary-color, #6b7280)\",\n fontSize: 11,\n lineHeight: \"16px\",\n }}\n />\n </div>\n </div>\n ) : null,\n ];\n };\n\n return (\n <ChartBase\n options={options}\n {...frameProps({\n ...props,\n onPointClick: undefined,\n renderTooltip: undefined,\n })}\n overlay={overlay}\n onInstance={(chart) => {\n engineRef.current = chart;\n }}\n onPointClick={(event) => {\n const index = event.items[0]?.index;\n if (index !== undefined) clickPoint(index);\n }}\n onPlotClick={\n onQuadrantClick\n ? (at) => onQuadrantClick(quadrantOf(geometry, at.x, at.y), at)\n : undefined\n }\n onHover={(event) => {\n const index = event?.items[0]?.index ?? null;\n if (hoverTimer.current) clearTimeout(hoverTimer.current);\n hoverTimer.current = null;\n if (index !== null) setHoveredRef({ index, points });\n // off the dot: the card stays a moment (the pointer may be on its\n // way to the actions)\n else\n hoverTimer.current = setTimeout(\n () => setHoveredRef(null),\n CARD_LINGER_MS,\n );\n props.onHover?.(event);\n }}\n onDragStart={(event) => {\n dragAt.current = { x: event.x, y: event.y };\n setDragging(event.item.index);\n }}\n onDragEnd={() => {\n dragAt.current = null;\n setDragging(null);\n }}\n onDrag={(event) => {\n const index = event.item.index;\n positions.emit({ x: event.x, y: event.y });\n if (points[index] && onPointDrag)\n onPointDrag(points[index], index, dropAt(event));\n }}\n onDrop={(event) => {\n pendingFocus.current = null;\n const index = event.item.index;\n if (points[index] && onPointDrop)\n onPointDrop(points[index], index, dropAt(event));\n }}\n />\n );\n}\n\n/**\n * Horizontal bar chart: categories down the left side, values from the\n * left (rankings, long names, diverging surveys, stacked progress)\n */\nexport function HorizontalBarChart(props: HorizontalBarChartProps) {\n return <BarChart {...props} orientation=\"horizontal\" />;\n}\n\n/**\n * Range area chart: bands between a lower (`y0`) and an upper edge\n * (confidence intervals, min-max ranges), mixable with lines\n */\nexport function RangeAreaChart(props: RangeAreaChartProps) {\n const { series: input, curve = \"smooth\" } = props;\n const series = useMemo(() => rangeAreaSeries(input, curve), [input, curve]);\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Combination chart: bars, lines and areas on one or two value axes\n * (`yAxis: \"right\"` series use `yAxis2`, aligned on the left grid)\n */\nexport function MixedChart(props: MixedChartProps) {\n return <Chart {...props} />;\n}\n\n/** Bubble chart: x, y and a value sized by area (√value diameters) */\nexport function BubbleChart(props: BubbleChartProps) {\n const { series: input, minSize, maxSize, maxValue } = props;\n const series = useMemo(\n () => bubbleSeries(input, { minSize, maxSize, maxValue }),\n [input, minSize, maxSize, maxValue],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Histogram: the distribution of raw samples in bins of equal width\n * (Freedman-Diaconis, Sturges or a count); millions of samples are binned\n * in milliseconds\n */\nexport function HistogramChart(props: HistogramChartProps) {\n const {\n values,\n bins,\n domain,\n nice,\n name,\n color,\n formatBin,\n series: extra,\n locale,\n } = props;\n // page language read at every render: a language switch renames the series\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n histogramSeries(values, {\n bins,\n domain,\n nice,\n name,\n color,\n format: formatBin,\n locale: lang,\n }),\n ...(extra ?? []),\n ],\n [values, bins, domain, nice, name, color, formatBin, extra, lang],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Box plot: medians, quartiles, whiskers and outliers of samples, from raw\n * values (`groups`) or computed statistics (`series`)\n */\nexport function BoxPlotChart(props: BoxPlotChartProps) {\n const {\n series: input,\n groups,\n name,\n whisker,\n orientation,\n locale,\n outlierShape,\n outlierSize,\n } = props;\n const groupName = name ?? presetLabels(resolveLocale(locale)).values;\n const series = useMemo(\n () =>\n boxplotSeries([\n ...(groups?.length\n ? [\n {\n id: \"boxplot\",\n name: groupName,\n data: boxplotData(groups, { whisker }),\n },\n ]\n : []),\n ...(input ?? []),\n ]).map((s) =>\n s.type === \"boxplot\"\n ? {\n ...s,\n outlierShape: s.outlierShape ?? outlierShape,\n outlierSize: s.outlierSize ?? outlierSize,\n }\n : s,\n ),\n [input, groups, groupName, whisker, outlierShape, outlierSize],\n );\n return (\n <ChartBase\n options={engineOptions({ ...props, series, orientation })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Waterfall (bridge) chart: how changes take a value from a start to an\n * end, with subtotals and totals (P&L bridges, budget variances)\n */\nexport function WaterfallChart(props: WaterfallChartProps) {\n const {\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels = true,\n format,\n connector,\n orientation,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const series = useMemo(\n () => [\n waterfallSeries(steps, {\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n locale: lang,\n }),\n ],\n [\n steps,\n name,\n upColor,\n downColor,\n totalColor,\n start,\n labels,\n format,\n connector,\n lang,\n ],\n );\n return (\n <ChartBase\n options={engineOptions({\n ...props,\n labels: undefined,\n series,\n orientation,\n })}\n {...frameProps(props)}\n />\n );\n}\n\n/**\n * Gantt chart: tasks as bars on a time axis with their progress, groups,\n * milestones and a today line; zooms and pans along the time\n */\nexport function GanttChart(props: GanttChartProps) {\n const {\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n barLabels,\n today = false,\n todayLabel,\n xAxis,\n yAxis,\n annotations,\n interaction,\n legend,\n locale,\n } = props;\n const lang = resolveLocale(locale);\n const gantt = useMemo(\n () =>\n ganttSeries(tasks, {\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n barLabels,\n locale: lang,\n }),\n [\n tasks,\n colors,\n taskName,\n progressName,\n milestoneName,\n formatProgress,\n dependenciesName,\n dependencyArrows,\n dependencyColor,\n barLabels,\n lang,\n ],\n );\n const [mountedAt] = useState(() => Date.now());\n const now =\n today === false\n ? null\n : today === true\n ? mountedAt\n : today instanceof Date\n ? today.getTime()\n : today;\n const lines: ChartAnnotation[] =\n now === null\n ? []\n : [\n {\n type: \"line\",\n axis: \"y\",\n value: now,\n color: \"var(--danger-color, #dc2626)\",\n dash: [4, 3],\n label: todayLabel,\n },\n ];\n return (\n <ChartBase\n options={{\n ...engineOptions({\n ...props,\n series: gantt.series,\n orientation: \"horizontal\",\n }),\n xAxis: {\n type: \"category\",\n categories: gantt.categories,\n ...xAxis,\n },\n yAxis: {\n type: \"time\",\n min: gantt.domain[0],\n max: gantt.domain[1],\n ...yAxis,\n },\n annotations: [...(annotations ?? []), ...lines],\n dependencies: gantt.dependencies,\n interaction: interaction ?? { zoom: \"y\" },\n legend: legend ?? gantt.series.length > 1,\n }}\n {...frameProps(props)}\n />\n );\n}\n"],"mappings":"uPA2EA,IAAM+C,EAAc,IAA6C,CAC/D,OAAQC,EAAM,OACd,MAAOA,EAAM,MACb,UAAWA,EAAM,UACjB,MAAOA,EAAM,MACb,UAAWA,EAAM,IACjB,QAASA,EAAM,QACf,aAAcA,EAAM,aACpB,YAAaA,EAAM,YACnB,OAAQA,EAAM,OACd,iBAAkBA,EAAM,iBACxB,cAAeA,EAAM,aACvB,GAGA,SAAgBC,EAAU,EAAuB,CAC/C,GAAM,CACJ,OAAQC,EACR,OAAO,GACP,QACA,UAAU,GACV,UAAU,IACRF,EACEG,GAAA,EAASnD,EAAAA,QAAAA,KACPC,EAAAA,WAAWiD,EAAOE,EAAM,CAAE,QAAO,QAASC,GAAWC,CAAQ,CAAC,EACpE,CAACJ,EAAOE,EAAMG,EAAOF,EAASC,CAAO,CACvC,EACA,OACE,EAAAR,EAAA,IAAA,CAAC5C,EAAAA,UAAD,CACE,QAASC,EAAAA,cAAc,CACrB,GAAG6C,EACH,SACA,UAAWM,EAAU,UAAY,IAAA,EACnC,CAAC,EACD,GAAIP,EAAWC,CAAK,CACrB,CAAA,CAEL,CAGA,SAAgBQ,EAAU,EAAuB,CAC/C,GAAM,CACJ,OAAQN,EACR,QAAQ,SACR,UAAU,GACV,UAAU,IACRF,EACEG,GAAA,EAASnD,EAAAA,QAAAA,KACPI,EAAAA,WAAW8C,EAAO,CAAE,QAAO,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