p1-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.
Files changed (74) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +58 -2
  3. package/dist/CategoryBarChart-KYzsjGwg.js +715 -0
  4. package/dist/CategoryBarChart-KYzsjGwg.js.map +1 -0
  5. package/dist/{ChartFrame-B1bVFM2E.js → ChartFrame-DOEsou-R.js} +2 -2
  6. package/dist/{ChartFrame-B1bVFM2E.js.map → ChartFrame-DOEsou-R.js.map} +1 -1
  7. package/dist/ChartLegend-B8ZmIG2y.js +46 -0
  8. package/dist/ChartLegend-B8ZmIG2y.js.map +1 -0
  9. package/dist/{Heatmap-CFC753mV.js → Heatmap-Bwhf305C.js} +2 -2
  10. package/dist/{Heatmap-CFC753mV.js.map → Heatmap-Bwhf305C.js.map} +1 -1
  11. package/dist/{PieLegend-CbpjaOJH.js → PieLegend-16E6W10x.js} +3 -3
  12. package/dist/{PieLegend-CbpjaOJH.js.map → PieLegend-16E6W10x.js.map} +1 -1
  13. package/dist/PolarChart-C_vPz-3K.js +489 -0
  14. package/dist/PolarChart-C_vPz-3K.js.map +1 -0
  15. package/dist/{TimeSeriesChart-BzeHEtQl.js → TimeSeriesChart-BZMLERDZ.js} +451 -451
  16. package/dist/{TimeSeriesChart-BzeHEtQl.js.map → TimeSeriesChart-BZMLERDZ.js.map} +1 -1
  17. package/dist/category.d.ts +4 -1
  18. package/dist/category.d.ts.map +1 -1
  19. package/dist/category.js +4 -3
  20. package/dist/charts/CategoryBarChart/index.d.ts +3 -1
  21. package/dist/charts/CategoryBarChart/index.d.ts.map +1 -1
  22. package/dist/charts/ScatterChart/index.d.ts +1 -1
  23. package/dist/charts/ScatterChart/index.d.ts.map +1 -1
  24. package/dist/components/ChartLegend/index.d.ts +13 -0
  25. package/dist/components/ChartLegend/index.d.ts.map +1 -0
  26. package/dist/{css-BtFQ2bM4.js → css-BTZA9hea.js} +2 -2
  27. package/dist/{css-BtFQ2bM4.js.map → css-BTZA9hea.js.map} +1 -1
  28. package/dist/heatmap.js +1 -1
  29. package/dist/index.d.ts +5 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +64 -63
  32. package/dist/index.js.map +1 -1
  33. package/dist/pie.js +1 -1
  34. package/dist/scatter.d.ts +4 -1
  35. package/dist/scatter.d.ts.map +1 -1
  36. package/dist/scatter.js +3 -2
  37. package/dist/series.js +1 -1
  38. package/dist/standalone/p1-charts.standalone.js +13 -0
  39. package/dist/standalone.d.ts +27 -0
  40. package/dist/standalone.d.ts.map +1 -0
  41. package/dist/story.js +2 -2
  42. package/dist/theme.js +2 -2
  43. package/dist/{theme.utils-DgmWROoe.js → theme.utils-DF_e8LxQ.js} +118 -119
  44. package/dist/theme.utils-DF_e8LxQ.js.map +1 -0
  45. package/dist/types/category.d.ts +16 -0
  46. package/dist/types/category.d.ts.map +1 -1
  47. package/dist/types/scatter.d.ts +31 -0
  48. package/dist/types/scatter.d.ts.map +1 -1
  49. package/dist/{useChartTheme-KKtc1C4K.js → useChartTheme-D0bQ3LQq.js} +2 -2
  50. package/dist/{useChartTheme-KKtc1C4K.js.map → useChartTheme-D0bQ3LQq.js.map} +1 -1
  51. package/dist/utils/category.utils.d.ts +13 -1
  52. package/dist/utils/category.utils.d.ts.map +1 -1
  53. package/dist/utils/scatter.utils.d.ts +17 -1
  54. package/dist/utils/scatter.utils.d.ts.map +1 -1
  55. package/dist/utils/theme.utils.d.ts +1 -1
  56. package/dist/utils/theme.utils.d.ts.map +1 -1
  57. package/package.json +7 -3
  58. package/src/category.ts +4 -1
  59. package/src/charts/CategoryBarChart/index.tsx +108 -19
  60. package/src/charts/ScatterChart/index.tsx +73 -10
  61. package/src/components/ChartLegend/index.tsx +46 -0
  62. package/src/index.ts +5 -1
  63. package/src/scatter.ts +4 -1
  64. package/src/standalone.tsx +68 -0
  65. package/src/types/category.ts +16 -0
  66. package/src/types/scatter.ts +20 -0
  67. package/src/utils/category.utils.ts +89 -2
  68. package/src/utils/scatter.utils.ts +22 -5
  69. package/src/utils/theme.utils.ts +18 -15
  70. package/dist/CategoryBarChart-1Kn3Vozc.js +0 -580
  71. package/dist/CategoryBarChart-1Kn3Vozc.js.map +0 -1
  72. package/dist/PolarChart-hcNTWKfJ.js +0 -450
  73. package/dist/PolarChart-hcNTWKfJ.js.map +0 -1
  74. package/dist/theme.utils-DgmWROoe.js.map +0 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["removesUndefinedDefault","histogramColorsFromTheme","textStyle","contrastRatio","readableInk","pickPaths","deepMerge","defaultTheme","themeFromCssVariables","withAlpha","chartOptionsFromTheme","toSrgb","createTheme","referenceLine","themedLine","sameInputs","quantize","tidyTree","pieArcs","assertNonNegative","sum","extent","symmetricExtent","useHeatmapSteps","heatmapGrid","normaliseRange","pointerCell","HeatmapLegend","heatmapLayout","stepColor","useHeatmapSelection","cellAt","rangeStats","useHeatmapState","extremes","Heatmap","inRange","linear","easeInOutCubic","easeOutCubic","ChartThemeProvider","useChartTheme","useChart","toUnixSeconds","useWheelZoom","CandlestickChart","resolveBandStyles","isUp","aggregatePoints","toLinePoints","SeriesChart","histogramPriceLines","RibbonPrimitive","LineChart","histogramOptions","editorialChartOptions","HistogramChart","colorBars","patchSquareCanvasLabels","aggregate","TimeSeriesChart","BarChart","TimeRangePrimitive","timeToX","normalizePoints","bandAt","pieSlices","arcPath","PieChart","placeLabels","usePieState","PieLegend","useTween","CategoryBarChart","useMarkMemory","ScatterChart","PolarChart","Sparkline","bin","p1Theme","p1ThemeFromCss","p1Accents","p1CssVariables","useSteps","ChartStory","downloadCsv","toCsv","ChartFrame","worst","total","areas","smallest","largest","side2","side","total2","placeRow","row","index","vertical","free","thickness","offset","length","squarify","values","out","rect","area","value","order","b","a","rowAreas","indices","next","useNowLine","element","line","instance","timeScale","chart","place","x","now","visible","TimelinePane","HistogramPane","BAR_HEIGHT","MAX_GRID","defaultStyle","theme","height","timeline","text","typography","hash","key","char","palette","timeRangeStyler","overrides","timelineRanges","items","bar","start","end","state","etaTime","eta","startTime","unixTimes","seconds","times","time","timeGrid","known","first","last","step","size","from","to","usePaneRanges","entries","useRef","useEffect","list","panes","detach","entry","lanes","pane","lane","inputs","options","primitive","usePaneSeries","create","series","HistogramSeries","defaults","mode","optionInputs","dataInputs","over","positive","negative","lineInputs","i","ROOT","LABELS","LABEL","PLOT","FILL","NOW","DEFAULTS","NO_POINTS","formatValue","point","ChartPanes","forwardRef","container","nowLine","handlers","axisHeight","setAxisHeight","useState","hovered","setHovered","resolved","paneHeight","laneHeight","children","isValidElement","child","firstOptions","useMemo","ctrlWheelZoom","chartOptions","update","active","pointsAt","normalized","onMove","param","points","onClick","useImperativeHandle","ref","heights","nowLineTheme","nowStyle","labelsStyle","labelStyle","titleStyle","metaStyle","classNames","styles","axisLabel","ariaLabel","TimelineChart","props","id"],"sources":["../src/utils/squarify.utils.ts","../src/hooks/useNowLine.ts","../src/charts/TimelinePane/index.tsx","../src/charts/HistogramPane/index.tsx","../src/utils/timeline.utils.ts","../src/hooks/usePaneRanges.ts","../src/hooks/usePaneSeries.ts","../src/charts/ChartPanes/index.tsx","../src/charts/TimelineChart/index.tsx"],"sourcesContent":["import type { LayoutRect } from \"../types/layout.js\";\nimport { sum, extent, assertNonNegative } from \"./layout.utils.js\";\n\nfunction worst(areas: ReadonlyArray<number>, side: number) {\n const total = sum(areas);\n const [smallest, largest] = extent(areas);\n const side2 = side * side;\n const total2 = total * total;\n\n return Math.max((side2 * largest) / total2, total2 / (side2 * smallest));\n}\n\nfunction placeRow(\n row: ReadonlyArray<number>,\n areas: ReadonlyArray<number>,\n free: LayoutRect,\n out: LayoutRect[],\n): LayoutRect {\n const total = sum(row.map((index) => areas[index]!));\n const vertical = free.width >= free.height;\n const thickness = total / (vertical ? free.height : free.width);\n let offset = 0;\n\n for (const index of row) {\n const length = areas[index]! / thickness;\n out[index] = vertical\n ? { x: free.x, y: free.y + offset, width: thickness, height: length }\n : { x: free.x + offset, y: free.y, width: length, height: thickness };\n offset += length;\n }\n\n return vertical\n ? {\n ...free,\n x: free.x + thickness,\n width: Math.max(0, free.width - thickness),\n }\n : {\n ...free,\n y: free.y + thickness,\n height: Math.max(0, free.height - thickness),\n };\n}\n\nexport function squarify(\n values: ReadonlyArray<number>,\n rect: LayoutRect,\n): LayoutRect[] {\n assertNonNegative(\"squarify\", values);\n\n const out = values.map(() => ({ x: rect.x, y: rect.y, width: 0, height: 0 }));\n const total = sum(values);\n const area = Math.max(0, rect.width) * Math.max(0, rect.height);\n\n if (total === 0 || area === 0) return out;\n\n const areas = values.map((value) => (value * area) / total);\n const order = areas\n .map((_, index) => index)\n .filter((index) => areas[index]! > 0)\n .sort((a, b) => areas[b]! - areas[a]! || a - b);\n\n let free = { ...rect };\n let row: number[] = [];\n const rowAreas = (indices: number[]) => indices.map((index) => areas[index]!);\n\n for (const index of order) {\n const side = Math.min(free.width, free.height);\n const next = [...row, index];\n\n if (\n row.length === 0 ||\n worst(rowAreas(next), side) <= worst(rowAreas(row), side)\n ) {\n row = next;\n } else {\n free = placeRow(row, areas, free, out);\n row = [index];\n }\n }\n\n if (row.length > 0) placeRow(row, areas, free, out);\n\n return out;\n}\n","import { useEffect, type RefObject } from \"react\";\nimport { timeToX } from \"../utils/timeScale.utils.js\";\nimport type { ChartInstance } from \"../types/chart.js\";\n\nexport function useNowLine(\n instance: ChartInstance<\"Histogram\"> | null,\n line: RefObject<HTMLDivElement | null>,\n now: number | null,\n) {\n useEffect(() => {\n const element = line.current;\n\n if (!instance || !element) return;\n\n const { chart } = instance;\n const timeScale = chart.timeScale();\n\n const place = () => {\n const x = now === null ? null : timeToX(timeScale, now);\n const visible = x !== null && x >= 0 && x <= timeScale.width();\n\n element.style.display = visible ? \"block\" : \"none\";\n if (visible)\n element.style.transform = `translateX(${x + chart.priceScale(\"left\").width()}px)`;\n };\n\n place();\n timeScale.subscribeVisibleLogicalRangeChange(place);\n timeScale.subscribeSizeChange(place);\n\n return () => {\n timeScale.unsubscribeVisibleLogicalRangeChange(place);\n timeScale.unsubscribeSizeChange(place);\n };\n }, [instance, line, now]);\n}\n","import type { TimelinePaneProps } from \"../../types/timeline.js\";\n\nexport function TimelinePane(_props: TimelinePaneProps): null {\n return null;\n}\n","import type { HistogramPaneProps } from \"../../types/panes.js\";\n\nexport function HistogramPane(_props: HistogramPaneProps): null {\n return null;\n}\n","import type {\n TimelineItem,\n TimeRangeItem,\n TimeRangeStyle,\n} from \"../types/timeline.js\";\n\nimport type { Time } from \"../types/chart.js\";\nimport { deepMerge } from \"./merge.utils.js\";\nimport { toUnixSeconds } from \"./time.utils.js\";\nimport type { Theme } from \"../types/theme.js\";\n\nconst BAR_HEIGHT = 18;\nconst MAX_GRID = 5000;\n\nfunction defaultStyle(theme: Theme, key: string): TimeRangeStyle {\n const { palette, typography, timeline } = theme;\n const height = timeline.barHeight ?? BAR_HEIGHT;\n const text = (color: string) => ({ ...typography.label, color });\n const hash = [...key].reduce((sum, char) => sum + char.charCodeAt(0), 0);\n\n switch (key) {\n case \"active\":\n return {\n fill: palette.categorical[0] ?? palette.neutral,\n height,\n text: text(palette.background),\n };\n case \"confirmed\":\n return { fill: palette.grid, height, text: text(palette.text) };\n case \"tentative\":\n return {\n stroke: { color: palette.neutral, width: 1, style: \"dashed\" },\n height,\n text: text(palette.text),\n };\n case \"arrival\":\n return {\n hatch: { color: palette.neutral, spacing: 6, width: 1, opacity: 0.55 },\n height,\n };\n }\n\n const fill =\n palette.categorical[hash % palette.categorical.length] ?? palette.neutral;\n\n return { fill, height, text: text(palette.background) };\n}\n\nexport function timeRangeStyler(\n theme: Theme | null,\n overrides: Record<string, TimeRangeStyle> = {},\n): (key: string) => TimeRangeStyle {\n return (key) =>\n deepMerge<TimeRangeStyle>(\n theme && defaultStyle(theme, key),\n theme?.timeline.styles?.[key],\n overrides[key],\n );\n}\n\nexport function timelineRanges(\n items: ReadonlyArray<TimelineItem>,\n): TimeRangeItem[] {\n return items.flatMap(({ start, end, eta, state, label, color }) => {\n const bar = { from: start, to: end, key: state, label, color };\n const etaTime = eta === undefined ? null : toUnixSeconds(eta);\n const startTime = toUnixSeconds(start);\n\n return etaTime !== null && startTime !== null && etaTime < startTime\n ? [{ from: eta!, to: start, key: \"arrival\" }, bar]\n : [bar];\n });\n}\n\nexport function unixTimes(times: ReadonlyArray<Time>): number[] {\n const seconds = times\n .map(toUnixSeconds)\n .filter((time): time is number => time !== null);\n\n return [...new Set(seconds)].sort((a, b) => a - b);\n}\n\nexport function timeGrid(times: ReadonlyArray<Time>, step = 3600): number[] {\n const known = unixTimes(times);\n const first = known[0];\n const last = known[known.length - 1];\n\n if (first === undefined || last === undefined || !(step > 0)) return [];\n\n const size = Math.max(step, Math.ceil((last - first) / MAX_GRID));\n const from = Math.floor(first / size) * size;\n const to = Math.ceil(last / size) * size;\n\n return Array.from(\n { length: Math.max(1, (to - from) / size + 1) },\n (_, index) => from + index * size,\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport { sameInputs } from \"../utils/merge.utils.js\";\nimport type { Theme } from \"../types/theme.js\";\nimport type { ChartInstance } from \"../types/chart.js\";\nimport { TimeRangePrimitive } from \"../primitives/TimeRangePrimitive.js\";\nimport type { RangeEntry, TimelinePaneProps } from \"../types/timeline.js\";\nimport { timelineRanges, timeRangeStyler } from \"../utils/timeline.utils.js\";\n\nexport function usePaneRanges(\n instance: ChartInstance<\"Histogram\"> | null,\n lanes: ReadonlyArray<TimelinePaneProps | null>,\n theme: Theme | null,\n) {\n const entries = useRef<Array<RangeEntry | undefined>>([]);\n\n useEffect(() => {\n entries.current = [];\n }, [instance]);\n\n useEffect(() => {\n if (!instance) return;\n\n const list = entries.current;\n const panes = instance.chart.panes();\n const detach = (entry: RangeEntry | undefined) =>\n entry?.pane.detachPrimitive(entry.primitive);\n\n lanes.forEach((lane, index) => {\n const pane = panes[index];\n let entry = list[index];\n\n if (entry && (!lane || entry.pane !== pane)) {\n detach(entry);\n entry = list[index] = undefined;\n }\n\n if (!lane || !pane) return;\n\n const inputs = [lane.items, lane.styles, theme];\n\n if (entry && sameInputs(entry.inputs, inputs)) return;\n\n const options = {\n items: timelineRanges(lane.items),\n style: timeRangeStyler(theme, lane.styles),\n };\n\n if (entry) {\n entry.primitive.applyOptions(options);\n entry.inputs = inputs;\n return;\n }\n\n const primitive = new TimeRangePrimitive(options);\n\n pane.attachPrimitive(primitive);\n list[index] = { pane, primitive, inputs };\n });\n\n list.splice(lanes.length).forEach(detach);\n });\n}\n","import {\n HistogramSeries,\n type LineData,\n type IPriceLine,\n type ISeriesApi,\n type UTCTimestamp,\n type HistogramSeriesPartialOptions,\n} from \"lightweight-charts\";\n\nimport {\n colorBars,\n histogramOptions,\n histogramPriceLines,\n} from \"../utils/histogram.utils.js\";\n\nimport {\n deepMerge,\n pickPaths,\n sameInputs,\n removesUndefinedDefault,\n} from \"../utils/merge.utils.js\";\n\nimport { normalizePoints } from \"../utils/data.utils.js\";\nimport type { NormalizedSeries } from \"../types/series.js\";\n\nimport {\n themedLine,\n referenceLine,\n histogramColorsFromTheme,\n} from \"../utils/theme.utils.js\";\n\nimport type { Theme } from \"../types/theme.js\";\nimport type { LinePoint } from \"../types/chart.js\";\nimport type { ChartInstance } from \"../types/chart.js\";\nimport { unixTimes } from \"../utils/timeline.utils.js\";\nimport { useEffect, useRef, type RefObject } from \"react\";\nimport type { PaneSeriesInput, HistogramPaneProps } from \"../types/panes.js\";\n\nexport interface PaneEntry {\n series: ISeriesApi<\"Histogram\">;\n defaults: HistogramSeriesPartialOptions;\n options: HistogramSeriesPartialOptions;\n optionInputs: unknown[];\n dataInputs: unknown[];\n lineInputs: unknown[];\n lines: IPriceLine[];\n normalized: NormalizedSeries<LinePoint, LineData>;\n}\n\nexport function usePaneSeries(\n instance: ChartInstance<\"Histogram\"> | null,\n panes: ReadonlyArray<PaneSeriesInput>,\n theme: Theme | null,\n): RefObject<PaneEntry[]> {\n const entries = useRef<PaneEntry[]>([]);\n\n useEffect(() => {\n entries.current = [];\n }, [instance]);\n\n useEffect(() => {\n if (!instance) return;\n\n const { chart } = instance;\n const list = entries.current;\n\n const create = (\n index: number,\n options: HistogramSeriesPartialOptions,\n optionInputs: unknown[],\n ): PaneEntry => {\n const series =\n index === 0\n ? instance.series\n : chart.addSeries(HistogramSeries, {}, index);\n const defaults = deepMerge<HistogramSeriesPartialOptions>(\n series.options(),\n );\n\n if (index > 0) {\n series.applyOptions(options);\n chart.panes()[index]?.setPreserveEmptyPane(true);\n }\n\n return {\n series,\n defaults,\n options,\n optionInputs,\n dataInputs: [],\n lineInputs: [],\n lines: [],\n normalized: normalizePoints([]),\n };\n };\n\n panes.forEach((pane, index) => {\n const mode = pane.mode ?? \"plain\";\n const optionInputs = [mode, pane.seriesOptions];\n const options = histogramOptions(mode, pane.seriesOptions);\n let entry = list[index];\n\n if (entry && index > 0 && !sameInputs(entry.optionInputs, optionInputs)) {\n if (removesUndefinedDefault(entry.defaults, entry.options, options)) {\n chart.removeSeries(entry.series);\n entry = undefined;\n } else {\n entry.series.applyOptions(\n deepMerge(pickPaths(entry.defaults, entry.options), options),\n );\n entry.options = options;\n entry.optionInputs = optionInputs;\n }\n }\n\n if (!entry) list[index] = entry = create(index, options, optionInputs);\n\n const { bar, over, positive, negative } = deepMerge<\n NonNullable<HistogramPaneProps[\"colors\"]>\n >(histogramColorsFromTheme(theme), pane.colors);\n const dataInputs = [\n pane.data,\n pane.whitespace,\n mode,\n pane.threshold,\n bar,\n over,\n positive,\n negative,\n ];\n\n if (!sameInputs(entry.dataInputs, dataInputs)) {\n entry.normalized = normalizePoints(pane.data);\n entry.series.setData(\n pane.whitespace\n ? unixTimes(pane.whitespace).map((time) => ({\n time: time as UTCTimestamp,\n }))\n : colorBars(entry.normalized.data, mode, pane.threshold, {\n bar,\n over,\n positive,\n negative,\n }),\n );\n entry.dataInputs = dataInputs;\n }\n\n const lineInputs = [\n mode,\n pane.threshold,\n pane.thresholdLine,\n pane.zeroLine,\n theme,\n ];\n\n if (!sameInputs(entry.lineInputs, lineInputs)) {\n const { series } = entry;\n\n entry.lines.forEach((line) => series.removePriceLine(line));\n entry.lines = histogramPriceLines(\n mode,\n pane.threshold,\n themedLine(\n referenceLine(theme, theme?.histogram.threshold, \"dashed\"),\n pane.thresholdLine,\n ),\n themedLine(\n referenceLine(theme, theme?.histogram.zero, \"solid\"),\n pane.zeroLine,\n ),\n ).map((line) => series.createPriceLine(line));\n entry.lineInputs = lineInputs;\n }\n\n chart.panes()[index]?.setStretchFactor(pane.height);\n });\n\n list.splice(panes.length).forEach((entry) => {\n if (entry.series !== instance.series) {\n chart.removeSeries(entry.series);\n return;\n }\n\n entry.lines.forEach((line) => entry.series.removePriceLine(line));\n entry.series.setData([]);\n });\n\n for (let i = chart.panes().length - 1; i >= Math.max(panes.length, 1); i--)\n chart.removePane(i);\n });\n\n return entries;\n}\n","import {\n useRef,\n useMemo,\n useState,\n Children,\n useEffect,\n forwardRef,\n isValidElement,\n type CSSProperties,\n useImperativeHandle,\n} from \"react\";\n\nimport {\n HistogramSeries,\n type DeepPartial,\n type ChartOptions,\n type MouseEventParams,\n} from \"lightweight-charts\";\n\nimport type {\n ChartPanesProps,\n ChartPanesHandle,\n PaneSeriesInput,\n HistogramPaneProps,\n} from \"../../types/panes.js\";\n\nimport {\n textStyle,\n defaultTheme,\n chartOptionsFromTheme,\n} from \"../../utils/theme.utils.js\";\n\nimport { useChart } from \"../../hooks/useChart.js\";\nimport type { ThemeLine } from \"../../types/theme.js\";\nimport type { LinePoint } from \"../../types/chart.js\";\nimport { useNowLine } from \"../../hooks/useNowLine.js\";\nimport { deepMerge } from \"../../utils/merge.utils.js\";\nimport { TimelinePane } from \"../TimelinePane/index.js\";\nimport { HistogramPane } from \"../HistogramPane/index.js\";\nimport { toUnixSeconds } from \"../../utils/time.utils.js\";\nimport { useWheelZoom } from \"../../hooks/useWheelZoom.js\";\nimport { useChartTheme } from \"../../hooks/useChartTheme.js\";\nimport { usePaneRanges } from \"../../hooks/usePaneRanges.js\";\nimport { usePaneSeries } from \"../../hooks/usePaneSeries.js\";\nimport type { TimelinePaneProps } from \"../../types/timeline.js\";\nimport { histogramOptions } from \"../../utils/histogram.utils.js\";\n\nconst ROOT: CSSProperties = { display: \"flex\" };\nconst LABELS: CSSProperties = { flex: \"none\" };\nconst LABEL: CSSProperties = { boxSizing: \"border-box\", overflow: \"hidden\" };\nconst PLOT: CSSProperties = { position: \"relative\", flex: 1, minWidth: 0 };\nconst FILL: CSSProperties = { position: \"absolute\", inset: 0 };\nconst NOW: CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: 1,\n display: \"none\",\n pointerEvents: \"none\",\n};\nconst DEFAULTS: DeepPartial<ChartOptions> = {\n layout: { panes: { enableResize: false } },\n};\n\nconst NO_POINTS: LinePoint[] = [];\n\nconst formatValue = (point: LinePoint) => point.value.toLocaleString();\n\nexport const ChartPanes = forwardRef<ChartPanesHandle | null, ChartPanesProps>(\n function ChartPanes(\n {\n children,\n now = null,\n axisLabel,\n chartOptions,\n ctrlWheelZoom = true,\n ariaLabel = \"Chart panes\",\n className,\n classNames = {},\n styles = {},\n onPaneClick,\n onPaneHover,\n onPaneLeave,\n theme,\n unstyled,\n },\n ref,\n ) {\n const container = useRef<HTMLDivElement>(null);\n const nowLine = useRef<HTMLDivElement>(null);\n const handlers = useRef({ onPaneClick, onPaneHover, onPaneLeave });\n const [axisHeight, setAxisHeight] = useState(0);\n const [hovered, setHovered] = useState<Array<LinePoint | null> | null>(\n null,\n );\n handlers.current = { onPaneClick, onPaneHover, onPaneLeave };\n\n const resolved = useChartTheme({ theme, unstyled });\n const paneHeight =\n resolved?.sizes.paneHeight ?? defaultTheme.sizes.paneHeight;\n const laneHeight = resolved?.sizes.laneHeight ?? paneHeight;\n const lanes: Array<TimelinePaneProps | null> = [];\n const panes: PaneSeriesInput[] = [];\n\n Children.forEach(children, (child) => {\n if (\n isValidElement<HistogramPaneProps>(child) &&\n child.type === HistogramPane\n ) {\n lanes.push(null);\n panes.push({\n ...child.props,\n height: child.props.height ?? paneHeight,\n });\n }\n if (\n isValidElement<TimelinePaneProps>(child) &&\n child.type === TimelinePane\n ) {\n const { label, meta, height = laneHeight, times } = child.props;\n\n lanes.push(child.props);\n panes.push({ label, meta, height, data: NO_POINTS, whitespace: times });\n }\n });\n\n const first = panes[0];\n const firstOptions = useMemo(\n () => histogramOptions(first?.mode ?? \"plain\", first?.seriesOptions),\n [first?.mode, first?.seriesOptions],\n );\n const options = useMemo(\n () =>\n deepMerge<DeepPartial<ChartOptions>>(\n chartOptionsFromTheme(resolved),\n DEFAULTS,\n ctrlWheelZoom && {\n handleScale: { mouseWheel: false },\n handleScroll: { mouseWheel: false },\n },\n chartOptions,\n ),\n [resolved, ctrlWheelZoom, chartOptions],\n );\n\n const instance = useChart(\n container,\n HistogramSeries,\n options,\n firstOptions,\n );\n const entries = usePaneSeries(instance, panes, resolved);\n usePaneRanges(instance, lanes, resolved);\n useWheelZoom(instance, container, ctrlWheelZoom);\n\n useEffect(() => {\n if (!instance) return;\n\n const timeScale = instance.chart.timeScale();\n const update = () => setAxisHeight(timeScale.height());\n\n update();\n timeScale.subscribeSizeChange(update);\n\n return () => timeScale.unsubscribeSizeChange(update);\n }, [instance]);\n\n useEffect(() => {\n if (!instance) return;\n\n const { chart } = instance;\n let active = false;\n\n const pointsAt = (time: number) =>\n entries.current.map(({ normalized }) => {\n const index = normalized.indexByTime.get(time);\n\n return index === undefined\n ? null\n : (normalized.points[index] ?? null);\n });\n\n const onMove = (param: MouseEventParams) => {\n if (param.time === undefined || !param.point) {\n if (!active) return;\n\n active = false;\n setHovered(null);\n handlers.current.onPaneLeave?.();\n return;\n }\n\n const time = Number(param.time);\n const points = pointsAt(time);\n\n active = true;\n setHovered(points);\n handlers.current.onPaneHover?.({ time, points });\n };\n\n const onClick = (param: MouseEventParams) => {\n if (param.time === undefined) return;\n\n const time = Number(param.time);\n\n handlers.current.onPaneClick?.({ time, points: pointsAt(time) });\n };\n\n chart.subscribeCrosshairMove(onMove);\n chart.subscribeClick(onClick);\n\n return () => {\n chart.unsubscribeCrosshairMove(onMove);\n chart.unsubscribeClick(onClick);\n };\n }, [instance, entries]);\n\n useNowLine(instance, nowLine, now === null ? null : toUnixSeconds(now));\n\n useImperativeHandle<ChartPanesHandle | null, ChartPanesHandle | null>(\n ref,\n () =>\n instance\n ? {\n chart: instance.chart,\n get series() {\n return entries.current.map((entry) => entry.series);\n },\n }\n : null,\n [instance, entries],\n );\n\n const heights = panes.map((pane) => pane.height);\n const nowLineTheme =\n resolved &&\n deepMerge<ThemeLine>({ color: resolved.palette.now }, resolved.panes.now);\n const nowStyle: CSSProperties = nowLineTheme\n ? {\n width: 0,\n borderLeft: `${nowLineTheme.width ?? 1}px ${nowLineTheme.style ?? \"solid\"} ${nowLineTheme.color}`,\n }\n : {};\n const labelsStyle: CSSProperties = { width: resolved?.sizes.paneLabel };\n const labelStyle: CSSProperties = { padding: resolved?.spacing.paneLabel };\n const titleStyle = textStyle(\n resolved\n ? deepMerge(resolved.typography.title, resolved.panes.title)\n : undefined,\n );\n const metaStyle = textStyle(\n resolved\n ? deepMerge(resolved.typography.value, resolved.panes.meta)\n : undefined,\n );\n const total =\n heights.reduce((sum, height) => sum + height, 0) +\n Math.max(0, panes.length - 1) +\n axisHeight;\n\n return (\n <div className={className} style={ROOT}>\n <div\n data-part=\"labels\"\n className={classNames.labels}\n style={{ ...LABELS, ...labelsStyle, ...styles.labels }}\n >\n {panes.map((pane, index) => {\n const point = hovered?.[index];\n\n return (\n <div\n key={index}\n data-part=\"label\"\n className={classNames.label}\n style={{\n ...LABEL,\n ...labelStyle,\n height: heights[index]! + (index > 0 ? 1 : 0),\n ...styles.label,\n }}\n >\n <div\n data-part=\"title\"\n className={classNames.title}\n style={{ ...titleStyle, ...styles.title }}\n >\n {pane.label}\n </div>\n <div\n data-part=\"meta\"\n className={classNames.meta}\n style={{ ...metaStyle, ...styles.meta }}\n >\n {point ? (pane.format ?? formatValue)(point) : pane.meta}\n </div>\n </div>\n );\n })}\n <div\n data-part=\"axis\"\n className={classNames.axis}\n style={{ ...LABEL, height: axisHeight, ...styles.axis }}\n >\n {axisLabel}\n </div>\n </div>\n <div\n data-part=\"plot\"\n className={classNames.plot}\n style={{ ...PLOT, height: total, ...styles.plot }}\n >\n <div ref={container} style={FILL} role=\"img\" aria-label={ariaLabel} />\n <div\n ref={nowLine}\n data-part=\"now\"\n className={classNames.now}\n style={{ ...NOW, ...nowStyle, bottom: axisHeight, ...styles.now }}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n );\n },\n);\n","import { forwardRef, useMemo } from \"react\";\nimport { ChartPanes } from \"../ChartPanes/index.js\";\nimport { TimelinePane } from \"../TimelinePane/index.js\";\nimport { timeGrid } from \"../../utils/timeline.utils.js\";\nimport type { ChartPanesHandle } from \"../../types/panes.js\";\nimport type { TimelineChartProps } from \"../../types/timeline.js\";\n\nexport const TimelineChart = forwardRef<\n ChartPanesHandle | null,\n TimelineChartProps\n>(function TimelineChart({ lanes, step, ...props }, ref) {\n const times = useMemo(\n () =>\n timeGrid(\n lanes.flatMap((lane) =>\n lane.items.flatMap(({ start, end, eta }) =>\n eta === undefined ? [start, end] : [eta, start, end],\n ),\n ),\n step,\n ),\n [lanes, step],\n );\n\n return (\n <ChartPanes ref={ref} {...props}>\n {lanes.map(({ id, ...lane }, index) => (\n <TimelinePane\n key={id}\n {...lane}\n times={index === 0 ? times : undefined}\n />\n ))}\n </ChartPanes>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,SAASwF,GAAM,GAA8B,GAAc;CACzD,IAAMC,IAAQrE,EAAIsE,CAAK,GACjB,CAACC,GAAUC,KAAWvE,EAAOqE,CAAK,GAClCG,IAAQC,IAAOA,GACfC,IAASN,IAAQA;CAEvB,OAAO,KAAK,IAAKI,IAAQD,IAAWG,GAAQA,KAAUF,IAAQF,EAAS;AACzE;AAEA,SAASK,GACP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W,OAAOR;IAAM,MAAK;IAAM,cAAY8C;GAAY,CAAA,GACrE,kBAAC,OAAD;IACE,KAAKrC;IACL,aAAU;IACV,WAAWkC,EAAW;IACtB,OAAO;KAAE,GAAG1C;KAAK,GAAGqC;KAAU,QAAQ3B;KAAY,GAAGiC,EAAO;IAAI;IAChE,eAAY;GACb,CAAA,CACE;EACF,CAAA,CAAA;;AAET,CACF,GC7TaG,KAAgBxC,EAG3B,SAAuB,EAAE,UAAO,SAAM,GAAGyC,KAAS,GAAK;CACvD,IAAMzF,IAAQgE,QAEV9D,GACEgB,EAAM,SAAS,MACbE,EAAK,MAAM,SAAS,EAAE,UAAO,QAAK,aAChCxB,MAAQ,KAAA,IAAY,CAACJ,GAAOC,CAAG,IAAI;EAACG;EAAKJ;EAAOC;CAAG,CACrD,CACF,GACAa,CACF,GACF,CAACY,GAAOZ,CAAI,CACd;CAEA,OACE,kBAACyC,IAAD;EAAiB;EAAK,GAAI0C;EACvB,UAAAvE,EAAM,KAAK,EAAE,OAAI,GAAGE,KAAQ,MAC3B,kBAAC/C,GAAD;GAEE,GAAI+C;GACJ,OAAO3E,MAAU,IAAIuD,IAAQ,KAAA;EAC9B,GAHM0F,CAGN,CACF;CACS,CAAA;AAEhB,CAAC"}
