@aiconstructions/graficos 0.0.0-stage → 0.2.2

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 (267) hide show
  1. package/ALTERACOES.md +57 -0
  2. package/LICENSE-BKLIT +21 -0
  3. package/LICENSE-visx-pattern +21 -0
  4. package/README.md +189 -2
  5. package/dist/aic/cores.js +83 -0
  6. package/dist/aic/index.js +22 -0
  7. package/dist/aic/interacao.js +55 -0
  8. package/dist/charts/animation.js +55 -0
  9. package/dist/charts/arc-geometry.js +58 -0
  10. package/dist/charts/arc-path.js +15 -0
  11. package/dist/charts/area-chart-loading.js +89 -0
  12. package/dist/charts/area-chart.js +149 -0
  13. package/dist/charts/area-gradient-defs.js +90 -0
  14. package/dist/charts/area-value-label-layout.js +70 -0
  15. package/dist/charts/area-value-labels.js +211 -0
  16. package/dist/charts/area.js +272 -0
  17. package/dist/charts/background.js +198 -0
  18. package/dist/charts/band-config.js +82 -0
  19. package/dist/charts/band-geometry.js +186 -0
  20. package/dist/charts/band.js +346 -0
  21. package/dist/charts/bar-chart-loading.js +27 -0
  22. package/dist/charts/bar-chart.js +545 -0
  23. package/dist/charts/bar-depth-geometry.js +18 -0
  24. package/dist/charts/bar-depth.js +608 -0
  25. package/dist/charts/bar-lollipop.js +278 -0
  26. package/dist/charts/bar-squares-layout.js +66 -0
  27. package/dist/charts/bar-squares.js +467 -0
  28. package/dist/charts/bar-value-label-layout.js +42 -0
  29. package/dist/charts/bar-x-axis.js +133 -0
  30. package/dist/charts/bar-y-axis.js +116 -0
  31. package/dist/charts/bar.js +457 -0
  32. package/dist/charts/bollinger.js +49 -0
  33. package/dist/charts/candlestick-chart.js +370 -0
  34. package/dist/charts/candlestick.js +368 -0
  35. package/dist/charts/chart-brush-handle.js +91 -0
  36. package/dist/charts/chart-brush-layout.js +91 -0
  37. package/dist/charts/chart-brush-selection-overlay.js +87 -0
  38. package/dist/charts/chart-brush-state.js +253 -0
  39. package/dist/charts/chart-brush-track-overlay.js +103 -0
  40. package/dist/charts/chart-brush.js +517 -0
  41. package/dist/charts/chart-center-typography.js +8 -0
  42. package/dist/charts/chart-child-passthrough.js +119 -0
  43. package/dist/charts/chart-config-context.js +56 -0
  44. package/dist/charts/chart-context.js +337 -0
  45. package/dist/charts/chart-crosshair.js +262 -0
  46. package/dist/charts/chart-data-override.js +186 -0
  47. package/dist/charts/chart-defs.js +56 -0
  48. package/dist/charts/chart-formatters.js +77 -0
  49. package/dist/charts/chart-legend-hover.js +27 -0
  50. package/dist/charts/chart-legend.js +163 -0
  51. package/dist/charts/chart-loading-label.js +52 -0
  52. package/dist/charts/chart-parent-size.js +138 -0
  53. package/dist/charts/chart-phase.js +29 -0
  54. package/dist/charts/chart-reveal-clip.js +62 -0
  55. package/dist/charts/chart-scale.js +19 -0
  56. package/dist/charts/chart-stat-flow.js +72 -0
  57. package/dist/charts/choropleth/choropleth-background.js +29 -0
  58. package/dist/charts/choropleth/choropleth-camera.js +379 -0
  59. package/dist/charts/choropleth/choropleth-chart.js +644 -0
  60. package/dist/charts/choropleth/choropleth-context.js +152 -0
  61. package/dist/charts/choropleth/choropleth-dot-grid.js +293 -0
  62. package/dist/charts/choropleth/choropleth-feature.js +291 -0
  63. package/dist/charts/choropleth/choropleth-graticule.js +40 -0
  64. package/dist/charts/choropleth/choropleth-marker.js +222 -0
  65. package/dist/charts/choropleth/choropleth-projection.js +37 -0
  66. package/dist/charts/choropleth/choropleth-tooltip.js +82 -0
  67. package/dist/charts/choropleth/choropleth-zoom-matrix.js +150 -0
  68. package/dist/charts/choropleth/index.js +44 -0
  69. package/dist/charts/choropleth/use-choropleth-zoom-state.js +636 -0
  70. package/dist/charts/composed-chart.js +346 -0
  71. package/dist/charts/crosshair-store.js +49 -0
  72. package/dist/charts/dash-tail-stroke.js +58 -0
  73. package/dist/charts/date-pill-store.js +50 -0
  74. package/dist/charts/date-ranges.js +131 -0
  75. package/dist/charts/deadline.js +295 -0
  76. package/dist/charts/decimate-time-series.js +112 -0
  77. package/dist/charts/fade-edges.js +171 -0
  78. package/dist/charts/fast-path.js +78 -0
  79. package/dist/charts/filter-data-by-x-domain.js +45 -0
  80. package/dist/charts/funnel-chart.js +773 -0
  81. package/dist/charts/gauge-arc-layers.js +479 -0
  82. package/dist/charts/gauge-dial.js +329 -0
  83. package/dist/charts/gauge-label-layout.js +148 -0
  84. package/dist/charts/gauge.js +946 -0
  85. package/dist/charts/generate-chart-skeleton-data.js +27 -0
  86. package/dist/charts/gradients.js +158 -0
  87. package/dist/charts/grid-lines.js +114 -0
  88. package/dist/charts/grid.js +225 -0
  89. package/dist/charts/heatmap/generate-heatmap-skeleton-data.js +13 -0
  90. package/dist/charts/heatmap/heatmap-animation.js +128 -0
  91. package/dist/charts/heatmap/heatmap-cells.js +519 -0
  92. package/dist/charts/heatmap/heatmap-chart-loading.js +44 -0
  93. package/dist/charts/heatmap/heatmap-chart.js +548 -0
  94. package/dist/charts/heatmap/heatmap-colors.js +127 -0
  95. package/dist/charts/heatmap/heatmap-context.js +107 -0
  96. package/dist/charts/heatmap/heatmap-legend-gradient.js +97 -0
  97. package/dist/charts/heatmap/heatmap-legend-swatch.js +76 -0
  98. package/dist/charts/heatmap/heatmap-legend.js +165 -0
  99. package/dist/charts/heatmap/heatmap-pattern-defs.js +37 -0
  100. package/dist/charts/heatmap/heatmap-rect-cells.js +39 -0
  101. package/dist/charts/heatmap/heatmap-resolve-separator.js +84 -0
  102. package/dist/charts/heatmap/heatmap-separator.js +168 -0
  103. package/dist/charts/heatmap/heatmap-tooltip.js +73 -0
  104. package/dist/charts/heatmap/heatmap-utils.js +633 -0
  105. package/dist/charts/heatmap/heatmap-x-axis.js +79 -0
  106. package/dist/charts/heatmap/heatmap-y-axis.js +72 -0
  107. package/dist/charts/heatmap/index.js +208 -0
  108. package/dist/charts/highlight-segment-bounds.js +34 -0
  109. package/dist/charts/highlight-segment.js +119 -0
  110. package/dist/charts/index.js +944 -0
  111. package/dist/charts/indicator-fade.js +44 -0
  112. package/dist/charts/legend/index.js +22 -0
  113. package/dist/charts/legend/legend-context.js +47 -0
  114. package/dist/charts/legend/legend-item.js +30 -0
  115. package/dist/charts/legend/legend-label.js +14 -0
  116. package/dist/charts/legend/legend-marker.js +18 -0
  117. package/dist/charts/legend/legend-progress.js +39 -0
  118. package/dist/charts/legend/legend-value.js +31 -0
  119. package/dist/charts/legend/legend.js +69 -0
  120. package/dist/charts/line-backdrop.js +129 -0
  121. package/dist/charts/line-chart-loading.js +85 -0
  122. package/dist/charts/line-chart.js +182 -0
  123. package/dist/charts/line-loading-pulse.js +185 -0
  124. package/dist/charts/line-loading-timing.js +12 -0
  125. package/dist/charts/line-path.js +58 -0
  126. package/dist/charts/line-series-terminal-marker.js +75 -0
  127. package/dist/charts/line.js +499 -0
  128. package/dist/charts/live-line-chart.js +494 -0
  129. package/dist/charts/live-line.js +277 -0
  130. package/dist/charts/live-x-axis.js +116 -0
  131. package/dist/charts/live-y-axis.js +164 -0
  132. package/dist/charts/loading-sweep.js +344 -0
  133. package/dist/charts/local-point.js +56 -0
  134. package/dist/charts/markers/chart-markers.js +149 -0
  135. package/dist/charts/markers/index.js +14 -0
  136. package/dist/charts/markers/marker-group.js +411 -0
  137. package/dist/charts/motion-utils.js +29 -0
  138. package/dist/charts/notch-gauge-shared.js +146 -0
  139. package/dist/charts/particle-line.js +1340 -0
  140. package/dist/charts/path-stroke-utils.js +51 -0
  141. package/dist/charts/pattern-area.js +127 -0
  142. package/dist/charts/pattern-preset.js +287 -0
  143. package/dist/charts/pattern-tile.js +31 -0
  144. package/dist/charts/patterns/circles.js +62 -0
  145. package/dist/charts/patterns/constants.js +9 -0
  146. package/dist/charts/patterns/hexagons.js +38 -0
  147. package/dist/charts/patterns/index.js +16 -0
  148. package/dist/charts/patterns/lines.js +65 -0
  149. package/dist/charts/patterns/path.js +37 -0
  150. package/dist/charts/patterns/pattern.js +16 -0
  151. package/dist/charts/patterns/waves.js +40 -0
  152. package/dist/charts/pie-center-shell.js +127 -0
  153. package/dist/charts/pie-center.js +87 -0
  154. package/dist/charts/pie-chart.js +377 -0
  155. package/dist/charts/pie-context.js +116 -0
  156. package/dist/charts/pie-slice.js +394 -0
  157. package/dist/charts/pie-ticks.js +332 -0
  158. package/dist/charts/profit-loss-legend-hover.js +18 -0
  159. package/dist/charts/profit-loss-legend.js +53 -0
  160. package/dist/charts/profit-loss-line.js +162 -0
  161. package/dist/charts/profit-loss-segments.js +88 -0
  162. package/dist/charts/projection-config.js +90 -0
  163. package/dist/charts/projection-line-end-marker.js +50 -0
  164. package/dist/charts/projection-line.js +466 -0
  165. package/dist/charts/projection-utils.js +303 -0
  166. package/dist/charts/radar-area.js +192 -0
  167. package/dist/charts/radar-axis.js +41 -0
  168. package/dist/charts/radar-chart.js +184 -0
  169. package/dist/charts/radar-context.js +104 -0
  170. package/dist/charts/radar-grid.js +121 -0
  171. package/dist/charts/radar-labels.js +62 -0
  172. package/dist/charts/radial-area.js +498 -0
  173. package/dist/charts/radial-axis.js +652 -0
  174. package/dist/charts/radial-bar.js +316 -0
  175. package/dist/charts/radial-center.js +67 -0
  176. package/dist/charts/radial-chart.js +740 -0
  177. package/dist/charts/radial-dot-bar-layout.js +68 -0
  178. package/dist/charts/radial-dot-bar.js +387 -0
  179. package/dist/charts/radial-geometry.js +114 -0
  180. package/dist/charts/radial-legend.js +66 -0
  181. package/dist/charts/radial-line.js +280 -0
  182. package/dist/charts/radial-ring-bar.js +255 -0
  183. package/dist/charts/radial-scrubber.js +120 -0
  184. package/dist/charts/radial-series-color.js +10 -0
  185. package/dist/charts/reference-area-config.js +43 -0
  186. package/dist/charts/reference-area-geometry.js +76 -0
  187. package/dist/charts/reference-area-registration-context.js +10 -0
  188. package/dist/charts/reference-area.js +241 -0
  189. package/dist/charts/responsive-chart-label-count.js +18 -0
  190. package/dist/charts/ring-center.js +78 -0
  191. package/dist/charts/ring-chart.js +362 -0
  192. package/dist/charts/ring-context.js +122 -0
  193. package/dist/charts/ring-grid.js +175 -0
  194. package/dist/charts/ring-labels.js +109 -0
  195. package/dist/charts/ring.js +237 -0
  196. package/dist/charts/sankey/index.js +22 -0
  197. package/dist/charts/sankey/sankey-chart.js +199 -0
  198. package/dist/charts/sankey/sankey-context.js +32 -0
  199. package/dist/charts/sankey/sankey-link.js +232 -0
  200. package/dist/charts/sankey/sankey-node.js +348 -0
  201. package/dist/charts/sankey/sankey-tooltip.js +94 -0
  202. package/dist/charts/scatter-chart-shell.js +279 -0
  203. package/dist/charts/scatter-chart.js +150 -0
  204. package/dist/charts/scatter-jitter.js +86 -0
  205. package/dist/charts/scatter-svg.js +17 -0
  206. package/dist/charts/scatter.js +92 -0
  207. package/dist/charts/segment.js +107 -0
  208. package/dist/charts/series-bar-layout.js +42 -0
  209. package/dist/charts/series-bar.js +241 -0
  210. package/dist/charts/series-dash-tail-overlay.js +53 -0
  211. package/dist/charts/series-highlight-layer.js +43 -0
  212. package/dist/charts/series-hover-dim.js +32 -0
  213. package/dist/charts/series-markers.js +239 -0
  214. package/dist/charts/series-path-utils.js +185 -0
  215. package/dist/charts/series-point-marker.js +150 -0
  216. package/dist/charts/sparkline-geometry.js +197 -0
  217. package/dist/charts/sparkline.js +910 -0
  218. package/dist/charts/static-chart-preview-context.js +16 -0
  219. package/dist/charts/sunburst-breadcrumb.js +33 -0
  220. package/dist/charts/sunburst-center.js +37 -0
  221. package/dist/charts/sunburst-chart.js +408 -0
  222. package/dist/charts/sunburst-context.js +140 -0
  223. package/dist/charts/sunburst-data.js +0 -0
  224. package/dist/charts/sunburst-hint.js +42 -0
  225. package/dist/charts/sunburst-labels.js +130 -0
  226. package/dist/charts/sunburst-segment.js +144 -0
  227. package/dist/charts/sunburst.js +419 -0
  228. package/dist/charts/time-series-chart-shell.js +688 -0
  229. package/dist/charts/tooltip/chart-tooltip.js +516 -0
  230. package/dist/charts/tooltip/cursor-tooltip-box.js +183 -0
  231. package/dist/charts/tooltip/date-ticker.js +376 -0
  232. package/dist/charts/tooltip/index.js +32 -0
  233. package/dist/charts/tooltip/liquid-glass.js +142 -0
  234. package/dist/charts/tooltip/tooltip-box.js +502 -0
  235. package/dist/charts/tooltip/tooltip-content.js +59 -0
  236. package/dist/charts/tooltip/tooltip-dot.js +170 -0
  237. package/dist/charts/tooltip/tooltip-indicator.js +175 -0
  238. package/dist/charts/tooltip/use-delayed-tooltip-data.js +41 -0
  239. package/dist/charts/tooltip/use-velocity-stretch.js +52 -0
  240. package/dist/charts/trend-line-utils.js +64 -0
  241. package/dist/charts/trend-line.js +318 -0
  242. package/dist/charts/use-animated-band.js +175 -0
  243. package/dist/charts/use-animated-series-path.js +208 -0
  244. package/dist/charts/use-animated-y-domains.js +192 -0
  245. package/dist/charts/use-category-slots.js +29 -0
  246. package/dist/charts/use-chart-interaction.js +296 -0
  247. package/dist/charts/use-chart-phase-orchestrator.js +183 -0
  248. package/dist/charts/use-enter-complete.js +18 -0
  249. package/dist/charts/use-grid-shimmer.js +88 -0
  250. package/dist/charts/use-highlight-segment.js +65 -0
  251. package/dist/charts/use-mount-progress.js +23 -0
  252. package/dist/charts/use-scatter-chart-interaction.js +364 -0
  253. package/dist/charts/use-scheduled-tooltip.js +84 -0
  254. package/dist/charts/visx-pattern.js +30 -0
  255. package/dist/charts/weekends.js +174 -0
  256. package/dist/charts/x-axis-hover.js +46 -0
  257. package/dist/charts/x-axis.js +523 -0
  258. package/dist/charts/y-axis-scales.js +71 -0
  259. package/dist/charts/y-axis-ticks.js +22 -0
  260. package/dist/charts/y-axis.js +233 -0
  261. package/dist/charts/y-domain-utils.js +189 -0
  262. package/dist/index.d.ts +7346 -0
  263. package/dist/index.js +2 -0
  264. package/dist/lib/utils.js +8 -0
  265. package/dist/shimmering-text.js +54 -0
  266. package/package.json +78 -4
  267. package/tema.css +202 -0
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { memo, useEffect, useMemo, useState } from "react";
4
+ import { createPortal } from "react-dom";
5
+ import { cn } from "../../lib/utils";
6
+ import { useHeatmap } from "./heatmap-context";
7
+ import {
8
+ formatHeatmapYAxisLabel,
9
+ getHeatmapDayLabels,
10
+ resolveHeatmapRowOpacity,
11
+ shouldShowHeatmapYAxisTick
12
+ } from "./heatmap-utils";
13
+ const HeatmapYAxis = memo(function HeatmapYAxis2({
14
+ className,
15
+ tickFilter = "odd",
16
+ labelFormat = "full",
17
+ rowOpacity
18
+ }) {
19
+ const { containerRef, margin, binHeight, gap, yScale, weekStartDay } = useHeatmap();
20
+ const [mounted, setMounted] = useState(false);
21
+ useEffect(() => {
22
+ setMounted(true);
23
+ }, []);
24
+ const labels = useMemo(
25
+ () => getHeatmapDayLabels(weekStartDay).map((label, row) => ({
26
+ row,
27
+ label: formatHeatmapYAxisLabel(label, labelFormat),
28
+ y: margin.top + yScale(row) + (binHeight - gap) / 2
29
+ })).filter((tick) => shouldShowHeatmapYAxisTick(tick.row, tickFilter)),
30
+ [binHeight, gap, labelFormat, margin.top, tickFilter, weekStartDay, yScale]
31
+ );
32
+ const container = containerRef.current;
33
+ if (!(mounted && container)) {
34
+ return null;
35
+ }
36
+ return createPortal(
37
+ labels.map((tick) => /* @__PURE__ */ jsx(
38
+ "div",
39
+ {
40
+ className: "pointer-events-none absolute",
41
+ style: {
42
+ top: tick.y,
43
+ left: 4,
44
+ width: Math.max(margin.left - 12, 0),
45
+ display: "flex",
46
+ alignItems: "center",
47
+ justifyContent: "flex-end",
48
+ transform: "translateY(-50%)"
49
+ },
50
+ children: /* @__PURE__ */ jsx(
51
+ "span",
52
+ {
53
+ className: cn(
54
+ "whitespace-nowrap text-chart-label text-xs",
55
+ className
56
+ ),
57
+ style: { opacity: resolveHeatmapRowOpacity(tick.row, rowOpacity) },
58
+ children: tick.label
59
+ }
60
+ )
61
+ },
62
+ tick.row
63
+ )),
64
+ container
65
+ );
66
+ });
67
+ HeatmapYAxis.displayName = "HeatmapYAxis";
68
+ var heatmap_y_axis_default = HeatmapYAxis;
69
+ export {
70
+ HeatmapYAxis,
71
+ heatmap_y_axis_default as default
72
+ };
@@ -0,0 +1,208 @@
1
+ import { generateHeatmapSkeletonFromTarget } from "./generate-heatmap-skeleton-data";
2
+ import {
3
+ computeHeatmapLevelRange,
4
+ HEATMAP_DEFAULT_ENTER_DURATION_MS,
5
+ HEATMAP_DEFAULT_ENTER_TRANSITION,
6
+ HEATMAP_DEFAULT_LOADING_CELL_MAX_OPACITY,
7
+ HEATMAP_DEFAULT_LOADING_CELL_RANDOMNESS,
8
+ HEATMAP_ENTER_FADE_EASE,
9
+ HEATMAP_ENTER_FADE_MS,
10
+ HEATMAP_LOADING_BASE_CELL_OPACITY,
11
+ HEATMAP_LOADING_CHART_OPACITY,
12
+ HEATMAP_LOADING_CONCEAL_MS,
13
+ HEATMAP_WAVE_ROW_LEAN_MS,
14
+ heatmapLoadingCellParticipates,
15
+ heatmapWaveDelayMs,
16
+ resolveHeatmapWaveTiming
17
+ } from "./heatmap-animation";
18
+ import { HeatmapCells } from "./heatmap-cells";
19
+ import {
20
+ HeatmapChart
21
+ } from "./heatmap-chart";
22
+ import {
23
+ HeatmapChartLoading
24
+ } from "./heatmap-chart-loading";
25
+ import {
26
+ buildHeatmapColorScale,
27
+ buildHeatmapColorScaleFromStyles,
28
+ buildHeatmapFillScale,
29
+ defaultHeatmapColorScale,
30
+ defaultHeatmapFillScale,
31
+ HEATMAP_DEFAULT_LEVEL_COLORS,
32
+ HEATMAP_DEFAULT_LEVEL_STYLES,
33
+ heatmapLevelPatternId,
34
+ isHeatmapLevelPattern,
35
+ levelColorsFromStyles,
36
+ levelStylesFromColors,
37
+ resolveHeatmapLevelStyles
38
+ } from "./heatmap-colors";
39
+ import {
40
+ HeatmapInteractionBoundary,
41
+ HeatmapInteractionProvider,
42
+ HeatmapInteractionRoot,
43
+ HeatmapProvider,
44
+ heatmapCssVars,
45
+ useHeatmap,
46
+ useHeatmapInteraction,
47
+ useHeatmapInteractionOptional
48
+ } from "./heatmap-context";
49
+ import {
50
+ HEATMAP_LEGEND_LEVELS,
51
+ HeatmapLegend
52
+ } from "./heatmap-legend";
53
+ import {
54
+ resolveHeatmapSeparatorConfig,
55
+ resolveHeatmapSeparatorConfigWithData
56
+ } from "./heatmap-resolve-separator";
57
+ import {
58
+ HeatmapSeparator
59
+ } from "./heatmap-separator";
60
+ import { HeatmapTooltip } from "./heatmap-tooltip";
61
+ import {
62
+ buildHeatmapLegendGradient,
63
+ buildHeatmapQuarterSeparatorGroups,
64
+ buildHeatmapRowOpacity,
65
+ buildHeatmapSeparatorGradientStops,
66
+ countHeatmapWeekDaysOnOrAfter,
67
+ filterHeatmapColumns,
68
+ findHeatmapColumnIndexForDate,
69
+ formatHeatmapContributionLabel,
70
+ formatHeatmapTooltipDate,
71
+ formatHeatmapTooltipWeekday,
72
+ formatHeatmapYAxisLabel,
73
+ getCalendarQuarter,
74
+ getCalendarQuarterStartDatesBetween,
75
+ getHeatmapCalendarRangeStart,
76
+ getHeatmapColumnMonthAnchor,
77
+ getHeatmapColumnQuarterAnchor,
78
+ getHeatmapColumnXOffset,
79
+ getHeatmapContributionLevel,
80
+ getHeatmapDayLabels,
81
+ getHeatmapMonthLabelColumnIndex,
82
+ getHeatmapPlotInnerWidth,
83
+ getHeatmapSeparatorColumnIndices,
84
+ getHeatmapSeparatorCount,
85
+ getHeatmapSeparatorGroupStartColumn,
86
+ getHeatmapSeparatorLineY,
87
+ getHeatmapSeparatorX,
88
+ getHeatmapTimeExtent,
89
+ getHeatmapWeekCount,
90
+ getHeatmapWeekStartAlignedToRange,
91
+ getHeatmapWeekStartSunday,
92
+ getHeatmapYearStartMonth,
93
+ HEATMAP_DAY_LABELS,
94
+ HEATMAP_MONTHS_ONE_YEAR,
95
+ HEATMAP_MONTHS_SIX,
96
+ HEATMAP_WEEKS_ONE_YEAR,
97
+ inferHeatmapCalendarRangeStart,
98
+ isHeatmapGhostBin,
99
+ isHeatmapHoverEffectEnabled,
100
+ isHeatmapInactiveEffectEnabled,
101
+ resolveHeatmapDisplayRange,
102
+ resolveHeatmapHoverStyle,
103
+ resolveHeatmapInactiveStyle,
104
+ resolveHeatmapRowOpacity,
105
+ resolveHeatmapSeparatorLayout,
106
+ resolveHeatmapSeparatorStrokeDasharray,
107
+ resolveHeatmapWeekRange,
108
+ rotateHeatmapColumnBins,
109
+ shouldShowHeatmapYAxisTick
110
+ } from "./heatmap-utils";
111
+ import { HeatmapXAxis } from "./heatmap-x-axis";
112
+ import { HeatmapYAxis } from "./heatmap-y-axis";
113
+ export {
114
+ HEATMAP_DAY_LABELS,
115
+ HEATMAP_DEFAULT_ENTER_DURATION_MS,
116
+ HEATMAP_DEFAULT_ENTER_TRANSITION,
117
+ HEATMAP_DEFAULT_LEVEL_COLORS,
118
+ HEATMAP_DEFAULT_LEVEL_STYLES,
119
+ HEATMAP_DEFAULT_LOADING_CELL_MAX_OPACITY,
120
+ HEATMAP_DEFAULT_LOADING_CELL_RANDOMNESS,
121
+ HEATMAP_ENTER_FADE_EASE,
122
+ HEATMAP_ENTER_FADE_MS,
123
+ HEATMAP_LEGEND_LEVELS,
124
+ HEATMAP_LOADING_BASE_CELL_OPACITY,
125
+ HEATMAP_LOADING_CHART_OPACITY,
126
+ HEATMAP_LOADING_CONCEAL_MS,
127
+ HEATMAP_MONTHS_ONE_YEAR,
128
+ HEATMAP_MONTHS_SIX,
129
+ HEATMAP_WAVE_ROW_LEAN_MS,
130
+ HEATMAP_WEEKS_ONE_YEAR,
131
+ HeatmapCells,
132
+ HeatmapChart,
133
+ HeatmapChartLoading,
134
+ HeatmapInteractionBoundary,
135
+ HeatmapInteractionProvider,
136
+ HeatmapInteractionRoot,
137
+ HeatmapLegend,
138
+ HeatmapProvider,
139
+ HeatmapSeparator,
140
+ HeatmapTooltip,
141
+ HeatmapXAxis,
142
+ HeatmapYAxis,
143
+ buildHeatmapColorScale,
144
+ buildHeatmapColorScaleFromStyles,
145
+ buildHeatmapFillScale,
146
+ buildHeatmapLegendGradient,
147
+ buildHeatmapQuarterSeparatorGroups,
148
+ buildHeatmapRowOpacity,
149
+ buildHeatmapSeparatorGradientStops,
150
+ computeHeatmapLevelRange,
151
+ countHeatmapWeekDaysOnOrAfter,
152
+ defaultHeatmapColorScale,
153
+ defaultHeatmapFillScale,
154
+ filterHeatmapColumns,
155
+ findHeatmapColumnIndexForDate,
156
+ formatHeatmapContributionLabel,
157
+ formatHeatmapTooltipDate,
158
+ formatHeatmapTooltipWeekday,
159
+ formatHeatmapYAxisLabel,
160
+ generateHeatmapSkeletonFromTarget,
161
+ getCalendarQuarter,
162
+ getCalendarQuarterStartDatesBetween,
163
+ getHeatmapCalendarRangeStart,
164
+ getHeatmapColumnMonthAnchor,
165
+ getHeatmapColumnQuarterAnchor,
166
+ getHeatmapColumnXOffset,
167
+ getHeatmapContributionLevel,
168
+ getHeatmapDayLabels,
169
+ getHeatmapMonthLabelColumnIndex,
170
+ getHeatmapPlotInnerWidth,
171
+ getHeatmapSeparatorColumnIndices,
172
+ getHeatmapSeparatorCount,
173
+ getHeatmapSeparatorGroupStartColumn,
174
+ getHeatmapSeparatorLineY,
175
+ getHeatmapSeparatorX,
176
+ getHeatmapTimeExtent,
177
+ getHeatmapWeekCount,
178
+ getHeatmapWeekStartAlignedToRange,
179
+ getHeatmapWeekStartSunday,
180
+ getHeatmapYearStartMonth,
181
+ heatmapCssVars,
182
+ heatmapLevelPatternId,
183
+ heatmapLoadingCellParticipates,
184
+ heatmapWaveDelayMs,
185
+ inferHeatmapCalendarRangeStart,
186
+ isHeatmapGhostBin,
187
+ isHeatmapHoverEffectEnabled,
188
+ isHeatmapInactiveEffectEnabled,
189
+ isHeatmapLevelPattern,
190
+ levelColorsFromStyles,
191
+ levelStylesFromColors,
192
+ resolveHeatmapDisplayRange,
193
+ resolveHeatmapHoverStyle,
194
+ resolveHeatmapInactiveStyle,
195
+ resolveHeatmapLevelStyles,
196
+ resolveHeatmapRowOpacity,
197
+ resolveHeatmapSeparatorConfig,
198
+ resolveHeatmapSeparatorConfigWithData,
199
+ resolveHeatmapSeparatorLayout,
200
+ resolveHeatmapSeparatorStrokeDasharray,
201
+ resolveHeatmapWaveTiming,
202
+ resolveHeatmapWeekRange,
203
+ rotateHeatmapColumnBins,
204
+ shouldShowHeatmapYAxisTick,
205
+ useHeatmap,
206
+ useHeatmapInteraction,
207
+ useHeatmapInteractionOptional
208
+ };
@@ -0,0 +1,34 @@
1
+ const INACTIVE_SEGMENT = {
2
+ x: 0,
3
+ width: 0,
4
+ isActive: false
5
+ };
6
+ function computeSegmentBounds(data, xScale, xAccessor, tooltipData, selection, span = 1) {
7
+ if (data.length === 0) {
8
+ return INACTIVE_SEGMENT;
9
+ }
10
+ if (selection?.active) {
11
+ const x = Math.min(selection.startX, selection.endX);
12
+ const width = Math.abs(selection.endX - selection.startX);
13
+ return { x, width, isActive: true };
14
+ }
15
+ if (!tooltipData) {
16
+ return INACTIVE_SEGMENT;
17
+ }
18
+ const idx = tooltipData.index;
19
+ const reach = Math.max(1, Math.round(span));
20
+ const startIdx = Math.max(0, idx - reach);
21
+ const endIdx = Math.min(data.length - 1, idx + reach);
22
+ const startPoint = data[startIdx];
23
+ const endPoint = data[endIdx];
24
+ if (!(startPoint && endPoint)) {
25
+ return INACTIVE_SEGMENT;
26
+ }
27
+ const startX = xScale(xAccessor(startPoint)) ?? 0;
28
+ const endX = xScale(xAccessor(endPoint)) ?? 0;
29
+ return { x: startX, width: Math.max(0, endX - startX), isActive: true };
30
+ }
31
+ export {
32
+ INACTIVE_SEGMENT,
33
+ computeSegmentBounds
34
+ };
@@ -0,0 +1,119 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { m } from "motion/react";
4
+ import { useId, useLayoutEffect, useRef } from "react";
5
+ function HighlightSegment({
6
+ pathRef,
7
+ visible,
8
+ stroke,
9
+ strokeWidth,
10
+ height,
11
+ x,
12
+ width,
13
+ fadeLength = 0,
14
+ glow
15
+ }) {
16
+ const bandId = useId();
17
+ const fadeId = `${bandId}-fade`;
18
+ const highlightRef = useRef(null);
19
+ const glowRef = useRef(null);
20
+ const appliedRef = useRef(null);
21
+ useLayoutEffect(() => {
22
+ if (!visible) {
23
+ return;
24
+ }
25
+ const d = pathRef.current?.getAttribute("d") || "";
26
+ const highlight = highlightRef.current;
27
+ const glowPath = glowRef.current;
28
+ const applied = appliedRef.current;
29
+ if (applied && applied.d === d && applied.highlight === highlight && applied.glow === glowPath) {
30
+ return;
31
+ }
32
+ highlight?.setAttribute("d", d);
33
+ glowPath?.setAttribute("d", d);
34
+ appliedRef.current = { d, highlight, glow: glowPath };
35
+ });
36
+ if (!visible) {
37
+ return null;
38
+ }
39
+ const fade = Math.min(50, Math.max(0, fadeLength));
40
+ const soft = fade > 0;
41
+ const bleed = Math.max(strokeWidth, glow ? glow.strokeWidth * 2 : 0);
42
+ const band = /* @__PURE__ */ jsx(
43
+ m.rect,
44
+ {
45
+ fill: soft ? `url(#${fadeId})` : void 0,
46
+ height: height + bleed * 2,
47
+ width,
48
+ x,
49
+ y: -bleed
50
+ }
51
+ );
52
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
53
+ /* @__PURE__ */ jsx("defs", { children: soft ? (
54
+ // Horizontal luminance ramp over the band (objectBoundingBox is fine:
55
+ // the band rect always has area). White = visible.
56
+ /* @__PURE__ */ jsxs(Fragment, { children: [
57
+ /* @__PURE__ */ jsxs("linearGradient", { id: fadeId, x1: "0", x2: "1", y1: "0", y2: "0", children: [
58
+ /* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "white", stopOpacity: 0 }),
59
+ /* @__PURE__ */ jsx("stop", { offset: fade / 100, stopColor: "white", stopOpacity: 1 }),
60
+ /* @__PURE__ */ jsx("stop", { offset: 1 - fade / 100, stopColor: "white", stopOpacity: 1 }),
61
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: 0 })
62
+ ] }),
63
+ /* @__PURE__ */ jsx(
64
+ "mask",
65
+ {
66
+ height: "300%",
67
+ id: bandId,
68
+ maskUnits: "userSpaceOnUse",
69
+ width: "300%",
70
+ x: "-100%",
71
+ y: "-100%",
72
+ children: band
73
+ }
74
+ )
75
+ ] })
76
+ ) : /* @__PURE__ */ jsx("clipPath", { id: bandId, children: band }) }),
77
+ /* @__PURE__ */ jsxs(
78
+ m.g,
79
+ {
80
+ animate: { opacity: 1 },
81
+ clipPath: soft ? void 0 : `url(#${bandId})`,
82
+ exit: { opacity: 0 },
83
+ initial: { opacity: 0 },
84
+ mask: soft ? `url(#${bandId})` : void 0,
85
+ transition: { duration: 0.4, ease: "easeInOut" },
86
+ children: [
87
+ glow ? /* @__PURE__ */ jsx(
88
+ "path",
89
+ {
90
+ fill: "none",
91
+ filter: glow.filter,
92
+ ref: glowRef,
93
+ stroke,
94
+ strokeLinecap: "round",
95
+ strokeOpacity: glow.opacity,
96
+ strokeWidth: glow.strokeWidth
97
+ }
98
+ ) : null,
99
+ /* @__PURE__ */ jsx(
100
+ "path",
101
+ {
102
+ fill: "none",
103
+ ref: highlightRef,
104
+ stroke,
105
+ strokeLinecap: "round",
106
+ strokeWidth
107
+ }
108
+ )
109
+ ]
110
+ }
111
+ )
112
+ ] });
113
+ }
114
+ HighlightSegment.displayName = "HighlightSegment";
115
+ var highlight_segment_default = HighlightSegment;
116
+ export {
117
+ HighlightSegment,
118
+ highlight_segment_default as default
119
+ };