@texturehq/edges 1.35.2 → 1.36.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.
@@ -211,10 +211,24 @@ interface TooltipData {
211
211
  isEvent?: boolean;
212
212
  /** Optional event metadata to display */
213
213
  eventMetadata?: Record<string, string | number>;
214
+ /** Optional list of event items to display in event tooltips. */
215
+ eventItems?: TooltipEventItem[];
216
+ }
217
+ interface TooltipEventItem {
218
+ label: string;
219
+ color: string;
220
+ metadata?: Record<string, string | number>;
214
221
  }
215
222
  interface TooltipSeries {
216
223
  label: string;
217
224
  value: number;
225
+ /**
226
+ * Optional y-axis coordinate (in data space) where the focus highlight
227
+ * should be drawn for this series. Defaults to `value`. Used by stacked
228
+ * series where the drawn position differs from the reported value.
229
+ */
230
+ chartY?: number;
231
+ showMarker?: boolean;
218
232
  color: string;
219
233
  type?: "area" | "line" | "bar" | "event";
220
234
  category?: string;
@@ -256,7 +270,37 @@ declare const useChartContext: () => ChartContextType;
256
270
 
257
271
  interface BaseDataPoint {
258
272
  xValue: Date;
273
+ /**
274
+ * The data value for this point. This is the value reported to tooltips and
275
+ * CSV exports, and — by default — also the y-axis coordinate where the point
276
+ * is drawn.
277
+ *
278
+ * For stacked or banded charts where the *drawn* position differs from the
279
+ * data value (e.g. each band is drawn at its cumulative stack top), set
280
+ * `chartYValue` on the point instead of mutating `yValue`. That keeps tooltip
281
+ * and export output honest while letting the chart draw the visual stack.
282
+ */
259
283
  yValue: number;
284
+ /**
285
+ * Optional render-only override for where to draw this point on the y-axis.
286
+ * When set, series components (e.g. `AreaSeries`, `LineSeries`) draw the
287
+ * point at `chartYValue` instead of `yValue`. Tooltip values and CSV exports
288
+ * continue to use `yValue`, so the user-facing number reflects the underlying
289
+ * data and not the stacked coordinate.
290
+ *
291
+ * Used for stacked area charts where each band's drawn y is the cumulative
292
+ * top of the stack, but the displayed value should be the band's own
293
+ * magnitude. Existing non-stacked consumers can leave this undefined and
294
+ * behavior is unchanged.
295
+ */
296
+ chartYValue?: number;
297
+ /**
298
+ * Optional render-only control for the tooltip focus marker. Defaults to true.
299
+ * Useful for zero-height stacked bands: the tooltip row should still report
300
+ * the zero value, but drawing a marker at the current stack baseline makes the
301
+ * band look active when it is not.
302
+ */
303
+ showTooltipMarker?: boolean;
260
304
  category?: string;
261
305
  }
262
306
  interface ChartMargin {
@@ -211,10 +211,24 @@ interface TooltipData {
211
211
  isEvent?: boolean;
212
212
  /** Optional event metadata to display */
213
213
  eventMetadata?: Record<string, string | number>;
214
+ /** Optional list of event items to display in event tooltips. */
215
+ eventItems?: TooltipEventItem[];
216
+ }
217
+ interface TooltipEventItem {
218
+ label: string;
219
+ color: string;
220
+ metadata?: Record<string, string | number>;
214
221
  }
215
222
  interface TooltipSeries {
216
223
  label: string;
217
224
  value: number;
225
+ /**
226
+ * Optional y-axis coordinate (in data space) where the focus highlight
227
+ * should be drawn for this series. Defaults to `value`. Used by stacked
228
+ * series where the drawn position differs from the reported value.
229
+ */
230
+ chartY?: number;
231
+ showMarker?: boolean;
218
232
  color: string;
219
233
  type?: "area" | "line" | "bar" | "event";
220
234
  category?: string;
@@ -256,7 +270,37 @@ declare const useChartContext: () => ChartContextType;
256
270
 
257
271
  interface BaseDataPoint {
258
272
  xValue: Date;
273
+ /**
274
+ * The data value for this point. This is the value reported to tooltips and
275
+ * CSV exports, and — by default — also the y-axis coordinate where the point
276
+ * is drawn.
277
+ *
278
+ * For stacked or banded charts where the *drawn* position differs from the
279
+ * data value (e.g. each band is drawn at its cumulative stack top), set
280
+ * `chartYValue` on the point instead of mutating `yValue`. That keeps tooltip
281
+ * and export output honest while letting the chart draw the visual stack.
282
+ */
259
283
  yValue: number;
284
+ /**
285
+ * Optional render-only override for where to draw this point on the y-axis.
286
+ * When set, series components (e.g. `AreaSeries`, `LineSeries`) draw the
287
+ * point at `chartYValue` instead of `yValue`. Tooltip values and CSV exports
288
+ * continue to use `yValue`, so the user-facing number reflects the underlying
289
+ * data and not the stacked coordinate.
290
+ *
291
+ * Used for stacked area charts where each band's drawn y is the cumulative
292
+ * top of the stack, but the displayed value should be the band's own
293
+ * magnitude. Existing non-stacked consumers can leave this undefined and
294
+ * behavior is unchanged.
295
+ */
296
+ chartYValue?: number;
297
+ /**
298
+ * Optional render-only control for the tooltip focus marker. Defaults to true.
299
+ * Useful for zero-height stacked bands: the tooltip row should still report
300
+ * the zero value, but drawing a marker at the current stack baseline makes the
301
+ * band look active when it is not.
302
+ */
303
+ showTooltipMarker?: boolean;
260
304
  category?: string;
261
305
  }
262
306
  interface ChartMargin {