@redsift/dashboard 7.7.0-alpha.0 → 7.7.0-alpha.2

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/CONTRIBUTING.md CHANGED
@@ -52,7 +52,7 @@ The Design System is following a monorepo architecture, providing multiple packa
52
52
 
53
53
  - `@redsift/dashboard`
54
54
 
55
- This package provides dashboard-related components. Charts are based on [dc.js](https://dc-js.github.io/dc.js/) and [crossfilter](https://crossfilter.github.io/crossfilter/) and datagrids are based on `@redsift/table`. It contains every filterable elements to use inside a dashboard. For static charts, see `@redsift/charts`.
55
+ This package provides dashboard-related components. Charts are based on [dc.js](https://dc-js.github.io/dc.js/), [d3fc](https://d3fc.io/) and [crossfilter](https://crossfilter.github.io/crossfilter/) and datagrids are based on `@redsift/table`. It contains every filterable elements to use inside a dashboard. For static charts, see `@redsift/charts`.
56
56
 
57
57
  - _Deprecated_ `@redsift/design-system-legacy`
58
58
 
package/index.d.ts CHANGED
@@ -335,7 +335,7 @@ declare const HorizontalBarChartTheme: {
335
335
  readonly monochrome: "monochrome";
336
336
  };
337
337
  type HorizontalBarChartTheme = ValueOf<typeof HorizontalBarChartTheme>;
338
- interface LocaleText$3 {
338
+ interface LocaleText$4 {
339
339
  emptyChartTitle?: string;
340
340
  emptyChartSubtitle?: string;
341
341
  emptyChartResetLabel?: string;
@@ -369,7 +369,7 @@ interface HorizontalBarChartProps extends ComponentProps<'div'> {
369
369
  /** Whether the reset button is hidden or not. */
370
370
  isResetable?: boolean;
371
371
  /** Overriden values for internal labels and texts. */
372
- localeText?: LocaleText$3;
372
+ localeText?: LocaleText$4;
373
373
  /** Method to call when a filter occured on the chart. */
374
374
  onFilter?: (filters?: string[]) => void;
375
375
  /** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
@@ -387,7 +387,7 @@ type StyledHorizontalBarChartProps = Omit<HorizontalBarChartProps, 'columnToFilt
387
387
 
388
388
  declare const HorizontalBarChart: Comp<HorizontalBarChartProps, HTMLDivElement>;
389
389
 
390
- interface LocaleText$2 {
390
+ interface LocaleText$3 {
391
391
  maxSizeDisclaimer?: string;
392
392
  }
393
393
  interface PdfExportButtonProps extends ButtonProps {
@@ -398,7 +398,7 @@ interface PdfExportButtonProps extends ButtonProps {
398
398
  /** Text to display at the beginning of the PDF. */
399
399
  introduction?: string;
400
400
  /** Labels and texts. */
401
- localeText?: LocaleText$2;
401
+ localeText?: LocaleText$3;
402
402
  /** Image to put at the top of the PDF (SVG format not supported). */
403
403
  logo?: string;
404
404
  /** Function to be executed when button is clicked. */
@@ -409,7 +409,7 @@ interface PdfExportButtonProps extends ButtonProps {
409
409
 
410
410
  declare const PdfExportButton: Comp<PdfExportButtonProps, HTMLButtonElement>;
411
411
 
412
- interface LocaleText$1 {
412
+ interface LocaleText$2 {
413
413
  emptyChartTitle?: string;
414
414
  emptyChartSubtitle?: string;
415
415
  emptyChartResetLabel?: string;
@@ -441,7 +441,7 @@ interface PieChartProps extends ComponentProps<'div'> {
441
441
  /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. */
442
442
  labelVariant?: PieChartLabelVariant;
443
443
  /** Overriden values for internal labels and texts. */
444
- localeText?: LocaleText$1;
444
+ localeText?: LocaleText$2;
445
445
  /** Method to call when a filter occured on the chart. */
446
446
  onFilter?: (filters?: string[]) => void;
447
447
  /** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
@@ -493,7 +493,7 @@ declare const TimeSeriesBarChartTheme: {
493
493
  };
494
494
  type TimeSeriesBarChartTheme = ValueOf<typeof TimeSeriesBarChartTheme>;
495
495
  type datetimeEnum = 'hour' | 'day' | 'week' | 'month' | 'year';
496
- interface LocaleText {
496
+ interface LocaleText$1 {
497
497
  emptyChartTitle?: string;
498
498
  emptyChartSubtitle?: string;
499
499
  emptyChartResetLabel?: string;
@@ -522,7 +522,7 @@ interface TimeSeriesBarChartProps extends ComponentProps<'div'> {
522
522
  /** Whether the reset button is hidden or not. */
523
523
  isResetable?: boolean;
524
524
  /** Overriden values for internal labels and texts. */
525
- localeText?: LocaleText;
525
+ localeText?: LocaleText$1;
526
526
  /** Method to call when a filter occured on the chart. */
527
527
  onFilter?: (filters?: string[], allFiltered?: JSONArray) => void;
528
528
  /** TimeSeriesChart size. */
@@ -542,4 +542,100 @@ type StyledTimeSeriesBarChartProps = Omit<TimeSeriesBarChartProps, 'dimension' |
542
542
 
543
543
  declare const TimeSeriesBarChart: Comp<TimeSeriesBarChartProps, HTMLDivElement>;
544
544
 
545
- export { COUNT, ChartDimensions, ChartEmptyState, ChartEmptyStateProps, Dashboard, DashboardContext, DashboardContextProps, DashboardProps, DashboardReducer, DashboardReducerAction, DashboardReducerActionType, DashboardReducerState, DataGrid, DataGridProps, Dimension, DimensionSelector, Group, GroupSelector, HorizontalBarChart, HorizontalBarChartProps, HorizontalBarChartSize, HorizontalBarChartTheme, JSONArray, JSONObject, JSONValue, PdfExportButton, PieChart, PieChartProps, SUM, StyledHorizontalBarChartProps, StyledPieChartProps, StyledTimeSeriesBarChartProps, SuccessDangerColorTheme, TNdx, TimeSeriesBarChart, TimeSeriesBarChartProps, TimeSeriesBarChartSize, TimeSeriesBarChartTheme, datetimeEnum, groupReduceSum, initialState };
545
+ /**
546
+ * Component size.
547
+ */
548
+ declare const ScatterPlotSize: {
549
+ readonly xlarge: "xlarge";
550
+ readonly large: "large";
551
+ readonly medium: "medium";
552
+ readonly small: "small";
553
+ };
554
+ type ScatterPlotSize = ValueOf<typeof ScatterPlotSize>;
555
+ /**
556
+ * Component's labels variant.
557
+ */
558
+ declare const ScatterPlotLabelVariant: {
559
+ readonly none: "none";
560
+ readonly label: "label";
561
+ readonly labelValue: "labelValue";
562
+ readonly labelPercent: "labelPercent";
563
+ };
564
+ type ScatterPlotLabelVariant = ValueOf<typeof ScatterPlotLabelVariant>;
565
+ /**
566
+ * Component theme.
567
+ */
568
+ declare const ScatterPlotTheme: {
569
+ readonly default: "default";
570
+ readonly dark: "dark";
571
+ readonly darker: "darker";
572
+ readonly monochrome: "monochrome";
573
+ };
574
+ type ScatterPlotTheme = ValueOf<typeof ScatterPlotTheme>;
575
+ interface LocaleText {
576
+ emptyChartTitle?: string;
577
+ emptyChartSubtitle?: string;
578
+ emptyChartResetLabel?: string;
579
+ resetLabel?: string;
580
+ }
581
+ /**
582
+ * Component props.
583
+ */
584
+ interface ScatterPlotProps extends ComponentProps<'div'> {
585
+ /** Defines the fields to display on hover. An array of key/value will indicate which field to display and how to name it. An object of selectable fields and default selected fields can be used to make the annotations customizable by the user. */
586
+ annotations?: {
587
+ key: string;
588
+ value: string;
589
+ }[] | {
590
+ /** List of fields selected by default. Should only contain values that are keys in selectableFields prop. */
591
+ defaultSelectedFields?: string[];
592
+ /** List of fields to display inside the tooltip. keys should match the ones in the dataset and values would be the one used to label the checkboxes. */
593
+ selectableFields: {
594
+ key: string;
595
+ value: string;
596
+ }[];
597
+ };
598
+ /** Caption. */
599
+ caption?: string;
600
+ /** Dataset to use to generate the chart, if no context is provided. */
601
+ data?: JSONArray;
602
+ /** Which datagrid column the chart is filtering for x and y but also for category if provided. */
603
+ datagridFilter?: {
604
+ x: string;
605
+ y: string;
606
+ category?: string;
607
+ };
608
+ /** Method that will be used by crossfilter to compute the dimensions of the charts. */
609
+ dimension: OrderedValueSelector<any, [number, number, string]> | OrderedValueSelector<any, [number, number]>;
610
+ /** Reset function that is triggered when reset button is pressed in the empty state chart. */
611
+ emptyChartResetFn?: () => void;
612
+ /** Whether the dimension field is an array or not. */
613
+ isDimensionArray?: boolean;
614
+ /** Whether the reset button is hidden or not. */
615
+ isResetable?: boolean;
616
+ /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. */
617
+ labelVariant?: ScatterPlotLabelVariant;
618
+ /** Overriden values for internal labels and texts. */
619
+ localeText?: LocaleText;
620
+ /** Method to call when a filter occured on the chart. */
621
+ onFilter?: (filters?: string[]) => void;
622
+ /** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
623
+ others?: boolean | string;
624
+ /** Method to override the data labels. */
625
+ setLabels?: (key: string) => string | undefined;
626
+ /** ScatterPlot size. */
627
+ size?: ScatterPlotSize | {
628
+ width: number;
629
+ height: number;
630
+ dotSize: number;
631
+ };
632
+ /** Color palette to use. You can choose among the list of available color palette or also choose to use the success/warning/danger theme for which you have to specify which key corresponds to which status. */
633
+ theme?: ScatterPlotTheme | SuccessDangerColorTheme;
634
+ /** Title. */
635
+ title?: string;
636
+ }
637
+ type StyledScatterPlotProps = Omit<ScatterPlotProps, 'columnToFilter' | 'data' | 'dimension' | 'group' | 'localeText'> & {};
638
+
639
+ declare const ScatterPlot: Comp<ScatterPlotProps, HTMLDivElement>;
640
+
641
+ export { COUNT, ChartDimensions, ChartEmptyState, ChartEmptyStateProps, Dashboard, DashboardContext, DashboardContextProps, DashboardProps, DashboardReducer, DashboardReducerAction, DashboardReducerActionType, DashboardReducerState, DataGrid, DataGridProps, Dimension, DimensionSelector, Group, GroupSelector, HorizontalBarChart, HorizontalBarChartProps, HorizontalBarChartSize, HorizontalBarChartTheme, JSONArray, JSONObject, JSONValue, PdfExportButton, PieChart, PieChartProps, SUM, ScatterPlot, ScatterPlotLabelVariant, ScatterPlotProps, ScatterPlotSize, ScatterPlotTheme, StyledHorizontalBarChartProps, StyledPieChartProps, StyledScatterPlotProps, StyledTimeSeriesBarChartProps, SuccessDangerColorTheme, TNdx, TimeSeriesBarChart, TimeSeriesBarChartProps, TimeSeriesBarChartSize, TimeSeriesBarChartTheme, datetimeEnum, groupReduceSum, initialState };