@vizzly/dashboard 0.14.4-dev-24f9cd0bb1a4c71a63f54ca0536be5df044db3a4 → 0.14.4-dev-e92d7e73ad10f9a39cbd6f8d0ebbd4f8db295c86

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.
@@ -1,16 +1,18 @@
1
- import { FunctionComponent } from 'react';
1
+ /// <reference types="react" />
2
2
  import { BaseXAxis } from '../../../../../shared-logic/src/ChartsV2/types';
3
3
  import { Margin } from '../../utils/buildMargin';
4
4
  import { ChartThemeCSS } from '../../utils/getChartThemeCSS';
5
5
  import { DataType } from '../../../../../shared-logic/src/Field/types';
6
6
  import { ScaleBand, ScaleLinear, ScaleTime, ScalePoint } from '@visx/vendor/d3-scale';
7
- export declare const AxisBottom: FunctionComponent<{
7
+ export declare type AxisBottomProps = {
8
8
  x: BaseXAxis;
9
9
  margin: Margin;
10
+ baselineShift?: number;
10
11
  themeCSS: ChartThemeCSS;
11
12
  show?: boolean;
12
13
  removeStroke?: boolean;
13
14
  xScaleDataType?: DataType;
14
15
  xScale: ScaleBand<string> | ScaleBand<Date> | ScaleBand<number> | ScaleLinear<number, number, never> | ScalePoint<string> | ScaleTime<number, number, never> | null;
15
16
  height: number;
16
- }>;
17
+ };
18
+ export declare function AxisBottom({ x, margin, themeCSS, show, removeStroke, xScaleDataType, xScale, height, baselineShift }: AxisBottomProps): JSX.Element | null;
@@ -1,10 +1,7 @@
1
- import { BarChartRepresentation, BarStyles } from '../../../../../shared-logic/src/BarChartV2/types';
1
+ /// <reference types="react" />
2
+ import { BarChartRepresentation } from '../../../../../shared-logic/src/BarChartV2/types';
2
3
  import { ChartTheme } from '../../../types';
3
- import { FunctionComponent } from 'react';
4
- import { DataType } from '../../../../../shared-logic/src/Field/types';
5
- import { ChartDataDefinition, ChartOnViewClick, ConditionalFormattingRule, ShapeDefinition } from '../../../../../shared-logic/src/ChartsV2/types';
6
- import { DatumObject } from '@visx/shape/lib/types';
7
- import { ScaleLinear, ScaleBand } from '@visx/vendor/d3-scale';
4
+ import { ChartOnViewClick } from '../../../../../shared-logic/src/ChartsV2/types';
8
5
  export declare type BarChartProps = {
9
6
  width: number;
10
7
  height: number;
@@ -22,31 +19,6 @@ export declare type BarChartProps = {
22
19
  };
23
20
  onClick: (params: ChartOnViewClick) => void;
24
21
  enableHover?: boolean;
22
+ numberOfDimensions: number;
25
23
  };
26
- export declare const BarChart: ({ chart, width, height, options, theme, onClick, enableHover }: BarChartProps) => JSX.Element;
27
- export declare function BarGroup({ data, keys, height, xKey, xScaleDataType, xScale, innerXScale, yScale, onClick, conditionalFormattingRules, bars, enableHover, }: {
28
- data: ChartDataDefinition[];
29
- keys: string[];
30
- height: number;
31
- xKey: string;
32
- xScaleDataType: DataType;
33
- xScale: ScaleBand<string> | ScaleBand<Date> | ScaleBand<number> | null;
34
- innerXScale: ScaleBand<string> | undefined;
35
- yScale: ScaleLinear<number, number, never>;
36
- onClick: (e: React.MouseEvent<SVGRectElement, MouseEvent>, barGroup: any, bar: any) => void;
37
- conditionalFormattingRules: ConditionalFormattingRule[];
38
- bars: ShapeDefinition<BarStyles>[];
39
- enableHover?: boolean;
40
- }): JSX.Element;
41
- export declare const BarStacked: FunctionComponent<{
42
- conditionalFormattingRules: ConditionalFormattingRule[];
43
- bars: ShapeDefinition<BarStyles>[];
44
- keys?: string[];
45
- yScale: ScaleLinear<number, number, never>;
46
- xScale: any;
47
- xScaleDataType: string;
48
- xScaleKey: string;
49
- data: DatumObject[];
50
- height: number;
51
- width: number;
52
- }>;
24
+ export declare const BarChart: ({ chart, width, height, options, theme, onClick, enableHover, numberOfDimensions }: BarChartProps) => JSX.Element;
@@ -3,17 +3,18 @@ import { ShapeDefinition, ConditionalFormattingRule, Key } from '../../../../../
3
3
  import { BarStyles } from '../../../../../shared-logic/src/BarChartV2/types';
4
4
  import { LineStyles } from '../../../../../shared-logic/src/LineChartV2/types';
5
5
  import { AreaStyles } from '../../../../../shared-logic/src/AreaChartV2/types';