1
+ {"version":3,"file":"index.js","names":["removesUndefinedDefault","histogramColorsFromTheme","textStyle","contrastRatio","readableInk","pickPaths","deepMerge","defaultTheme","themeFromCssVariables","withAlpha","chartOptionsFromTheme","toSrgb","createTheme","referenceLine","themedLine","sameInputs","quantize","tidyTree","pieArcs","assertNonNegative","sum","extent","symmetricExtent","useHeatmapSteps","heatmapGrid","normaliseRange","pointerCell","HeatmapLegend","heatmapLayout","stepColor","useHeatmapSelection","cellAt","rangeStats","useHeatmapState","extremes","Heatmap","inRange","linear","easeInOutCubic","easeOutCubic","ChartThemeProvider","useChartTheme","useChart","toUnixSeconds","useWheelZoom","CandlestickChart","resolveBandStyles","isUp","aggregatePoints","toLinePoints","SeriesChart","histogramPriceLines","RibbonPrimitive","LineChart","histogramOptions","editorialChartOptions","HistogramChart","colorBars","patchSquareCanvasLabels","aggregate","TimeSeriesChart","BarChart","TimeRangePrimitive","timeToX","normalizePoints","bandAt","pieSlices","arcPath","PieChart","placeLabels","usePieState","PieLegend","useTween","niceStep","niceExtent","CategoryBarChart","useMarkMemory","ChartLegend","ScatterChart","PolarChart","Sparkline","bin","p1Theme","p1ThemeFromCss","p1Accents","p1CssVariables","useSteps","ChartStory","downloadCsv","toCsv","ChartFrame","worst","total","areas","smallest","largest","side2","side","total2","placeRow","row","index","vertical","free","thickness","offset","length","squarify","values","out","rect","area","value","order","b","a","rowAreas","indices","next","useNowLine","element","line","instance","timeScale","chart","place","x","now","visible","TimelinePane","HistogramPane","BAR_HEIGHT","MAX_GRID","defaultStyle","theme","height","timeline","text","typography","hash","key","char","palette","timeRangeStyler","overrides","timelineRanges","items","bar","start","end","state","etaTime","eta","startTime","unixTimes","seconds","times","time","timeGrid","known","first","last","step","size","from","to","usePaneRanges","entries","useRef","useEffect","list","panes","detach","entry","lanes","pane","lane","inputs","options","primitive","usePaneSeries","create","series","HistogramSeries","defaults","mode","optionInputs","dataInputs","over","positive","negative","lineInputs","i","ROOT","LABELS","LABEL","PLOT","FILL","NOW","DEFAULTS","NO_POINTS","formatValue","point","ChartPanes","forwardRef","container","nowLine","handlers","axisHeight","setAxisHeight","useState","hovered","setHovered","resolved","paneHeight","laneHeight","children","isValidElement","child","firstOptions","useMemo","ctrlWheelZoom","chartOptions","update","active","pointsAt","normalized","onMove","param","points","onClick","useImperativeHandle","ref","heights","nowLineTheme","nowStyle","labelsStyle","labelStyle","titleStyle","metaStyle","classNames","styles","axisLabel","ariaLabel","TimelineChart","props","id"],"sources":["../src/utils/squarify.utils.ts","../src/hooks/useNowLine.ts","../src/charts/TimelinePane/index.tsx","../src/charts/HistogramPane/index.tsx","../src/utils/timeline.utils.ts","../src/hooks/usePaneRanges.ts","../src/hooks/usePaneSeries.ts","../src/charts/ChartPanes/index.tsx","../src/charts/TimelineChart/index.tsx"],"sourcesContent":["import type { LayoutRect } from \"../types/layout.js\";\nimport { sum, extent, assertNonNegative } from \"./layout.utils.js\";\n\nfunction worst(areas: ReadonlyArray<number>, side: number) {\n const total = sum(areas);\n const [smallest, largest] = extent(areas);\n const side2 = side * side;\n const total2 = total * total;\n\n return Math.max((side2 * largest) / total2, total2 / (side2 * smallest));\n}\n\nfunction placeRow(\n row: ReadonlyArray<number>,\n areas: ReadonlyArray<number>,\n free: LayoutRect,\n out: LayoutRect[],\n): LayoutRect {\n const total = sum(row.map((index) => areas[index]!));\n const vertical = free.width >= free.height;\n const thickness = total / (vertical ? free.height : free.width);\n let offset = 0;\n\n for (const index of row) {\n const length = areas[index]! / thickness;\n out[index] = vertical\n ? { x: free.x, y: free.y + offset, width: thickness, height: length }\n : { x: free.x + offset, y: free.y, width: length, height: thickness };\n offset += length;\n }\n\n return vertical\n ? {\n ...free,\n x: free.x + thickness,\n width: Math.max(0, free.width - thickness),\n }\n : {\n ...free,\n y: free.y + thickness,\n height: Math.max(0, free.height - thickness),\n };\n}\n\nexport function squarify(\n values: ReadonlyArray<number>,\n rect: LayoutRect,\n): LayoutRect[] {\n assertNonNegative(\"squarify\", values);\n\n const out = values.map(() => ({ x: rect.x, y: rect.y, width: 0, height: 0 }));\n const total = sum(values);\n const area = Math.max(0, rect.width) * Math.max(0, rect.height);\n\n if (total === 0 || area === 0) return out;\n\n const areas = values.map((value) => (value * area) / total);\n const order = areas\n .map((_, index) => index)\n .filter((index) => areas[index]! > 0)\n .sort((a, b) => areas[b]! - areas[a]! || a - b);\n\n let free = { ...rect };\n let row: number[] = [];\n const rowAreas = (indices: number[]) => indices.map((index) => areas[index]!);\n\n for (const index of order) {\n const side = Math.min(free.width, free.height);\n const next = [...row, index];\n\n if (\n row.length === 0 ||\n worst(rowAreas(next), side) <= worst(rowAreas(row), side)\n ) {\n row = next;\n } else {\n free = placeRow(row, areas, free, out);\n row = [index];\n }\n }\n\n if (row.length > 0) placeRow(row, areas, free, out);\n\n return out;\n}\n","import { useEffect, type RefObject } from \"react\";\nimport { timeToX } from \"../utils/timeScale.utils.js\";\nimport type { ChartInstance } from \"../types/chart.js\";\n\nexport function useNowLine(\n instance: ChartInstance<\"Histogram\"> | null,\n line: RefObject<HTMLDivElement | null>,\n now: number | null,\n) {\n useEffect(() => {\n const element = line.current;\n\n if (!instance || !element) return;\n\n const { chart } = instance;\n const timeScale = chart.timeScale();\n\n const place = () => {\n const x = now === null ? null : timeToX(timeScale, now);\n const visible = x !== null && x >= 0 && x <= timeScale.width();\n\n element.style.display = visible ? \"block\" : \"none\";\n if (visible)\n element.style.transform = `translateX(${x + chart.priceScale(\"left\").width()}px)`;\n };\n\n place();\n timeScale.subscribeVisibleLogicalRangeChange(place);\n timeScale.subscribeSizeChange(place);\n\n return () => {\n timeScale.unsubscribeVisibleLogicalRangeChange(place);\n timeScale.unsubscribeSizeChange(place);\n };\n }, [instance, line, now]);\n}\n","import type { TimelinePaneProps } from \"../../types/timeline.js\";\n\nexport function TimelinePane(_props: TimelinePaneProps): null {\n return null;\n}\n","import type { HistogramPaneProps } from \"../../types/panes.js\";\n\nexport function HistogramPane(_props: HistogramPaneProps): null {\n return null;\n}\n","import type {\n TimelineItem,\n TimeRangeItem,\n TimeRangeStyle,\n} from \"../types/timeline.js\";\n\nimport type { Time } from \"../types/chart.js\";\nimport { deepMerge } from \"./merge.utils.js\";\nimport { toUnixSeconds } from \"./time.utils.js\";\nimport type { Theme } from \"../types/theme.js\";\n\nconst BAR_HEIGHT = 18;\nconst MAX_GRID = 5000;\n\nfunction defaultStyle(theme: Theme, key: string): TimeRangeStyle {\n const { palette, typography, timeline } = theme;\n const height = timeline.barHeight ?? BAR_HEIGHT;\n const text = (color: string) => ({ ...typography.label, color });\n const hash = [...key].reduce((sum, char) => sum + char.charCodeAt(0), 0);\n\n switch (key) {\n case \"active\":\n return {\n fill: palette.categorical[0] ?? palette.neutral,\n height,\n text: text(palette.background),\n };\n case \"confirmed\":\n return { fill: palette.grid, height, text: text(palette.text) };\n case \"tentative\":\n return {\n stroke: { color: palette.neutral, width: 1, style: \"dashed\" },\n height,\n text: text(palette.text),\n };\n case \"arrival\":\n return {\n hatch: { color: palette.neutral, spacing: 6, width: 1, opacity: 0.55 },\n height,\n };\n }\n\n const fill =\n palette.categorical[hash % palette.categorical.length] ?? palette.neutral;\n\n return { fill, height, text: text(palette.background) };\n}\n\nexport function timeRangeStyler(\n theme: Theme | null,\n overrides: Record<string, TimeRangeStyle> = {},\n): (key: string) => TimeRangeStyle {\n return (key) =>\n deepMerge<TimeRangeStyle>(\n theme && defaultStyle(theme, key),\n theme?.timeline.styles?.[key],\n overrides[key],\n );\n}\n\nexport function timelineRanges(\n items: ReadonlyArray<TimelineItem>,\n): TimeRangeItem[] {\n return items.flatMap(({ start, end, eta, state, label, color }) => {\n const bar = { from: start, to: end, key: state, label, color };\n const etaTime = eta === undefined ? null : toUnixSeconds(eta);\n const startTime = toUnixSeconds(start);\n\n return etaTime !== null && startTime !== null && etaTime < startTime\n ? [{ from: eta!, to: start, key: \"arrival\" }, bar]\n : [bar];\n });\n}\n\nexport function unixTimes(times: ReadonlyArray<Time>): number[] {\n const seconds = times\n .map(toUnixSeconds)\n .filter((time): time is number => time !== null);\n\n return [...new Set(seconds)].sort((a, b) => a - b);\n}\n\nexport function timeGrid(times: ReadonlyArray<Time>, step = 3600): number[] {\n const known = unixTimes(times);\n const first = known[0];\n const last = known[known.length - 1];\n\n if (first === undefined || last === undefined || !(step > 0)) return [];\n\n const size = Math.max(step, Math.ceil((last - first) / MAX_GRID));\n const from = Math.floor(first / size) * size;\n const to = Math.ceil(last / size) * size;\n\n return Array.from(\n { length: Math.max(1, (to - from) / size + 1) },\n (_, index) => from + index * size,\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport { sameInputs } from \"../utils/merge.utils.js\";\nimport type { Theme } from \"../types/theme.js\";\nimport type { ChartInstance } from \"../types/chart.js\";\nimport { TimeRangePrimitive } from \"../primitives/TimeRangePrimitive.js\";\nimport type { RangeEntry, TimelinePaneProps } from \"../types/timeline.js\";\nimport { timelineRanges, timeRangeStyler } from \"../utils/timeline.utils.js\";\n\nexport function usePaneRanges(\n instance: ChartInstance<\"Histogram\"> | null,\n lanes: ReadonlyArray<TimelinePaneProps | null>,\n theme: Theme | null,\n) {\n const entries = useRef<Array<RangeEntry | undefined>>([]);\n\n useEffect(() => {\n entries.current = [];\n }, [instance]);\n\n useEffect(() => {\n if (!instance) return;\n\n const list = entries.current;\n const panes = instance.chart.panes();\n const detach = (entry: RangeEntry | undefined) =>\n entry?.pane.detachPrimitive(entry.primitive);\n\n lanes.forEach((lane, index) => {\n const pane = panes[index];\n let entry = list[index];\n\n if (entry && (!lane || entry.pane !== pane)) {\n detach(entry);\n entry = list[index] = undefined;\n }\n\n if (!lane || !pane) return;\n\n const inputs = [lane.items, lane.styles, theme];\n\n if (entry && sameInputs(entry.inputs, inputs)) return;\n\n const options = {\n items: timelineRanges(lane.items),\n style: timeRangeStyler(theme, lane.styles),\n };\n\n if (entry) {\n entry.primitive.applyOptions(options);\n entry.inputs = inputs;\n return;\n }\n\n const primitive = new TimeRangePrimitive(options);\n\n pane.attachPrimitive(primitive);\n list[index] = { pane, primitive, inputs };\n });\n\n list.splice(lanes.length).forEach(detach);\n });\n}\n","import {\n HistogramSeries,\n type LineData,\n type IPriceLine,\n type ISeriesApi,\n type UTCTimestamp,\n type HistogramSeriesPartialOptions,\n} from \"lightweight-charts\";\n\nimport {\n colorBars,\n histogramOptions,\n histogramPriceLines,\n} from \"../utils/histogram.utils.js\";\n\nimport {\n deepMerge,\n pickPaths,\n sameInputs,\n removesUndefinedDefault,\n} from \"../utils/merge.utils.js\";\n\nimport { normalizePoints } from \"../utils/data.utils.js\";\nimport type { NormalizedSeries } from \"../types/series.js\";\n\nimport {\n themedLine,\n referenceLine,\n histogramColorsFromTheme,\n} from \"../utils/theme.utils.js\";\n\nimport type { Theme } from \"../types/theme.js\";\nimport type { LinePoint } from \"../types/chart.js\";\nimport type { ChartInstance } from \"../types/chart.js\";\nimport { unixTimes } from \"../utils/timeline.utils.js\";\nimport { useEffect, useRef, type RefObject } from \"react\";\nimport type { PaneSeriesInput, HistogramPaneProps } from \"../types/panes.js\";\n\nexport interface PaneEntry {\n series: ISeriesApi<\"Histogram\">;\n defaults: HistogramSeriesPartialOptions;\n options: HistogramSeriesPartialOptions;\n optionInputs: unknown[];\n dataInputs: unknown[];\n lineInputs: unknown[];\n lines: IPriceLine[];\n normalized: NormalizedSeries<LinePoint, LineData>;\n}\n\nexport function usePaneSeries(\n instance: ChartInstance<\"Histogram\"> | null,\n panes: ReadonlyArray<PaneSeriesInput>,\n theme: Theme | null,\n): RefObject<PaneEntry[]> {\n const entries = useRef<PaneEntry[]>([]);\n\n useEffect(() => {\n entries.current = [];\n }, [instance]);\n\n useEffect(() => {\n if (!instance) return;\n\n const { chart } = instance;\n const list = entries.current;\n\n const create = (\n index: number,\n options: HistogramSeriesPartialOptions,\n optionInputs: unknown[],\n ): PaneEntry => {\n const series =\n index === 0\n ? instance.series\n : chart.addSeries(HistogramSeries, {}, index);\n const defaults = deepMerge<HistogramSeriesPartialOptions>(\n series.options(),\n );\n\n if (index > 0) {\n series.applyOptions(options);\n chart.panes()[index]?.setPreserveEmptyPane(true);\n }\n\n return {\n series,\n defaults,\n options,\n optionInputs,\n dataInputs: [],\n lineInputs: [],\n lines: [],\n normalized: normalizePoints([]),\n };\n };\n\n panes.forEach((pane, index) => {\n const mode = pane.mode ?? \"plain\";\n const optionInputs = [mode, pane.seriesOptions];\n const options = histogramOptions(mode, pane.seriesOptions);\n let entry = list[index];\n\n if (entry && index > 0 && !sameInputs(entry.optionInputs, optionInputs)) {\n if (removesUndefinedDefault(entry.defaults, entry.options, options)) {\n chart.removeSeries(entry.series);\n entry = undefined;\n } else {\n entry.series.applyOptions(\n deepMerge(pickPaths(entry.defaults, entry.options), options),\n );\n entry.options = options;\n entry.optionInputs = optionInputs;\n }\n }\n\n if (!entry) list[index] = entry = create(index, options, optionInputs);\n\n const { bar, over, positive, negative } = deepMerge<\n NonNullable<HistogramPaneProps[\"colors\"]>\n >(histogramColorsFromTheme(theme), pane.colors);\n const dataInputs = [\n pane.data,\n pane.whitespace,\n mode,\n pane.threshold,\n bar,\n over,\n positive,\n negative,\n ];\n\n if (!sameInputs(entry.dataInputs, dataInputs)) {\n entry.normalized = normalizePoints(pane.data);\n entry.series.setData(\n pane.whitespace\n ? unixTimes(pane.whitespace).map((time) => ({\n time: time as UTCTimestamp,\n }))\n : colorBars(entry.normalized.data, mode, pane.threshold, {\n bar,\n over,\n positive,\n negative,\n }),\n );\n entry.dataInputs = dataInputs;\n }\n\n const lineInputs = [\n mode,\n pane.threshold,\n pane.thresholdLine,\n pane.zeroLine,\n theme,\n ];\n\n if (!sameInputs(entry.lineInputs, lineInputs)) {\n const { series } = entry;\n\n entry.lines.forEach((line) => series.removePriceLine(line));\n entry.lines = histogramPriceLines(\n mode,\n pane.threshold,\n themedLine(\n referenceLine(theme, theme?.histogram.threshold, \"dashed\"),\n pane.thresholdLine,\n ),\n themedLine(\n referenceLine(theme, theme?.histogram.zero, \"solid\"),\n pane.zeroLine,\n ),\n ).map((line) => series.createPriceLine(line));\n entry.lineInputs = lineInputs;\n }\n\n chart.panes()[index]?.setStretchFactor(pane.height);\n });\n\n list.splice(panes.length).forEach((entry) => {\n if (entry.series !== instance.series) {\n chart.removeSeries(entry.series);\n return;\n }\n\n entry.lines.forEach((line) => entry.series.removePriceLine(line));\n entry.series.setData([]);\n });\n\n for (let i = chart.panes().length - 1; i >= Math.max(panes.length, 1); i--)\n chart.removePane(i);\n });\n\n return entries;\n}\n","import {\n useRef,\n useMemo,\n useState,\n Children,\n useEffect,\n forwardRef,\n isValidElement,\n type CSSProperties,\n useImperativeHandle,\n} from \"react\";\n\nimport {\n HistogramSeries,\n type DeepPartial,\n type ChartOptions,\n type MouseEventParams,\n} from \"lightweight-charts\";\n\nimport type {\n ChartPanesProps,\n ChartPanesHandle,\n PaneSeriesInput,\n HistogramPaneProps,\n} from \"../../types/panes.js\";\n\nimport {\n textStyle,\n defaultTheme,\n chartOptionsFromTheme,\n} from \"../../utils/theme.utils.js\";\n\nimport { useChart } from \"../../hooks/useChart.js\";\nimport type { ThemeLine } from \"../../types/theme.js\";\nimport type { LinePoint } from \"../../types/chart.js\";\nimport { useNowLine } from \"../../hooks/useNowLine.js\";\nimport { deepMerge } from \"../../utils/merge.utils.js\";\nimport { TimelinePane } from \"../TimelinePane/index.js\";\nimport { HistogramPane } from \"../HistogramPane/index.js\";\nimport { toUnixSeconds } from \"../../utils/time.utils.js\";\nimport { useWheelZoom } from \"../../hooks/useWheelZoom.js\";\nimport { useChartTheme } from \"../../hooks/useChartTheme.js\";\nimport { usePaneRanges } from \"../../hooks/usePaneRanges.js\";\nimport { usePaneSeries } from \"../../hooks/usePaneSeries.js\";\nimport type { TimelinePaneProps } from \"../../types/timeline.js\";\nimport { histogramOptions } from \"../../utils/histogram.utils.js\";\n\nconst ROOT: CSSProperties = { display: \"flex\" };\nconst LABELS: CSSProperties = { flex: \"none\" };\nconst LABEL: CSSProperties = { boxSizing: \"border-box\", overflow: \"hidden\" };\nconst PLOT: CSSProperties = { position: \"relative\", flex: 1, minWidth: 0 };\nconst FILL: CSSProperties = { position: \"absolute\", inset: 0 };\nconst NOW: CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: 1,\n display: \"none\",\n pointerEvents: \"none\",\n};\nconst DEFAULTS: DeepPartial<ChartOptions> = {\n layout: { panes: { enableResize: false } },\n};\n\nconst NO_POINTS: LinePoint[] = [];\n\nconst formatValue = (point: LinePoint) => point.value.toLocaleString();\n\nexport const ChartPanes = forwardRef<ChartPanesHandle | null, ChartPanesProps>(\n function ChartPanes(\n {\n children,\n now = null,\n axisLabel,\n chartOptions,\n ctrlWheelZoom = true,\n ariaLabel = \"Chart panes\",\n className,\n classNames = {},\n styles = {},\n onPaneClick,\n onPaneHover,\n onPaneLeave,\n theme,\n unstyled,\n },\n ref,\n ) {\n const container = useRef<HTMLDivElement>(null);\n const nowLine = useRef<HTMLDivElement>(null);\n const handlers = useRef({ onPaneClick, onPaneHover, onPaneLeave });\n const [axisHeight, setAxisHeight] = useState(0);\n const [hovered, setHovered] = useState<Array<LinePoint | null> | null>(\n null,\n );\n handlers.current = { onPaneClick, onPaneHover, onPaneLeave };\n\n const resolved = useChartTheme({ theme, unstyled });\n const paneHeight =\n resolved?.sizes.paneHeight ?? defaultTheme.sizes.paneHeight;\n const laneHeight = resolved?.sizes.laneHeight ?? paneHeight;\n const lanes: Array<TimelinePaneProps | null> = [];\n const panes: PaneSeriesInput[] = [];\n\n Children.forEach(children, (child) => {\n if (\n isValidElement<HistogramPaneProps>(child) &&\n child.type === HistogramPane\n ) {\n lanes.push(null);\n panes.push({\n ...child.props,\n height: child.props.height ?? paneHeight,\n });\n }\n if (\n isValidElement<TimelinePaneProps>(child) &&\n child.type === TimelinePane\n ) {\n const { label, meta, height = laneHeight, times } = child.props;\n\n lanes.push(child.props);\n panes.push({ label, meta, height, data: NO_POINTS, whitespace: times });\n }\n });\n\n const first = panes[0];\n const firstOptions = useMemo(\n () => histogramOptions(first?.mode ?? \"plain\", first?.seriesOptions),\n [first?.mode, first?.seriesOptions],\n );\n const options = useMemo(\n () =>\n deepMerge<DeepPartial<ChartOptions>>(\n chartOptionsFromTheme(resolved),\n DEFAULTS,\n ctrlWheelZoom && {\n handleScale: { mouseWheel: false },\n handleScroll: { mouseWheel: false },\n },\n chartOptions,\n ),\n [resolved, ctrlWheelZoom, chartOptions],\n );\n\n const instance = useChart(\n container,\n HistogramSeries,\n options,\n firstOptions,\n );\n const entries = usePaneSeries(instance, panes, resolved);\n usePaneRanges(instance, lanes, resolved);\n useWheelZoom(instance, container, ctrlWheelZoom);\n\n useEffect(() => {\n if (!instance) return;\n\n const timeScale = instance.chart.timeScale();\n const update = () => setAxisHeight(timeScale.height());\n\n update();\n timeScale.subscribeSizeChange(update);\n\n return () => timeScale.unsubscribeSizeChange(update);\n }, [instance]);\n\n useEffect(() => {\n if (!instance) return;\n\n const { chart } = instance;\n let active = false;\n\n const pointsAt = (time: number) =>\n entries.current.map(({ normalized }) => {\n const index = normalized.indexByTime.get(time);\n\n return index === undefined\n ? null\n : (normalized.points[index] ?? null);\n });\n\n const onMove = (param: MouseEventParams) => {\n if (param.time === undefined || !param.point) {\n if (!active) return;\n\n active = false;\n setHovered(null);\n handlers.current.onPaneLeave?.();\n return;\n }\n\n const time = Number(param.time);\n const points = pointsAt(time);\n\n active = true;\n setHovered(points);\n handlers.current.onPaneHover?.({ time, points });\n };\n\n const onClick = (param: MouseEventParams) => {\n if (param.time === undefined) return;\n\n const time = Number(param.time);\n\n handlers.current.onPaneClick?.({ time, points: pointsAt(time) });\n };\n\n chart.subscribeCrosshairMove(onMove);\n chart.subscribeClick(onClick);\n\n return () => {\n chart.unsubscribeCrosshairMove(onMove);\n chart.unsubscribeClick(onClick);\n };\n }, [instance, entries]);\n\n useNowLine(instance, nowLine, now === null ? null : toUnixSeconds(now));\n\n useImperativeHandle<ChartPanesHandle | null, ChartPanesHandle | null>(\n ref,\n () =>\n instance\n ? {\n chart: instance.chart,\n get series() {\n return entries.current.map((entry) => entry.series);\n },\n }\n : null,\n [instance, entries],\n );\n\n const heights = panes.map((pane) => pane.height);\n const nowLineTheme =\n resolved &&\n deepMerge<ThemeLine>({ color: resolved.palette.now }, resolved.panes.now);\n const nowStyle: CSSProperties = nowLineTheme\n ? {\n width: 0,\n borderLeft: `${nowLineTheme.width ?? 1}px ${nowLineTheme.style ?? \"solid\"} ${nowLineTheme.color}`,\n }\n : {};\n const labelsStyle: CSSProperties = { width: resolved?.sizes.paneLabel };\n const labelStyle: CSSProperties = { padding: resolved?.spacing.paneLabel };\n const titleStyle = textStyle(\n resolved\n ? deepMerge(resolved.typography.title, resolved.panes.title)\n : undefined,\n );\n const metaStyle = textStyle(\n resolved\n ? deepMerge(resolved.typography.value, resolved.panes.meta)\n : undefined,\n );\n const total =\n heights.reduce((sum, height) => sum + height, 0) +\n Math.max(0, panes.length - 1) +\n axisHeight;\n\n return (\n <div className={className} style={ROOT}>\n <div\n data-part=\"labels\"\n className={classNames.labels}\n style={{ ...LABELS, ...labelsStyle, ...styles.labels }}\n >\n {panes.map((pane, index) => {\n const point = hovered?.[index];\n\n return (\n <div\n key={index}\n data-part=\"label\"\n className={classNames.label}\n style={{\n ...LABEL,\n ...labelStyle,\n height: heights[index]! + (index > 0 ? 1 : 0),\n ...styles.label,\n }}\n >\n <div\n data-part=\"title\"\n className={classNames.title}\n style={{ ...titleStyle, ...styles.title }}\n >\n {pane.label}\n </div>\n <div\n data-part=\"meta\"\n className={classNames.meta}\n style={{ ...metaStyle, ...styles.meta }}\n >\n {point ? (pane.format ?? formatValue)(point) : pane.meta}\n </div>\n </div>\n );\n })}\n <div\n data-part=\"axis\"\n className={classNames.axis}\n style={{ ...LABEL, height: axisHeight, ...styles.axis }}\n >\n {axisLabel}\n </div>\n </div>\n <div\n data-part=\"plot\"\n className={classNames.plot}\n style={{ ...PLOT, height: total, ...styles.plot }}\n >\n <div ref={container} style={FILL} role=\"img\" aria-label={ariaLabel} />\n <div\n ref={nowLine}\n data-part=\"now\"\n className={classNames.now}\n style={{ ...NOW, ...nowStyle, bottom: axisHeight, ...styles.now }}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n );\n },\n);\n","import { forwardRef, useMemo } from \"react\";\nimport { ChartPanes } from \"../ChartPanes/index.js\";\nimport { TimelinePane } from \"../TimelinePane/index.js\";\nimport { timeGrid } from \"../../utils/timeline.utils.js\";\nimport type { ChartPanesHandle } from \"../../types/panes.js\";\nimport type { TimelineChartProps } from \"../../types/timeline.js\";\n\nexport const TimelineChart = forwardRef<\n ChartPanesHandle | null,\n TimelineChartProps\n>(function TimelineChart({ lanes, step, ...props }, ref) {\n const times = useMemo(\n () =>\n timeGrid(\n lanes.flatMap((lane) =>\n lane.items.flatMap(({ start, end, eta }) =>\n eta === undefined ? [start, end] : [eta, start, end],\n ),\n ),\n step,\n ),\n [lanes, step],\n );\n\n return (\n <ChartPanes ref={ref} {...props}>\n {lanes.map(({ id, ...lane }, index) => (\n <TimelinePane\n key={id}\n {...lane}\n times={index === 0 ? times : undefined}\n />\n ))}\n </ChartPanes>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,SAAS2F,GAAM,GAA8B,GAAc;CACzD,IAAMC,IAAQxE,EAAIyE,CAAK,GACjB,CAACC,GAAUC,KAAW1E,EAAOwE,CAAK,GAClCG,IAAQC,IAAOA,GACfC,IAASN,IAAQA;CAEvB,OAAO,KAAK,IAAKI,IAAQD,IAAWG,GAAQA,KAAUF,IAAQF,EAAS;AACzE;AAEA,SAASK,GACP,GACA,GACA,GACA,GACY;CACZ,IAAMP,IAAQxE,EAAIgF,EAAI,KAAK,MAAUP,EAAMQ,EAAO,CAAC,GAC7CC,IAAWC,EAAK,SAASA,EAAK,QAC9BC,IAAYZ,KAASU,IAAWC,EAAK,SAASA,EAAK,QACrDE,IAAS;CAEb,KAAK,IAAMJ,KAASD,GAAK;EACvB,IAAMM,IAASb,EAAMQ,KAAUG;EAI/B,AAHA,EAAIH,KAASC,IACT;GAAE,GAAGC,EAAK;GAAG,GAAGA,EAAK,IAAIE;GAAQ,OAAOD;GAAW,QAAQE;EAAO,IAClE;GAAE,GAAGH,EAAK,IAAIE;GAAQ,GAAGF,EAAK;GAAG,OAAOG;GAAQ,QAAQF;EAAU,GACtE,KAAUE;CACZ;CAEA,OAAOJ,IACH;EACE,GAAGC;EACH,GAAGA,EAAK,IAAIC;EACZ,OAAO,KAAK,IAAI,GAAGD,EAAK,QAAQC,CAAS;CAC3C,IACA;EACE,GAAGD;EACH,GAAGA,EAAK,IAAIC;EACZ,QAAQ,KAAK,IAAI,GAAGD,EAAK,SAASC,CAAS;CAC7C;AACN;AAEA,SAAgBG,GACd,GACA,GACc;CACd,EAAkB,YAAYC,CAAM;CAEpC,IAA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F;CACS,CAAA;AAEhB,CAAC"}
package/dist/pie.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import { a as e, i as t, n, o as r, r as i, t as a } from "./PieLegend-CbpjaOJH.js";
2
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./PieLegend-16E6W10x.js";
3
3
  export { n as PieChart, a as PieLegend, t as arcPath, e as pieSlices, r as placeLabels, i as usePieState };
package/dist/scatter.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  export { ScatterChart } from "./charts/ScatterChart/index.js";
2
2
  export { PolarChart } from "./charts/PolarChart/index.js";
3
3
  export { scatterLayout } from "./utils/scatter.utils.js";
4
+ export type { ScatterDomain } from "./utils/scatter.utils.js";
4
5
  export { sectorPath } from "./utils/polar.utils.js";
5
- export type { ScatterChartProps, ScatterSeries } from "./types/scatter.js";
6
+ export type { ScatterChartProps, ScatterReference, ScatterSeries } from "./types/scatter.js";
7
+ export { ChartLegend } from "./components/ChartLegend/index.js";
8
+ export type { ChartLegendItem } from "./components/ChartLegend/index.js";
6
9
  export type { PolarChartProps } from "./types/polar.js";
7
10
  //# sourceMappingURL=scatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scatter.d.ts","sourceRoot":"","sources":["../src/scatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3E,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"scatter.d.ts","sourceRoot":"","sources":["../src/scatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,YAAY,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/scatter.js CHANGED
@@ -1,3 +1,4 @@
1
1
  "use client";
2
- import { i as e, n as t, r as n, t as r } from "./PolarChart-hcNTWKfJ.js";
3
- export { r as PolarChart, n as ScatterChart, e as scatterLayout, t as sectorPath };
2
+ import { t as e } from "./ChartLegend-B8ZmIG2y.js";
3
+ import { i as t, n, r, t as i } from "./PolarChart-C_vPz-3K.js";
4
+ export { e as ChartLegend, i as PolarChart, r as ScatterChart, t as scatterLayout, n as sectorPath };
package/dist/series.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use client";
2
- import { a as e, g as t, i as n, l as r, n as i, o as a, r as o, t as s, u as c } from "./TimeSeriesChart-BzeHEtQl.js";
2
+ import { a as e, g as t, i as n, l as r, n as i, o as a, r as o, t as s, u as c } from "./TimeSeriesChart-BZMLERDZ.js";
3
3
  import { t as l } from "./bin.utils-Ch1y7YDn.js";
4
4
  export { c as BarChart, e as CandlestickChart, a as HistogramChart, r as LineChart, n as RibbonPrimitive, t as SeriesChart, s as TimeSeriesChart, l as bin, i as editorialChartOptions, o as patchSquareCanvasLabels };