@sckyzo/cosmos-charts 0.3.0 → 0.4.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 +14 -0
- package/README.md +12 -1
- package/dist/BarChart.cjs +18 -18
- package/dist/BarChart.js +5 -5
- package/dist/BoxPlotChart.cjs +18 -18
- package/dist/BoxPlotChart.js +5 -5
- package/dist/BumpChart.cjs +6 -6
- package/dist/BumpChart.js +3 -3
- package/dist/CalendarChart.cjs +9 -7
- package/dist/CalendarChart.cjs.map +1 -1
- package/dist/CalendarChart.js +5 -3
- package/dist/CalendarChart.js.map +1 -1
- package/dist/DonutChart.cjs +8 -8
- package/dist/DonutChart.js +3 -3
- package/dist/FunnelChart.cjs +8 -6
- package/dist/FunnelChart.cjs.map +1 -1
- package/dist/FunnelChart.js +4 -2
- package/dist/FunnelChart.js.map +1 -1
- package/dist/GradientRadial.cjs +3 -3
- package/dist/GradientRadial.js +2 -2
- package/dist/HeatmapChart.cjs +8 -6
- package/dist/HeatmapChart.cjs.map +1 -1
- package/dist/HeatmapChart.js +5 -3
- package/dist/HeatmapChart.js.map +1 -1
- package/dist/LineAreaChart.cjs +13 -13
- package/dist/LineAreaChart.js +4 -4
- package/dist/MixedChart.cjs +16 -16
- package/dist/MixedChart.js +5 -5
- package/dist/RadarChart.cjs +9 -9
- package/dist/RadarChart.js +3 -3
- package/dist/RadialBarChart.cjs +3 -3
- package/dist/RadialBarChart.js +1 -1
- package/dist/RangeBarChart.cjs +13 -13
- package/dist/RangeBarChart.js +4 -4
- package/dist/RealtimeChart.cjs +8 -8
- package/dist/RealtimeChart.js +2 -2
- package/dist/ScatterChart.cjs +12 -12
- package/dist/ScatterChart.js +4 -4
- package/dist/SemiCircleGauge.cjs +2 -2
- package/dist/SemiCircleGauge.js +1 -1
- package/dist/Sparkline.cjs +4 -4
- package/dist/Sparkline.js +1 -1
- package/dist/StrokedGauge.cjs +3 -3
- package/dist/StrokedGauge.js +2 -2
- package/dist/TreemapChart.cjs +2 -2
- package/dist/TreemapChart.js +1 -1
- package/dist/WaterfallChart.cjs +12 -12
- package/dist/WaterfallChart.js +3 -3
- package/dist/{chunk-6ALKZLN2.js → chunk-4AKHZNWP.js} +3 -3
- package/dist/{chunk-6ALKZLN2.js.map → chunk-4AKHZNWP.js.map} +1 -1
- package/dist/{chunk-3N43QT36.js → chunk-56WD3OHA.js} +6 -4
- package/dist/chunk-56WD3OHA.js.map +1 -0
- package/dist/{chunk-YWYF5CCJ.js → chunk-6FGJZBTC.js} +3 -3
- package/dist/{chunk-YWYF5CCJ.js.map → chunk-6FGJZBTC.js.map} +1 -1
- package/dist/{chunk-MN4CDVOS.cjs → chunk-CMBNNLIV.cjs} +4 -4
- package/dist/{chunk-MN4CDVOS.cjs.map → chunk-CMBNNLIV.cjs.map} +1 -1
- package/dist/{chunk-RILUG7JB.js → chunk-DI2FBGKM.js} +3 -3
- package/dist/{chunk-RILUG7JB.js.map → chunk-DI2FBGKM.js.map} +1 -1
- package/dist/{chunk-SGG7XKOY.js → chunk-ESVGCUJN.js} +3 -3
- package/dist/{chunk-SGG7XKOY.js.map → chunk-ESVGCUJN.js.map} +1 -1
- package/dist/{chunk-RLHGPHC7.cjs → chunk-G4WOPX4D.cjs} +4 -4
- package/dist/{chunk-RLHGPHC7.cjs.map → chunk-G4WOPX4D.cjs.map} +1 -1
- package/dist/{chunk-GZRMVE4X.cjs → chunk-RCDTBZC2.cjs} +4 -4
- package/dist/{chunk-GZRMVE4X.cjs.map → chunk-RCDTBZC2.cjs.map} +1 -1
- package/dist/{chunk-6NRRABPF.cjs → chunk-SR2ESX3R.cjs} +6 -4
- package/dist/chunk-SR2ESX3R.cjs.map +1 -0
- package/dist/{chunk-ICL5K2CW.js → chunk-UL3SNXQR.js} +3 -3
- package/dist/{chunk-ICL5K2CW.js.map → chunk-UL3SNXQR.js.map} +1 -1
- package/dist/{chunk-6BKLL7LZ.cjs → chunk-XMFBVMW7.cjs} +4 -4
- package/dist/{chunk-6BKLL7LZ.cjs.map → chunk-XMFBVMW7.cjs.map} +1 -1
- package/dist/{chunk-Z4LZFMDH.cjs → chunk-XUGQ6VXO.cjs} +4 -4
- package/dist/{chunk-Z4LZFMDH.cjs.map → chunk-XUGQ6VXO.cjs.map} +1 -1
- package/dist/{chunk-HMH6DI7U.js → chunk-YMRNTIOK.js} +3 -3
- package/dist/{chunk-HMH6DI7U.js.map → chunk-YMRNTIOK.js.map} +1 -1
- package/dist/{chunk-TPH5T3DA.cjs → chunk-ZWHCUYIN.cjs} +4 -4
- package/dist/{chunk-TPH5T3DA.cjs.map → chunk-ZWHCUYIN.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3N43QT36.js.map +0 -1
- package/dist/chunk-6NRRABPF.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { TEXT_SIZE } from './chunk-
|
|
2
|
+
import { TEXT_SIZE } from './chunk-DI2FBGKM.js';
|
|
3
3
|
import { INTENT_COLORS, MUTED } from './chunk-UATB2IRY.js';
|
|
4
4
|
import { ReferenceArea, ReferenceLine } from 'recharts';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -54,5 +54,5 @@ var referenceMarks = ({
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export { referenceMarks };
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-ESVGCUJN.js.map
|
|
58
|
+
//# sourceMappingURL=chunk-ESVGCUJN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/reference.tsx"],"names":[],"mappings":";;;;;;AAYA,IAAM,IAAA,GAAO,KAAA;AAEb,IAAM,UAAA,GAAa,EAAA;AAInB,IAAM,OAAA,GAAU,CAAC,KAAA,EAAe,QAAA,MAAkD;AAAA,EAChF,KAAA;AAAA,EACA,QAA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AA,EAAO,gBAAgB,CAAA,GAAI;AAAA,OAAA;AAAA,MAPvD,QAAQ,CAAC,CAAA;AAAA,KASjB;AAAA,GACH;AACF","file":"chunk-ESVGCUJN.js","sourcesContent":["import { ReferenceArea, ReferenceLine } from 'recharts';\nimport type { ChartReferenceProps } from '../types';\nimport { TEXT_SIZE } from './axes';\nimport { INTENT_COLORS, MUTED } from './colors';\n\ntype ReferenceOptions = ChartReferenceProps & {\n /** The axis the values are read on: `y` (default), or `x` on a chart of horizontal bars. */\n axis?: 'x' | 'y';\n /** The id of that axis, when the chart has several. */\n axisId?: string;\n};\n\nconst DASH = '6 4';\n// Behind the series (an area is at 100, a bar at 300) and above the grid.\nconst BAND_LAYER = 50;\n\n// Plain SVG text in the muted color: an amber or red label would not read on\n// the card in every theme, so the line and the band carry the intent.\nconst labelOf = (value: string, position: 'insideTopRight' | 'insideTopLeft') => ({\n value,\n position,\n className: 'recharts-reference-label',\n fill: MUTED,\n style: { fontSize: TEXT_SIZE },\n});\n\n/**\n * The `ReferenceArea`s then the `ReferenceLine`s of a chart's `referenceBands`\n * and `referenceLines`, to render inside it, before `children`. A mark outside\n * the data makes the axis reach it (`ifOverflow=\"extendDomain\"`) instead of\n * vanishing. Colors come from `INTENT_COLORS`, so a theme switch repaints\n * them; labels are text, not markup.\n */\nexport const referenceMarks = ({\n referenceLines = [],\n referenceBands = [],\n axis = 'y',\n axisId,\n}: ReferenceOptions) => {\n const onAxis = axisId === undefined ? {} : { [`${axis}AxisId`]: axisId };\n return [\n ...referenceBands.map((band, i) => {\n const [low, high] = [Math.min(band.from, band.to), Math.max(band.from, band.to)];\n return (\n <ReferenceArea\n key={`band-${i}`}\n {...{ [`${axis}1`]: low, [`${axis}2`]: high }}\n {...onAxis}\n fill={INTENT_COLORS[band.intent ?? 'neutral']}\n fillOpacity={0.14}\n ifOverflow=\"extendDomain\"\n zIndex={BAND_LAYER}\n label={band.label ? labelOf(band.label, 'insideTopLeft') : undefined}\n />\n );\n }),\n ...referenceLines.map((line, i) => (\n <ReferenceLine\n key={`line-${i}`}\n {...{ [axis]: line.value }}\n {...onAxis}\n stroke={INTENT_COLORS[line.intent ?? 'neutral']}\n strokeWidth={1.5}\n strokeDasharray={line.dashed ? DASH : undefined}\n ifOverflow=\"extendDomain\"\n label={line.label ? labelOf(line.label, 'insideTopRight') : undefined}\n />\n )),\n ];\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkSR2ESX3R_cjs = require('./chunk-SR2ESX3R.cjs');
|
|
5
5
|
var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
|
|
6
6
|
|
|
7
7
|
// src/core/axes.ts
|
|
@@ -13,7 +13,7 @@ var AXIS = {
|
|
|
13
13
|
tick: { fill: chunkLT3UC65O_cjs.MUTED, style: { fontSize: TEXT_SIZE } }
|
|
14
14
|
};
|
|
15
15
|
var AXIS_AFTER_FONTS = { ...AXIS, tick: { ...AXIS.tick } };
|
|
16
|
-
var useAxis = () =>
|
|
16
|
+
var useAxis = () => chunkSR2ESX3R_cjs.useFontsLoaded() ? AXIS_AFTER_FONTS : AXIS;
|
|
17
17
|
var GRID_PROPS = {
|
|
18
18
|
vertical: false,
|
|
19
19
|
stroke: chunkLT3UC65O_cjs.GRID,
|
|
@@ -47,5 +47,5 @@ exports.TEXT_SIZE = TEXT_SIZE;
|
|
|
47
47
|
exports.useAxis = useAxis;
|
|
48
48
|
exports.xAxisTitle = xAxisTitle;
|
|
49
49
|
exports.yAxisTitle = yAxisTitle;
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-G4WOPX4D.cjs.map
|
|
51
|
+
//# sourceMappingURL=chunk-G4WOPX4D.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/axes.ts"],"names":["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k-G4WOPX4D.cjs","sourcesContent":["import { GRID, MUTED } from './colors';\nimport { useFontsLoaded } from './frame';\n\n// Axis text is 12px at the normal text size and follows the text size setting:\n// `--text-xs` is rescaled on <html> by `data-text-size`. The fallback is the\n// normal size, for an app that doesn't load the theme.\nexport const TEXT_SIZE = 'var(--text-xs, 0.75rem)';\n\n/** The look of every axis: no line, no tick mark, muted text. */\nexport const AXIS = {\n axisLine: false,\n tickLine: false,\n tickMargin: 8,\n tick: { fill: MUTED, style: { fontSize: TEXT_SIZE } },\n} as const;\n\n// `AXIS` again, with a `tick` object of its own. Recharts measures a\n// `width=\"auto\"` axis when its settings change, and reads the same `tick`\n// object as no change: handing it a new one after a web font has loaded makes\n// the axis measure its labels again, in the font that is drawn.\nconst AXIS_AFTER_FONTS = { ...AXIS, tick: { ...AXIS.tick } } as const;\n\n/**\n * `AXIS` for the axes of a chart. Once a web font has finished loading after\n * the chart mounted it is another object, once: the labels were measured in\n * the fallback font, and an axis with `width=\"auto\"` makes room for them in\n * the font that is drawn (recharts 3.10.1 measures on a settings change).\n */\nexport const useAxis = () => (useFontsLoaded() ? AXIS_AFTER_FONTS : AXIS);\n\n/** The grid: horizontal dashed lines only. */\nexport const GRID_PROPS = {\n vertical: false,\n stroke: GRID,\n strokeDasharray: '4 4',\n} as const;\n\n// `fill` as an attribute too: the label's own default is gray.\nconst titleStyle = { fill: MUTED, fontSize: TEXT_SIZE } as const;\n\n/** Props for an `XAxis` with an optional title under it. The title is SVG text: markup shows as written. */\nexport const xAxisTitle = (title?: string) =>\n title\n ? ({\n height: 52,\n label: {\n value: title,\n position: 'insideBottom',\n offset: 0,\n fill: MUTED,\n style: titleStyle,\n },\n } as const)\n : {};\n\n/** Props for a `YAxis` with an optional title beside it. */\nexport const yAxisTitle = (title?: string) =>\n title\n ? ({\n label: {\n value: title,\n angle: -90,\n position: 'insideLeft',\n offset: 4,\n fill: MUTED,\n style: { ...titleStyle, textAnchor: 'middle' },\n },\n } as const)\n : {};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkG4WOPX4D_cjs = require('./chunk-G4WOPX4D.cjs');
|
|
5
5
|
var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -28,7 +28,7 @@ var ChartLegend = ({ payload, hidden, onToggle, column, detail }) => /* @__PURE_
|
|
|
28
28
|
margin: 0,
|
|
29
29
|
padding: 0,
|
|
30
30
|
listStyle: "none",
|
|
31
|
-
fontSize:
|
|
31
|
+
fontSize: chunkG4WOPX4D_cjs.TEXT_SIZE,
|
|
32
32
|
color: chunkLT3UC65O_cjs.MUTED
|
|
33
33
|
},
|
|
34
34
|
children: payload?.map((entry, index) => {
|
|
@@ -127,5 +127,5 @@ var legendProps = (position, { hidden, toggle }) => ({
|
|
|
127
127
|
exports.ChartLegend = ChartLegend;
|
|
128
128
|
exports.legendProps = legendProps;
|
|
129
129
|
exports.useHiddenSeries = useHiddenSeries;
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
130
|
+
//# sourceMappingURL=chunk-RCDTBZC2.cjs.map
|
|
131
|
+
//# sourceMappingURL=chunk-RCDTBZC2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/ChartLegend.tsx"],"names":["useState","useCallback","jsx","TEXT_SIZE","MUTED","jsxs","Fragment","TEXT"],"mappings":";;;;;;;;AAUO,IAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,IAAIA,cAAA,iBAA8B,IAAI,KAAK,CAAA;AACnE,EAAA,MAAM,MAAA,GAASC,iBAAA,CAAY,CAAC,GAAA,KAAgB;AAC1C,IAAA,SAAA,CAAU,CAAC,OAAA,KAAY;AACrB,M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,MACA,QAAA,EAAU,MAAA;AAAA,MACV,MAAA,EAAQ,QAAA,KAAa,MAAA,IAAU,QAAA,KAAa;AAAA;AAAA;AAGlD,CAAA","file":"chunk-RCDTBZC2.cjs","sourcesContent":["import { useCallback, useState, type ReactNode } from 'react';\nimport type { LegendPayload, LegendProps } from 'recharts';\nimport type { ChartLegendPosition } from '../types';\nimport { MUTED, TEXT } from './colors';\nimport { TEXT_SIZE } from './axes';\n\n/**\n * The series a click on the legend hid, and the toggle. A hidden series is\n * passed to its graphical item as `hide`, so the axes fit what is left.\n */\nexport const useHiddenSeries = () => {\n const [hidden, setHidden] = useState<ReadonlySet<string>>(new Set());\n const toggle = useCallback((key: string) => {\n setHidden((current) => {\n const next = new Set(current);\n if (!next.delete(key)) next.add(key);\n return next;\n });\n }, []);\n return { hidden, toggle };\n};\n\ntype ChartLegendProps = {\n /** Given by Recharts: one entry per series, in the order the series are drawn. */\n payload?: readonly LegendPayload[];\n /** The keys of the hidden series. */\n hidden: ReadonlySet<string>;\n onToggle: (key: string) => void;\n /** Items in a column (`left`, `right`) or a row (`top`, `bottom`). */\n column?: boolean;\n /**\n * A figure written after the name of the entry at `index`: a value and its\n * share. In a column the figures sit at the right edge, aligned on their\n * last digit; in a row they follow the name.\n */\n detail?: (index: number) => { value: string; share: string };\n};\n\n/**\n * The legend of every chart: a round chip and the series name in the muted\n * text color, one button per series. A click (or Enter, Space) hides the series\n * and shows it again; the button says which in `aria-pressed`. Pass it as\n * `<Legend content={…} itemSorter={null} />`: Recharts sorts the items by name\n * unless told not to, and the series keep their order.\n */\nexport const ChartLegend = ({ payload, hidden, onToggle, column, detail }: ChartLegendProps) => (\n <ul\n style={{\n display: 'flex',\n flexDirection: column ? 'column' : 'row',\n flexWrap: 'wrap',\n gap: column ? '0.375rem' : '0.25rem 1rem',\n margin: 0,\n padding: 0,\n listStyle: 'none',\n fontSize: TEXT_SIZE,\n color: MUTED,\n }}\n >\n {payload?.map((entry, index) => {\n const key = String(entry.dataKey);\n const figures = detail?.(index);\n const off = hidden.has(key);\n return (\n <li key={key}>\n <button\n type=\"button\"\n aria-pressed={!off}\n onClick={() => onToggle(key)}\n className=\"focus-visible:focus-indicator\"\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: '0.375rem',\n padding: '0.125rem 0.25rem',\n font: 'inherit',\n color: 'inherit',\n background: 'none',\n border: 0,\n borderRadius: '0.25rem',\n cursor: 'pointer',\n textDecoration: off ? 'line-through' : undefined,\n // The figures of a column reach its right edge, which aligns them.\n ...(figures && column ? { display: 'flex', width: '100%', gap: '0.75rem' } : {}),\n }}\n >\n <span\n aria-hidden\n style={{\n width: '0.625rem',\n height: '0.625rem',\n borderRadius: '50%',\n background: entry.color,\n // Text keeps its color: dimming it would fail the contrast check.\n opacity: off ? 0.35 : 1,\n }}\n />\n {figures ? (\n <>\n <span style={column ? { flex: 1, textAlign: 'start' } : undefined}>\n {entry.value as ReactNode}\n </span>\n <span\n style={{\n color: TEXT,\n fontWeight: 600,\n fontVariantNumeric: 'tabular-nums',\n textAlign: 'end',\n }}\n >\n {figures.value}\n </span>\n <span\n style={{\n minWidth: column ? '3.5ch' : undefined,\n fontVariantNumeric: 'tabular-nums',\n textAlign: 'end',\n }}\n >\n {figures.share}\n </span>\n </>\n ) : (\n (entry.value as ReactNode)\n )}\n </button>\n </li>\n );\n })}\n </ul>\n);\n\nconst GAP = '1rem';\n\n/**\n * The props of the `<Legend>` of a chart: on `position`, the chips and names\n * of `ChartLegend`, in series order, a `GAP` away from the plot.\n */\nexport const legendProps = (\n position: ChartLegendPosition,\n { hidden, toggle }: ReturnType<typeof useHiddenSeries>\n): LegendProps => ({\n position,\n itemSorter: null,\n wrapperStyle: {\n top: { width: '100%', paddingBottom: GAP },\n bottom: { width: '100%', paddingTop: GAP },\n left: { paddingRight: GAP },\n right: { paddingLeft: GAP },\n }[position],\n content: (\n <ChartLegend\n hidden={hidden}\n onToggle={toggle}\n column={position === 'left' || position === 'right'}\n />\n ),\n});\n"]}
|
|
@@ -15,8 +15,10 @@ var frameProps = ({
|
|
|
15
15
|
accessibilityLayer: keyboard,
|
|
16
16
|
...keyboard ? {} : { role: "img" },
|
|
17
17
|
"aria-label": ariaLabel,
|
|
18
|
-
// `maxWidth`: a chart wider than its parent would widen the page.
|
|
19
|
-
|
|
18
|
+
// `maxWidth`: a chart wider than its parent would widen the page. `direction`: a chart keeps
|
|
19
|
+
// its left-to-right axes under `dir="rtl"`; left alone, the SVG's `text-anchor` would read
|
|
20
|
+
// `start` and `end` from the page and put the labels on the wrong side of their marks.
|
|
21
|
+
style: { width, height, maxWidth: "100%", direction: "ltr" }
|
|
20
22
|
});
|
|
21
23
|
var useFontsLoaded = () => {
|
|
22
24
|
const [loaded, setLoaded] = react.useState(0);
|
|
@@ -60,5 +62,5 @@ var ChartEmpty = ({ message, ariaLabel, height, width = "100%" }) => /* @__PURE_
|
|
|
60
62
|
exports.ChartEmpty = ChartEmpty;
|
|
61
63
|
exports.frameProps = frameProps;
|
|
62
64
|
exports.useFontsLoaded = useFontsLoaded;
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-SR2ESX3R.cjs.map
|
|
66
|
+
//# sourceMappingURL=chunk-SR2ESX3R.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/frame.tsx"],"names":["useState","useEffect","jsx","MUTED"],"mappings":";;;;;;;AAoBO,IAAM,aAAa,CAAC;AAAA,EACzB,MAAA;AAAA,EACA,KAAA,GAAQ,MAAA;AAAA,EACR,SAAA;AAAA,EACA,QAAA,GAAW;AACb,CAAA,MAAqB;AAAA,EACnB,UAAA,EAAY,IAAA;AAAA,EACZ,kBAAA,EAAoB,QAAA;AAAA,EACpB,GAAI,QAAA,GAAW,EAAC,GAAI,EAAE,MAAM,KAAA,EAAM;AAAA,EAClC,YAAA,EAAc,SAAA;AAAA;AAAA;AAAA;AAAA,EA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C,uBAAA;AAAA,MACP,QAAA,EAAU,0BAAA;AAAA,MACV,SAAA,EAAW;AAAA,KACb;AAAA,IAEC,QAAA,EAAA;AAAA;AACH","file":"chunk-SR2ESX3R.cjs","sourcesContent":["import { useEffect, useState, type CSSProperties } from 'react';\nimport { MUTED } from './colors';\nimport type { ChartSize } from '../types';\n\ntype FrameOptions = ChartSize & {\n ariaLabel: string;\n /**\n * Tab reaches the chart and the arrow keys walk its points (default). Off,\n * the chart is an image out of the tab order: right for a single value.\n */\n keyboard?: boolean;\n};\n\n/**\n * What every Recharts chart takes on its root, spread onto it: it fills the\n * width it is given (`width` default `100%`) at `height`, and is named by\n * `ariaLabel`. With `accessibilityLayer`, Recharts makes the chart an\n * `application` in the tab order, and the arrow keys move the tooltip from\n * point to point.\n */\nexport const frameProps = ({\n height,\n width = '100%',\n ariaLabel,\n keyboard = true,\n}: FrameOptions) => ({\n responsive: true,\n accessibilityLayer: keyboard,\n ...(keyboard ? {} : { role: 'img' }),\n 'aria-label': ariaLabel,\n // `maxWidth`: a chart wider than its parent would widen the page. `direction`: a chart keeps\n // its left-to-right axes under `dir=\"rtl\"`; left alone, the SVG's `text-anchor` would read\n // `start` and `end` from the page and put the labels on the wrong side of their marks.\n style: { width, height, maxWidth: '100%', direction: 'ltr' } satisfies CSSProperties,\n});\n\n/**\n * `0` until a web font finishes loading after the chart mounted, then `1`\n * (one more render of the chart, no more). `YAxis width=\"auto\"` measures its\n * labels once, in the fallback font if the web font is not there yet, and a\n * label set in the real font can overrun the axis: `useAxis` (axes.ts) hands\n * the axes a new object when this turns `1`, and they measure again. A chart\n * that mounts with the font ready never changes, and nothing runs where\n * `document.fonts` is missing (SSR, old browsers).\n */\nexport const useFontsLoaded = (): 0 | 1 => {\n const [loaded, setLoaded] = useState<0 | 1>(0);\n useEffect(() => {\n const fonts = typeof document === 'undefined' ? undefined : document.fonts;\n if (!fonts?.addEventListener) return;\n let active = true;\n const done = () => {\n if (active) setLoaded(1);\n };\n fonts.addEventListener('loadingdone', done);\n // A font already loading when the chart mounts: its event may be on its way\n // or already gone, `ready` settles once it has loaded.\n if (fonts.status === 'loading') void fonts.ready.then(done);\n return () => {\n active = false;\n fonts.removeEventListener('loadingdone', done);\n };\n }, []);\n return loaded;\n};\n\ntype EmptyProps = ChartSize & {\n /** Plain text. An empty string draws nothing. */\n message: string;\n ariaLabel: string;\n};\n\n/** What a chart with no data draws in place of its plot: the message, centered, and nothing around it. */\nexport const ChartEmpty = ({ message, ariaLabel, height, width = '100%' }: EmptyProps) => (\n <div\n role=\"group\"\n aria-label={ariaLabel}\n data-chart-empty=\"\"\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width,\n height,\n maxWidth: '100%',\n color: MUTED,\n fontSize: 'var(--text-sm, 0.875rem)',\n textAlign: 'center',\n }}\n >\n {message}\n </div>\n);\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { textOn } from './chunk-BFEDLXVW.js';
|
|
3
|
-
import { TEXT_SIZE } from './chunk-
|
|
3
|
+
import { TEXT_SIZE } from './chunk-DI2FBGKM.js';
|
|
4
4
|
import { TooltipCard } from './chunk-VIOSQN4Z.js';
|
|
5
5
|
import { MUTED, PANEL, TEXT } from './chunk-UATB2IRY.js';
|
|
6
6
|
import { useRef, useState, useLayoutEffect } from 'react';
|
|
@@ -276,5 +276,5 @@ var HeatGrid = ({
|
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
export { HeatGrid };
|
|
279
|
-
//# sourceMappingURL=chunk-
|
|
280
|
-
//# sourceMappingURL=chunk-
|
|
279
|
+
//# sourceMappingURL=chunk-UL3SNXQR.js.map
|
|
280
|
+
//# sourceMappingURL=chunk-UL3SNXQR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/HeatGrid.tsx"],"names":["cell"],"mappings":";;;;;;;;AAqEA,IAAM,GAAA,GAAM,CAAA;AACZ,IAAM,MAAA,GAA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AAO,EAAE,SAAA,EAAW,MAAA,EAAQ,OAAA,EAAS,CAAA,EAAE,EAC7D,QAAA,EAAA,IAAA,EACH;AAAA,QAEA,IAAA;AAAA,IAED,GAAA,IAAO,4BACN,GAAA,CAAC,KAAA,EAAA,EAAI,qBAAkB,EAAA,EAAG,aAAA,EAAW,IAAA,EAAC,KAAA,EAAO,QAAA,EAC3C,QAAA,kBAAA,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,IAAI,IAAA,CAAK,KAAA;AAAA,QAChB,IAAA,EAAM,CAAC,EAAE,IAAA,EAAM,IAAI,IAAA,CAAK,KAAA,EAAO,KAAA,EAAO,GAAA,CAAI,KAAK,KAAA,EAAO,KAAA,EAAO,GAAA,CAAI,IAAA,CAAK,OAAO;AAAA;AAAA,KAC/E,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"chunk-ICL5K2CW.js","sourcesContent":["import {\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type KeyboardEvent,\n} from 'react';\nimport { TEXT_SIZE } from './axes';\nimport { TooltipCard } from './ChartTooltip';\nimport { MUTED, PANEL, TEXT } from './colors';\nimport { textOn } from './readable';\n\n/** One cell of a `HeatGrid`. A slot with no cell stays empty. */\nexport type HeatCell = {\n /** Zero-based position: the index in `rows` and in `columns`. */\n row: number;\n column: number;\n /** Any CSS color. The text printed in the cell reads on it. */\n color: string;\n /** Heads the tooltip, such as the column's category. */\n title: string;\n /** Names the cell in the tooltip, such as the row. May be empty when the value says it all. */\n label: string;\n /** The value, formatted: the tooltip's value, and the end of the cell's accessible name. */\n value: string;\n /** Printed inside the cell. */\n text?: string;\n};\n\ntype HeatGridProps = {\n /** The label of each row, top to bottom. An empty string leaves the row unlabelled. */\n rows: readonly string[];\n /** The label of each column, left to right. Too many for the width: every n-th one is drawn. */\n columns: readonly string[];\n cells: readonly HeatCell[];\n /**\n * Height of a row in px. Without it the rows share the height of the\n * parent, which must then have one.\n */\n cellHeight?: number;\n /** Names the grid for screen readers. */\n ariaLabel: string;\n /** Title under the columns. Drawn as plain text. */\n xTitle?: string;\n /** Title beside the rows. Drawn as plain text. */\n yTitle?: string;\n /** Space between two cells in px. Default 3. */\n gap?: number;\n /** Corner radius of a cell in px. Default 5. */\n cellRadius?: number;\n /**\n * Width of a column in px. Without it the columns share the width of the\n * parent; with it they keep this width, and the grid scrolls sideways inside\n * its own box when it is wider than the parent. The row labels stay in view.\n */\n columnWidth?: number;\n /** Draw the column labels above the rows instead of under them. */\n labelsAbove?: boolean;\n /**\n * Draw every column label, as given. By default the labels are centered on\n * their column and every n-th one is drawn so that none touches the next.\n * Off, each starts at the left of its column and may run over the columns\n * after it, which an empty label leaves free: for labels such as the months\n * of a calendar, where the caller decides which columns carry one.\n */\n thinLabels?: boolean;\n};\n\nconst GAP = 3;\nconst RADIUS = 5;\n// Clear space kept between two column labels.\nconst LABEL_GAP = 6;\n// Room the tooltip card leaves the pointer or the cell.\nconst TIP_GAP = 6;\n\nconst key = (row: number, column: number) => `${row}:${column}`;\n\n/**\n * How many columns apart the labels are drawn so that none touches the next:\n * 1 when they all fit. Measured on the page, since the text size, the font and\n * the width all change it.\n */\nconst useLabelStride = (probe: string, gap: number) => {\n const gridRef = useRef<HTMLDivElement>(null);\n const probeRef = useRef<HTMLSpanElement>(null);\n const columnRef = useRef<HTMLDivElement>(null);\n const [stride, setStride] = useState(1);\n useLayoutEffect(() => {\n const read = () => {\n const label = probeRef.current?.offsetWidth ?? 0;\n const column = columnRef.current?.offsetWidth ?? 0;\n setStride(column > 0 ? Math.max(1, Math.ceil((label + LABEL_GAP) / (column + gap))) : 1);\n };\n read();\n const observer = new ResizeObserver(read);\n for (const el of [gridRef.current, probeRef.current]) if (el) observer.observe(el);\n return () => observer.disconnect();\n }, [probe, gap]);\n return { gridRef, probeRef, columnRef, stride };\n};\n\ntype Tip = {\n cell: HeatCell;\n /** Where the card is anchored, in px from the grid's corner, and on which side of the cell. */\n x: number;\n top: number;\n bottom: number;\n align: 'start' | 'center' | 'end';\n below: boolean;\n};\n\n/**\n * A grid of colored cells with row and column labels: the drawing of\n * `HeatmapChart`, and of any chart laid out as rows and columns. Recharts has\n * no such chart, so it is plain HTML in a CSS grid, which sizes the label\n * column to the text (it follows the text size) and the cells to the width.\n *\n * Keyboard: the grid is one tab stop (a roving tabindex), and the arrow keys\n * move between cells, skipping empty slots; Home and End go to the ends of the\n * row, Ctrl+Home and Ctrl+End to the first and last cell. The cell under the\n * pointer or the keyboard shows its tooltip. Each cell is named\n * `label, title: value`, so a screen reader reads what the tooltip says.\n */\nexport const HeatGrid = ({\n rows,\n columns,\n cells,\n cellHeight,\n ariaLabel,\n xTitle,\n yTitle,\n gap = GAP,\n cellRadius = RADIUS,\n columnWidth,\n labelsAbove = false,\n thinLabels = true,\n}: HeatGridProps) => {\n const frame = useRef<HTMLDivElement>(null);\n const longest = columns.reduce((a, b) => (b.length > a.length ? b : a), '');\n const { gridRef, probeRef, columnRef, stride: measured } = useLabelStride(longest, gap);\n const stride = thinLabels ? measured : 1;\n const byPosition = new Map(cells.map((cell) => [key(cell.row, cell.column), cell]));\n const cellsByRow = new Map<number, HeatCell[]>();\n for (const cell of cells) cellsByRow.set(cell.row, [...(cellsByRow.get(cell.row) ?? []), cell]);\n const inReadingOrder = [...cells].sort((a, b) => a.row - b.row || a.column - b.column);\n const [roving, setRoving] = useState<string>();\n // The cell that takes Tab: the last one focused, while it is still there.\n const first = inReadingOrder[0];\n const tabbable =\n roving && byPosition.has(roving) ? roving : first && key(first.row, first.column);\n const [hover, setHover] = useState<Tip>();\n const [focus, setFocus] = useState<Tip>();\n const tip = hover ?? focus;\n\n const tipFor = (cell: HeatCell, element: HTMLElement): Tip => {\n const host = (frame.current as HTMLElement).getBoundingClientRect();\n const box = element.getBoundingClientRect();\n const middle = box.left - host.left + box.width / 2;\n // The card hangs from the side of the cell nearest the middle of the grid,\n // so it never leaves the grid.\n const align =\n middle < host.width / 3 ? 'start' : middle > (2 * host.width) / 3 ? 'end' : 'center';\n return {\n cell,\n x: { start: box.left - host.left, center: middle, end: box.right - host.left }[align],\n top: box.top - host.top,\n bottom: box.bottom - host.top,\n align,\n // Not enough room above the cell for the card: it goes under.\n below: box.top - host.top < 90,\n };\n };\n\n const move = (event: KeyboardEvent<HTMLDivElement>) => {\n const origin = (event.target as HTMLElement).closest<HTMLElement>('[data-heat-cell]');\n if (!origin) return;\n const row = Number(origin.dataset.row);\n const column = Number(origin.dataset.column);\n // The next cell in a direction: empty slots are skipped, the edge stops.\n const step = (dRow: number, dColumn: number) => {\n for (\n let r = row + dRow, c = column + dColumn;\n r >= 0 && r < rows.length && c >= 0 && c < columns.length;\n r += dRow, c += dColumn\n ) {\n if (byPosition.has(key(r, c))) return key(r, c);\n }\n };\n const edge = (last: boolean) => {\n const pool = event.ctrlKey\n ? inReadingOrder\n : inReadingOrder.filter((cell) => cell.row === row);\n const cell = last ? pool.at(-1) : pool[0];\n return cell && key(cell.row, cell.column);\n };\n const targets: Record<string, () => string | undefined> = {\n ArrowRight: () => step(0, 1),\n ArrowLeft: () => step(0, -1),\n ArrowDown: () => step(1, 0),\n ArrowUp: () => step(-1, 0),\n Home: () => edge(false),\n End: () => edge(true),\n };\n const target = targets[event.key];\n if (!target) return;\n event.preventDefault();\n const next = target();\n if (next) gridRef.current?.querySelector<HTMLElement>(`[data-position=\"${next}\"]`)?.focus();\n };\n\n const focusIn = (cell: HeatCell, event: FocusEvent<HTMLElement>) => {\n setRoving(key(cell.row, cell.column));\n // A click focuses a cell too, and would leave its tooltip up: only the keyboard shows it.\n if (event.currentTarget.matches(':focus-visible')) {\n setFocus(tipFor(cell, event.currentTarget));\n }\n };\n const focusOut = (event: FocusEvent<HTMLDivElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget)) setFocus(undefined);\n };\n\n const rowOffset = yTitle ? 2 : 1;\n // The rows start under the labels when these sit above them.\n const top = labelsAbove ? 1 : 0;\n const labelsRow = labelsAbove ? 1 : rows.length + 1;\n const tipStyle: CSSProperties | undefined = tip && {\n position: 'absolute',\n left: tip.x,\n top: tip.below ? tip.bottom + TIP_GAP : tip.top - TIP_GAP,\n transform: `translate(${{ start: '0', center: '-50%', end: '-100%' }[tip.align]}, ${tip.below ? '0' : '-100%'})`,\n zIndex: 10,\n pointerEvents: 'none',\n };\n\n const grid = (\n <div\n ref={gridRef}\n role=\"grid\"\n aria-label={ariaLabel}\n onKeyDown={move}\n onBlur={focusOut}\n style={{\n display: 'grid',\n gridTemplateColumns: `${yTitle ? 'auto ' : ''}${columnWidth ? 'auto' : 'fit-content(40%)'} repeat(${columns.length}, ${columnWidth ? `${columnWidth}px` : 'minmax(0, 1fr)'})`,\n gridTemplateRows: `${labelsAbove ? 'auto ' : ''}repeat(${rows.length}, ${cellHeight ? `${cellHeight}px` : 'minmax(0, 1fr)'})${labelsAbove ? '' : ' auto'}${xTitle ? ' auto' : ''}`,\n gap,\n width: columnWidth ? 'max-content' : '100%',\n height: cellHeight ? undefined : '100%',\n fontSize: TEXT_SIZE,\n color: MUTED,\n }}\n >\n {yTitle && (\n <div\n aria-hidden\n style={{\n gridRow: `${1 + top} / ${rows.length + 1 + top}`,\n gridColumn: 1,\n writingMode: 'vertical-rl',\n transform: 'rotate(180deg)',\n textAlign: 'center',\n alignSelf: 'center',\n }}\n >\n {yTitle}\n </div>\n )}\n {rows.map((name, r) => (\n <div key={r} role=\"row\" style={{ display: 'contents' }}>\n <div\n aria-hidden\n data-heat-row=\"\"\n style={{\n gridRow: r + 1 + top,\n gridColumn: rowOffset,\n alignSelf: 'center',\n paddingRight: '0.5rem',\n // Stays in view when the grid scrolls sideways under it.\n ...(columnWidth ? { position: 'sticky', left: 0, zIndex: 2, background: PANEL } : {}),\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </div>\n {(cellsByRow.get(r) ?? []).map((cell) => {\n const position = key(cell.row, cell.column);\n const active = tip?.cell === cell;\n return (\n <div\n key={position}\n role=\"gridcell\"\n data-heat-cell=\"\"\n data-position={position}\n data-row={cell.row}\n data-column={cell.column}\n tabIndex={position === tabbable ? 0 : -1}\n aria-label={`${cell.label ? `${cell.label}, ` : ''}${cell.title}: ${cell.value}`}\n onFocus={(event) => focusIn(cell, event)}\n onMouseEnter={(event) => setHover(tipFor(cell, event.currentTarget))}\n onMouseLeave={() => setHover(undefined)}\n style={{\n gridRow: r + 1 + top,\n gridColumn: cell.column + rowOffset + 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minWidth: 0,\n overflow: 'hidden',\n borderRadius: cellRadius,\n background: cell.color,\n color: textOn(cell.color),\n fontSize: 'var(--text-2xs, 0.6875rem)',\n fontWeight: 500,\n lineHeight: 1,\n whiteSpace: 'nowrap',\n // The same ring for the pointer and the keyboard, in the text color\n // since an accent ring would vanish on the cells that are the accent.\n outline: active ? `2px solid ${TEXT}` : 'none',\n zIndex: active ? 1 : undefined,\n }}\n >\n {cell.text}\n </div>\n );\n })}\n </div>\n ))}\n {columns.map((name, c) => (\n <div\n key={c}\n ref={c === 0 ? columnRef : undefined}\n aria-hidden\n data-heat-column=\"\"\n style={{\n gridRow: labelsRow,\n gridColumn: c + rowOffset + 1,\n display: 'flex',\n justifyContent: thinLabels ? 'center' : 'flex-start',\n whiteSpace: 'nowrap',\n minWidth: 0,\n }}\n >\n {c % stride === 0 ? name : null}\n </div>\n ))}\n {xTitle && (\n <div\n aria-hidden\n style={{\n gridRow: (labelsAbove ? rows.length + 1 : labelsRow) + 1,\n gridColumn: `${rowOffset + 1} / -1`,\n textAlign: 'center',\n }}\n >\n {xTitle}\n </div>\n )}\n <span\n ref={probeRef}\n aria-hidden\n style={{ position: 'absolute', visibility: 'hidden', whiteSpace: 'nowrap' }}\n >\n {longest}\n </span>\n </div>\n );\n\n return (\n <div ref={frame} style={{ position: 'relative', width: '100%', height: '100%', minWidth: 0 }}>\n {columnWidth ? (\n // The padding leaves room for the focus outline of the cells at the edges,\n // which the scrolling box would cut.\n <div data-heat-scroll=\"\" style={{ overflowX: 'auto', padding: 3 }}>\n {grid}\n </div>\n ) : (\n grid\n )}\n {tip && tipStyle && (\n <div data-heat-tooltip=\"\" aria-hidden style={tipStyle}>\n <TooltipCard\n title={tip.cell.title}\n rows={[{ name: tip.cell.label, value: tip.cell.value, color: tip.cell.color }]}\n />\n </div>\n )}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/HeatGrid.tsx"],"names":["cell"],"mappings":";;;;;;;;AAqEA,IAAM,GAAA,GAAM,CAAA;AACZ,IAAM,MAAA,GAAS,CAAA;AAEf,IAAM,SAAA,GAAY,CAAA;AAElB,IAAM,OAAA,GAAU,CAAA;AAEhB,IAAM,MAAM,CAAC,GAAA,EAAa,WAAmB,CAAA,EAAG,GAAG,IAAI,MAAM,CAAA,CAAA;AAO7D,IAAM,cAAA,GAAiB,CAAC,KAAA,EAAe,GAAA,KAAgB;AACrD,EAAA,MAAM,OAAA,GAAU,OAAuB,IAAI,CAAA;AAC3C,EAAA,MAAM,QAAA,GAAW,OAAwB,IAAI,CAAA;AAC7C,EAAA,MAAM,SAAA,GAAY,OAAuB,IAAI,CAAA;AAC7C,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,CAAC,CAAA;AACtC,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,OAAA,EAAS,WAAA,IAAe,CAAA;AAC/C,MAAA,MAAM,MAAA,GAAS,SAAA,CAAU,OAAA,EAAS,WAAA,IAAe,CAAA;AACjD,MAAA,SAAA,CAAU,MAAA,GAAS,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,IAAA,CAAK,IAAA,CAAA,CAAM,KAAA,GAAQ,SAAA,KAAc,MAAA,GAAS,GAAA,CAAI,CAAC,IAAI,CAAC,CAAA;AAAA,IACzF,CAA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U,YAAY,QAAA,EAAS;AAAA,YAEzE,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAGF,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAK,KAAA,EAAO,OAAO,EAAE,QAAA,EAAU,UAAA,EAAY,KAAA,EAAO,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,QAAA,EAAU,GAAE,EACxF,QAAA,EAAA;AAAA,IAAA,WAAA;AAAA;AAAA;AAAA,sBAGC,GAAA,CAAC,KAAA,EAAA,EAAI,kBAAA,EAAiB,EAAA,EAAG,KAAA,EAAO,EAAE,SAAA,EAAW,MAAA,EAAQ,OAAA,EAAS,CAAA,EAAE,EAC7D,QAAA,EAAA,IAAA,EACH;AAAA,QAEA,IAAA;AAAA,IAED,GAAA,IAAO,4BACN,GAAA,CAAC,KAAA,EAAA,EAAI,qBAAkB,EAAA,EAAG,aAAA,EAAW,IAAA,EAAC,KAAA,EAAO,QAAA,EAC3C,QAAA,kBAAA,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,IAAI,IAAA,CAAK,KAAA;AAAA,QAChB,IAAA,EAAM,CAAC,EAAE,IAAA,EAAM,IAAI,IAAA,CAAK,KAAA,EAAO,KAAA,EAAO,GAAA,CAAI,KAAK,KAAA,EAAO,KAAA,EAAO,GAAA,CAAI,IAAA,CAAK,OAAO;AAAA;AAAA,KAC/E,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ","file":"chunk-UL3SNXQR.js","sourcesContent":["import {\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type KeyboardEvent,\n} from 'react';\nimport { TEXT_SIZE } from './axes';\nimport { TooltipCard } from './ChartTooltip';\nimport { MUTED, PANEL, TEXT } from './colors';\nimport { textOn } from './readable';\n\n/** One cell of a `HeatGrid`. A slot with no cell stays empty. */\nexport type HeatCell = {\n /** Zero-based position: the index in `rows` and in `columns`. */\n row: number;\n column: number;\n /** Any CSS color. The text printed in the cell reads on it. */\n color: string;\n /** Heads the tooltip, such as the column's category. */\n title: string;\n /** Names the cell in the tooltip, such as the row. May be empty when the value says it all. */\n label: string;\n /** The value, formatted: the tooltip's value, and the end of the cell's accessible name. */\n value: string;\n /** Printed inside the cell. */\n text?: string;\n};\n\ntype HeatGridProps = {\n /** The label of each row, top to bottom. An empty string leaves the row unlabelled. */\n rows: readonly string[];\n /** The label of each column, left to right. Too many for the width: every n-th one is drawn. */\n columns: readonly string[];\n cells: readonly HeatCell[];\n /**\n * Height of a row in px. Without it the rows share the height of the\n * parent, which must then have one.\n */\n cellHeight?: number;\n /** Names the grid for screen readers. */\n ariaLabel: string;\n /** Title under the columns. Drawn as plain text. */\n xTitle?: string;\n /** Title beside the rows. Drawn as plain text. */\n yTitle?: string;\n /** Space between two cells in px. Default 3. */\n gap?: number;\n /** Corner radius of a cell in px. Default 5. */\n cellRadius?: number;\n /**\n * Width of a column in px. Without it the columns share the width of the\n * parent; with it they keep this width, and the grid scrolls sideways inside\n * its own box when it is wider than the parent. The row labels stay in view.\n */\n columnWidth?: number;\n /** Draw the column labels above the rows instead of under them. */\n labelsAbove?: boolean;\n /**\n * Draw every column label, as given. By default the labels are centered on\n * their column and every n-th one is drawn so that none touches the next.\n * Off, each starts at the left of its column and may run over the columns\n * after it, which an empty label leaves free: for labels such as the months\n * of a calendar, where the caller decides which columns carry one.\n */\n thinLabels?: boolean;\n};\n\nconst GAP = 3;\nconst RADIUS = 5;\n// Clear space kept between two column labels.\nconst LABEL_GAP = 6;\n// Room the tooltip card leaves the pointer or the cell.\nconst TIP_GAP = 6;\n\nconst key = (row: number, column: number) => `${row}:${column}`;\n\n/**\n * How many columns apart the labels are drawn so that none touches the next:\n * 1 when they all fit. Measured on the page, since the text size, the font and\n * the width all change it.\n */\nconst useLabelStride = (probe: string, gap: number) => {\n const gridRef = useRef<HTMLDivElement>(null);\n const probeRef = useRef<HTMLSpanElement>(null);\n const columnRef = useRef<HTMLDivElement>(null);\n const [stride, setStride] = useState(1);\n useLayoutEffect(() => {\n const read = () => {\n const label = probeRef.current?.offsetWidth ?? 0;\n const column = columnRef.current?.offsetWidth ?? 0;\n setStride(column > 0 ? Math.max(1, Math.ceil((label + LABEL_GAP) / (column + gap))) : 1);\n };\n read();\n const observer = new ResizeObserver(read);\n for (const el of [gridRef.current, probeRef.current]) if (el) observer.observe(el);\n return () => observer.disconnect();\n }, [probe, gap]);\n return { gridRef, probeRef, columnRef, stride };\n};\n\ntype Tip = {\n cell: HeatCell;\n /** Where the card is anchored, in px from the grid's corner, and on which side of the cell. */\n x: number;\n top: number;\n bottom: number;\n align: 'start' | 'center' | 'end';\n below: boolean;\n};\n\n/**\n * A grid of colored cells with row and column labels: the drawing of\n * `HeatmapChart`, and of any chart laid out as rows and columns. Recharts has\n * no such chart, so it is plain HTML in a CSS grid, which sizes the label\n * column to the text (it follows the text size) and the cells to the width.\n *\n * Keyboard: the grid is one tab stop (a roving tabindex), and the arrow keys\n * move between cells, skipping empty slots; Home and End go to the ends of the\n * row, Ctrl+Home and Ctrl+End to the first and last cell. The cell under the\n * pointer or the keyboard shows its tooltip. Each cell is named\n * `label, title: value`, so a screen reader reads what the tooltip says.\n */\nexport const HeatGrid = ({\n rows,\n columns,\n cells,\n cellHeight,\n ariaLabel,\n xTitle,\n yTitle,\n gap = GAP,\n cellRadius = RADIUS,\n columnWidth,\n labelsAbove = false,\n thinLabels = true,\n}: HeatGridProps) => {\n const frame = useRef<HTMLDivElement>(null);\n const longest = columns.reduce((a, b) => (b.length > a.length ? b : a), '');\n const { gridRef, probeRef, columnRef, stride: measured } = useLabelStride(longest, gap);\n const stride = thinLabels ? measured : 1;\n const byPosition = new Map(cells.map((cell) => [key(cell.row, cell.column), cell]));\n const cellsByRow = new Map<number, HeatCell[]>();\n for (const cell of cells) cellsByRow.set(cell.row, [...(cellsByRow.get(cell.row) ?? []), cell]);\n const inReadingOrder = [...cells].sort((a, b) => a.row - b.row || a.column - b.column);\n const [roving, setRoving] = useState<string>();\n // The cell that takes Tab: the last one focused, while it is still there.\n const first = inReadingOrder[0];\n const tabbable =\n roving && byPosition.has(roving) ? roving : first && key(first.row, first.column);\n const [hover, setHover] = useState<Tip>();\n const [focus, setFocus] = useState<Tip>();\n const tip = hover ?? focus;\n\n const tipFor = (cell: HeatCell, element: HTMLElement): Tip => {\n const host = (frame.current as HTMLElement).getBoundingClientRect();\n const box = element.getBoundingClientRect();\n const middle = box.left - host.left + box.width / 2;\n // The card hangs from the side of the cell nearest the middle of the grid,\n // so it never leaves the grid.\n const align =\n middle < host.width / 3 ? 'start' : middle > (2 * host.width) / 3 ? 'end' : 'center';\n return {\n cell,\n x: { start: box.left - host.left, center: middle, end: box.right - host.left }[align],\n top: box.top - host.top,\n bottom: box.bottom - host.top,\n align,\n // Not enough room above the cell for the card: it goes under.\n below: box.top - host.top < 90,\n };\n };\n\n const move = (event: KeyboardEvent<HTMLDivElement>) => {\n const origin = (event.target as HTMLElement).closest<HTMLElement>('[data-heat-cell]');\n if (!origin) return;\n const row = Number(origin.dataset.row);\n const column = Number(origin.dataset.column);\n // The next cell in a direction: empty slots are skipped, the edge stops.\n const step = (dRow: number, dColumn: number) => {\n for (\n let r = row + dRow, c = column + dColumn;\n r >= 0 && r < rows.length && c >= 0 && c < columns.length;\n r += dRow, c += dColumn\n ) {\n if (byPosition.has(key(r, c))) return key(r, c);\n }\n };\n const edge = (last: boolean) => {\n const pool = event.ctrlKey\n ? inReadingOrder\n : inReadingOrder.filter((cell) => cell.row === row);\n const cell = last ? pool.at(-1) : pool[0];\n return cell && key(cell.row, cell.column);\n };\n const targets: Record<string, () => string | undefined> = {\n ArrowRight: () => step(0, 1),\n ArrowLeft: () => step(0, -1),\n ArrowDown: () => step(1, 0),\n ArrowUp: () => step(-1, 0),\n Home: () => edge(false),\n End: () => edge(true),\n };\n const target = targets[event.key];\n if (!target) return;\n event.preventDefault();\n const next = target();\n if (next) gridRef.current?.querySelector<HTMLElement>(`[data-position=\"${next}\"]`)?.focus();\n };\n\n const focusIn = (cell: HeatCell, event: FocusEvent<HTMLElement>) => {\n setRoving(key(cell.row, cell.column));\n // A click focuses a cell too, and would leave its tooltip up: only the keyboard shows it.\n if (event.currentTarget.matches(':focus-visible')) {\n setFocus(tipFor(cell, event.currentTarget));\n }\n };\n const focusOut = (event: FocusEvent<HTMLDivElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget)) setFocus(undefined);\n };\n\n const rowOffset = yTitle ? 2 : 1;\n // The rows start under the labels when these sit above them.\n const top = labelsAbove ? 1 : 0;\n const labelsRow = labelsAbove ? 1 : rows.length + 1;\n const tipStyle: CSSProperties | undefined = tip && {\n position: 'absolute',\n left: tip.x,\n top: tip.below ? tip.bottom + TIP_GAP : tip.top - TIP_GAP,\n transform: `translate(${{ start: '0', center: '-50%', end: '-100%' }[tip.align]}, ${tip.below ? '0' : '-100%'})`,\n zIndex: 10,\n pointerEvents: 'none',\n };\n\n const grid = (\n <div\n ref={gridRef}\n role=\"grid\"\n aria-label={ariaLabel}\n onKeyDown={move}\n onBlur={focusOut}\n style={{\n display: 'grid',\n gridTemplateColumns: `${yTitle ? 'auto ' : ''}${columnWidth ? 'auto' : 'fit-content(40%)'} repeat(${columns.length}, ${columnWidth ? `${columnWidth}px` : 'minmax(0, 1fr)'})`,\n gridTemplateRows: `${labelsAbove ? 'auto ' : ''}repeat(${rows.length}, ${cellHeight ? `${cellHeight}px` : 'minmax(0, 1fr)'})${labelsAbove ? '' : ' auto'}${xTitle ? ' auto' : ''}`,\n gap,\n width: columnWidth ? 'max-content' : '100%',\n height: cellHeight ? undefined : '100%',\n fontSize: TEXT_SIZE,\n color: MUTED,\n }}\n >\n {yTitle && (\n <div\n aria-hidden\n style={{\n gridRow: `${1 + top} / ${rows.length + 1 + top}`,\n gridColumn: 1,\n writingMode: 'vertical-rl',\n transform: 'rotate(180deg)',\n textAlign: 'center',\n alignSelf: 'center',\n }}\n >\n {yTitle}\n </div>\n )}\n {rows.map((name, r) => (\n <div key={r} role=\"row\" style={{ display: 'contents' }}>\n <div\n aria-hidden\n data-heat-row=\"\"\n style={{\n gridRow: r + 1 + top,\n gridColumn: rowOffset,\n alignSelf: 'center',\n paddingRight: '0.5rem',\n // Stays in view when the grid scrolls sideways under it.\n ...(columnWidth ? { position: 'sticky', left: 0, zIndex: 2, background: PANEL } : {}),\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </div>\n {(cellsByRow.get(r) ?? []).map((cell) => {\n const position = key(cell.row, cell.column);\n const active = tip?.cell === cell;\n return (\n <div\n key={position}\n role=\"gridcell\"\n data-heat-cell=\"\"\n data-position={position}\n data-row={cell.row}\n data-column={cell.column}\n tabIndex={position === tabbable ? 0 : -1}\n aria-label={`${cell.label ? `${cell.label}, ` : ''}${cell.title}: ${cell.value}`}\n onFocus={(event) => focusIn(cell, event)}\n onMouseEnter={(event) => setHover(tipFor(cell, event.currentTarget))}\n onMouseLeave={() => setHover(undefined)}\n style={{\n gridRow: r + 1 + top,\n gridColumn: cell.column + rowOffset + 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minWidth: 0,\n overflow: 'hidden',\n borderRadius: cellRadius,\n background: cell.color,\n color: textOn(cell.color),\n fontSize: 'var(--text-2xs, 0.6875rem)',\n fontWeight: 500,\n lineHeight: 1,\n whiteSpace: 'nowrap',\n // The same ring for the pointer and the keyboard, in the text color\n // since an accent ring would vanish on the cells that are the accent.\n outline: active ? `2px solid ${TEXT}` : 'none',\n zIndex: active ? 1 : undefined,\n }}\n >\n {cell.text}\n </div>\n );\n })}\n </div>\n ))}\n {columns.map((name, c) => (\n <div\n key={c}\n ref={c === 0 ? columnRef : undefined}\n aria-hidden\n data-heat-column=\"\"\n style={{\n gridRow: labelsRow,\n gridColumn: c + rowOffset + 1,\n display: 'flex',\n justifyContent: thinLabels ? 'center' : 'flex-start',\n whiteSpace: 'nowrap',\n minWidth: 0,\n }}\n >\n {c % stride === 0 ? name : null}\n </div>\n ))}\n {xTitle && (\n <div\n aria-hidden\n style={{\n gridRow: (labelsAbove ? rows.length + 1 : labelsRow) + 1,\n gridColumn: `${rowOffset + 1} / -1`,\n textAlign: 'center',\n }}\n >\n {xTitle}\n </div>\n )}\n <span\n ref={probeRef}\n aria-hidden\n style={{ position: 'absolute', visibility: 'hidden', whiteSpace: 'nowrap' }}\n >\n {longest}\n </span>\n </div>\n );\n\n return (\n <div ref={frame} style={{ position: 'relative', width: '100%', height: '100%', minWidth: 0 }}>\n {columnWidth ? (\n // The padding leaves room for the focus outline of the cells at the edges,\n // which the scrolling box would cut.\n <div data-heat-scroll=\"\" style={{ overflowX: 'auto', padding: 3 }}>\n {grid}\n </div>\n ) : (\n grid\n )}\n {tip && tipStyle && (\n <div data-heat-tooltip=\"\" aria-hidden style={tipStyle}>\n <TooltipCard\n title={tip.cell.title}\n rows={[{ name: tip.cell.label, value: tip.cell.value, color: tip.cell.color }]}\n />\n </div>\n )}\n </div>\n );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkG4WOPX4D_cjs = require('./chunk-G4WOPX4D.cjs');
|
|
5
5
|
|
|
6
6
|
// src/core/categoryAxis.ts
|
|
7
7
|
var MAX_CHARS = 14;
|
|
@@ -18,7 +18,7 @@ var categoryAxis = (categories, title) => {
|
|
|
18
18
|
...tilted ? {
|
|
19
19
|
interval: 0,
|
|
20
20
|
angle: -40,
|
|
21
|
-
tick: { ...
|
|
21
|
+
tick: { ...chunkG4WOPX4D_cjs.AXIS.tick, textAnchor: "end" },
|
|
22
22
|
height: base + Math.round(Math.min(longest, MAX_CHARS) * 4.2)
|
|
23
23
|
} : {}
|
|
24
24
|
};
|
|
@@ -26,5 +26,5 @@ var categoryAxis = (categories, title) => {
|
|
|
26
26
|
|
|
27
27
|
exports.categoryAxis = categoryAxis;
|
|
28
28
|
exports.trimLabel = trimLabel;
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-XMFBVMW7.cjs.map
|
|
30
|
+
//# sourceMappingURL=chunk-XMFBVMW7.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/categoryAxis.ts"],"names":["AXIS"],"mappings":";;;;;;AAEA,IAAM,SAAA,GAAY,EAAA;AAGX,IAAM,SAAA,GAAY,CAAC,KAAA,KAA2B;AACnD,EAAA,MAAM,IAAA,GAAO,OAAO,KAAK,CAAA;AACzB,EAAA,OAAO,IAAA,CAAK,MAAA,GAAS,SAAA,GAAY,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,EAAG,SAAA,GAAY,CAAC,CAAC,CAAA,MAAA,CAAA,GAAM,IAAA;AACxE;AAOO,IAAM,YAAA,GAAe,CAAC,UAAA,EAA0C,KAAA,KAAmB;AACxF,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,GAAG,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,CAAE,MAAM,CAAC,CAAA;AACtE,EAAA,MAAM,MAAA,GAAS,UAAA,CAAW,MAAA,GAAS,CAAA,IAAK,OAAA,GAAU,CAAA;AAClD,EAAA,MAAM,IAAA,GAAO,QAAQ,EAAA,GAAK,EAAA;AAC1B,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,SAAA;AAAA,IACf,GAAI,MAAA,GACA;AAAA,MACE,QAAA,EAAU,CAAA;AAAA,MACV,KAAA,EAAO,GAAA;AAAA,MACP,MAAM,EAAE,GAAGA,sBAAA,CAAK,IAAA,EAAM,YAAY,KAAA,EAAM;AAAA,MACxC,MAAA,EAAQ,OAAO,IAAA,CAAK,KAAA,CAAM,KAAK,GAAA,CAAI,OAAA,EAAS,SAAS,CAAA,GAAI,GAAG;AAAA,QAE9D;AAAC,GACP;AACF","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/core/categoryAxis.ts"],"names":["AXIS"],"mappings":";;;;;;AAEA,IAAM,SAAA,GAAY,EAAA;AAGX,IAAM,SAAA,GAAY,CAAC,KAAA,KAA2B;AACnD,EAAA,MAAM,IAAA,GAAO,OAAO,KAAK,CAAA;AACzB,EAAA,OAAO,IAAA,CAAK,MAAA,GAAS,SAAA,GAAY,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,EAAG,SAAA,GAAY,CAAC,CAAC,CAAA,MAAA,CAAA,GAAM,IAAA;AACxE;AAOO,IAAM,YAAA,GAAe,CAAC,UAAA,EAA0C,KAAA,KAAmB;AACxF,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,GAAG,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,CAAE,MAAM,CAAC,CAAA;AACtE,EAAA,MAAM,MAAA,GAAS,UAAA,CAAW,MAAA,GAAS,CAAA,IAAK,OAAA,GAAU,CAAA;AAClD,EAAA,MAAM,IAAA,GAAO,QAAQ,EAAA,GAAK,EAAA;AAC1B,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,SAAA;AAAA,IACf,GAAI,MAAA,GACA;AAAA,MACE,QAAA,EAAU,CAAA;AAAA,MACV,KAAA,EAAO,GAAA;AAAA,MACP,MAAM,EAAE,GAAGA,sBAAA,CAAK,IAAA,EAAM,YAAY,KAAA,EAAM;AAAA,MACxC,MAAA,EAAQ,OAAO,IAAA,CAAK,KAAA,CAAM,KAAK,GAAA,CAAI,OAAA,EAAS,SAAS,CAAA,GAAI,GAAG;AAAA,QAE9D;AAAC,GACP;AACF","file":"chunk-XMFBVMW7.cjs","sourcesContent":["import { AXIS } from './axes';\n\nconst MAX_CHARS = 14;\n\n/** A category name cut short with an ellipsis; the tooltip keeps the full name. */\nexport const trimLabel = (value: string | number) => {\n const text = String(value);\n return text.length > MAX_CHARS ? `${text.slice(0, MAX_CHARS - 1)}…` : text;\n};\n\n/**\n * The props of a horizontal category `XAxis` that keeps its labels readable:\n * names that would not fit side by side are tilted and cut short, and every one\n * is kept (Recharts would otherwise skip the ones that overlap).\n */\nexport const categoryAxis = (categories: readonly (string | number)[], title?: string) => {\n const longest = Math.max(0, ...categories.map((c) => String(c).length));\n const tilted = categories.length > 6 && longest > 8;\n const base = title ? 52 : 30;\n return {\n tickFormatter: trimLabel,\n ...(tilted\n ? {\n interval: 0,\n angle: -40,\n tick: { ...AXIS.tick, textAnchor: 'end' },\n height: base + Math.round(Math.min(longest, MAX_CHARS) * 4.2),\n }\n : {}),\n } as const;\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkG4WOPX4D_cjs = require('./chunk-G4WOPX4D.cjs');
|
|
5
5
|
var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
|
|
6
6
|
var recharts = require('recharts');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -13,7 +13,7 @@ var labelOf = (value, position) => ({
|
|
|
13
13
|
position,
|
|
14
14
|
className: "recharts-reference-label",
|
|
15
15
|
fill: chunkLT3UC65O_cjs.MUTED,
|
|
16
|
-
style: { fontSize:
|
|
16
|
+
style: { fontSize: chunkG4WOPX4D_cjs.TEXT_SIZE }
|
|
17
17
|
});
|
|
18
18
|
var referenceMarks = ({
|
|
19
19
|
referenceLines = [],
|
|
@@ -56,5 +56,5 @@ var referenceMarks = ({
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
exports.referenceMarks = referenceMarks;
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-XUGQ6VXO.cjs.map
|
|
60
|
+
//# sourceMappingURL=chunk-XUGQ6VXO.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,MAACG,sBAAA;AAAA,MAAA;AAAA,QAEE,GAAG,EAAE,CAAC,IAAI,GAAG,KAAK,KAAA,EAAM;AAAA,QACxB,GAAG,MAAA;AAAA,QACJ,MAAA,EAAQD,+BAAA,CAAc,IAAA,CAAK,MAAA,IAAU,SAAS,CAAA;AAAA,QAC9C,WAAA,EAAa,GAAA;AAAA,QACb,eAAA,EAAiB,IAAA,CAAK,MAAA,GAAS,IAAA,GAAO,MAAA;AAAA,QACtC,UAAA,EAAW,cAAA;AAAA,QACX,OAAO,IAAA,CAAK,KAAA,GAAQ,QAAQ,IAAA,CAAK,KAAA,EAAO,gBAAgB,CAAA,GAAI;AAAA,OAAA;AAAA,MAPvD,QAAQ,CAAC,CAAA;AAAA,KASjB;AAAA,GACH;AACF","file":"chunk-XUGQ6VXO.cjs","sourcesContent":["import { ReferenceArea, ReferenceLine } from 'recharts';\nimport type { ChartReferenceProps } from '../types';\nimport { TEXT_SIZE } from './axes';\nimport { INTENT_COLORS, MUTED } from './colors';\n\ntype ReferenceOptions = ChartReferenceProps & {\n /** The axis the values are read on: `y` (default), or `x` on a chart of horizontal bars. */\n axis?: 'x' | 'y';\n /** The id of that axis, when the chart has several. */\n axisId?: string;\n};\n\nconst DASH = '6 4';\n// Behind the series (an area is at 100, a bar at 300) and above the grid.\nconst BAND_LAYER = 50;\n\n// Plain SVG text in the muted color: an amber or red label would not read on\n// the card in every theme, so the line and the band carry the intent.\nconst labelOf = (value: string, position: 'insideTopRight' | 'insideTopLeft') => ({\n value,\n position,\n className: 'recharts-reference-label',\n fill: MUTED,\n style: { fontSize: TEXT_SIZE },\n});\n\n/**\n * The `ReferenceArea`s then the `ReferenceLine`s of a chart's `referenceBands`\n * and `referenceLines`, to render inside it, before `children`. A mark outside\n * the data makes the axis reach it (`ifOverflow=\"extendDomain\"`) instead of\n * vanishing. Colors come from `INTENT_COLORS`, so a theme switch repaints\n * them; labels are text, not markup.\n */\nexport const referenceMarks = ({\n referenceLines = [],\n referenceBands = [],\n axis = 'y',\n axisId,\n}: ReferenceOptions) => {\n const onAxis = axisId === undefined ? {} : { [`${axis}AxisId`]: axisId };\n return [\n ...referenceBands.map((band, i) => {\n const [low, high] = [Math.min(band.from, band.to), Math.max(band.from, band.to)];\n return (\n <ReferenceArea\n key={`band-${i}`}\n {...{ [`${axis}1`]: low, [`${axis}2`]: high }}\n {...onAxis}\n fill={INTENT_COLORS[band.intent ?? 'neutral']}\n fillOpacity={0.14}\n ifOverflow=\"extendDomain\"\n zIndex={BAND_LAYER}\n label={band.label ? labelOf(band.label, 'insideTopLeft') : undefined}\n />\n );\n }),\n ...referenceLines.map((line, i) => (\n <ReferenceLine\n key={`line-${i}`}\n {...{ [axis]: line.value }}\n {...onAxis}\n stroke={INTENT_COLORS[line.intent ?? 'neutral']}\n strokeWidth={1.5}\n strokeDasharray={line.dashed ? DASH : undefined}\n ifOverflow=\"extendDomain\"\n label={line.label ? labelOf(line.label, 'insideTopRight') : undefined}\n />\n )),\n ];\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { AXIS } from './chunk-
|
|
2
|
+
import { AXIS } from './chunk-DI2FBGKM.js';
|
|
3
3
|
|
|
4
4
|
// src/core/categoryAxis.ts
|
|
5
5
|
var MAX_CHARS = 14;
|
|
@@ -23,5 +23,5 @@ var categoryAxis = (categories, title) => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export { categoryAxis, trimLabel };
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-YMRNTIOK.js.map
|
|
27
|
+
//# sourceMappingURL=chunk-YMRNTIOK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/categoryAxis.ts"],"names":[],"mappings":";;;;AAEA,IAAM,SAAA,GAAY,EAAA;AAGX,IAAM,SAAA,GAAY,CAAC,KAAA,KAA2B;AACnD,EAAA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IAAA;AACxE;AAOO,IAAM,YAAA,GAAe,CAAC,UAAA,EAA0C,KAAA,KAAmB;AACxF,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,GAAG,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,CAAE,MAAM,CAAC,CAAA;AACtE,EAAA,MAAM,MAAA,GAAS,UAAA,CAAW,MAAA,GAAS,CAAA,IAAK,OAAA,GAAU,CAAA;AAClD,EAAA,MAAM,IAAA,GAAO,QAAQ,EAAA,GAAK,EAAA;AAC1B,EAAA,OAAO;AAAA,IACL,aAAA,EAAe,SAAA;AAAA,IACf,GAAI,MAAA,GACA;AAAA,MACE,QAAA,EAAU,CAAA;AAAA,MACV,KAAA,EAAO,GAAA;AAAA,MACP,MAAM,EAAE,GAAG,IAAA,CAAK,IAAA,EAAM,YAAY,KAAA,EAAM;AAAA,MACxC,MAAA,EAAQ,OAAO,IAAA,CAAK,KAAA,CAAM,KAAK,GAAA,CAAI,OAAA,EAAS,SAAS,CAAA,GAAI,GAAG;AAAA,QAE9D;AAAC,GACP;AACF","file":"chunk-YMRNTIOK.js","sourcesContent":["import { AXIS } from './axes';\n\nconst MAX_CHARS = 14;\n\n/** A category name cut short with an ellipsis; the tooltip keeps the full name. */\nexport const trimLabel = (value: string | number) => {\n const text = String(value);\n return text.length > MAX_CHARS ? `${text.slice(0, MAX_CHARS - 1)}…` : text;\n};\n\n/**\n * The props of a horizontal category `XAxis` that keeps its labels readable:\n * names that would not fit side by side are tilted and cut short, and every one\n * is kept (Recharts would otherwise skip the ones that overlap).\n */\nexport const categoryAxis = (categories: readonly (string | number)[], title?: string) => {\n const longest = Math.max(0, ...categories.map((c) => String(c).length));\n const tilted = categories.length > 6 && longest > 8;\n const base = title ? 52 : 30;\n return {\n tickFormatter: trimLabel,\n ...(tilted\n ? {\n interval: 0,\n angle: -40,\n tick: { ...AXIS.tick, textAnchor: 'end' },\n height: base + Math.round(Math.min(longest, MAX_CHARS) * 4.2),\n }\n : {}),\n } as const;\n};\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkDBZQI4HM_cjs = require('./chunk-DBZQI4HM.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkG4WOPX4D_cjs = require('./chunk-G4WOPX4D.cjs');
|
|
6
6
|
var chunkT3K6Q34U_cjs = require('./chunk-T3K6Q34U.cjs');
|
|
7
7
|
var chunkLT3UC65O_cjs = require('./chunk-LT3UC65O.cjs');
|
|
8
8
|
var react = require('react');
|
|
@@ -138,7 +138,7 @@ var HeatGrid = ({
|
|
|
138
138
|
gap,
|
|
139
139
|
width: columnWidth ? "max-content" : "100%",
|
|
140
140
|
height: cellHeight ? void 0 : "100%",
|
|
141
|
-
fontSize:
|
|
141
|
+
fontSize: chunkG4WOPX4D_cjs.TEXT_SIZE,
|
|
142
142
|
color: chunkLT3UC65O_cjs.MUTED
|
|
143
143
|
},
|
|
144
144
|
children: [
|
|
@@ -278,5 +278,5 @@ var HeatGrid = ({
|
|
|
278
278
|
};
|
|
279
279
|
|
|
280
280
|
exports.HeatGrid = HeatGrid;
|
|
281
|
-
//# sourceMappingURL=chunk-
|
|
282
|
-
//# sourceMappingURL=chunk-
|
|
281
|
+
//# sourceMappingURL=chunk-ZWHCUYIN.cjs.map
|
|
282
|
+
//# sourceMappingURL=chunk-ZWHCUYIN.cjs.map
|