@peripheries/charts 0.4.0 → 0.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peripheries/charts",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "The shared charts lineage, built on @stack/core",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -16,6 +16,7 @@ export interface AreaChartProps extends ChartCellProps {
16
16
  tooltip?: boolean;
17
17
  margins?: Partial<ChartMargins>;
18
18
  title?: string;
19
+ showTitle?: boolean;
19
20
  description?: string;
20
21
  referenceLines?: readonly ReferenceLineSpec[];
21
22
  }
@@ -16,6 +16,7 @@ export interface BarChartProps extends ChartCellProps {
16
16
  tooltip?: boolean;
17
17
  margins?: Partial<ChartMargins>;
18
18
  title?: string;
19
+ showTitle?: boolean;
19
20
  description?: string;
20
21
  }
21
- export declare function BarChart({ series, data, x, y, label, value, xAxis, yAxis, height, colors, mode, legend, tooltip, margins: marginOverride, title, description, size, baseProps, isLoading, error, className, style, }: BarChartProps): ReactElement;
22
+ export declare function BarChart({ series, data, x, y, label, value, xAxis, yAxis, height, colors, mode, legend, tooltip, margins: marginOverride, title, showTitle, description, size, baseProps, isLoading, error, className, style, }: BarChartProps): ReactElement;
@@ -17,6 +17,7 @@ export interface BarLineChartProps extends ChartCellProps {
17
17
  tooltip?: boolean;
18
18
  margins?: Partial<ChartMargins>;
19
19
  title?: string;
20
+ showTitle?: boolean;
20
21
  description?: string;
21
22
  }
22
- export declare function BarLineChart({ barSeries, lineSeries, data, x, bar, line, xAxis, yLeft, yRight, height, colors, curve, legend, tooltip, margins: marginOverride, title, description, size, baseProps, isLoading, error, className, style, }: BarLineChartProps): ReactElement;
23
+ export declare function BarLineChart({ barSeries, lineSeries, data, x, bar, line, xAxis, yLeft, yRight, height, colors, curve, legend, tooltip, margins: marginOverride, title, showTitle, description, size, baseProps, isLoading, error, className, style, }: BarLineChartProps): ReactElement;
@@ -19,9 +19,10 @@ export interface LineChartProps extends ChartCellProps {
19
19
  tooltip?: boolean;
20
20
  margins?: Partial<ChartMargins>;
21
21
  title?: string;
22
+ showTitle?: boolean;
22
23
  description?: string;
23
24
  referenceLines?: readonly ReferenceLineSpec[];
24
25
  selectedRange?: ChartRange | null;
25
26
  onSelectRange?: (range: ChartRange | null) => void;
26
27
  }
27
- export declare function LineChart({ series, data, x, y, xAxis, yAxis, height, colors, markers, fill, fillOpacity, curve, legend, tooltip, margins: marginOverride, title, description, referenceLines, selectedRange, onSelectRange, size, baseProps, isLoading, error, className, style, }: LineChartProps): ReactElement;
28
+ export declare function LineChart({ series, data, x, y, xAxis, yAxis, height, colors, markers, fill, fillOpacity, curve, legend, tooltip, margins: marginOverride, title, showTitle, description, referenceLines, selectedRange, onSelectRange, size, baseProps, isLoading, error, className, style, }: LineChartProps): ReactElement;
@@ -21,6 +21,7 @@ export interface PieChartProps extends ChartCellProps {
21
21
  centerLabel?: string;
22
22
  centerSublabel?: string;
23
23
  title?: string;
24
+ showTitle?: boolean;
24
25
  description?: string;
25
26
  }
26
- export declare function PieChart({ slices: slicesProp, data, label, value, height, colors, innerRadius, outerRadius, padAngle, sliceStroke, sliceStrokeWidth, legend, tooltip, format, valueFormatter, centerLabel, centerSublabel, title, description, size, baseProps, isLoading, error, className, style, }: PieChartProps): ReactElement;
27
+ export declare function PieChart({ slices: slicesProp, data, label, value, height, colors, innerRadius, outerRadius, padAngle, sliceStroke, sliceStrokeWidth, legend, tooltip, format, valueFormatter, centerLabel, centerSublabel, title, showTitle, description, size, baseProps, isLoading, error, className, style, }: PieChartProps): ReactElement;
@@ -17,6 +17,7 @@ export interface ScatterChartProps extends ChartCellProps {
17
17
  tooltip?: boolean;
18
18
  margins?: Partial<ChartMargins>;
19
19
  title?: string;
20
+ showTitle?: boolean;
20
21
  description?: string;
21
22
  }
