UNPKG

react-plot

Version:

Library of React components to render SVG 2D plots.

64 lines 2.3 kB
import type { CSSProperties, ReactNode } from 'react'; import type { Margins } from '../types.js'; import type { AnnotationArrowProps, AnnotationCircleProps, AnnotationEllipseProps, AnnotationGroupProps, AnnotationLineProps, AnnotationRectangleProps, AnnotationShapeProps, AnnotationTextProps } from './Annotations/index.js'; import type { AxisProps } from './Axis/Axis.js'; import type { ParallelAxisProps } from './Axis/ParallelAxis.js'; import type { LegendProps } from './Legend.js'; import type { PlotProps } from './Plot.js'; import type { LineSeriesProps } from './Series/LineSeries.js'; import type { ScatterSeriesProps } from './Series/ScatterSeries.js'; export type PlotObjectAnnotations = ({ type: 'arrow'; } & AnnotationArrowProps) | ({ type: 'circle'; } & AnnotationCircleProps) | ({ type: 'ellipse'; } & AnnotationEllipseProps) | ({ type: 'line'; } & AnnotationLineProps) | ({ type: 'rectangle'; } & AnnotationRectangleProps) | ({ type: 'shape'; } & AnnotationShapeProps) | ({ type: 'text'; children: string; } & Omit<AnnotationTextProps, 'children'>) | ({ type: 'group'; children: PlotObjectAnnotations[]; } & Omit<AnnotationGroupProps, 'children'>); type PlotObjectContent = { type: 'annotation'; children: PlotObjectAnnotations[]; } | ({ type: 'line'; } & LineSeriesProps) | ({ type: 'scatter'; } & ScatterSeriesProps); export interface PlotObjectPlot { axes: Array<({ type: 'main'; } & AxisProps) | ({ type: 'secondary'; } & ParallelAxisProps)>; content: PlotObjectContent[]; legend?: LegendProps; dimensions: { width: number; height: number; margin?: Partial<Margins>; }; svg?: Pick<PlotProps, 'plotViewportStyle' | 'seriesViewportStyle'> & { className?: string; id?: string; style?: PlotProps['svgStyle']; }; colorScheme?: Iterable<string>; seriesViewportStyle?: CSSProperties; } export interface PlotObjectProps { plot: PlotObjectPlot; children?: ReactNode; } export declare function PlotObject({ plot: { dimensions, svg, seriesViewportStyle, axes, content, legend, colorScheme, }, children, }: PlotObjectProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=PlotObject.d.ts.map