Files
chartkit/dist/react/LineChart.d.ts
T
CatoandClaude d40fb3fe68 feat(line): markers and area on LineChart, so a year of closes is a clean line (#10)
A share-price chart of daily closes drew a dot on every value: about 250
beads on a one-year chart. LineChart gains two backward-compatible props:

- markers: "all" (default, unchanged) | "none" | "ends" | "auto".
  auto drops the dots above 60 points on a series; ends keeps only the
  last value. A hidden value is a full-height strip of the plot (strips
  tile it edge to edge), and hover or keyboard focus shows its dot, a
  hairline cursor and its value. The table still holds every value.
- area: a light fill under each line in the series' token colour.

Core gains areaPath, hitColumns, resolveMarkers, AUTO_MARKER_LIMIT.
Browser check runs at 1440px too and covers the dense chart at 390/1440.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-27 13:46:54 +01:00

35 lines
1.7 KiB
TypeScript

import { type LineMarkers, type LineSeries } from "../index.js";
export interface LineChartProps {
series: LineSeries[];
/** "GW", "weeks", "USD m": shown with every value. */
unit?: string;
caption: string;
/**
* Where the value axis starts. `zero` always, `data` at the data's rounded
* floor; left out, zero when the data sits near it and the floor otherwise.
*/
yFrom?: "zero" | "data";
/** Plot height in CSS px. The width is the container's. */
height?: number;
/**
* Which values carry a dot. `all` (the default) marks every value; `none`
* draws the line alone; `ends` marks only each series' last value; `auto`
* is `all` up to 60 points on a series and `none` above — a year of daily
* closes reads as a line, not a string of beads. Whatever is drawn, every
* value can still be pointed at or tabbed to: its dot, value and period
* appear on hover and on keyboard focus, and the table holds them all.
*/
markers?: LineMarkers;
/** A light fill under each line, in the series' own token colour. */
area?: boolean;
}
/**
* One or more series on shared axes. The line is an SVG stretched to the
* plot (`preserveAspectRatio="none"`, non-scaling stroke), so it is drawn by
* the browser at any width; the axis labels and the points are HTML laid
* over it in per cent, so the text is in rem and never shrinks with the
* plot. Every point is an anchor to the page its number came from, with its
* value, period and note on hover and on keyboard focus.
*/
export declare function LineChart({ series, unit, caption, yFrom, height, markers, area, }: LineChartProps): import("react").JSX.Element;
//# sourceMappingURL=LineChart.d.ts.map