22
- export declare function ScatterChart({ series, data, x, y, label, xAxis, yAxis, height, colors, pointRadius, sizeKey, sizeRange, legend, tooltip, margins: marginOverride, title, description, size, baseProps, isLoading, error, className, style, }: ScatterChartProps): ReactElement;
23
+ export declare function ScatterChart({ series, data, x, y, label, xAxis, yAxis, height, colors, pointRadius, sizeKey, sizeRange, legend, tooltip, margins: marginOverride, title, showTitle, description, size, baseProps, isLoading, error, className, style, }: ScatterChartProps): ReactElement;
@@ -15,7 +15,12 @@ export interface WaterfallChartProps extends ChartCellProps {
15
15
  valueLabels?: boolean;
16
16
  margins?: Partial<ChartMargins>;
17
17
  title?: string;
18
+ showTitle?: boolean;
18
19
  description?: string;
19
20
  }
21
+ export declare function signedFigure(b: {
22
+ value: number;
23
+ display: number;
24
+ }): number;
20
25
  export declare function valueDomain(bars: readonly Pick<Step, 'base' | 'value'>[], plotHeight?: number): [number, number];
21
- export declare function WaterfallChart({ bars, data, label, value, total, xAxis, yAxis, height, valueFormatter, valueLabels, margins: marginOverride, title, description, size, baseProps, isLoading, error, className, style, }: WaterfallChartProps): ReactElement;
26
+ export declare function WaterfallChart({ bars, data, label, value, total, xAxis, yAxis, height, valueFormatter, valueLabels, margins: marginOverride, title, showTitle, description, size, baseProps, isLoading, error, className, style, }: WaterfallChartProps): ReactElement;
@@ -16,6 +16,7 @@ export interface ChartFrameProps {
16
16
  className?: string;
17
17
  style?: CSSProperties;
18
18
  title?: string;
19
+ showTitle?: boolean;
19
20
  description?: string;
20
21
  width: number;
21
22
  height: number;
@@ -26,7 +27,7 @@ export interface ChartFrameProps {
26
27
  tooltip?: ReactNode;
27
28
  children?: ReactNode;
28
29
  }
29
- export declare function ChartFrame({ chartClass, className, style, title, description, width, height, measureRef, state, table, legend, tooltip, children, }: ChartFrameProps): ReactElement;
30
+ export declare function ChartFrame({ chartClass, className, style, title, showTitle, description, width, height, measureRef, state, table, legend, tooltip, children, }: ChartFrameProps): ReactElement;
30
31
  export declare function ChartDataTable({ table }: {
31
32
  table: ChartTable;
32
33
  }): ReactElement;
@@ -1,8 +1,6 @@
1
+ import { type DisplayLocale } from '@stack/core';
1
2
  import { type AxisConfig, type AxisFormat, type ChartMargins } from './types';
2
- export interface ChartLocale {
3
- locale: string;
4
- currency: string;
5
- }
3
+ export type ChartLocale = DisplayLocale;
6
4
  export declare const DEFAULT_LOCALE: ChartLocale;
7
5
  export declare function chartLocale(baseProps?: unknown): ChartLocale;
8
6
  export declare function formatValue(value: number | Date | string, format?: AxisFormat, loc?: ChartLocale): string;
@@ -36,7 +36,7 @@ export interface ChartCellProps {
36
36
  style?: CSSProperties;
37
37
  }
38
38
  export type AxisType = 'time' | 'linear' | 'band';
39
- export type AxisFormat = 'date' | 'date-short' | 'currency' | 'percent' | 'number' | 'compact';
39
+ export type AxisFormat = 'date' | 'date-short' | 'currency' | 'percent' | 'fraction-percent' | 'number' | 'compact' | 'year';
40
40
  export interface AxisConfig {
41
41
  type?: AxisType;
42
42
  format?: AxisFormat;