@panneau/ui 5.0.0-alpha.39 → 5.0.0-alpha.41
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/README.md +4 -1
- package/dist/chart-legend/ChartLegend.css +73 -0
- package/dist/chart-legend/ChartLegend.d.ts +32 -0
- package/dist/chart-legend/ChartLegend.d.ts.map +1 -0
- package/dist/chart-legend/ChartLegend.js +76 -0
- package/dist/chart-legend/ChartLegend.js.map +1 -0
- package/dist/chart-legend/ChartLegend.module.js +26 -0
- package/dist/chart-legend/ChartLegend.module.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/line-chart/LineChart.css +31 -0
- package/dist/line-chart/LineChart.d.ts +24 -1
- package/dist/line-chart/LineChart.d.ts.map +1 -1
- package/dist/line-chart/LineChart.js +517 -533
- package/dist/line-chart/LineChart.js.map +1 -1
- package/dist/line-chart/LineChart.module.js +9 -1
- package/dist/line-chart/LineChart.module.js.map +1 -1
- package/dist/sparkline/Sparkline.css +44 -0
- package/dist/sparkline/Sparkline.d.ts +23 -0
- package/dist/sparkline/Sparkline.d.ts.map +1 -0
- package/dist/sparkline/Sparkline.js +164 -0
- package/dist/sparkline/Sparkline.js.map +1 -0
- package/dist/sparkline/Sparkline.module.js +20 -0
- package/dist/sparkline/Sparkline.module.js.map +1 -0
- package/dist/sparkline/tokens.d.ts +3 -0
- package/dist/sparkline/tokens.d.ts.map +1 -0
- package/dist/sparkline/tokens.js +17 -0
- package/dist/sparkline/tokens.js.map +1 -0
- package/dist/stat/Stat.css +30 -0
- package/dist/stat/Stat.d.ts +15 -1
- package/dist/stat/Stat.d.ts.map +1 -1
- package/dist/stat/Stat.js +48 -33
- package/dist/stat/Stat.js.map +1 -1
- package/dist/stat/Stat.module.js +9 -1
- package/dist/stat/Stat.module.js.map +1 -1
- package/dist/theme/components.d.ts +1 -0
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +2 -0
- package/dist/theme/components.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.js","names":["CSSProperties","KeyboardEvent","PointerEvent","useId","useState","messages","usePanneauIntl","Skeleton","chartColors","cx","styles","PlotPoint","axisLabelIndices","linearPath","monotonePath","niceScale","LineChartPoint","label","shortLabel","value","LineChartProps","points","formatValue","formatTick","axisLabel","showAxis","showLast","showMax","isInteractive","domain","min","max","curve","height","color","className","MAX_AXIS_LABELS","LABEL_GAP","LineChart","t0","$","_c","t1","t2","t3","t4","t5","t6","undefined","intl","t7","t8","t9","Symbol","for","replace","gradientId","active","setActive","formatNumber","format","t10","categorical","t11","t12","style","t13","chart","t14","t15","skeleton","t16","lastIndex","plotted","t17","t18","t19","t20","t21","t22","t23","t24","t25","t26","t27","t28","t29","t30","t31","values","map","_temp","scale","Math","tick","value_0","notation","y","value_1","t32","length","point_0","index","x","point","line","zero","firstPoint","lastPoint","maxValue","maxIndex","indexOf","maxPoint","labelLast","labelMax","activePoint","activeData","_temp2","t33","point_2","formatMessage","chartPoint","describe","t34","event","rect","currentTarget","getBoundingClientRect","width","ratio","clientX","left","round","point_3","t35","event_0","current","next","key","preventDefault","move","focused","t36","role","tabIndex","const","onPointerMove","onPointerDown","onPointerLeave","onFocus","current_0","onBlur","onKeyDown","interaction","widestTick","ticks","reduce","_temp3","t37","index_0","previous","current_1","placement","t38","index_1","where","placedAt","data","valueLabel","positionOf","body","widest","value_2","top","plot","t39","t40","areaTop","areaBottom","t41","t42","value_3","grid","t43","baseline","t44","reveal","area","svg","crosshair","marks","dot","activeDot","tooltip","tooltipValue","tooltipLabel","index_2","minor","data_0","where_0","date","dates","data_1","index_3","visuallyHidden","text","point_1","_c","styles","_Fragment"],"sources":["../../src/line-chart/LineChart.tsx"],"sourcesContent":["import { type CSSProperties, type KeyboardEvent, type PointerEvent, useId, useState } from 'react';\n\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { chartColors } from '../theme/chartColors';\nimport { cx } from '../utils/cx';\nimport styles from './LineChart.module.css';\nimport { type PlotPoint, axisLabelIndices, linearPath, monotonePath, niceScale } from './geometry';\n\n/** A point of a `LineChart`. */\nexport interface LineChartPoint {\n /** What the point is, in its table and its tooltip: a day, a week, a month. */\n label: string;\n /** A shorter label, under the chart: `Oct 5`. The `label` by default. */\n shortLabel?: string | undefined;\n value: number;\n}\n\nexport interface LineChartProps {\n /** What the chart shows: the caption of its table, for assistive technologies. */\n label: string;\n /** The points, in order. Left `undefined` while they load: a skeleton of the plot. */\n points?: LineChartPoint[] | undefined;\n /** Formats a value: in the table, the labels on the line and the tooltip. A number of the locale by default. */\n formatValue?: ((value: number) => string) | undefined;\n /**\n * Formats a graduation of the scale, short: `1 min`, `25 %`. A number of the locale by default,\n * compact (`10K`) on a scale that reaches 10,000.\n */\n formatTick?: ((value: number) => string) | undefined;\n /** What the values are, above the scale: `Entries`, `Minutes`. */\n axisLabel?: string | undefined;\n /**\n * Shows the scale: round graduations, with a line across the plot for each. Without it, a line\n * at 0 alone, for a chart that only shows a trend. `true` by default.\n */\n showAxis?: boolean | undefined;\n /** Writes the last value at the end of the line. `true` by default. */\n showLast?: boolean | undefined;\n /** Marks the highest value on the line, with its value. */\n showMax?: boolean | undefined;\n /**\n * Shows the value of the point under the pointer, or chosen with the arrow keys: for a long\n * series, where a point can't be read from the scale. Off by default: the values a chart needs\n * are on it, and every one is in its table.\n */\n isInteractive?: boolean | undefined;\n /**\n * Fixes the bounds of the scale: `{ min: 0, max: 1 }` for a ratio. From 0, or the lowest value\n * under it, to a round value above the highest by default.\n */\n domain?: { min?: number | undefined; max?: number | undefined } | undefined;\n /** `monotone` (default) curves through the points without going past them, `linear` joins them straight. */\n curve?: 'monotone' | 'linear' | undefined;\n /** Height of the plot, without the labels: `'10rem'`. Defaults to the `height` token. */\n height?: string | undefined;\n /** The categorical color of the line, from 0. Defaults to the first. */\n color?: number | undefined;\n className?: string | undefined;\n}\n\n/** At most this number of labels under the chart, half of them when it is narrow. */\nconst MAX_AXIS_LABELS = 7;\n\n/** Closer than this (in percents of the width), the highest value isn't labeled beside the last one. */\nconst LABEL_GAP = 12;\n\n/**\n * A line of values over time, on the categorical chart colors of the theme: a curve and the area\n * under it, a scale of round graduations, labels of dates under it, and the last value at the end\n * of the line. The plot is hidden from assistive technologies, which read the values in a table;\n * with `isInteractive`, the pointer and the arrow keys also show the value of each point.\n */\nexport function LineChart({\n label,\n points,\n formatValue,\n formatTick,\n axisLabel,\n showAxis = true,\n showLast = true,\n showMax = false,\n isInteractive = false,\n domain,\n curve = 'monotone',\n height,\n color = 0,\n className,\n}: LineChartProps) {\n const intl = usePanneauIntl();\n const gradientId = `panneau-line-chart-${useId().replace(/[^\\w-]/g, '')}`;\n const [active, setActive] = useState<number | null>(null);\n const format = formatValue ?? ((value: number) => intl.formatNumber(value));\n const style = {\n '--_panneau-line-chart-color': chartColors.categorical(color),\n ...(height !== undefined ? { '--_panneau-line-chart-height': height } : {}),\n } as CSSProperties;\n if (points === undefined) {\n return (\n <div className={cx('panneau-line-chart', styles.chart, className)} style={style}>\n <div className={styles.skeleton}>\n <Skeleton shape=\"rect\" height=\"100%\" />\n </div>\n <Skeleton width=\"100%\" />\n </div>\n );\n }\n\n const values = points.map((point) => point.value);\n const scale = niceScale(Math.min(...values, 0), Math.max(...values, 0), domain);\n const tick =\n formatTick ??\n ((value: number) =>\n intl.formatNumber(value, scale.max >= 10_000 ? { notation: 'compact' } : {}));\n const y = (value: number) => 100 - ((value - scale.min) / (scale.max - scale.min)) * 100;\n const plotted: PlotPoint[] = points.map((point, index) => ({\n x: points.length === 1 ? 50 : (index / (points.length - 1)) * 100,\n y: y(point.value),\n }));\n const line = curve === 'linear' ? linearPath(plotted) : monotonePath(plotted);\n const zero = y(Math.min(Math.max(0, scale.min), scale.max));\n const firstPoint = plotted[0];\n const lastIndex = points.length - 1;\n const lastPoint = plotted[lastIndex];\n const maxValue = Math.max(...values);\n const maxIndex = values.indexOf(maxValue);\n const maxPoint = plotted[maxIndex];\n const labelLast = showLast && lastPoint !== undefined;\n const labelMax =\n showMax &&\n maxPoint !== undefined &&\n maxValue > scale.min &&\n !(labelLast && lastPoint.x - maxPoint.x < LABEL_GAP);\n const activePoint = active !== null ? plotted[active] : undefined;\n const activeData = active !== null ? points[active] : undefined;\n const shortLabel = (point: LineChartPoint) => point.shortLabel ?? point.label;\n const describe = (point: LineChartPoint) =>\n intl.formatMessage(messages.chartPoint, { label: point.label, value: format(point.value) });\n\n // The point under the pointer: the nearest one along the width of the plot\n const point = (event: PointerEvent<HTMLDivElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n if (rect.width > 0 && points.length > 0) {\n const ratio = Math.min(Math.max((event.clientX - rect.left) / rect.width, 0), 1);\n setActive(Math.round(ratio * lastIndex));\n }\n };\n const move = (event: KeyboardEvent<HTMLDivElement>) => {\n const current = active ?? lastIndex;\n const next =\n event.key === 'ArrowLeft' || event.key === 'ArrowDown'\n ? current - 1\n : event.key === 'ArrowRight' || event.key === 'ArrowUp'\n ? current + 1\n : event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? lastIndex\n : null;\n if (next !== null) {\n event.preventDefault();\n setActive(Math.min(Math.max(next, 0), lastIndex));\n }\n };\n const focused = points[active ?? lastIndex];\n const interaction =\n isInteractive && focused !== undefined\n ? {\n role: 'slider',\n tabIndex: 0,\n 'aria-label': label,\n 'aria-orientation': 'horizontal' as const,\n 'aria-valuemin': 0,\n 'aria-valuemax': lastIndex,\n 'aria-valuenow': active ?? lastIndex,\n 'aria-valuetext': describe(focused),\n onPointerMove: point,\n onPointerDown: point,\n onPointerLeave: () => setActive(null),\n onFocus: () => setActive((current) => current ?? lastIndex),\n onBlur: () => setActive(null),\n onKeyDown: move,\n }\n : {};\n\n const widestTick = scale.ticks\n .map(tick)\n .reduce((widest, text) => (text.length > widest.length ? text : widest), '');\n const placement = (index: number): 'above' | 'below' => {\n const previous = points[index - 1];\n const current = points[index];\n return previous !== undefined && current !== undefined && previous.value > current.value\n ? 'below'\n : 'above';\n };\n const valueLabel = (index: number, where: PlotPoint, placedAt: 'above' | 'below') => {\n const data = points[index];\n return data !== undefined ? (\n <span className={styles.valueLabel} data-placement={placedAt} style={positionOf(where)}>\n {format(data.value)}\n </span>\n ) : null;\n };\n\n return (\n <figure\n className={cx('panneau-line-chart', styles.chart, className)}\n style={style}\n data-axis={showAxis ? '' : undefined}\n data-labels={labelLast || labelMax ? '' : undefined}\n >\n {axisLabel !== undefined ? (\n <div className={styles.axisLabel} aria-hidden=\"true\">\n {axisLabel}\n </div>\n ) : null}\n <div className={styles.body}>\n {showAxis ? (\n <div className={styles.scale} aria-hidden=\"true\">\n {/* The widest graduation gives the width of the column */}\n <span className={styles.widest}>{widestTick}</span>\n {scale.ticks.map((value) => (\n <span\n key={value}\n className={styles.tick}\n style={{ top: `${y(value)}%` }}\n >\n {tick(value)}\n </span>\n ))}\n </div>\n ) : null}\n <div className={styles.plot} {...interaction}>\n <svg\n className={styles.svg}\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0\" className={styles.areaTop} />\n <stop offset=\"1\" className={styles.areaBottom} />\n </linearGradient>\n </defs>\n {showAxis\n ? scale.ticks.map((value) => (\n <line\n key={value}\n className={styles.grid}\n x1=\"0\"\n x2=\"100\"\n y1={y(value)}\n y2={y(value)}\n />\n ))\n : null}\n <line className={styles.baseline} x1=\"0\" x2=\"100\" y1={zero} y2={zero} />\n {firstPoint !== undefined &&\n lastPoint !== undefined &&\n points.length > 1 ? (\n <g className={styles.reveal}>\n <path\n className={styles.area}\n fill={`url(#${gradientId})`}\n d={`${line} L${lastPoint.x},${zero} L${firstPoint.x},${zero} Z`}\n />\n <path className={styles.line} d={line} />\n </g>\n ) : null}\n </svg>\n {activePoint !== undefined ? (\n <span\n className={styles.crosshair}\n style={{ left: `${activePoint.x}%` }}\n aria-hidden=\"true\"\n />\n ) : null}\n <div className={styles.marks} aria-hidden=\"true\">\n {points.length === 1 && firstPoint !== undefined && !labelLast ? (\n <span className={styles.dot} style={positionOf(firstPoint)} />\n ) : null}\n {labelMax && maxPoint !== undefined ? (\n <span className={styles.dot} style={positionOf(maxPoint)} />\n ) : null}\n {labelLast && lastPoint !== undefined ? (\n <span className={styles.dot} style={positionOf(lastPoint)} />\n ) : null}\n {activePoint === undefined && labelMax && maxPoint !== undefined\n ? valueLabel(maxIndex, maxPoint, 'above')\n : null}\n {activePoint === undefined && labelLast && lastPoint !== undefined\n ? valueLabel(lastIndex, lastPoint, placement(lastIndex))\n : null}\n {activePoint !== undefined && activeData !== undefined ? (\n <>\n <span\n className={cx(styles.dot, styles.activeDot)}\n style={positionOf(activePoint)}\n />\n <span\n className={styles.tooltip}\n data-placement={activePoint.y < 30 ? 'below' : 'above'}\n style={positionOf(activePoint)}\n >\n <strong className={styles.tooltipValue}>\n {format(activeData.value)}\n </strong>\n <span className={styles.tooltipLabel}>{activeData.label}</span>\n </span>\n </>\n ) : null}\n </div>\n </div>\n <div className={styles.dates} aria-hidden=\"true\">\n {axisLabelIndices(points.length, MAX_AXIS_LABELS).map(({ index, minor }) => {\n const data = points[index];\n const where = plotted[index];\n return data !== undefined && where !== undefined ? (\n <span\n key={index}\n className={cx(styles.date, minor && styles.minor)}\n data-edge={\n points.length === 1\n ? undefined\n : index === 0\n ? 'start'\n : index === lastIndex\n ? 'end'\n : undefined\n }\n style={{ left: `${where.x}%` }}\n >\n {shortLabel(data)}\n </span>\n ) : null;\n })}\n </div>\n </div>\n {/* Hidden in a wrapper: on the table itself, Chrome leaves its caption visible */}\n <div className={styles.visuallyHidden}>\n <table>\n <caption>{label}</caption>\n <tbody>\n {points.map((data, index) => (\n <tr key={index}>\n <th scope=\"row\">{data.label}</th>\n <td>{format(data.value)}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </figure>\n );\n}\n\n/** The position of a mark on the plot, and its place along the width, to keep its label inside. */\nfunction positionOf(where: PlotPoint): CSSProperties {\n return { left: `${where.x}%`, top: `${where.y}%`, '--_x': where.x } as CSSProperties;\n}\n"],"mappings":";;;;;;;;;;;;AA+DA,IAAMoC,kBAAkB;;AAGxB,IAAMC,YAAY;;;;;;;AAQlB,SAAOC,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAmB,MAAA,EAAAxB,OAAAI,QAAAC,aAAAC,YAAAC,WAAAC,UAAAiB,IAAAhB,UAAAiB,IAAAhB,SAAAiB,IAAAhB,eAAAiB,IAAAhB,QAAAG,OAAAc,IAAAb,QAAAC,OAAAa,IAAAZ,cAAAI;CAMtB,MAAAd,WAAAiB,OAAAM,KAAAA,IAAA,OAAAN;CACA,MAAAhB,WAAAiB,OAAAK,KAAAA,IAAA,OAAAL;CACA,MAAAhB,UAAAiB,OAAAI,KAAAA,IAAA,QAAAJ;CACA,MAAAhB,gBAAAiB,OAAAG,KAAAA,IAAA,QAAAH;CAEA,MAAAb,QAAAc,OAAAE,KAAAA,IAAA,aAAAF;CAEA,MAAAZ,QAAAa,OAAAC,KAAAA,IAAA,IAAAD;CAGA,MAAAE,OAAa3C,eAAe;CACa,MAAA4C,KAAA/C,MAAM;CAAC,IAAAgD;CAAA,IAAAX,EAAA,OAAAU,IAAA;EAAA,IAAAE;EAAA,IAAAZ,EAAA,OAAAa,OAAAC,IAAA,2BAAA,GAAA;GAASF,KAAA;GAASZ,EAAA,KAAAY;EAAA,OAAAA,KAAAZ,EAAA;EAAzBW,KAAAD,GAAOK,QAASH,IAAW,EAAE;EAACZ,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAvE,MAAAgB,aAAmB,sBAAsBL;CACzC,MAAA,CAAAM,QAAAC,aAA4BtD,SA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AAvI,EAAA,OAAAwI;CAAA,OAAAA,MAAAxI,EAAA;CAAA,IAAA2I;CAAA,IAAA3I,EAAA,SAAA4C,OAAA5C,EAAA,SAAA6C,OAAA7C,EAAA,SAAA8C,OAAA9C,EAAA,SAAA+C,OAAA/C,EAAA,SAAAgD,OAAAhD,EAAA,SAAAsG,OAAAtG,EAAA,SAAAwI,KAAA;EApJVG,MAAA,qBAAA,UAAA;GACe,WAAA/F;GACJnB,OAAAA;GACI,aAAAqB;GACE,eAAAC;GAJjB,UAAA;IAMKC;IAKDsD;IA6HAkC;GAaK;;EAAAxI,EAAA,OAAA4C;EAAA5C,EAAA,OAAA6C;EAAA7C,EAAA,OAAA8C;EAAA9C,EAAA,OAAA+C;EAAA/C,EAAA,OAAAgD;EAAAhD,EAAA,OAAAsG;EAAAtG,EAAA,OAAAwI;EAAAxI,EAAA,OAAA2I;CAAA,OAAAA,MAAA3I,EAAA;CAAA,OArJT2I;AAqJS;;AAzRV,SAAAtB,OAAAc,QAAAkC,MAAA;CAAA,OAkH4BA,KAAIzG,SAAUuE,OAAMvE,SAApByG,OAAAlC;AAA2C;AAlHvE,SAAAtD,OAAAyF,SAAA;CAAA,OA8D2CtG,QAAKtF,cAAesF,QAAKvF;AAAM;AA9D1E,SAAA0E,MAAAa,OAAA;CAAA,OAmCkCA,MAAKrF;AAAM;AA2PpD,SAASsJ,WAAWJ,OAAiC;CACjD,OAAO;EAAElC,MAAM,GAAGkC,MAAM9D,EAAC;EAAKsE,KAAK,GAAGR,MAAMpE,EAAC;EAAK,QAAQoE,MAAM9D;CAAE;AACtE"}
|
|
1
|
+
{"version":3,"file":"LineChart.js","names":["CSSProperties","KeyboardEvent","PointerEvent","useId","useState","messages","usePanneauIntl","Skeleton","chartColors","toneClass","Tone","cx","styles","PlotPoint","axisLabelIndices","linearPath","monotonePath","niceScale","LineChartPoint","label","shortLabel","value","LineChartSeries","points","color","tone","LineChartProps","series","stacked","formatValue","formatTick","axisLabel","showAxis","showLast","showMax","isInteractive","domain","min","max","curve","height","className","MAX_AXIS_LABELS","LABEL_GAP","LineChart","t0","$","_c","ownPoints","t1","t2","t3","t4","t5","t6","t7","undefined","intl","t8","t9","t10","Symbol","for","replace","gradientId","active","setActive","formatNumber","format","t11","categorical","t12","t13","style","multiple","length","t14","t15","t16","t17","t18","t19","t20","t21","t22","t23","t24","bb0","t25","chart","t26","t27","skeleton","t28","lines","map","line","index","values","_","at","tops","line_0","index_0","value_0","at_0","slice","reduce","sum","other","drawn","flat","_temp","scale","Math","tick","value_1","notation","y","value_2","plotted","point_0","index_1","x","point","line_1","zero","firstPoint","lastIndex","lastPoint","maxValue","maxIndex","indexOf","maxPoint","labelLast","labelMax","activePoint","activeData","_temp2","describe","point_2","index_2","formatMessage","chartPoint","line_2","join","plotLine","line_3","value_3","index_3","plot","pathOf","colorStyle","_temp3","colorClass","_temp4","point_3","event","rect","currentTarget","getBoundingClientRect","width","ratio","clientX","left","round","event_0","current","next","key","preventDefault","move","focused","interaction","role","tabIndex","const","onPointerMove","onPointerDown","onPointerLeave","onFocus","current_0","onBlur","onKeyDown","widestTick","ticks","_temp5","placement","index_4","previous","current_1","valueLabel","index_5","where","placedAt","data","positionOf","areaTop","areaBottom","t29","t30","value_5","grid","t31","baseline","t32","reveal","line_6","index_6","top","below","point_4","back","reverse","stackArea","t33","area","t34","svg","body","widest","value_4","crosshair","marks","line_7","index_7","at_1","value_6","where_0","dot","activeDot","tooltip","tooltipLabel","line_8","index_8","tooltipRow","swatch","tooltipValue","dates","t35","index_9","minor","data_0","where_1","date","visuallyHidden","chartDate","_temp6","data_1","index_11","line_10","at_2","line_9","index_10","text","line_5","toned","line_4","point_1","_c","styles","_Fragment"],"sources":["../../src/line-chart/LineChart.tsx"],"sourcesContent":["import { type CSSProperties, type KeyboardEvent, type PointerEvent, useId, useState } from 'react';\n\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { chartColors } from '../theme/chartColors';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './LineChart.module.css';\nimport { type PlotPoint, axisLabelIndices, linearPath, monotonePath, niceScale } from './geometry';\n\n/** A point of a `LineChart`. */\nexport interface LineChartPoint {\n /** What the point is, in its table and its tooltip: a day, a week, a month. */\n label: string;\n /** A shorter label, under the chart: `Oct 5`. The `label` by default. */\n shortLabel?: string | undefined;\n value: number;\n}\n\n/** A line of a `LineChart` with several. */\nexport interface LineChartSeries {\n /** What the line is: a column of the table of the chart, and a line of its tooltip. */\n label: string;\n /**\n * Its points, one per date, in the order of those of the first line, whose labels are the\n * dates of the chart. A point missing is 0.\n */\n points: LineChartPoint[];\n /** Its categorical color, from 0. Defaults to its place among the lines. */\n color?: number | undefined;\n /** The solid color of a tone instead. */\n tone?: Tone | undefined;\n}\n\nexport interface LineChartProps {\n /** What the chart shows: the caption of its table, for assistive technologies. */\n label: string;\n /** The points, in order. Left `undefined` while they load: a skeleton of the plot. */\n points?: LineChartPoint[] | undefined;\n /**\n * Several lines over the same dates, instead of `points`: each on its categorical color or its\n * tone, without values written on them (a legend beside the chart gives their names and\n * totals). The table of the chart has a column per line.\n */\n series?: LineChartSeries[] | undefined;\n /** Stacks the lines of `series`, as areas: the top one is their total. */\n stacked?: boolean | undefined;\n /** Formats a value: in the table, the labels on the line and the tooltip. A number of the locale by default. */\n formatValue?: ((value: number) => string) | undefined;\n /**\n * Formats a graduation of the scale, short: `1 min`, `25 %`. A number of the locale by default,\n * compact (`10K`) on a scale that reaches 10,000.\n */\n formatTick?: ((value: number) => string) | undefined;\n /** What the values are, above the scale: `Entries`, `Minutes`. */\n axisLabel?: string | undefined;\n /**\n * Shows the scale: round graduations, with a line across the plot for each. Without it, a line\n * at 0 alone, for a chart that only shows a trend. `true` by default.\n */\n showAxis?: boolean | undefined;\n /** Writes the last value at the end of the line. `true` by default. */\n showLast?: boolean | undefined;\n /** Marks the highest value on the line, with its value. */\n showMax?: boolean | undefined;\n /**\n * Shows the value of the point under the pointer, or chosen with the arrow keys: for a long\n * series, where a point can't be read from the scale. Off by default: the values a chart needs\n * are on it, and every one is in its table.\n */\n isInteractive?: boolean | undefined;\n /**\n * Fixes the bounds of the scale: `{ min: 0, max: 1 }` for a ratio. From 0, or the lowest value\n * under it, to a round value above the highest by default.\n */\n domain?: { min?: number | undefined; max?: number | undefined } | undefined;\n /** `monotone` (default) curves through the points without going past them, `linear` joins them straight. */\n curve?: 'monotone' | 'linear' | undefined;\n /** Height of the plot, without the labels: `'10rem'`. Defaults to the `height` token. */\n height?: string | undefined;\n /** The categorical color of the line, from 0. Defaults to the first. */\n color?: number | undefined;\n className?: string | undefined;\n}\n\n/** At most this number of labels under the chart, half of them when it is narrow. */\nconst MAX_AXIS_LABELS = 7;\n\n/** Closer than this (in percents of the width), the highest value isn't labeled beside the last one. */\nconst LABEL_GAP = 12;\n\n/**\n * A line of values over time, on the categorical chart colors of the theme: a curve and the area\n * under it, a scale of round graduations, labels of dates under it, and the last value at the end\n * of the line. The plot is hidden from assistive technologies, which read the values in a table;\n * with `isInteractive`, the pointer and the arrow keys also show the value of each point.\n */\nexport function LineChart({\n label,\n points: ownPoints,\n series,\n stacked = false,\n formatValue,\n formatTick,\n axisLabel,\n showAxis = true,\n showLast = true,\n showMax = false,\n isInteractive = false,\n domain,\n curve = 'monotone',\n height,\n color = 0,\n className,\n}: LineChartProps) {\n const intl = usePanneauIntl();\n const gradientId = `panneau-line-chart-${useId().replace(/[^\\w-]/g, '')}`;\n const [active, setActive] = useState<number | null>(null);\n const format = formatValue ?? ((value: number) => intl.formatNumber(value));\n const style = {\n '--_panneau-line-chart-color': chartColors.categorical(color),\n ...(height !== undefined ? { '--_panneau-line-chart-height': height } : {}),\n } as CSSProperties;\n const multiple = series !== undefined && series.length > 1;\n const points = series !== undefined ? (series[0]?.points ?? []) : ownPoints;\n if (points === undefined) {\n return (\n <div className={cx('panneau-line-chart', styles.chart, className)} style={style}>\n <div className={styles.skeleton}>\n <Skeleton shape=\"rect\" height=\"100%\" />\n </div>\n <Skeleton width=\"100%\" />\n </div>\n );\n }\n\n // The values of each line, aligned on the dates of the first one; stacked, their running totals\n const lines = (series ?? [{ label, points, color, tone: undefined }]).map((line, index) => ({\n label: line.label,\n color: line.color ?? (series !== undefined ? index : color),\n tone: line.tone,\n values: points.map((_, at) => line.points[at]?.value ?? 0),\n }));\n const tops = lines.map((line, index) =>\n line.values.map((value, at) =>\n stacked\n ? lines.slice(0, index + 1).reduce((sum, other) => sum + (other.values[at] ?? 0), 0)\n : value,\n ),\n );\n const drawn = tops.flat();\n const values = points.map((point) => point.value);\n const scale = niceScale(Math.min(...drawn, 0), Math.max(...drawn, 0), domain);\n const tick =\n formatTick ??\n ((value: number) =>\n intl.formatNumber(value, scale.max >= 10_000 ? { notation: 'compact' } : {}));\n const y = (value: number) => 100 - ((value - scale.min) / (scale.max - scale.min)) * 100;\n const plotted: PlotPoint[] = points.map((point, index) => ({\n x: points.length === 1 ? 50 : (index / (points.length - 1)) * 100,\n y: y(point.value),\n }));\n const line = curve === 'linear' ? linearPath(plotted) : monotonePath(plotted);\n const zero = y(Math.min(Math.max(0, scale.min), scale.max));\n const firstPoint = plotted[0];\n const lastIndex = points.length - 1;\n const lastPoint = plotted[lastIndex];\n const maxValue = Math.max(...values);\n const maxIndex = values.indexOf(maxValue);\n const maxPoint = plotted[maxIndex];\n const labelLast = showLast && !multiple && lastPoint !== undefined;\n const labelMax =\n !multiple &&\n showMax &&\n maxPoint !== undefined &&\n maxValue > scale.min &&\n !(labelLast && lastPoint.x - maxPoint.x < LABEL_GAP);\n const activePoint = active !== null ? plotted[active] : undefined;\n const activeData = active !== null ? points[active] : undefined;\n const shortLabel = (point: LineChartPoint) => point.shortLabel ?? point.label;\n const describe = (point: LineChartPoint, index: number) =>\n intl.formatMessage(messages.chartPoint, {\n label: point.label,\n value: multiple\n ? lines\n .map((line) =>\n intl.formatMessage(messages.chartPoint, {\n label: line.label,\n value: format(line.values[index] ?? 0),\n }),\n )\n .join(', ')\n : format(point.value),\n });\n const plotLine = (line: number[]): PlotPoint[] =>\n line.map((value, index) => ({\n x: points.length === 1 ? 50 : (index / (points.length - 1)) * 100,\n y: y(value),\n }));\n const pathOf = (plot: PlotPoint[]) =>\n curve === 'linear' ? linearPath(plot) : monotonePath(plot);\n const colorStyle = (line: (typeof lines)[number]) =>\n ({ '--_panneau-line-chart-color': chartColors.categorical(line.color) }) as CSSProperties;\n const colorClass = (line: (typeof lines)[number]) =>\n line.tone !== undefined ? cx(styles.toned, toneClass(line.tone)) : undefined;\n\n // The point under the pointer: the nearest one along the width of the plot\n const point = (event: PointerEvent<HTMLDivElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n if (rect.width > 0 && points.length > 0) {\n const ratio = Math.min(Math.max((event.clientX - rect.left) / rect.width, 0), 1);\n setActive(Math.round(ratio * lastIndex));\n }\n };\n const move = (event: KeyboardEvent<HTMLDivElement>) => {\n const current = active ?? lastIndex;\n const next =\n event.key === 'ArrowLeft' || event.key === 'ArrowDown'\n ? current - 1\n : event.key === 'ArrowRight' || event.key === 'ArrowUp'\n ? current + 1\n : event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? lastIndex\n : null;\n if (next !== null) {\n event.preventDefault();\n setActive(Math.min(Math.max(next, 0), lastIndex));\n }\n };\n const focused = points[active ?? lastIndex];\n const interaction =\n isInteractive && focused !== undefined\n ? {\n role: 'slider',\n tabIndex: 0,\n 'aria-label': label,\n 'aria-orientation': 'horizontal' as const,\n 'aria-valuemin': 0,\n 'aria-valuemax': lastIndex,\n 'aria-valuenow': active ?? lastIndex,\n 'aria-valuetext': describe(focused, active ?? lastIndex),\n onPointerMove: point,\n onPointerDown: point,\n onPointerLeave: () => setActive(null),\n onFocus: () => setActive((current) => current ?? lastIndex),\n onBlur: () => setActive(null),\n onKeyDown: move,\n }\n : {};\n\n const widestTick = scale.ticks\n .map(tick)\n .reduce((widest, text) => (text.length > widest.length ? text : widest), '');\n const placement = (index: number): 'above' | 'below' => {\n const previous = points[index - 1];\n const current = points[index];\n return previous !== undefined && current !== undefined && previous.value > current.value\n ? 'below'\n : 'above';\n };\n const valueLabel = (index: number, where: PlotPoint, placedAt: 'above' | 'below') => {\n const data = points[index];\n return data !== undefined ? (\n <span className={styles.valueLabel} data-placement={placedAt} style={positionOf(where)}>\n {format(data.value)}\n </span>\n ) : null;\n };\n\n return (\n <figure\n className={cx('panneau-line-chart', styles.chart, className)}\n style={style}\n data-axis={showAxis ? '' : undefined}\n data-labels={labelLast || labelMax ? '' : undefined}\n >\n {axisLabel !== undefined ? (\n <div className={styles.axisLabel} aria-hidden=\"true\">\n {axisLabel}\n </div>\n ) : null}\n <div className={styles.body}>\n {showAxis ? (\n <div className={styles.scale} aria-hidden=\"true\">\n {/* The widest graduation gives the width of the column */}\n <span className={styles.widest}>{widestTick}</span>\n {scale.ticks.map((value) => (\n <span\n key={value}\n className={styles.tick}\n style={{ top: `${y(value)}%` }}\n >\n {tick(value)}\n </span>\n ))}\n </div>\n ) : null}\n <div className={styles.plot} {...interaction}>\n <svg\n className={styles.svg}\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0\" className={styles.areaTop} />\n <stop offset=\"1\" className={styles.areaBottom} />\n </linearGradient>\n </defs>\n {showAxis\n ? scale.ticks.map((value) => (\n <line\n key={value}\n className={styles.grid}\n x1=\"0\"\n x2=\"100\"\n y1={y(value)}\n y2={y(value)}\n />\n ))\n : null}\n <line className={styles.baseline} x1=\"0\" x2=\"100\" y1={zero} y2={zero} />\n {multiple && points.length > 1 ? (\n <g className={styles.reveal}>\n {lines.map((line, index) => {\n const top = plotLine(tops[index] ?? []);\n const below =\n index > 0\n ? plotLine(tops[index - 1] ?? [])\n : top.map((point) => ({ ...point, y: zero }));\n const back = pathOf([...below].reverse()).replace(/^M/, 'L');\n return (\n <g\n key={index}\n className={colorClass(line)}\n style={colorStyle(line)}\n >\n {stacked ? (\n <path\n className={styles.stackArea}\n d={`${pathOf(top)} ${back} Z`}\n />\n ) : null}\n <path className={styles.line} d={pathOf(top)} />\n </g>\n );\n })}\n </g>\n ) : null}\n {!multiple &&\n firstPoint !== undefined &&\n lastPoint !== undefined &&\n points.length > 1 ? (\n <g className={styles.reveal}>\n <path\n className={styles.area}\n fill={`url(#${gradientId})`}\n d={`${line} L${lastPoint.x},${zero} L${firstPoint.x},${zero} Z`}\n />\n <path className={styles.line} d={line} />\n </g>\n ) : null}\n </svg>\n {activePoint !== undefined ? (\n <span\n className={styles.crosshair}\n style={{ left: `${activePoint.x}%` }}\n aria-hidden=\"true\"\n />\n ) : null}\n <div className={styles.marks} aria-hidden=\"true\">\n {multiple\n ? lines.map((line, index) => {\n const at = active ?? lastIndex;\n const value = tops[index]?.[at];\n const where = plotted[at];\n return value !== undefined && where !== undefined ? (\n <span\n key={index}\n className={cx(\n styles.dot,\n active !== null && styles.activeDot,\n colorClass(line),\n )}\n style={{\n ...colorStyle(line),\n ...positionOf({ x: where.x, y: y(value) }),\n }}\n />\n ) : null;\n })\n : null}\n {!multiple &&\n points.length === 1 &&\n firstPoint !== undefined &&\n !labelLast ? (\n <span className={styles.dot} style={positionOf(firstPoint)} />\n ) : null}\n {labelMax && maxPoint !== undefined ? (\n <span className={styles.dot} style={positionOf(maxPoint)} />\n ) : null}\n {labelLast && lastPoint !== undefined ? (\n <span className={styles.dot} style={positionOf(lastPoint)} />\n ) : null}\n {activePoint === undefined && labelMax && maxPoint !== undefined\n ? valueLabel(maxIndex, maxPoint, 'above')\n : null}\n {activePoint === undefined && labelLast && lastPoint !== undefined\n ? valueLabel(lastIndex, lastPoint, placement(lastIndex))\n : null}\n {activePoint !== undefined && activeData !== undefined && multiple ? (\n <span\n className={styles.tooltip}\n data-placement=\"below\"\n style={positionOf({ x: activePoint.x, y: 0 })}\n >\n <span className={styles.tooltipLabel}>{activeData.label}</span>\n {lines.map((line, index) => (\n <span key={index} className={styles.tooltipRow}>\n <span\n className={cx(styles.swatch, colorClass(line))}\n style={colorStyle(line)}\n />\n {line.label}\n <strong className={styles.tooltipValue}>\n {format(line.values[active ?? lastIndex] ?? 0)}\n </strong>\n </span>\n ))}\n </span>\n ) : null}\n {activePoint !== undefined && activeData !== undefined && !multiple ? (\n <>\n <span\n className={cx(styles.dot, styles.activeDot)}\n style={positionOf(activePoint)}\n />\n <span\n className={styles.tooltip}\n data-placement={activePoint.y < 30 ? 'below' : 'above'}\n style={positionOf(activePoint)}\n >\n <strong className={styles.tooltipValue}>\n {format(activeData.value)}\n </strong>\n <span className={styles.tooltipLabel}>{activeData.label}</span>\n </span>\n </>\n ) : null}\n </div>\n </div>\n <div className={styles.dates} aria-hidden=\"true\">\n {axisLabelIndices(points.length, MAX_AXIS_LABELS).map(({ index, minor }) => {\n const data = points[index];\n const where = plotted[index];\n return data !== undefined && where !== undefined ? (\n <span\n key={index}\n className={cx(styles.date, minor && styles.minor)}\n data-edge={\n points.length === 1\n ? undefined\n : index === 0\n ? 'start'\n : index === lastIndex\n ? 'end'\n : undefined\n }\n style={{ left: `${where.x}%` }}\n >\n {shortLabel(data)}\n </span>\n ) : null;\n })}\n </div>\n </div>\n {/* Hidden in a wrapper: on the table itself, Chrome leaves its caption visible */}\n <div className={styles.visuallyHidden}>\n <table>\n <caption>{label}</caption>\n {multiple ? (\n <thead>\n <tr>\n <th scope=\"col\">{intl.formatMessage(messages.chartDate)}</th>\n {lines.map((line, index) => (\n <th key={index} scope=\"col\">\n {line.label}\n </th>\n ))}\n </tr>\n </thead>\n ) : null}\n <tbody>\n {points.map((data, index) => (\n <tr key={index}>\n <th scope=\"row\">{data.label}</th>\n {multiple ? (\n lines.map((line, at) => (\n <td key={at}>{format(line.values[index] ?? 0)}</td>\n ))\n ) : (\n <td>{format(data.value)}</td>\n )}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </figure>\n );\n}\n\n/** The position of a mark on the plot, and its place along the width, to keep its label inside. */\nfunction positionOf(where: PlotPoint): CSSProperties {\n return { left: `${where.x}%`, top: `${where.y}%`, '--_x': where.x } as CSSProperties;\n}\n"],"mappings":";;;;;;;;;;;;;AAwFA,IAAM0C,kBAAkB;;AAGxB,IAAMC,YAAY;;;;;;;AAQlB,SAAOC,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAmB,MAAA,EAAA5B,OAAAI,QAAAyB,WAAArB,QAAAC,SAAAqB,IAAApB,aAAAC,YAAAC,WAAAC,UAAAkB,IAAAjB,UAAAkB,IAAAjB,SAAAkB,IAAAjB,eAAAkB,IAAAjB,QAAAG,OAAAe,IAAAd,QAAAhB,OAAA+B,IAAAd,cAAAI;CAItB,MAAAjB,UAAAqB,OAAAO,KAAAA,IAAA,QAAAP;CAIA,MAAAjB,WAAAkB,OAAAM,KAAAA,IAAA,OAAAN;CACA,MAAAjB,WAAAkB,OAAAK,KAAAA,IAAA,OAAAL;CACA,MAAAjB,UAAAkB,OAAAI,KAAAA,IAAA,QAAAJ;CACA,MAAAjB,gBAAAkB,OAAAG,KAAAA,IAAA,QAAAH;CAEA,MAAAd,QAAAe,OAAAE,KAAAA,IAAA,aAAAF;CAEA,MAAA9B,QAAA+B,OAAAC,KAAAA,IAAA,IAAAD;CAGA,MAAAE,OAAanD,eAAe;CACa,MAAAoD,KAAAvD,MAAM;CAAC,IAAAwD;CAAA,IAAAb,EAAA,OAAAY,IAAA;EAAA,IAAAE;EAAA,IAAAd,EAAA,OAAAe,OAAAC,IAAA,2BAAA,GAAA;GAASF,MAAA;GAASd,EAAA,KAAAc;EAAA,OAAAA,MAAAd,EAAA;EAAzBa,KAAAD,GAAOK,QAASH,KAAW,EAAE;EAACd,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAvE,MAAAkB,aAAmB,sBAAsBL;CAC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,QAAAkC,MAAA;CAAA,OA6J4BA,KAAInL,SAAUiJ,OAAMjJ,SAApBmL,OAAAlC;AAA2C;AA7JvE,SAAAjE,OAAAoG,QAAA;CAAA,OA2GC/J,OAAIvE,SAAU+B,KAAAA,IAAY7C,GAAGC,yBAAMoP,OAAQvP,UAAUuF,OAAIvE,IAAK,CAAa,IAA3E+B,KAAAA;AAA4E;AA3G7E,SAAAiG,OAAAwG,QAAA;CAAA,OAyGE,EAAA,+BAAiCzP,YAAW8D,YAAa0B,OAAIxE,KAAM,EAAE;AAAmB;AAzG1F,SAAAkH,OAAAwH,SAAA;CAAA,OAkF2CtI,QAAKxG,cAAewG,QAAKzG;AAAM;AAlF1E,SAAA6F,MAAAY,OAAA;CAAA,OAsDkCA,MAAKvG;AAAM;AA8WpD,SAAS+K,WAAWH,OAAiC;CACjD,OAAO;EAAE7B,MAAM,GAAG6B,MAAMtE,EAAC;EAAKsF,KAAK,GAAGhB,MAAM3E,EAAC;EAAK,QAAQ2E,MAAMtE;CAAE;AACtE"}
|
|
@@ -14,6 +14,8 @@ var baseline = "panneau-line-chart-baseline";
|
|
|
14
14
|
var areaTop = "panneau-line-chart-area-top";
|
|
15
15
|
var areaBottom = "panneau-line-chart-area-bottom";
|
|
16
16
|
var area = "panneau-line-chart-area";
|
|
17
|
+
var toned = "panneau-line-chart-toned";
|
|
18
|
+
var stackArea = "panneau-line-chart-stack-area";
|
|
17
19
|
var line = "panneau-line-chart-line";
|
|
18
20
|
var reveal = "panneau-line-chart-reveal";
|
|
19
21
|
var marks = "panneau-line-chart-marks";
|
|
@@ -24,6 +26,8 @@ var valueLabel = "panneau-line-chart-value-label";
|
|
|
24
26
|
var tooltip = "panneau-line-chart-tooltip";
|
|
25
27
|
var tooltipValue = "panneau-line-chart-tooltip-value";
|
|
26
28
|
var tooltipLabel = "panneau-line-chart-tooltip-label";
|
|
29
|
+
var tooltipRow = "panneau-line-chart-tooltip-row";
|
|
30
|
+
var swatch = "panneau-line-chart-swatch";
|
|
27
31
|
var dates = "panneau-line-chart-dates";
|
|
28
32
|
var date = "panneau-line-chart-date";
|
|
29
33
|
var minor = "panneau-line-chart-minor";
|
|
@@ -43,6 +47,8 @@ var LineChart_module_default = {
|
|
|
43
47
|
areaTop,
|
|
44
48
|
areaBottom,
|
|
45
49
|
area,
|
|
50
|
+
toned,
|
|
51
|
+
stackArea,
|
|
46
52
|
line,
|
|
47
53
|
reveal,
|
|
48
54
|
marks,
|
|
@@ -54,12 +60,14 @@ var LineChart_module_default = {
|
|
|
54
60
|
tooltip,
|
|
55
61
|
tooltipValue,
|
|
56
62
|
tooltipLabel,
|
|
63
|
+
tooltipRow,
|
|
64
|
+
swatch,
|
|
57
65
|
dates,
|
|
58
66
|
date,
|
|
59
67
|
minor,
|
|
60
68
|
visuallyHidden
|
|
61
69
|
};
|
|
62
70
|
//#endregion
|
|
63
|
-
export { activeDot, area, areaBottom, areaTop, axisLabel, baseline, body, chart, crosshair, date, dates, LineChart_module_default as default, dot, grid, line, marks, minor, plot, reveal, scale, skeleton, svg, tick, tooltip, tooltipLabel, tooltipValue, valueLabel, visuallyHidden, widest };
|
|
71
|
+
export { activeDot, area, areaBottom, areaTop, axisLabel, baseline, body, chart, crosshair, date, dates, LineChart_module_default as default, dot, grid, line, marks, minor, plot, reveal, scale, skeleton, stackArea, svg, swatch, tick, toned, tooltip, tooltipLabel, tooltipRow, tooltipValue, valueLabel, visuallyHidden, widest };
|
|
64
72
|
|
|
65
73
|
//# sourceMappingURL=LineChart.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.module.js","names":[],"sources":["../../src/line-chart/LineChart.module.css"],"sourcesContent":[".chart {\n --_panneau-line-chart-plot-height: var(\n --_panneau-line-chart-height,\n var(--panneau-line-chart-height, 8rem)\n );\n --_panneau-line-chart-reveal: var(\n --panneau-line-chart-reveal-duration,\n calc(var(--panneau-duration-slow) * 3)\n );\n\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n margin: 0;\n container: panneau-line-chart / inline-size;\n font-size: var(--panneau-line-chart-label-font-size, var(--panneau-font-size-xs));\n line-height: 1.5;\n}\n\n.skeleton {\n height: var(--_panneau-line-chart-plot-height);\n}\n\n.axisLabel {\n color: var(--panneau-color-text-muted);\n}\n\n/* The scale on the left of the plot, the dates under it */\n.body {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n column-gap: var(--panneau-space-2);\n row-gap: var(--panneau-space-1);\n}\n\n.chart[data-axis] .body {\n grid-template-columns: auto minmax(0, 1fr);\n /* Room for the top graduation, centered on its line */\n padding-block-start: 0.75em;\n}\n\n/* Room for a value written above the highest point */\n.chart[data-labels] .body {\n padding-block-start: 2em;\n}\n\n.scale {\n position: relative;\n height: var(--_panneau-line-chart-plot-height);\n color: var(--panneau-color-text-muted);\n font-variant-numeric: tabular-nums;\n text-align: end;\n}\n\n.widest {\n display: block;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.tick {\n position: absolute;\n inset-inline-end: 0;\n transform: translateY(-50%);\n white-space: nowrap;\n}\n\n.plot {\n position: relative;\n height: var(--_panneau-line-chart-plot-height);\n border-radius: var(--panneau-radius-sm);\n touch-action: pan-y;\n}\n\n.plot[role='slider'] {\n cursor: crosshair;\n}\n\n.plot[role='slider']:focus-visible {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 4px;\n}\n\n.svg {\n display: block;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.grid,\n.baseline {\n stroke-width: 1px;\n vector-effect: non-scaling-stroke;\n shape-rendering: crispEdges;\n}\n\n.grid {\n stroke: var(--panneau-line-chart-grid-color, var(--panneau-color-border));\n stroke-opacity: 0.6;\n}\n\n.baseline {\n stroke: var(--panneau-color-border);\n}\n\n.areaTop {\n stop-color: var(--_panneau-line-chart-color);\n stop-opacity: var(--panneau-line-chart-area-opacity, 0.2);\n}\n\n.areaBottom {\n stop-color: var(--_panneau-line-chart-color);\n stop-opacity: 0;\n}\n\n.area {\n stroke: none;\n}\n\n.line {\n fill: none;\n stroke: var(--_panneau-line-chart-color);\n stroke-width: var(--panneau-line-chart-line-width, 2px);\n stroke-linejoin: round;\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n}\n\n/* The line draws itself from the left when the chart appears, then its labels fade in */\n.reveal {\n animation: reveal var(--_panneau-line-chart-reveal) var(--panneau-ease-out) both;\n}\n\n.marks {\n animation: fade-in var(--panneau-duration-slow) var(--panneau-ease-out)\n var(--_panneau-line-chart-reveal) both;\n}\n\n@keyframes reveal {\n from {\n clip-path: inset(-10% 100% -10% -10%);\n }\n\n to {\n clip-path: inset(-10% -10% -10% -10%);\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .reveal,\n .marks {\n animation: none;\n }\n}\n\n/* A dot, round whatever the width of the chart, with a ring of the surface around it */\n.dot {\n position: absolute;\n width: var(--panneau-line-chart-dot-size, 8px);\n height: var(--panneau-line-chart-dot-size, 8px);\n border-radius: 50%;\n background-color: var(--_panneau-line-chart-color);\n box-shadow: 0 0 0 2px var(--panneau-card-bg, var(--panneau-color-surface));\n transform: translate(-50%, -50%);\n pointer-events: none;\n}\n\n.activeDot {\n width: calc(var(--panneau-line-chart-dot-size, 8px) + 2px);\n height: calc(var(--panneau-line-chart-dot-size, 8px) + 2px);\n}\n\n.crosshair {\n position: absolute;\n inset-block: 0;\n width: 1px;\n background-color: var(--panneau-color-border-control);\n transform: translateX(-50%);\n pointer-events: none;\n}\n\n/* A value on the line: above or under its point, kept inside the width of the plot */\n.valueLabel,\n.tooltip {\n position: absolute;\n white-space: nowrap;\n pointer-events: none;\n --_panneau-line-chart-shift-x: calc(var(--_x) * -1%);\n}\n\n.valueLabel {\n padding-inline: 2px;\n font-weight: var(--panneau-font-weight-medium);\n font-variant-numeric: tabular-nums;\n color: var(--panneau-color-text);\n background-color: var(--panneau-card-bg, var(--panneau-color-surface));\n border-radius: var(--panneau-radius-sm);\n}\n\n.valueLabel[data-placement='above'],\n.tooltip[data-placement='above'] {\n transform: translate(var(--_panneau-line-chart-shift-x), calc(-100% - 0.5rem));\n}\n\n.valueLabel[data-placement='below'],\n.tooltip[data-placement='below'] {\n transform: translate(var(--_panneau-line-chart-shift-x), 0.5rem);\n}\n\n.tooltip {\n display: flex;\n flex-direction: column;\n padding: var(--panneau-space-1) var(--panneau-space-2);\n color: var(--panneau-color-text);\n background-color: var(--panneau-color-surface);\n border: 1px solid var(--panneau-color-border);\n border-radius: var(--panneau-radius-sm);\n box-shadow: var(--panneau-shadow-sm, none);\n z-index: 1;\n}\n\n.tooltipValue {\n font-size: var(--panneau-font-size-sm);\n font-weight: var(--panneau-font-weight-bold);\n font-variant-numeric: tabular-nums;\n}\n\n.tooltipLabel {\n color: var(--panneau-color-text-muted);\n}\n\n.dates {\n position: relative;\n grid-column: -2 / -1;\n height: 1.5em;\n color: var(--panneau-color-text-muted);\n}\n\n/* Centered under its point, the first and last kept inside the width of the plot */\n.date {\n position: absolute;\n white-space: nowrap;\n transform: translateX(-50%);\n}\n\n.date[data-edge='start'] {\n transform: none;\n}\n\n.date[data-edge='end'] {\n transform: translateX(-100%);\n}\n\n.minor {\n display: none;\n}\n\n@container panneau-line-chart (min-width: 28rem) {\n .minor {\n display: inline;\n }\n}\n\n.visuallyHidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"LineChart.module.js","names":[],"sources":["../../src/line-chart/LineChart.module.css"],"sourcesContent":[".chart {\n --_panneau-line-chart-plot-height: var(\n --_panneau-line-chart-height,\n var(--panneau-line-chart-height, 8rem)\n );\n --_panneau-line-chart-reveal: var(\n --panneau-line-chart-reveal-duration,\n calc(var(--panneau-duration-slow) * 3)\n );\n\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n margin: 0;\n container: panneau-line-chart / inline-size;\n font-size: var(--panneau-line-chart-label-font-size, var(--panneau-font-size-xs));\n line-height: 1.5;\n}\n\n.skeleton {\n height: var(--_panneau-line-chart-plot-height);\n}\n\n.axisLabel {\n color: var(--panneau-color-text-muted);\n}\n\n/* The scale on the left of the plot, the dates under it */\n.body {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n column-gap: var(--panneau-space-2);\n row-gap: var(--panneau-space-1);\n}\n\n.chart[data-axis] .body {\n grid-template-columns: auto minmax(0, 1fr);\n /* Room for the top graduation, centered on its line */\n padding-block-start: 0.75em;\n}\n\n/* Room for a value written above the highest point */\n.chart[data-labels] .body {\n padding-block-start: 2em;\n}\n\n.scale {\n position: relative;\n height: var(--_panneau-line-chart-plot-height);\n color: var(--panneau-color-text-muted);\n font-variant-numeric: tabular-nums;\n text-align: end;\n}\n\n.widest {\n display: block;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.tick {\n position: absolute;\n inset-inline-end: 0;\n transform: translateY(-50%);\n white-space: nowrap;\n}\n\n.plot {\n position: relative;\n height: var(--_panneau-line-chart-plot-height);\n border-radius: var(--panneau-radius-sm);\n touch-action: pan-y;\n}\n\n.plot[role='slider'] {\n cursor: crosshair;\n}\n\n.plot[role='slider']:focus-visible {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 4px;\n}\n\n.svg {\n display: block;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.grid,\n.baseline {\n stroke-width: 1px;\n vector-effect: non-scaling-stroke;\n shape-rendering: crispEdges;\n}\n\n.grid {\n stroke: var(--panneau-line-chart-grid-color, var(--panneau-color-border));\n stroke-opacity: 0.6;\n}\n\n.baseline {\n stroke: var(--panneau-color-border);\n}\n\n.areaTop {\n stop-color: var(--_panneau-line-chart-color);\n stop-opacity: var(--panneau-line-chart-area-opacity, 0.2);\n}\n\n.areaBottom {\n stop-color: var(--_panneau-line-chart-color);\n stop-opacity: 0;\n}\n\n.area {\n stroke: none;\n}\n\n/* A line of several in the color of a tone */\n.toned {\n --_panneau-line-chart-color: var(--panneau-tone-solid);\n}\n\n/* A stacked line: the area between it and the one under it */\n.stackArea {\n fill: var(--_panneau-line-chart-color);\n fill-opacity: calc(var(--panneau-line-chart-area-opacity, 0.2) * 1.75);\n stroke: none;\n}\n\n.line {\n fill: none;\n stroke: var(--_panneau-line-chart-color);\n stroke-width: var(--panneau-line-chart-line-width, 2px);\n stroke-linejoin: round;\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n}\n\n/* The line draws itself from the left when the chart appears, then its labels fade in */\n.reveal {\n animation: reveal var(--_panneau-line-chart-reveal) var(--panneau-ease-out) both;\n}\n\n.marks {\n animation: fade-in var(--panneau-duration-slow) var(--panneau-ease-out)\n var(--_panneau-line-chart-reveal) both;\n}\n\n@keyframes reveal {\n from {\n clip-path: inset(-10% 100% -10% -10%);\n }\n\n to {\n clip-path: inset(-10% -10% -10% -10%);\n }\n}\n\n@keyframes fade-in {\n from {\n opacity: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .reveal,\n .marks {\n animation: none;\n }\n}\n\n/* A dot, round whatever the width of the chart, with a ring of the surface around it */\n.dot {\n position: absolute;\n width: var(--panneau-line-chart-dot-size, 8px);\n height: var(--panneau-line-chart-dot-size, 8px);\n border-radius: 50%;\n background-color: var(--_panneau-line-chart-color);\n box-shadow: 0 0 0 2px var(--panneau-card-bg, var(--panneau-color-surface));\n transform: translate(-50%, -50%);\n pointer-events: none;\n}\n\n.activeDot {\n width: calc(var(--panneau-line-chart-dot-size, 8px) + 2px);\n height: calc(var(--panneau-line-chart-dot-size, 8px) + 2px);\n}\n\n.crosshair {\n position: absolute;\n inset-block: 0;\n width: 1px;\n background-color: var(--panneau-color-border-control);\n transform: translateX(-50%);\n pointer-events: none;\n}\n\n/* A value on the line: above or under its point, kept inside the width of the plot */\n.valueLabel,\n.tooltip {\n position: absolute;\n white-space: nowrap;\n pointer-events: none;\n --_panneau-line-chart-shift-x: calc(var(--_x) * -1%);\n}\n\n.valueLabel {\n padding-inline: 2px;\n font-weight: var(--panneau-font-weight-medium);\n font-variant-numeric: tabular-nums;\n color: var(--panneau-color-text);\n background-color: var(--panneau-card-bg, var(--panneau-color-surface));\n border-radius: var(--panneau-radius-sm);\n}\n\n.valueLabel[data-placement='above'],\n.tooltip[data-placement='above'] {\n transform: translate(var(--_panneau-line-chart-shift-x), calc(-100% - 0.5rem));\n}\n\n.valueLabel[data-placement='below'],\n.tooltip[data-placement='below'] {\n transform: translate(var(--_panneau-line-chart-shift-x), 0.5rem);\n}\n\n.tooltip {\n display: flex;\n flex-direction: column;\n padding: var(--panneau-space-1) var(--panneau-space-2);\n color: var(--panneau-color-text);\n background-color: var(--panneau-color-surface);\n border: 1px solid var(--panneau-color-border);\n border-radius: var(--panneau-radius-sm);\n box-shadow: var(--panneau-shadow-sm, none);\n z-index: 1;\n}\n\n.tooltipValue {\n font-size: var(--panneau-font-size-sm);\n font-weight: var(--panneau-font-weight-bold);\n font-variant-numeric: tabular-nums;\n}\n\n.tooltipLabel {\n color: var(--panneau-color-text-muted);\n}\n\n.tooltipRow {\n display: flex;\n align-items: center;\n gap: var(--panneau-space-1);\n}\n\n.tooltipRow .tooltipValue {\n margin-inline-start: auto;\n padding-inline-start: var(--panneau-space-2);\n}\n\n.swatch {\n flex-shrink: 0;\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 2px;\n background-color: var(--_panneau-line-chart-color);\n}\n\n.dates {\n position: relative;\n grid-column: -2 / -1;\n height: 1.5em;\n color: var(--panneau-color-text-muted);\n}\n\n/* Centered under its point, the first and last kept inside the width of the plot */\n.date {\n position: absolute;\n white-space: nowrap;\n transform: translateX(-50%);\n}\n\n.date[data-edge='start'] {\n transform: none;\n}\n\n.date[data-edge='end'] {\n transform: translateX(-100%);\n}\n\n.minor {\n display: none;\n}\n\n@container panneau-line-chart (min-width: 28rem) {\n .minor {\n display: inline;\n }\n}\n\n.visuallyHidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.panneau-sparkline {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
min-width: 3rem;
|
|
5
|
+
height: var(--panneau-sparkline-height, 2rem);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* In a tone: the solid color of the tone. */
|
|
9
|
+
.panneau-sparkline-toned {
|
|
10
|
+
--_panneau-sparkline-color: var(--panneau-tone-solid);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.panneau-sparkline-svg {
|
|
14
|
+
display: block;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
overflow: visible;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.panneau-sparkline-line {
|
|
21
|
+
fill: none;
|
|
22
|
+
stroke: var(--_panneau-sparkline-color);
|
|
23
|
+
stroke-width: var(--panneau-sparkline-line-width, 1.5px);
|
|
24
|
+
stroke-linejoin: round;
|
|
25
|
+
stroke-linecap: round;
|
|
26
|
+
vector-effect: non-scaling-stroke;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.panneau-sparkline-area {
|
|
30
|
+
fill: var(--_panneau-sparkline-color);
|
|
31
|
+
fill-opacity: var(--panneau-sparkline-area-opacity, 0.12);
|
|
32
|
+
stroke: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Round whatever the width, with a ring of the surface around it */
|
|
36
|
+
.panneau-sparkline-dot {
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: var(--panneau-sparkline-dot-size, 6px);
|
|
39
|
+
height: var(--panneau-sparkline-dot-size, 6px);
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
background-color: var(--_panneau-sparkline-color);
|
|
42
|
+
box-shadow: 0 0 0 2px var(--panneau-card-bg, var(--panneau-color-surface));
|
|
43
|
+
transform: translate(-50%, -50%);
|
|
44
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Tone } from '../theme/tones.js';
|
|
2
|
+
export interface SparklineProps {
|
|
3
|
+
/** The values, in order: a day, a week, a month each. Left `undefined` while they load. */
|
|
4
|
+
values?: readonly number[] | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* What the line shows, said to assistive technologies as an image: `Emails per day, up from
|
|
7
|
+
* 12 to 40`. Without it, the line is decorative: the numbers it goes with say its values.
|
|
8
|
+
*/
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
/** The categorical color of the line, from 0. Defaults to the first. */
|
|
11
|
+
color?: number | undefined;
|
|
12
|
+
/** The color of a tone instead. */
|
|
13
|
+
tone?: Tone | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A small line of values, without a scale or labels: the trend beside a number, in a card or a
|
|
18
|
+
* row of a table. From its lowest value to its highest, so that the trend shows whatever the size
|
|
19
|
+
* of the numbers (the number beside it says how large they are), with a dot on the last one. Equal
|
|
20
|
+
* values are a flat line: at the bottom at 0, in the middle otherwise.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Sparkline({ values, label, color, tone, className }: SparklineProps): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=Sparkline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/sparkline/Sparkline.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,MAAM,WAAW,cAAc;IAC3B,2FAA2F;IAC3F,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,mCAAmC;IACnC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAS,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,cAAc,+BAgEtF"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { toneClass } from "../theme/toneClass.js";
|
|
3
|
+
import { Skeleton } from "../skeleton/Skeleton.js";
|
|
4
|
+
import { chartColors } from "../theme/chartColors.js";
|
|
5
|
+
import { monotonePath } from "../line-chart/geometry.js";
|
|
6
|
+
import Sparkline_module_default from "./Sparkline.module.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/sparkline/Sparkline.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A small line of values, without a scale or labels: the trend beside a number, in a card or a
|
|
12
|
+
* row of a table. From its lowest value to its highest, so that the trend shows whatever the size
|
|
13
|
+
* of the numbers (the number beside it says how large they are), with a dot on the last one. Equal
|
|
14
|
+
* values are a flat line: at the bottom at 0, in the middle otherwise.
|
|
15
|
+
*/
|
|
16
|
+
function Sparkline(t0) {
|
|
17
|
+
const $ = c(37);
|
|
18
|
+
const { values, label, color: t1, tone, className } = t0;
|
|
19
|
+
const color = t1 === void 0 ? 0 : t1;
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[0] !== color) {
|
|
22
|
+
t2 = chartColors.categorical(color);
|
|
23
|
+
$[0] = color;
|
|
24
|
+
$[1] = t2;
|
|
25
|
+
} else t2 = $[1];
|
|
26
|
+
let t3;
|
|
27
|
+
if ($[2] !== t2) {
|
|
28
|
+
t3 = { "--_panneau-sparkline-color": t2 };
|
|
29
|
+
$[2] = t2;
|
|
30
|
+
$[3] = t3;
|
|
31
|
+
} else t3 = $[3];
|
|
32
|
+
const style = t3;
|
|
33
|
+
const t4 = tone !== void 0 && Sparkline_module_default.toned;
|
|
34
|
+
let t5;
|
|
35
|
+
if ($[4] !== className || $[5] !== t4 || $[6] !== tone) {
|
|
36
|
+
t5 = cx("panneau-sparkline", Sparkline_module_default.sparkline, t4, tone !== void 0 && toneClass(tone), className);
|
|
37
|
+
$[4] = className;
|
|
38
|
+
$[5] = t4;
|
|
39
|
+
$[6] = tone;
|
|
40
|
+
$[7] = t5;
|
|
41
|
+
} else t5 = $[7];
|
|
42
|
+
const classes = t5;
|
|
43
|
+
if (values === void 0) {
|
|
44
|
+
let t6;
|
|
45
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
46
|
+
t6 = /* @__PURE__ */ jsx(Skeleton, {
|
|
47
|
+
shape: "rect",
|
|
48
|
+
height: "100%"
|
|
49
|
+
});
|
|
50
|
+
$[8] = t6;
|
|
51
|
+
} else t6 = $[8];
|
|
52
|
+
let t7;
|
|
53
|
+
if ($[9] !== classes || $[10] !== style) {
|
|
54
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: classes,
|
|
56
|
+
style,
|
|
57
|
+
children: t6
|
|
58
|
+
});
|
|
59
|
+
$[9] = classes;
|
|
60
|
+
$[10] = style;
|
|
61
|
+
$[11] = t7;
|
|
62
|
+
} else t7 = $[11];
|
|
63
|
+
return t7;
|
|
64
|
+
}
|
|
65
|
+
const low = Math.min(...values);
|
|
66
|
+
const range = Math.max(...values) - low;
|
|
67
|
+
const flat = values.every(_temp) ? 100 : 50;
|
|
68
|
+
let first;
|
|
69
|
+
let last;
|
|
70
|
+
let points;
|
|
71
|
+
let t6;
|
|
72
|
+
if ($[12] !== flat || $[13] !== low || $[14] !== range || $[15] !== values) {
|
|
73
|
+
let t7;
|
|
74
|
+
if ($[20] !== flat || $[21] !== low || $[22] !== range || $[23] !== values.length) {
|
|
75
|
+
t7 = (value_0, index) => ({
|
|
76
|
+
x: values.length === 1 ? 100 : index / (values.length - 1) * 100,
|
|
77
|
+
y: range > 0 ? 100 - (value_0 - low) / range * 100 : flat
|
|
78
|
+
});
|
|
79
|
+
$[20] = flat;
|
|
80
|
+
$[21] = low;
|
|
81
|
+
$[22] = range;
|
|
82
|
+
$[23] = values.length;
|
|
83
|
+
$[24] = t7;
|
|
84
|
+
} else t7 = $[24];
|
|
85
|
+
points = values.map(t7);
|
|
86
|
+
first = points[0];
|
|
87
|
+
last = points.at(-1);
|
|
88
|
+
t6 = first !== void 0 && points.length === 1 ? `M0,${first.y} L100,${first.y}` : monotonePath(points);
|
|
89
|
+
$[12] = flat;
|
|
90
|
+
$[13] = low;
|
|
91
|
+
$[14] = range;
|
|
92
|
+
$[15] = values;
|
|
93
|
+
$[16] = first;
|
|
94
|
+
$[17] = last;
|
|
95
|
+
$[18] = points;
|
|
96
|
+
$[19] = t6;
|
|
97
|
+
} else {
|
|
98
|
+
first = $[16];
|
|
99
|
+
last = $[17];
|
|
100
|
+
points = $[18];
|
|
101
|
+
t6 = $[19];
|
|
102
|
+
}
|
|
103
|
+
const line = t6;
|
|
104
|
+
let t7;
|
|
105
|
+
if ($[25] !== label) {
|
|
106
|
+
t7 = label !== void 0 ? {
|
|
107
|
+
role: "img",
|
|
108
|
+
"aria-label": label
|
|
109
|
+
} : { "aria-hidden": true };
|
|
110
|
+
$[25] = label;
|
|
111
|
+
$[26] = t7;
|
|
112
|
+
} else t7 = $[26];
|
|
113
|
+
let t8;
|
|
114
|
+
if ($[27] !== first || $[28] !== last || $[29] !== line || $[30] !== points) {
|
|
115
|
+
t8 = last !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("svg", {
|
|
116
|
+
className: Sparkline_module_default.svg,
|
|
117
|
+
viewBox: "0 0 100 100",
|
|
118
|
+
preserveAspectRatio: "none",
|
|
119
|
+
focusable: "false",
|
|
120
|
+
"aria-hidden": "true",
|
|
121
|
+
children: [points.length > 1 && first !== void 0 ? /* @__PURE__ */ jsx("path", {
|
|
122
|
+
className: Sparkline_module_default.area,
|
|
123
|
+
d: `${line} L${last.x},100 L${first.x},100 Z`
|
|
124
|
+
}) : null, /* @__PURE__ */ jsx("path", {
|
|
125
|
+
className: Sparkline_module_default.line,
|
|
126
|
+
d: line
|
|
127
|
+
})]
|
|
128
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
129
|
+
className: Sparkline_module_default.dot,
|
|
130
|
+
style: {
|
|
131
|
+
left: `${last.x}%`,
|
|
132
|
+
top: `${last.y}%`
|
|
133
|
+
},
|
|
134
|
+
"aria-hidden": "true"
|
|
135
|
+
})] }) : null;
|
|
136
|
+
$[27] = first;
|
|
137
|
+
$[28] = last;
|
|
138
|
+
$[29] = line;
|
|
139
|
+
$[30] = points;
|
|
140
|
+
$[31] = t8;
|
|
141
|
+
} else t8 = $[31];
|
|
142
|
+
let t9;
|
|
143
|
+
if ($[32] !== classes || $[33] !== style || $[34] !== t7 || $[35] !== t8) {
|
|
144
|
+
t9 = /* @__PURE__ */ jsx("div", {
|
|
145
|
+
className: classes,
|
|
146
|
+
style,
|
|
147
|
+
...t7,
|
|
148
|
+
children: t8
|
|
149
|
+
});
|
|
150
|
+
$[32] = classes;
|
|
151
|
+
$[33] = style;
|
|
152
|
+
$[34] = t7;
|
|
153
|
+
$[35] = t8;
|
|
154
|
+
$[36] = t9;
|
|
155
|
+
} else t9 = $[36];
|
|
156
|
+
return t9;
|
|
157
|
+
}
|
|
158
|
+
function _temp(value) {
|
|
159
|
+
return value === 0;
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { Sparkline };
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=Sparkline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.js","names":["CSSProperties","monotonePath","Skeleton","chartColors","toneClass","Tone","cx","styles","SparklineProps","values","label","color","tone","className","Sparkline","t0","$","_c","t1","undefined","t2","categorical","t3","style","t4","toned","t5","sparkline","classes","t6","Symbol","for","t7","low","Math","min","high","max","range","flat","every","_temp","first","last","points","length","value_0","index","x","y","value","map","at","line","role","t8","svg","area","dot","left","top","t9","_c","styles","_Fragment"],"sources":["../../src/sparkline/Sparkline.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { monotonePath } from '../line-chart/geometry';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { chartColors } from '../theme/chartColors';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Sparkline.module.css';\n\nexport interface SparklineProps {\n /** The values, in order: a day, a week, a month each. Left `undefined` while they load. */\n values?: readonly number[] | undefined;\n /**\n * What the line shows, said to assistive technologies as an image: `Emails per day, up from\n * 12 to 40`. Without it, the line is decorative: the numbers it goes with say its values.\n */\n label?: string | undefined;\n /** The categorical color of the line, from 0. Defaults to the first. */\n color?: number | undefined;\n /** The color of a tone instead. */\n tone?: Tone | undefined;\n className?: string | undefined;\n}\n\n/**\n * A small line of values, without a scale or labels: the trend beside a number, in a card or a\n * row of a table. From its lowest value to its highest, so that the trend shows whatever the size\n * of the numbers (the number beside it says how large they are), with a dot on the last one. Equal\n * values are a flat line: at the bottom at 0, in the middle otherwise.\n */\nexport function Sparkline({ values, label, color = 0, tone, className }: SparklineProps) {\n const style = { '--_panneau-sparkline-color': chartColors.categorical(color) } as CSSProperties;\n const classes = cx(\n 'panneau-sparkline',\n styles.sparkline,\n tone !== undefined && styles.toned,\n tone !== undefined && toneClass(tone),\n className,\n );\n if (values === undefined) {\n return (\n <div className={classes} style={style}>\n <Skeleton shape=\"rect\" height=\"100%\" />\n </div>\n );\n }\n const low = Math.min(...values);\n const high = Math.max(...values);\n const range = high - low;\n const flat = values.every((value) => value === 0) ? 100 : 50;\n const points = values.map((value, index) => ({\n x: values.length === 1 ? 100 : (index / (values.length - 1)) * 100,\n y: range > 0 ? 100 - ((value - low) / range) * 100 : flat,\n }));\n const first = points[0];\n const last = points.at(-1);\n const line =\n first !== undefined && points.length === 1\n ? `M0,${first.y} L100,${first.y}`\n : monotonePath(points);\n return (\n <div\n className={classes}\n style={style}\n {...(label !== undefined\n ? { role: 'img', 'aria-label': label }\n : { 'aria-hidden': true })}\n >\n {last !== undefined ? (\n <>\n <svg\n className={styles.svg}\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n {points.length > 1 && first !== undefined ? (\n <path\n className={styles.area}\n d={`${line} L${last.x},100 L${first.x},100 Z`}\n />\n ) : null}\n <path className={styles.line} d={line} />\n </svg>\n <span\n className={styles.dot}\n style={{ left: `${last.x}%`, top: `${last.y}%` }}\n aria-hidden=\"true\"\n />\n </>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,SAAOc,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAmB,MAAA,EAAAR,QAAAC,OAAAC,OAAAO,IAAAN,MAAAC,cAAAE;CAAiB,MAAAJ,QAAAO,OAAAC,KAAAA,IAAA,IAAAD;CAAS,IAAAE;CAAA,IAAAJ,EAAA,OAAAL,OAAA;EACFS,KAAAjB,YAAWkB,YAAaV,KAAK;EAACK,EAAA,KAAAL;EAAAK,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAI,IAAA;EAA9DE,KAAA,EAAA,8BAAgCF,GAA+B;EAACJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAA9E,MAAAO,QAAcD;CAIV,MAAAE,KAAAZ,SAASO,KAAAA,KAAaZ,yBAAMkB;CAAM,IAAAC;CAAA,IAAAV,EAAA,OAAAH,aAAAG,EAAA,OAAAQ,MAAAR,EAAA,OAAAJ,MAAA;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E,eAAA;GALhB,UAAA,CAOKZ,OAAMC,SAAU,KAAKH,UAAUvB,KAAAA,IAC5B,oBAAA,QAAA;IACe,WAAAZ,yBAAMkD;IACd,GAAA,GAAGJ,KAAI,IAAKV,KAAIK,EAAE,QAASN,MAAKM,EAAE;GAAQ,CAAA,IAHpD,MAMD,oBAAA,QAAA;IAAiB,WAAAzC,yBAAM8C;IAAUA,GAAAA;GAAI,CAAA,CACnC;EACN,CAAA,GAAA,oBAAA,QAAA;GACe,WAAA9C,yBAAMmD;GACV,OAAA;IAAAC,MAAQ,GAAGhB,KAAIK,EAAE;IAAGY,KAAO,GAAGjB,KAAIM,EAAE;GAAI;GACnC,eAAA;EAAM,CAAA,CACpB,EAAA,CAAA,IArBT;EAuBOjC,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;EAAA3B,EAAA,MAAAqC;EAAArC,EAAA,MAAA4B;EAAA5B,EAAA,MAAAuC;CAAA,OAAAA,KAAAvC,EAAA;CAAA,IAAA6C;CAAA,IAAA7C,EAAA,QAAAY,WAAAZ,EAAA,QAAAO,SAAAP,EAAA,QAAAgB,MAAAhB,EAAA,QAAAuC,IAAA;EA9BZM,KAAA,oBAAA,OAAA;GACejC,WAAAA;GACJL;GAAK,GACPS;GAIJuB,UAAAA;EAwBC,CAAA;EAAAvC,EAAA,MAAAY;EAAAZ,EAAA,MAAAO;EAAAP,EAAA,MAAAgB;EAAAhB,EAAA,MAAAuC;EAAAvC,EAAA,MAAA6C;CAAA,OAAAA,KAAA7C,EAAA;CAAA,OA/BN6C;AA+BM;AA9DP,SAAApB,MAAAS,OAAA;CAAA,OAmBkCA,UAAU;AAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./Sparkline.css";
|
|
2
|
+
//#region src/sparkline/Sparkline.module.css
|
|
3
|
+
var sparkline = "panneau-sparkline";
|
|
4
|
+
var toned = "panneau-sparkline-toned";
|
|
5
|
+
var svg = "panneau-sparkline-svg";
|
|
6
|
+
var line = "panneau-sparkline-line";
|
|
7
|
+
var area = "panneau-sparkline-area";
|
|
8
|
+
var dot = "panneau-sparkline-dot";
|
|
9
|
+
var Sparkline_module_default = {
|
|
10
|
+
sparkline,
|
|
11
|
+
toned,
|
|
12
|
+
svg,
|
|
13
|
+
line,
|
|
14
|
+
area,
|
|
15
|
+
dot
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { area, Sparkline_module_default as default, dot, line, sparkline, svg, toned };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=Sparkline.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.module.js","names":[],"sources":["../../src/sparkline/Sparkline.module.css"],"sourcesContent":[".sparkline {\n position: relative;\n width: 100%;\n min-width: 3rem;\n height: var(--panneau-sparkline-height, 2rem);\n}\n\n/* In a tone: the solid color of the tone. */\n.toned {\n --_panneau-sparkline-color: var(--panneau-tone-solid);\n}\n\n.svg {\n display: block;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.line {\n fill: none;\n stroke: var(--_panneau-sparkline-color);\n stroke-width: var(--panneau-sparkline-line-width, 1.5px);\n stroke-linejoin: round;\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n}\n\n.area {\n fill: var(--_panneau-sparkline-color);\n fill-opacity: var(--panneau-sparkline-area-opacity, 0.12);\n stroke: none;\n}\n\n/* Round whatever the width, with a ring of the surface around it */\n.dot {\n position: absolute;\n width: var(--panneau-sparkline-dot-size, 6px);\n height: var(--panneau-sparkline-dot-size, 6px);\n border-radius: 50%;\n background-color: var(--_panneau-sparkline-color);\n box-shadow: 0 0 0 2px var(--panneau-card-bg, var(--panneau-color-surface));\n transform: translate(-50%, -50%);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Tokens of Sparkline. */
|
|
2
|
+
export declare const sparklineTokens: import("../index.js").ComponentTokens<"sparkline", "panneau-sparkline-height" | "panneau-sparkline-line-width" | "panneau-sparkline-dot-size" | "panneau-sparkline-area-opacity">;
|
|
3
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/sparkline/tokens.ts"],"names":[],"mappings":"AAEA,2BAA2B;AAC3B,eAAO,MAAM,eAAe,0KAS1B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponentTokens } from "../theme/componentTokens.js";
|
|
2
|
+
//#region src/sparkline/tokens.ts
|
|
3
|
+
/** Tokens of Sparkline. */
|
|
4
|
+
var sparklineTokens = defineComponentTokens("sparkline", {
|
|
5
|
+
/** Height of the line. */
|
|
6
|
+
height: "2rem",
|
|
7
|
+
/** Width of the line. */
|
|
8
|
+
"line-width": "1.5px",
|
|
9
|
+
/** Opacity of the area under the line. */
|
|
10
|
+
"area-opacity": "0.12",
|
|
11
|
+
/** Diameter of the dot on the last value. */
|
|
12
|
+
"dot-size": "6px"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { sparklineTokens };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","sparklineTokens","height"],"sources":["../../src/sparkline/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Sparkline. */\nexport const sparklineTokens = defineComponentTokens('sparkline', {\n /** Height of the line. */\n height: '2rem',\n /** Width of the line. */\n 'line-width': '1.5px',\n /** Opacity of the area under the line. */\n 'area-opacity': '0.12',\n /** Diameter of the dot on the last value. */\n 'dot-size': '6px',\n});\n"],"mappings":";;;AAGA,IAAaC,kBAAkBD,sBAAsB,aAAa;;CAE9DE,QAAQ;;CAER,cAAc;;CAEd,gBAAgB;;CAEhB,YAAY;AAChB,CAAC"}
|