@redsift/charts 10.3.0-alpha.8 → 10.3.0-alpha.9

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/index.d.ts CHANGED
@@ -550,7 +550,7 @@ interface ChartContainerProps extends Omit<ComponentProps<'div'>, 'title'>, Cont
550
550
  /** Description that won't be visually displayed but will be used for assistive technology. If you want to display the description, use `description` instead. */
551
551
  descriptionForAssistiveTechnology?: string;
552
552
  /** Whether the chart is static or interactive. */
553
- mode?: 'static' | 'interactive';
553
+ mode?: string;
554
554
  /** Small text explaining which kind of chart is presenting and what's its basic composition. */
555
555
  definition?: string;
556
556
  /** Small text explaining the basic composition of the x-axis, if any. */
@@ -606,7 +606,7 @@ interface LegendProps extends Omit<ComponentProps<'ul'>, 'onClick'>, ContainerPr
606
606
  data: (Statistic & {
607
607
  color: string;
608
608
  })[];
609
- /** Method to determine whether a slice is selected or not. */
609
+ /** Method to determine whether a legend is selected or not. */
610
610
  isLegendItemSelected?: (datum: LegendItemDatum) => void;
611
611
  /** Method to override the data labels. */
612
612
  labelDecorator?: (datum: LegendItemDatum, props?: {
@@ -695,7 +695,9 @@ interface BarChartProps extends ChartContainerProps, ChartAxesProps {
695
695
  /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. If set to "custom", use `legendDecorator` to customize it. */
696
696
  legendVariant?: BarChartLegendVariant;
697
697
  /** Props to forward to the Legend block. Can be used to make the legend selectable. */
698
- legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant' | 'width'>;
698
+ legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant' | 'width'> & {
699
+ extraLegendItems?: Statistics;
700
+ };
699
701
  /** Labels and texts. */
700
702
  localeText?: LocaleText$3;
701
703
  /** Custom margins, used to give more space for axes labels and legend for instance. */
@@ -818,7 +820,7 @@ type LineChartDimensions = ChartDimensions & {
818
820
  interface LineChartProps extends ChartContainerProps, ChartAxesProps {
819
821
  /** Dataset to use to generate the chart. */
820
822
  data?: TwoCategoryData;
821
- /** Dot role. If an onClick is provided, the dots will have the role `button`. For a navigation link, please use `getSliceAnchorProps` instead. */
823
+ /** Dot role. If an onClick is provided, the dots will have the role `button`. For a navigation link, please use `getDotAnchorProps` instead. */
822
824
  dotRole?: DotProps['role'];
823
825
  /** Component to use if the chart is empty (replacing the default one). */
824
826
  emptyComponent?: ReactNode;
@@ -841,12 +843,14 @@ interface LineChartProps extends ChartContainerProps, ChartAxesProps {
841
843
  /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. If set to "custom", use `legendDecorator` to customize it. */
842
844
  legendVariant?: LineChartLegendVariant;
843
845
  /** Props to forward to the Legend block. Can be used to make the legend selectable. */
844
- legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant' | 'width'>;
846
+ legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant' | 'width'> & {
847
+ extraLegendItems?: Statistics;
848
+ };
845
849
  /** Labels and texts. */
846
850
  localeText?: LocaleText$2;
847
851
  /** Custom margins, used to give more space for axes labels and legend for instance. */
848
852
  margins?: MarginProps;
849
- /** Method to be called on a click on a dot. For a navigation link, please use `getSliceAnchorProps` instead. */
853
+ /** Method to be called on a click on a dot. For a navigation link, please use `getDotAnchorProps` instead. */
850
854
  onDotClick?: (datum: DotDatum) => void;
851
855
  /** LineChart size. */
852
856
  size?: ChartSize | LineChartDimensions;
@@ -942,7 +946,9 @@ interface PieChartProps extends ChartContainerProps {
942
946
  /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. If set to "custom", use `legendDecorator` to customize it. */
943
947
  legendVariant?: PieChartLegendVariant;
944
948
  /** Props to forward to the Legend block. Can be used to make the legend selectable. */
945
- legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant'>;
949
+ legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant'> & {
950
+ extraLegendItems?: Statistics;
951
+ };
946
952
  /** Labels and texts. */
947
953
  localeText?: LocaleText$1;
948
954
  /** Method to be called on a click on a slice. For a navigation link, please use `getSliceAnchorProps` instead. */
@@ -1030,7 +1036,9 @@ type ScatterPlotDimensions = ChartDimensions & {
1030
1036
  interface ScatterPlotProps extends ChartContainerProps, ChartAxesProps {
1031
1037
  /** Dataset to use to generate the chart. */
1032
1038
  data?: CoordinatesCategoryData;
1033
- /** Slice role. Used to indicate that dots are to be considered buttons or links. If an onClick is provided, the dots will have the role `button` unless specifically set to `link` with this prop. */
1039
+ /** Method used to define the anchor props to use when the dot is a navigation link. */
1040
+ getDotAnchorProps?: (datum: DotDatum) => AnchorProps;
1041
+ /** Dot role. If an onClick is provided, the dots will have the role `button`. For a navigation link, please use `getDotAnchorProps` instead. */
1034
1042
  dotRole?: DotProps['role'];
1035
1043
  /** Component to use if the chart is empty (replacing the default one). */
1036
1044
  emptyComponent?: ReactNode;
@@ -1055,7 +1063,9 @@ interface ScatterPlotProps extends ChartContainerProps, ChartAxesProps {
1055
1063
  /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. If set to "custom", use `legendDecorator` to customize it. */
1056
1064
  legendVariant?: ScatterPlotLegendVariant;
1057
1065
  /** Props to forward to the Legend block. Can be used to make the legend selectable. */
1058
- legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant' | 'width'>;
1066
+ legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant' | 'width'> & {
1067
+ extraLegendItems?: Statistics;
1068
+ };
1059
1069
  /** Labels and texts. */
1060
1070
  localeText?: LocaleText;
1061
1071
  /** Custom margins, used to give more space for axes labels and legend for instance. */
@@ -1064,7 +1074,7 @@ interface ScatterPlotProps extends ChartContainerProps, ChartAxesProps {
1064
1074
  onBrush?: (selection: [[number, number], [number, number]] | null, scaleX: ScaleLinear$1<number, number>, scaleY: ScaleLinear$1<number, number>) => void;
1065
1075
  /** Method called on brush end. */
1066
1076
  onBrushEnd?: (selection: [[number, number], [number, number]] | null, scaleX?: ScaleLinear$1<number, number>, scaleY?: ScaleLinear$1<number, number>) => void;
1067
- /** Method to be called on a click on a dot. */
1077
+ /** Method to be called on a click on a dot. For a navigation link, please use `getDotAnchorProps` instead. */
1068
1078
  onDotClick?: (datum: DotDatum) => void;
1069
1079
  /** ScatterPlot size. */
1070
1080
  size?: ChartSize | ScatterPlotDimensions;