@sproutsocial/seeds-react-data-viz 0.4.3 → 0.5.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/dist/index.d.mts CHANGED
@@ -4,6 +4,7 @@ import { TimeTicksInfoObject, AxisLabelsFormatterContextObject, Chart, Annotatio
4
4
  import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
5
5
  import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
6
6
  import { Table } from '@sproutsocial/seeds-react-table';
7
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
7
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
9
  import * as styled_components from 'styled-components';
9
10
 
@@ -228,6 +229,15 @@ type TypeChartTooltipTitleProps = {
228
229
  };
229
230
  declare const ChartTooltipTitle: react.NamedExoticComponent<TypeChartTooltipTitleProps>;
230
231
 
232
+ declare const ChartXAnnotationDetails: react.NamedExoticComponent<Readonly<{
233
+ iconName: TypeIconName;
234
+ text: string;
235
+ }>>;
236
+
237
+ declare const ChartXAnnotationMarker: react.NamedExoticComponent<Readonly<{
238
+ iconName: TypeIconName;
239
+ }>>;
240
+
231
241
  type TypeColorBoxProps = TypeBoxProps;
232
242
  /**
233
243
  * ColorBox extends Box to apply basic styles.
@@ -269,13 +279,15 @@ type TypeDonutChartTooltipProps = Readonly<{
269
279
  value: number | null;
270
280
  icon?: ReactNode;
271
281
  }>;
282
+ type TypeDonutChartDataItem = Readonly<{
283
+ name: string;
284
+ value: number;
285
+ key?: string;
286
+ icon?: ReactNode;
287
+ styles?: TypeChartDataStyles;
288
+ }>;
272
289
  type TypeDonutChartProps = Readonly<{
273
- data: ReadonlyArray<Readonly<{
274
- name: string;
275
- value: number;
276
- icon?: ReactNode;
277
- styles?: TypeChartDataStyles;
278
- }>>;
290
+ data: ReadonlyArray<TypeDonutChartDataItem>;
279
291
  numberLocale: Intl.LocalesArgument;
280
292
  textLocale: Intl.LocalesArgument;
281
293
  currency?: string;
@@ -283,18 +295,13 @@ type TypeDonutChartProps = Readonly<{
283
295
  hideLegend?: boolean;
284
296
  numberFormat?: TypeChartNumberFormat;
285
297
  tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
286
- onClick?: ({ x }: Readonly<{
298
+ onClick?: (data: Readonly<{
287
299
  x: string;
288
- }>) => void;
300
+ } & TypeDonutChartDataItem>) => void;
289
301
  tooltipClickLabel?: ReactNode;
290
302
  }>;
291
303
  declare const DonutChart: react.NamedExoticComponent<Readonly<{
292
- data: ReadonlyArray<Readonly<{
293
- name: string;
294
- value: number;
295
- icon?: ReactNode;
296
- styles?: TypeChartDataStyles;
297
- }>>;
304
+ data: ReadonlyArray<TypeDonutChartDataItem>;
298
305
  numberLocale: Intl.LocalesArgument;
299
306
  textLocale: Intl.LocalesArgument;
300
307
  currency?: string;
@@ -302,9 +309,9 @@ declare const DonutChart: react.NamedExoticComponent<Readonly<{
302
309
  hideLegend?: boolean;
303
310
  numberFormat?: TypeChartNumberFormat;
304
311
  tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
305
- onClick?: ({ x }: Readonly<{
312
+ onClick?: (data: Readonly<{
306
313
  x: string;
307
- }>) => void;
314
+ } & TypeDonutChartDataItem>) => void;
308
315
  tooltipClickLabel?: ReactNode;
309
316
  }>>;
310
317
 
@@ -376,6 +383,40 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
376
383
  xAnnotations?: TypeChartXAnnotations;
377
384
  }>>;
378
385
 
386
+ declare const VerticalBarChart: react.NamedExoticComponent<Readonly<{
387
+ data: ReadonlyArray<Readonly<{
388
+ name: string;
389
+ points: ReadonlyArray<TypeChartDataPoint>;
390
+ icon?: ReactNode;
391
+ styles?: TypeChartDataStyles & Readonly<{
392
+ pattern?: TypeChartStylePattern;
393
+ }>;
394
+ }>>;
395
+ invalidNumberLabel: ReactNode;
396
+ numberLocale: Intl.LocalesArgument;
397
+ textLocale: Intl.LocalesArgument;
398
+ tooltipDateFormatter: TypeChartTooltipDateFormatter;
399
+ currency?: string;
400
+ numberFormat?: TypeChartNumberFormat;
401
+ seriesLimit?: number;
402
+ showSeriesLimitWarning?: boolean;
403
+ tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
404
+ yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
405
+ onClick?: ({ x }: Readonly<{
406
+ x: number;
407
+ }>) => void;
408
+ tooltipClickLabel?: ReactNode;
409
+ timeFormat?: TypeChartTimeFormat;
410
+ xAnnotations?: TypeChartXAnnotations;
411
+ xAxisLabelFormatter?: (params: {
412
+ textLocale: Intl.LocalesArgument;
413
+ tickPositions: number[];
414
+ unitName: string;
415
+ value: string | number;
416
+ timeFormat?: string;
417
+ }) => string;
418
+ }>>;
419
+
379
420
  declare const baseChartOptions: Options;
380
421
  declare const TIME_SERIES_CHART_HEIGHT = 275;
381
422
  declare const timeSeriesChartOptions: Options;
@@ -510,4 +551,4 @@ declare const donutChartStyles: styled_components.FlattenInterpolation<styled_co
510
551
  $hasOnClick: TypeChartStyleHasOnClick;
511
552
  }>, any>>;
512
553
 
513
- export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartXAnnotations, type TypeChartXAnnotationsDetails, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeExtendedChart, type TypeLegendLabel, type TypeLineChartProps, type TypeSeriesType, type TypeVerticalBarChartProps, VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, columnChartOptions, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, getStorybookCategoricalData, getStorybookSparseTimelineData, isCategoricalHourData, isHourlyTimeData, lineChartOptions, lineChartStyles, timeSeriesChartOptions, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
554
+ export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ChartXAnnotationDetails, ChartXAnnotationMarker, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartXAnnotations, type TypeChartXAnnotationsDetails, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartDataItem, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeExtendedChart, type TypeLegendLabel, type TypeLineChartProps, type TypeSeriesType, type TypeVerticalBarChartProps, VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT, VerticalBarChart, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, columnChartOptions, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, getStorybookCategoricalData, getStorybookSparseTimelineData, isCategoricalHourData, isHourlyTimeData, lineChartOptions, lineChartStyles, timeSeriesChartOptions, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { TimeTicksInfoObject, AxisLabelsFormatterContextObject, Chart, Annotatio
4
4
  import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
5
5
  import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
6
6
  import { Table } from '@sproutsocial/seeds-react-table';
7
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
7
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
8
9
  import * as styled_components from 'styled-components';
9
10
 
@@ -228,6 +229,15 @@ type TypeChartTooltipTitleProps = {
228
229
  };
229
230
  declare const ChartTooltipTitle: react.NamedExoticComponent<TypeChartTooltipTitleProps>;
230
231
 
232
+ declare const ChartXAnnotationDetails: react.NamedExoticComponent<Readonly<{
233
+ iconName: TypeIconName;
234
+ text: string;
235
+ }>>;
236
+
237
+ declare const ChartXAnnotationMarker: react.NamedExoticComponent<Readonly<{
238
+ iconName: TypeIconName;
239
+ }>>;
240
+
231
241
  type TypeColorBoxProps = TypeBoxProps;
232
242
  /**
233
243
  * ColorBox extends Box to apply basic styles.
@@ -269,13 +279,15 @@ type TypeDonutChartTooltipProps = Readonly<{
269
279
  value: number | null;
270
280
  icon?: ReactNode;
271
281
  }>;
282
+ type TypeDonutChartDataItem = Readonly<{
283
+ name: string;
284
+ value: number;
285
+ key?: string;
286
+ icon?: ReactNode;
287
+ styles?: TypeChartDataStyles;
288
+ }>;
272
289
  type TypeDonutChartProps = Readonly<{
273
- data: ReadonlyArray<Readonly<{
274
- name: string;
275
- value: number;
276
- icon?: ReactNode;
277
- styles?: TypeChartDataStyles;
278
- }>>;
290
+ data: ReadonlyArray<TypeDonutChartDataItem>;
279
291
  numberLocale: Intl.LocalesArgument;
280
292
  textLocale: Intl.LocalesArgument;
281
293
  currency?: string;
@@ -283,18 +295,13 @@ type TypeDonutChartProps = Readonly<{
283
295
  hideLegend?: boolean;
284
296
  numberFormat?: TypeChartNumberFormat;
285
297
  tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
286
- onClick?: ({ x }: Readonly<{
298
+ onClick?: (data: Readonly<{
287
299
  x: string;
288
- }>) => void;
300
+ } & TypeDonutChartDataItem>) => void;
289
301
  tooltipClickLabel?: ReactNode;
290
302
  }>;
291
303
  declare const DonutChart: react.NamedExoticComponent<Readonly<{
292
- data: ReadonlyArray<Readonly<{
293
- name: string;
294
- value: number;
295
- icon?: ReactNode;
296
- styles?: TypeChartDataStyles;
297
- }>>;
304
+ data: ReadonlyArray<TypeDonutChartDataItem>;
298
305
  numberLocale: Intl.LocalesArgument;
299
306
  textLocale: Intl.LocalesArgument;
300
307
  currency?: string;
@@ -302,9 +309,9 @@ declare const DonutChart: react.NamedExoticComponent<Readonly<{
302
309
  hideLegend?: boolean;
303
310
  numberFormat?: TypeChartNumberFormat;
304
311
  tooltip?: ({ color, name, percent, value, }: TypeDonutChartTooltipProps) => ReactNode;
305
- onClick?: ({ x }: Readonly<{
312
+ onClick?: (data: Readonly<{
306
313
  x: string;
307
- }>) => void;
314
+ } & TypeDonutChartDataItem>) => void;
308
315
  tooltipClickLabel?: ReactNode;
309
316
  }>>;
310
317
 
@@ -376,6 +383,40 @@ declare const LineChart: react.NamedExoticComponent<Readonly<{
376
383
  xAnnotations?: TypeChartXAnnotations;
377
384
  }>>;
378
385
 
386
+ declare const VerticalBarChart: react.NamedExoticComponent<Readonly<{
387
+ data: ReadonlyArray<Readonly<{
388
+ name: string;
389
+ points: ReadonlyArray<TypeChartDataPoint>;
390
+ icon?: ReactNode;
391
+ styles?: TypeChartDataStyles & Readonly<{
392
+ pattern?: TypeChartStylePattern;
393
+ }>;
394
+ }>>;
395
+ invalidNumberLabel: ReactNode;
396
+ numberLocale: Intl.LocalesArgument;
397
+ textLocale: Intl.LocalesArgument;
398
+ tooltipDateFormatter: TypeChartTooltipDateFormatter;
399
+ currency?: string;
400
+ numberFormat?: TypeChartNumberFormat;
401
+ seriesLimit?: number;
402
+ showSeriesLimitWarning?: boolean;
403
+ tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
404
+ yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
405
+ onClick?: ({ x }: Readonly<{
406
+ x: number;
407
+ }>) => void;
408
+ tooltipClickLabel?: ReactNode;
409
+ timeFormat?: TypeChartTimeFormat;
410
+ xAnnotations?: TypeChartXAnnotations;
411
+ xAxisLabelFormatter?: (params: {
412
+ textLocale: Intl.LocalesArgument;
413
+ tickPositions: number[];
414
+ unitName: string;
415
+ value: string | number;
416
+ timeFormat?: string;
417
+ }) => string;
418
+ }>>;
419
+
379
420
  declare const baseChartOptions: Options;
380
421
  declare const TIME_SERIES_CHART_HEIGHT = 275;
381
422
  declare const timeSeriesChartOptions: Options;
@@ -510,4 +551,4 @@ declare const donutChartStyles: styled_components.FlattenInterpolation<styled_co
510
551
  $hasOnClick: TypeChartStyleHasOnClick;
511
552
  }>, any>>;
512
553
 
513
- export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartXAnnotations, type TypeChartXAnnotationsDetails, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeExtendedChart, type TypeLegendLabel, type TypeLineChartProps, type TypeSeriesType, type TypeVerticalBarChartProps, VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, columnChartOptions, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, getStorybookCategoricalData, getStorybookSparseTimelineData, isCategoricalHourData, isHourlyTimeData, lineChartOptions, lineChartStyles, timeSeriesChartOptions, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };
554
+ export { AreaChart, ChartLegend, ChartLegendLabel, ChartTable, ChartTooltip, ChartTooltipFooter, ChartTooltipHeader, ChartTooltipPortal, ChartTooltipTable, ChartTooltipTitle, ChartXAnnotationDetails, ChartXAnnotationMarker, ColorBox, DONUT_CHART_HALO_SIZE, DONUT_CHART_HEIGHT, DONUT_CHART_WIDTH, DatavizColorBox, DonutChart, DonutChartLegendTable, type ExtendedAxisLabelsFormatterContextObject, type ExtendedTimeTicksInfoObject, GlobalChartStyleOverrides, LineChart, NetworkColorBox, TIME_SERIES_CHART_HEIGHT, type TypeAreaChartProps, type TypeChartDataPoint, type TypeChartDataStyles, type TypeChartLegendLabelProps, type TypeChartLegendProps, type TypeChartNumberFormat, type TypeChartStyleColor, type TypeChartStyleHasOnClick, type TypeChartStylePattern, type TypeChartTableProps, type TypeChartTimeFormat, type TypeChartTooltipDateFormatter, type TypeChartTooltipProps, type TypeChartTooltipTableProps, type TypeChartXAnnotations, type TypeChartXAnnotationsDetails, type TypeChartYAxisLabelFormatter, type TypeColorBoxProps, type TypeDatavizColorBox, type TypeDatavizColorBoxProps, type TypeDonutChartDataItem, type TypeDonutChartLegendTableProps, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeExtendedChart, type TypeLegendLabel, type TypeLineChartProps, type TypeSeriesType, type TypeVerticalBarChartProps, VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT, VerticalBarChart, areaChartOptions, areaChartStyles, baseChartOptions, baseChartStyles, columnChartOptions, donutChartOptions, donutChartStyles, generateChartTooltipPortalId, getDatavizColor, getDatavizColorWithAlpha, getDatavizOpacity, getStorybookCategoricalData, getStorybookSparseTimelineData, isCategoricalHourData, isHourlyTimeData, lineChartOptions, lineChartStyles, timeSeriesChartOptions, timeSeriesChartStyles, transformDataToSeries, transformTimeSeriesTooltipData, xAxisLabelFormatter, yAxisLabelFormatter };