import { ReactElement, ReactNode } from 'react'; import { ChartSnapshot } from '../chart-context'; import { NormalizedRow } from '../engine/normalize'; import { ChartSeries } from '../types'; import { RangeScales } from '../engine/ranges'; /** A neutral column uses the mark's own geometry, never an accepted observation. */ export interface LoadingMark { kind: string; depth?: boolean; render: (input: { cx: number; low: number; high: number; scales: RangeScales; mask: boolean; }) => ReactNode; } /** * The private contract every range mark is built on. A mark is an ordinary primitive that * draws from the chart context; its spec tells the plot how to lay it out and inspect it. * The contract is internal until it has proved itself across several marks. */ export interface MarkSpec
{
/**
* `column` marks give each observation a bar-like slot, so the plot insets its edges, and
* replace the line point with their own highlight on inspection. `overlay` marks, such as a
* band behind a line, leave layout and inspection to the line.
*/
layout: 'column' | 'overlay';
series: (props: P) => string;
/** Field IDs the mark reads from its series. */
fields: (props: P) => readonly string[];
loading?: (props: P) => LoadingMark;
/** Draws one observation emphasized, over the dimmed marks, while it is inspected. */
highlight?: (props: P, input: MarkHighlightInput) => ReactNode;
/**
* The color one observation is drawn in, when the mark decides it (rising and falling
* candles). Otherwise the series' `colorAt`, then its color.
*/
color?: (props: P, input: Omit (component: (props: P) => ReactElement, spec: MarkSpec ): (props: P) => ReactElement;
/** Marks placed directly in a plot, or inside fragments there, in document order. */
export declare function collectMarks(children: ReactNode): PlotMark[];
/** The descriptor a mark draws, after checking it carries every field the mark reads. */
export declare function markSeries