@peripheries/charts 0.0.0-stage → 0.1.1
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.
- package/LICENSE +7 -0
- package/README.md +8 -2
- package/index.css +1 -0
- package/index.d.ts +1 -0
- package/index.js +6961 -0
- package/package.json +25 -4
- package/types/charts/AreaChart/AreaChart.d.ts +22 -0
- package/types/charts/BarChart/BarChart.d.ts +21 -0
- package/types/charts/BarLineChart/BarLineChart.d.ts +22 -0
- package/types/charts/DonutChart/DonutChart.d.ts +6 -0
- package/types/charts/LineChart/LineChart.d.ts +27 -0
- package/types/charts/MetricChart/MetricChart.d.ts +21 -0
- package/types/charts/PieChart/PieChart.d.ts +26 -0
- package/types/charts/ScatterChart/ScatterChart.d.ts +22 -0
- package/types/charts/Sparkline/Sparkline.d.ts +17 -0
- package/types/charts/WaterfallChart/WaterfallChart.d.ts +21 -0
- package/types/charts/_shared/ChartFrame.d.ts +42 -0
- package/types/charts/_shared/axis-utils.d.ts +21 -0
- package/types/charts/_shared/brush-range.d.ts +22 -0
- package/types/charts/_shared/encodings.d.ts +41 -0
- package/types/charts/_shared/palette.d.ts +12 -0
- package/types/charts/_shared/reference-lines.d.ts +19 -0
- package/types/charts/_shared/scales.d.ts +14 -0
- package/types/charts/_shared/types.d.ts +66 -0
- package/types/charts/_shared/use-dimensions.d.ts +12 -0
- package/types/charts/_shared/use-focus.d.ts +23 -0
- package/types/charts/_shared/use-hover.d.ts +23 -0
- package/types/charts/primitives/Axis/Axis.d.ts +22 -0
- package/types/charts/primitives/ChartTooltip/ChartTooltip.d.ts +17 -0
- package/types/charts/primitives/Legend/Legend.d.ts +13 -0
- package/types/charts/primitives/PlotArea/PlotArea.d.ts +14 -0
- package/types/charts/primitives/ReferenceLine/ReferenceLine.d.ts +33 -0
- package/types/index.charts.d.ts +25 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ChartMargins } from '../../_shared/types';
|
|
3
|
+
export type ReferenceLineLabelPosition = 'top' | 'insideTopLeft' | 'insideTopRight' | 'insideBottomLeft' | 'insideBottomRight';
|
|
4
|
+
export interface ReferenceLineProps {
|
|
5
|
+
x?: number;
|
|
6
|
+
y?: number;
|
|
7
|
+
margins: ChartMargins;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
stroke?: string;
|
|
11
|
+
strokeDasharray?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
labelPosition?: ReferenceLineLabelPosition;
|
|
14
|
+
labelColor?: string;
|
|
15
|
+
labelFontSize?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function ReferenceLine({ x, y, margins, width, height, stroke, strokeDasharray, label, labelPosition, labelColor, labelFontSize, }: ReferenceLineProps): ReactElement | null;
|
|
18
|
+
interface AnchorArgs {
|
|
19
|
+
vertical: boolean;
|
|
20
|
+
at: number;
|
|
21
|
+
left: number;
|
|
22
|
+
right: number;
|
|
23
|
+
top: number;
|
|
24
|
+
bottom: number;
|
|
25
|
+
labelPosition: ReferenceLineLabelPosition;
|
|
26
|
+
labelFontSize: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function labelAnchor({ vertical, at, left, right, top, bottom, labelPosition, labelFontSize, }: AnchorArgs): {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
textAnchor: 'start' | 'middle' | 'end';
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { LineChart, type ChartRange, type LineChartProps } from './charts/LineChart/LineChart';
|
|
2
|
+
export { BarChart, type BarChartProps } from './charts/BarChart/BarChart';
|
|
3
|
+
export { AreaChart, type AreaChartProps } from './charts/AreaChart/AreaChart';
|
|
4
|
+
export { BarLineChart, type BarLineChartProps } from './charts/BarLineChart/BarLineChart';
|
|
5
|
+
export { ScatterChart, type ScatterChartProps } from './charts/ScatterChart/ScatterChart';
|
|
6
|
+
export { Sparkline, type SparklineProps } from './charts/Sparkline/Sparkline';
|
|
7
|
+
export { PieChart, type PieChartProps, type PieDatum } from './charts/PieChart/PieChart';
|
|
8
|
+
export { DonutChart, type DonutChartProps } from './charts/DonutChart/DonutChart';
|
|
9
|
+
export { MetricChart, type MetricChartProps } from './charts/MetricChart/MetricChart';
|
|
10
|
+
export { WaterfallChart, type WaterfallBarDatum, type WaterfallChartProps } from './charts/WaterfallChart/WaterfallChart';
|
|
11
|
+
export { Axis, type AxisProps } from './charts/primitives/Axis/Axis';
|
|
12
|
+
export { ChartTooltip, type ChartTooltipProps, type ChartTooltipRow } from './charts/primitives/ChartTooltip/ChartTooltip';
|
|
13
|
+
export { Legend, type LegendItem, type LegendProps } from './charts/primitives/Legend/Legend';
|
|
14
|
+
export { PlotArea, type PlotAreaProps } from './charts/primitives/PlotArea/PlotArea';
|
|
15
|
+
export { ReferenceLine, labelAnchor, type ReferenceLineLabelPosition, type ReferenceLineProps } from './charts/primitives/ReferenceLine/ReferenceLine';
|
|
16
|
+
export { ChartDataTable, ChartFrame, chartState, seriesTable, type ChartFrameProps, type ChartState, type ChartTable, type SeriesTableOptions } from './charts/_shared/ChartFrame';
|
|
17
|
+
export { axisFormatter, chartLocale, chartMargins, DEFAULT_LOCALE, type ChartLocale } from './charts/_shared/axis-utils';
|
|
18
|
+
export { asChartRange } from './charts/_shared/brush-range';
|
|
19
|
+
export { inferXType, toPoints, toSeries, toSlices, toSteps, type Slice, type Step } from './charts/_shared/encodings';
|
|
20
|
+
export { markerPath, resolveColor, resolveSeriesColor, seriesColors, seriesToken } from './charts/_shared/palette';
|
|
21
|
+
export { projectReferenceLines, type ProjectedReferenceLine } from './charts/_shared/reference-lines';
|
|
22
|
+
export { isNarrow, NARROW_WIDTH, useDimensions, type ChartDimensions } from './charts/_shared/use-dimensions';
|
|
23
|
+
export { useChartFocus, type ChartTargetProps } from './charts/_shared/use-focus';
|
|
24
|
+
export { useChartHover, type HoverState } from './charts/_shared/use-hover';
|
|
25
|
+
export type { AxisConfig, AxisFormat, AxisType, CategoryEncodings, ChartCellProps, ChartMargins, ChartRow, ChartSize, CurveType, DataPoint, ReferenceLineSpec, Series, XYEncodings, } from './charts/_shared/types';
|