6
- interface LegendProps<T> {
6
+ declare type Item<T> = {
7
+ legendItems: Array<ShapeDefinition<T>>;
8
+ visibleYKeys: Array<string>;
9
+ conditionalFormattingRules: Array<ConditionalFormattingRule>;
10
+ };
11
+ export declare type LegendProps<T> = {
7
12
  setVisibleYKeys?: React.Dispatch<React.SetStateAction<Array<string>>>;
8
13
  keys: {
9
14
  [key: string]: Key;
10
15
  };
11
16
  marginLeft: number;
12
- items?: {
13
- legendItems: Array<ShapeDefinition<T>>;
14
- visibleYKeys: Array<string>;
15
- conditionalFormattingRules: Array<ConditionalFormattingRule>;
16
- }[];
17
- }
17
+ items: Item<T>[];
18
+ };
18
19
  export declare const Legend: ({ keys, setVisibleYKeys, marginLeft, items, }: LegendProps<BarStyles | LineStyles | AreaStyles>) => JSX.Element;
19
20
  export {};
@@ -0,0 +1,10 @@
1
+ export declare type UseBottomAxisBaseLineShiftProps = {
2
+ showDetailedSubGroupingLabels: boolean;
3
+ hasBottomTitle: boolean;
4
+ hasLeftTitle: boolean;
5
+ };
6
+ export declare const useBottomAxisBaseLineShift: ({ showDetailedSubGroupingLabels, hasBottomTitle, hasLeftTitle, }: UseBottomAxisBaseLineShiftProps) => {
7
+ bottomAxisBaselineShift: number;
8
+ bottomOffset: number;
9
+ leftOffset: number;
10
+ };
@@ -0,0 +1 @@
1
+ export declare const BAR_RADIUS = 2;
@@ -7,4 +7,4 @@ export declare type Margin = {
7
7
  bottomTitleOffset: number;
8
8
  leftTitleOffset: number;
9
9
  };
10
- export declare const buildMargin: (yTicks: Tick<number>[], showYAxisLabels: boolean, hasYAxisTitle: boolean, hasXAxisTitle: boolean) => Margin;
10
+ export declare const buildMargin: (yTicks: Tick<number>[], showYAxisLabels: boolean, hasYAxisTitle: boolean, hasXAxisTitle: boolean, showDetailedSubGroupingLabels?: boolean) => Margin;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import { ChartDataDefinition, ConditionalFormattingRule, ShapeDefinition } from "../../../../../shared-logic/src/ChartsV2/types";
3
+ import { BarStyles } from "../../../../../shared-logic/src/BarChartV2/types";
4
+ import { ScaleLinear, ScaleBand } from '@visx/vendor/d3-scale';
5
+ import { DataType } from "../../../../../shared-logic/src/Field/types";
6
+ export declare type BarGroupProps = {
7
+ data: ChartDataDefinition[];
8
+ keys: string[];
9
+ height: number;
10
+ xKey: string;
11
+ xScaleDataType: DataType;
12
+ xScale: ScaleBand<string> | ScaleBand<Date> | ScaleBand<number> | null;
13
+ innerXScale: ScaleBand<string> | undefined;
14
+ yScale: ScaleLinear<number, number, never>;
15
+ onClick: (e: React.MouseEvent<SVGRectElement, MouseEvent>, barGroup: any, bar: any) => void;
16
+ conditionalFormattingRules: ConditionalFormattingRule[];
17
+ bars: ShapeDefinition<BarStyles>[];
18
+ enableHover?: boolean;
19
+ yAxisLabels?: string[];
20
+ yLabelPosition?: number;
21
+ showDetailedSubGroupingLabels: boolean;
22
+ labelStyle?: React.CSSProperties;
23
+ };
24
+ export declare function BarGroup({ data, keys, height, xKey, xScaleDataType, xScale, innerXScale, yScale, onClick, conditionalFormattingRules, bars, enableHover, yAxisLabels, yLabelPosition, showDetailedSubGroupingLabels, labelStyle, }: BarGroupProps): JSX.Element;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { BarStyles } from "../../../../../shared-logic/src/BarChartV2/types";
3
+ import { ConditionalFormattingRule, ShapeDefinition } from "../../../../../shared-logic/src/ChartsV2/types";
4
+ import { ScaleLinear } from '@visx/vendor/d3-scale';
5
+ import { DatumObject } from '@visx/shape/lib/types';
6
+ export declare type BarStackedProps = {
7
+ conditionalFormattingRules: ConditionalFormattingRule[];
8
+ bars: ShapeDefinition<BarStyles>[];
9
+ keys?: string[];
10
+ yScale: ScaleLinear<number, number, never>;
11
+ xScale: any;
12
+ xScaleDataType: string;
13
+ xScaleKey: string;
14
+ data: DatumObject[];
15
+ height: number;
16
+ width: number;
17
+ };
18
+ export declare const BarStacked: ({ xScaleDataType, data, xScaleKey, yScale, keys, bars, conditionalFormattingRules, xScale, height, width }: BarStackedProps) => JSX.Element;