minerva-design 1.17.2 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/custom-elements.json +10 -6
- package/dist/angular/fesm2022/minerva-angular.mjs +173 -70
- package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
- package/dist/angular/types/minerva-angular.d.ts +33 -21
- package/dist/charts/core.cjs +1 -1
- package/dist/charts/core.d.cts +1 -0
- package/dist/charts/core.d.ts +1 -0
- package/dist/charts/core.js +22 -21
- package/dist/charts/engine/chart.cjs +1 -1
- package/dist/charts/engine/chart.cjs.map +1 -1
- package/dist/charts/engine/chart.js +414 -376
- package/dist/charts/engine/chart.js.map +1 -1
- package/dist/charts/engine/overlay.cjs +1 -1
- package/dist/charts/engine/overlay.cjs.map +1 -1
- package/dist/charts/engine/overlay.d.cts +5 -0
- package/dist/charts/engine/overlay.d.ts +5 -0
- package/dist/charts/engine/overlay.js +94 -69
- package/dist/charts/engine/overlay.js.map +1 -1
- package/dist/charts/engine/quadrant-card.cjs +2 -0
- package/dist/charts/engine/quadrant-card.cjs.map +1 -0
- package/dist/charts/engine/quadrant-card.d.cts +83 -0
- package/dist/charts/engine/quadrant-card.d.ts +83 -0
- package/dist/charts/engine/quadrant-card.js +154 -0
- package/dist/charts/engine/quadrant-card.js.map +1 -0
- package/dist/charts/engine/scene.cjs +1 -1
- package/dist/charts/engine/scene.cjs.map +1 -1
- package/dist/charts/engine/scene.d.cts +5 -0
- package/dist/charts/engine/scene.d.ts +5 -0
- package/dist/charts/engine/scene.js +32 -32
- package/dist/charts/engine/scene.js.map +1 -1
- package/dist/charts/engine/types.d.cts +14 -0
- package/dist/charts/engine/types.d.ts +14 -0
- package/dist/charts/index.cjs +1 -1
- package/dist/charts/index.js +28 -27
- package/dist/charts/react/Chart.cjs +1 -1
- package/dist/charts/react/Chart.cjs.map +1 -1
- package/dist/charts/react/Chart.d.cts +4 -2
- package/dist/charts/react/Chart.d.ts +4 -2
- package/dist/charts/react/Chart.js +42 -42
- package/dist/charts/react/Chart.js.map +1 -1
- package/dist/charts/react/charts.cjs +1 -1
- package/dist/charts/react/charts.cjs.map +1 -1
- package/dist/charts/react/charts.js +395 -391
- package/dist/charts/react/charts.js.map +1 -1
- package/dist/charts/react/types.d.cts +8 -2
- package/dist/charts/react/types.d.ts +8 -2
- package/dist/core/contracts.cjs +1 -1
- package/dist/core/contracts.cjs.map +1 -1
- package/dist/core/contracts.js +1 -1
- package/dist/core/contracts.js.map +1 -1
- package/dist/native/charts/src/engine/overlay.cjs +1 -1
- package/dist/native/charts/src/engine/overlay.cjs.map +1 -1
- package/dist/native/charts/src/engine/overlay.js +89 -65
- package/dist/native/charts/src/engine/overlay.js.map +1 -1
- package/dist/native/charts/src/engine/scene.cjs +1 -1
- package/dist/native/charts/src/engine/scene.cjs.map +1 -1
- package/dist/native/charts/src/engine/scene.js +32 -32
- package/dist/native/charts/src/engine/scene.js.map +1 -1
- package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.cjs +1 -1
- package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.cjs.map +1 -1
- package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.js +14 -8
- package/dist/react/components/QuadrantTaskBoard/QuadrantTaskBoard.js.map +1 -1
- package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.cjs +1 -1
- package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.cjs.map +1 -1
- package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.js +16 -15
- package/dist/react/components/QuadrantTaskBoard/quadrantTaskBoard.module.scss.js.map +1 -1
- package/dist/react/style.css +1 -1
- package/dist/react/styles/quadrant-task-board.css +1 -1
- package/dist/taro/index.js +1521 -1496
- package/dist/taro/style.css +22 -0
- package/dist/uni/manifest.d.ts +34 -34
- package/dist/uni/manifest.js +34 -39
- package/dist/uni/style.css +22 -0
- package/dist/vue/components/Chart/QuadrantChart.vue.d.ts +4 -3
- package/dist/vue/components/Chart/QuadrantChart.vue.js.map +1 -1
- package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js +186 -142
- package/dist/vue/components/Chart/QuadrantChart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/vue/components/Chart/cartesian.d.ts +5 -1
- package/dist/vue/components/Chart/cartesian.js +2 -0
- package/dist/vue/components/Chart/cartesian.js.map +1 -1
- package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue.js.map +1 -1
- package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js +18 -12
- package/dist/vue/components/QuadrantTaskBoard/QuadrantTaskBoard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/weapp/charts/canvas.js +48 -11
- package/dist/weapp/controls.wxss +22 -0
- package/dist/web-components/components/chart/chart.d.ts +4 -1
- package/dist/web-components/components/chart/chart.js +3 -1
- package/dist/web-components/components/chart/chart.js.map +1 -1
- package/dist/web-components/components/chart/charts.d.ts +34 -14
- package/dist/web-components/components/chart/charts.js +145 -98
- package/dist/web-components/components/chart/charts.js.map +1 -1
- package/dist/web-components/components/quadrant-task-board/quadrant-task-board.d.ts +8 -8
- package/dist/web-components/components/quadrant-task-board/quadrant-task-board.js +16 -12
- package/dist/web-components/components/quadrant-task-board/quadrant-task-board.js.map +1 -1
- package/dist/web-components/styles/QuadrantTaskBoard/quadrantTaskBoard.css.js +1 -1
- package/dist/web-components/styles/QuadrantTaskBoard/quadrantTaskBoard.css.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.js","names":["quadrantName","nameOfQuadrant","_Fragment","frameProps","props","LineChart","input","series","useMemo","lineSeries","area","stacked","percent","curve","ChartBase","engineOptions","AreaChart","areaSeries","BarChart","barSeries","labels","CandlestickChart","candlestickSeries","HeatmapChart","heatmapChartOptions","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","base","Sparkline","options","sparklineOptions","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","scatterSeries","CORNERS","QUADRANT_CORNERS","DOUBLE_CLICK_MS","VISUALLY_HIDDEN","createPositionEmitter","listeners","listener","position","CARD_GAP","headerStyle","top","corner","left","cornerStyle","split","plot","QuadrantChart","geometry","dragging","setDragging","useState","hovered","setHovered","selection","setSelection","selected","selectedIndex","lastClick","useRef","focusedIndex","setFocusedIndex","announcement","setAnnouncement","pendingFocus","layerRef","cardRef","cardQuadrantRef","cardSwatchRef","cardThemed","dragAt","placeCard","positions","hintId","useId","texts","quadrantLabels","movable","onPointDrop","draggable","groups","quadrantGroups","points","xDomain","yDomain","xSplit","ySplit","reverseX","quadrantName$1","quadrantName","pointName","quadrantPointName","point","index","order","focusHover","quadrantHoverEvent","layer","pending","button","dropAt","event","quadrantOf","quadrantChartOptions","onPointDrag","renderQuadrantHeader","showCounts","accessiblePoints","i","a","x0","x1","y0","y1","fraction","v","b","pointButton","label","selectedIndices","QUADRANT_MOVE_SHORTCUTS","current","onPointClick","isQuadrantMoveKey","next","quadrantNavTarget","target","quadrantKeyTarget","quadrantMoveDrop","quadrantMovedText","activeIndex","cardIndex","cardPoint","useLayoutEffect","el","themeTooltip","live","at","fx","visualX","gap","side","quadrants","DEFAULT_QUADRANT_COLORS","useEffect","win","frame","off","overlay","xs","ys","fy","quadrantContent","group","header","getPointProps","Fragment","styleTooltip","now","last","double","onPointDoubleClick","onQuadrantClick","renderTooltip","HorizontalBarChart","RangeAreaChart","rangeAreaSeries","MixedChart","Chart","BubbleChart","bubbleSeries","minSize","maxSize","maxValue","HistogramChart","extra","lang","resolveLocale","histogramSeries","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","presetLabels","boxplotSeries","boxplotData","s","outlierShape","outlierSize","whisker","WaterfallChart","waterfallSeries","steps","upColor","downColor","totalColor","start","connector","GanttChart","gantt","ganttSeries","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":";;;;;;;;;AA0EA,IAAMG,KAAc,OAA6C;CAC/D,QAAQC,EAAM;CACd,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IT,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgBiB,GAAiB,GAA8B;CAC7D,IAAM,EAAE,QAAQf,MAAUF,GACpBG,IAASC,QAAcc,EAAkBhB,CAAK,GAAG,CAACA,CAAK,CAAC;CAC9D,OACE,kBAACQ,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;EAAO,CAAC;EAC3C,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgBmB,GAAa,GAA0B;CACrD,IAAM,EACJ,SACA,gBACA,gBACA,eACA,eACA,kBACA,SACA,WACA,cACEnB,GACEG,IAASC,QAEXgB,EAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,CAAC,QACL;EACEC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;CACF,CACF,GACMC,IAAOnB,EAAc;EAAE,GAAGX;EAAO;CAAO,CAAC;CAC/C,OACE,kBAACU,GAAD;EACE,SAAS;GACP,GAAGU,EACD;IAAE;IAAM;IAAa;GAAY,GACjC;IACE,GAAGU;IACH,QAAQ9B,EAAM;IACd,aAAaA,EAAM;IACnB,SAASA,EAAM;GACjB,CACF;GACA;EACF;EACA,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgB+B,GAAU,GAAuB;CAC/C,IAAM,EACJ,SACA,SACA,UACA,UACA,SACA,cACA,WACA,YAAS,IACT,UACA,aACA,YACA,YACA,cACA,WACA,WACA,cACA,WACA,SACA,aACA,qBACE/B,GACEgC,IAAU5B,QAEZ6B,EACE;EAAE;EAAM;EAAM;EAAO;EAAO;EAAM;EAAW;CAAO,GACpD;EAAE;EAAU;EAAS;EAAS;EAAW;EAAQ;CAAO,CAC1D,GACF;EACEZ;EACAa;EACAC;EACA1B;EACAkB;EACAS;EACAP;EACAQ;EACAC;EACAC;EACAC;EACAC;EACAzB;CACF,CACF;CACA,OACE,kBAACN,GAAD;EACW;EACD;EACD;EACI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B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQnB;CACV,CAAC,CACH,GACA;EACEmB;EACAtL;EACAuL;EACAC;EACAC;EACAC;EACArM;EACAa;EACAyL;EACAxB;CACF,CACF;CACA,OACE,kBAACpL,GAAD;EACE,SAASC,EAAc;GACrB,GAAGX;GACH,QAAQ,KAAA;GACR;GACA;EACF,CAAC;EACD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgBuN,GAAW,GAAwB;CACjD,IAAM,EACJ,UACA,WACA,aACA,iBACA,kBACA,mBACA,qBACA,qBACA,oBACA,cACA,WAAQ,IACR,eACA,UACA,WACA,iBACA,iBACA,WACA,cACEvN,GACE8L,IAAOC,EAActJ,CAAM,GAC3B+K,IAAQpN,QAEVqN,EAAYC,GAAO;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ5B;CACV,CAAC,GACH;EACE4B;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACArC;CACF,CACF,GACM,CAACsC,KAAanK,QAAe,KAAK,IAAI,CAAC,GACvC2G,IACJyD,MAAU,KACN,OACAA,MAAU,KACRD,IACAC,aAAiB,OACfA,EAAM,QAAQ,IACdA,GACJC,KACJ1D,MAAQ,OACJ,CAAC,IACD,CACE;EACE,MAAM;EACN,MAAM;EACN,OAAOA;EACP,OAAO;EACP,MAAM,CAAC,GAAG,CAAC;EACX,OAAO2D;CACT,CACF;CACN,OACE,kBAAC7N,GAAD;EACE,SAAS;GACP,GAAGC,EAAc;IACf,GAAGX;IACH,QAAQwN,EAAM;IACd,aAAa;GACf,CAAC;GACD,OAAO;IACL,MAAM;IACN,YAAYA,EAAM;IAClB,GAAGgB;GACL;GACA,OAAO;IACL,MAAM;IACN,KAAKhB,EAAM,OAAO;IAClB,KAAKA,EAAM,OAAO;IAClB,GAAGiB;GACL;GACA,aAAa,CAAC,GAAIC,MAAe,CAAC,GAAI,GAAGJ,EAAK;GAC9C,cAAcd,EAAM;GACpB,aAAamB,MAAe,EAAE,MAAM,IAAI;GACxC,QAAQC,KAAUpB,EAAM,OAAO,SAAS;EAC1C;EACA,GAAIzN,EAAWC,CAAK;CACrB,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"charts.js","names":["_Fragment","quadrantName","nameOfQuadrant","frameProps","props","LineChart","input","series","useMemo","lineSeries","area","stacked","percent","curve","ChartBase","engineOptions","AreaChart","areaSeries","BarChart","barSeries","labels","CandlestickChart","candlestickSeries","HeatmapChart","heatmapChartOptions","data","xCategories","yCategories","colorScale","valueRange","colorMidpoint","name","radius","format","base","Sparkline","options","sparklineOptions","type","color","reference","renderer","tooltip","palette","ariaLabel","locale","ref","ScatterChart","scatterSeries","CORNERS","QUADRANT_CORNERS","DOUBLE_CLICK_MS","VISUALLY_HIDDEN","createIndexStore","value","listeners","next","listener","PointCardSlots","index","useSyncExternalStore","store","point","points","useLayoutEffect","card","actions","renderActions","content","renderContent","Fragment","createPortal","headerStyle","top","corner","left","cornerStyle","split","plot","QuadrantChart","geometry","engineRef","useRef","selection","setSelection","useState","selected","selectedIndex","lastClick","focusedIndex","setFocusedIndex","announcement","setAnnouncement","pendingFocus","layerRef","setCard","cardStore","hintId","useId","texts","quadrantLabels","movable","onPointDrop","draggable","groups","quadrantGroups","xDomain","yDomain","xSplit","ySplit","reverseX","quadrantName$1","quadrantName","pointName","quadrantPointName","order","focusHover","quadrantHoverEvent","layer","pending","button","dropAt","event","quadrantOf","withQuadrantCard","quadrantChartOptions","onPointDrag","renderQuadrantHeader","showCounts","accessiblePoints","i","a","x0","x1","y0","y1","fraction","v","b","pointButton","label","selectedIndices","QUADRANT_MOVE_SHORTCUTS","current","onPointClick","isQuadrantMoveKey","quadrantNavTarget","target","quadrantKeyTarget","quadrantMoveDrop","quadrantMovedText","clickPoint","now","last","double","onPointDoubleClick","markActive","anchor","latest","cardOptionsRef","cardOptions","node","renderPointActions","renderTooltip","cardHost","useCallback","host","createQuadrantPointCard","overlay","xs","ys","fx","fy","quadrantContent","group","header","quadrants","getPointProps","chart","onQuadrantClick","at","HorizontalBarChart","RangeAreaChart","rangeAreaSeries","MixedChart","Chart","BubbleChart","bubbleSeries","minSize","maxSize","maxValue","HistogramChart","extra","lang","resolveLocale","histogramSeries","values","formatBin","bins","domain","nice","BoxPlotChart","groupName","presetLabels","boxplotSeries","boxplotData","s","outlierShape","outlierSize","whisker","WaterfallChart","waterfallSeries","steps","upColor","downColor","totalColor","start","connector","GanttChart","gantt","ganttSeries","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 useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n areaSeries,\n barSeries,\n boxplotData,\n boxplotSeries,\n bubbleSeries,\n candlestickSeries,\n ganttSeries,\n heatmapChartOptions,\n histogramSeries,\n lineSeries,\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 {\n createQuadrantPointCard,\n withQuadrantCard,\n type QuadrantPointCard,\n type QuadrantPointCardOptions,\n} from \"../engine/quadrant-card\";\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/** Index of the point of the card, read by the portals of the card */\nconst createIndexStore = () => {\n let value: number | null = null;\n const listeners = new Set<() => void>();\n return {\n get: () => value,\n set(next: number | null) {\n if (next === value) return;\n value = next;\n listeners.forEach((listener) => listener());\n },\n subscribe(listener: () => void) {\n listeners.add(listener);\n return () => void listeners.delete(listener);\n },\n };\n};\n\ntype IndexStore = ReturnType<typeof createIndexStore>;\n\n/**\n * The actions (and the custom content) of the point card: the only part of\n * the matrix rendered again when another point shows the card\n */\nfunction PointCardSlots({\n card,\n store,\n points,\n renderActions,\n renderContent,\n}: {\n card: QuadrantPointCard;\n store: IndexStore;\n points: readonly QuadrantPoint[];\n renderActions?: (point: QuadrantPoint, index: number) => ReactNode;\n renderContent?: (point: QuadrantPoint, index: number) => ReactNode;\n}) {\n const index = useSyncExternalStore(store.subscribe, store.get, store.get);\n const point = index === null ? undefined : points[index];\n // the size of the card follows its new content\n useLayoutEffect(() => card.place());\n if (index === null || !point) return null;\n const actions = renderActions?.(point, index);\n const content = renderContent?.(point, index);\n return (\n <>\n {actions !== null && actions !== undefined && actions !== false\n ? createPortal(actions, card.actions)\n : null}\n {content !== null && content !== undefined && content !== false\n ? createPortal(content, card.content)\n : null}\n </>\n );\n}\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 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 // the point card is DOM of its own (shared with the other renderers):\n // hover, focus and drag moves render nothing here; only its actions are\n // rendered again (`PointCardSlots`) when another point shows it\n const [card, setCard] = useState<QuadrantPointCard | null>(null);\n const cardStore = useMemo(() => createIndexStore(), []);\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 // 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 const options = withQuadrantCard(\n 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 );\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 // 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 // the dot anchors of the point of the card (`data-active`)\n const markActive = (index: number | null) => {\n layerRef.current\n ?.querySelectorAll<HTMLElement>(\".minerva-chart-quadrant-point\")\n .forEach((anchor) => {\n if (anchor.dataset.pointIndex === String(index))\n anchor.dataset.active = \"\";\n else delete anchor.dataset.active;\n });\n };\n\n const latest = useRef(props);\n const cardOptionsRef = useRef<() => QuadrantPointCardOptions>(() => ({\n config: { points },\n }));\n const cardOptions = (): QuadrantPointCardOptions => ({\n config: { points, ...geometry, quadrants, xLabel, yLabel, name },\n locale,\n pointSize,\n // the hovered point shows its card unless the tooltip is off\n hover: props.tooltip !== false,\n selectedIndex: selected,\n // a plain chart rings its selected point; a board keeps its card (the\n // actions of the point stay at hand)\n showSelected: !!props.renderPointActions,\n hasActions: (index) => {\n const { points: now, renderPointActions } = latest.current;\n const point = now[index];\n const node = point ? renderPointActions?.(point, index) : null;\n return node !== null && node !== undefined && node !== false;\n },\n custom: !!renderTooltip,\n chart: engineRef.current,\n onClick: clickPoint,\n onChange: (index) => {\n cardStore.set(index);\n markActive(index);\n },\n // Escape closes the card and drops a selection of the chart's own\n onDismiss: () => setSelection(null),\n });\n\n // after every render: new points, selection, texts (hover, focus and drag\n // moves go to the card directly)\n useLayoutEffect(() => {\n latest.current = props;\n cardOptionsRef.current = cardOptions;\n card?.update(cardOptions());\n markActive(cardStore.get());\n });\n // the box of the card is rendered once the plot is laid out\n const cardHost = useCallback((host: HTMLDivElement | null) => {\n if (!host) return;\n const next = createQuadrantPointCard(host, cardOptionsRef.current());\n setCard(next);\n return () => {\n next.destroy();\n setCard(null);\n };\n }, []);\n // the focused point button, named again by the new points\n useLayoutEffect(() => {\n card?.focus(accessiblePoints ? focusedIndex : null);\n }, [card, focusedIndex, accessiblePoints, points]);\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 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 // the box of the point card (DOM of its own, filled by the card)\n <div\n key=\"point-card\"\n ref={cardHost}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: plot.width,\n height: plot.height,\n pointerEvents: \"none\",\n }}\n />,\n ];\n };\n\n return (\n <>\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={(at) => {\n // a click beside the points drops a selection of the chart's own\n setSelection(null);\n onQuadrantClick?.(quadrantOf(geometry, at.x, at.y), at);\n }}\n onHover={(event) => {\n card?.hover(event?.items[0]?.index ?? null);\n props.onHover?.(event);\n }}\n onDragStart={(event) =>\n card?.drag(event.item.index, { x: event.x, y: event.y })\n }\n onDragEnd={() => card?.drag(null)}\n onDrag={(event) => {\n const index = event.item.index;\n card?.move({ 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 {card ? (\n <PointCardSlots\n card={card}\n store={cardStore}\n points={points}\n renderActions={props.renderPointActions}\n renderContent={renderTooltip}\n />\n ) : null}\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":";;;;;;;;;;AAmFA,IAAMG,KAAc,OAA6C;CAC/D,QAAQC,EAAM;CACd,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,OAAOA,EAAM;CACb,WAAWA,EAAM;CACjB,SAASA,EAAM;CACf,cAAcA,EAAM;CACpB,aAAaA,EA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AAkBhB,CAAK,GAAG,CAACA,CAAK,CAAC;CAC9D,OACE,kBAACQ,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;EAAO,CAAC;EAC3C,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgBmB,EAAa,GAA0B;CACrD,IAAM,EACJ,SACA,gBACA,gBACA,eACA,eACA,kBACA,SACA,WACA,cACEnB,GACEG,IAASC,QAEXgB,EAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,CAAC,QACL;EACEC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;CACF,CACF,GACMC,IAAOnB,EAAc;EAAE,GAAGX;EAAO;CAAO,CAAC;CAC/C,OACE,kBAACU,GAAD;EACE,SAAS;GACP,GAAGU,EACD;IAAE;IAAM;IAAa;GAAY,GACjC;IACE,GAAGU;IACH,QAAQ9B,EAAM;IACd,aAAaA,EAAM;IACnB,SAASA,EAAM;GACjB,CACF;GACA;EACF;EACA,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAGA,SAAgB+B,EAAU,GAAuB;CAC/C,IAAM,EACJ,SACA,SACA,UACA,UACA,SACA,cACA,WACA,YAAS,IACT,UACA,aACA,YACA,YACA,cACA,WACA,WACA,cACA,UACA,QACA,YACA,qBACE/B,GACEgC,IAAU5B,QAEZ6B,EACE;EAAE;EAAM;EAAM;EAAO;EAAO;EAAM;EAAW;CAAO,GACpD;EAAE;EAAU;EAAS;EAAS;EAAW;EAAQ;CAAO,CAC1D,GACF;EACEZ;EACAa;EACAC;EACA1B;EACAkB;EACAS;EACAP;EACAQ;EACAC;EACAC;EACAC;EACAC;EACAzB;CACF,CACF;CACA,OACE,kBAACN,GAAD;EACW;EACD;EACD;EACI;EACJ;EACP,WAAWgC;EACF;EACM;CAChB,CAAA;AAEL;AAGA,SAAgBC,EAAa,GAA0B;CACrD,IAAM,EAAE,QAAQzC,MAAUF,GACpBG,IAAS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AF,CACN,GACF;EAACxM;EAAOkG;EAAQkG;EAAWO;EAASF;EAAcC;CAAW,CAC/D;CACA,OACE,kBAAClM,GAAD;EACE,SAASC,EAAc;GAAE,GAAGX;GAAO;GAAQ;EAAY,CAAC;EACxD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgB8M,GAAe,GAA4B;CACzD,IAAM,EACJ,UACA,SACA,YACA,cACA,eACA,UACA,YAAS,IACT,WACA,cACA,gBACA,cACE9M,GACE6L,IAAOC,EAAcrJ,CAAM,GAC3BtC,IAASC,QACP,CACJ2M,EAAgBC,GAAO;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQnB;CACV,CAAC,CACH,GACA;EACEmB;EACArL;EACAsL;EACAC;EACAC;EACAC;EACApM;EACAa;EACAwL;EACAxB;CACF,CACF;CACA,OACE,kBAACnL,GAAD;EACE,SAASC,EAAc;GACrB,GAAGX;GACH,QAAQ,KAAA;GACR;GACA;EACF,CAAC;EACD,GAAID,EAAWC,CAAK;CACrB,CAAA;AAEL;AAMA,SAAgBsN,GAAW,GAAwB;CACjD,IAAM,EACJ,UACA,WACA,aACA,iBACA,kBACA,mBACA,qBACA,qBACA,oBACA,cACA,WAAQ,IACR,eACA,UACA,UACA,gBACA,gBACA,WACA,cACEtN,GACE6L,IAAOC,EAAcrJ,CAAM,GAC3B8K,IAAQnN,QAEVoN,EAAYC,GAAO;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ5B;CACV,CAAC,GACH;EACE4B;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACArC;CACF,CACF,GACM,CAACsC,MAAalJ,QAAe,KAAK,IAAI,CAAC,GACvCmE,IACJgF,MAAU,KACN,OACAA,MAAU,KACRD,KACAC,aAAiB,OACfA,EAAM,QAAQ,IACdA,GACJC,KACJjF,MAAQ,OACJ,CAAC,IACD,CACE;EACE,MAAM;EACN,MAAM;EACN,OAAOA;EACP,OAAO;EACP,MAAM,CAAC,GAAG,CAAC;EACX,OAAOkF;CACT,CACF;CACN,OACE,kBAAC5N,GAAD;EACE,SAAS;GACP,GAAGC,EAAc;IACf,GAAGX;IACH,QAAQuN,EAAM;IACd,aAAa;GACf,CAAC;GACD,OAAO;IACL,MAAM;IACN,YAAYA,EAAM;IAClB,GAAGgB;GACL;GACA,OAAO;IACL,MAAM;IACN,KAAKhB,EAAM,OAAO;IAClB,KAAKA,EAAM,OAAO;IAClB,GAAGiB;GACL;GACA,aAAa,CAAC,GAAIC,KAAe,CAAC,GAAI,GAAGJ,EAAK;GAC9C,cAAcd,EAAM;GACpB,aAAamB,KAAe,EAAE,MAAM,IAAI;GACxC,QAAQC,KAAUpB,EAAM,OAAO,SAAS;EAC1C;EACA,GAAIxN,EAAWC,CAAK;CACrB,CAAA;AAEL"}
|
|
@@ -329,7 +329,10 @@ export interface QuadrantHeaderInfo {
|
|
|
329
329
|
}
|
|
330
330
|
/** Props of QuadrantChart */
|
|
331
331
|
export interface QuadrantChartProps extends Omit<ChartCommonProps, "onPointClick" | "onPlotClick" | "renderTooltip" | "xAxis" | "yAxis">, QuadrantConfig {
|
|
332
|
-
/**
|
|
332
|
+
/**
|
|
333
|
+
* React actions (e.g. compact edit / delete icon buttons) shown in the
|
|
334
|
+
* card of the active point (hovered, focused or selected), beside its name
|
|
335
|
+
*/
|
|
333
336
|
renderPointActions?: (point: QuadrantPoint, index: number) => ReactNode;
|
|
334
337
|
/** Called with the clicked point and its index */
|
|
335
338
|
onPointClick?: (point: QuadrantPoint, index: number) => void;
|
|
@@ -351,7 +354,10 @@ export interface QuadrantChartProps extends Omit<ChartCommonProps, "onPointClick
|
|
|
351
354
|
* when it is set (the chart does not move them: update `points`)
|
|
352
355
|
*/
|
|
353
356
|
onPointDrop?: (point: QuadrantPoint, index: number, target: QuadrantDropTarget) => void;
|
|
354
|
-
/**
|
|
357
|
+
/**
|
|
358
|
+
* React content of the card of the active point, in place of its name and
|
|
359
|
+
* quadrant (the engine tooltip is not shown)
|
|
360
|
+
*/
|
|
355
361
|
renderTooltip?: (point: QuadrantPoint, index: number) => ReactNode;
|
|
356
362
|
/**
|
|
357
363
|
* React content placed over each quadrant (e.g. an add button); the
|
|
@@ -329,7 +329,10 @@ export interface QuadrantHeaderInfo {
|
|
|
329
329
|
}
|
|
330
330
|
/** Props of QuadrantChart */
|
|
331
331
|
export interface QuadrantChartProps extends Omit<ChartCommonProps, "onPointClick" | "onPlotClick" | "renderTooltip" | "xAxis" | "yAxis">, QuadrantConfig {
|
|
332
|
-
/**
|
|
332
|
+
/**
|
|
333
|
+
* React actions (e.g. compact edit / delete icon buttons) shown in the
|
|
334
|
+
* card of the active point (hovered, focused or selected), beside its name
|
|
335
|
+
*/
|
|
333
336
|
renderPointActions?: (point: QuadrantPoint, index: number) => ReactNode;
|
|
334
337
|
/** Called with the clicked point and its index */
|
|
335
338
|
onPointClick?: (point: QuadrantPoint, index: number) => void;
|
|
@@ -351,7 +354,10 @@ export interface QuadrantChartProps extends Omit<ChartCommonProps, "onPointClick
|
|
|
351
354
|
* when it is set (the chart does not move them: update `points`)
|
|
352
355
|
*/
|
|
353
356
|
onPointDrop?: (point: QuadrantPoint, index: number, target: QuadrantDropTarget) => void;
|
|
354
|
-
/**
|
|
357
|
+
/**
|
|
358
|
+
* React content of the card of the active point, in place of its name and
|
|
359
|
+
* quadrant (the engine tooltip is not shown)
|
|
360
|
+
*/
|
|
355
361
|
renderTooltip?: (point: QuadrantPoint, index: number) => ReactNode;
|
|
356
362
|
/**
|
|
357
363
|
* React content placed over each quadrant (e.g. an add button); the
|