@evergis/charts 2.0.54 → 2.0.57

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Kirill Protasov
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Kirill Protasov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # @evergis/charts
2
-
3
- ## Важно
4
-
5
- - Стилизовать графики необходимо импортируя названия классов из библиотеки.
6
-
7
- `import { calendarChartClassNames } from "@evergis/charts"`
8
-
9
- ## Документация зависимостей
10
-
11
- - [d3](https://github.com/d3/d3/blob/master/API.md)
12
- - [styled-components](https://styled-components.com/docs)
13
- - [storybook](https://storybook.js.org/docs/react/writing-docs/docs-page)
1
+ # @evergis/charts
2
+
3
+ ## Важно
4
+
5
+ - Стилизовать графики необходимо импортируя названия классов из библиотеки.
6
+
7
+ `import { calendarChartClassNames } from "@evergis/charts"`
8
+
9
+ ## Документация зависимостей
10
+
11
+ - [d3](https://github.com/d3/d3/blob/master/API.md)
12
+ - [styled-components](https://styled-components.com/docs)
13
+ - [storybook](https://storybook.js.org/docs/react/writing-docs/docs-page)
@@ -1,5 +1,5 @@
1
1
  import * as d3 from 'd3';
2
- import { BarChartLinetData } from '../types';
2
+ import { BarChartLineData } from '../types';
3
3
  import { DrawLinesProps } from './types';
4
4
  export declare const barChartLinesClassNames: {
5
5
  barChartLinesGlobal: string;
@@ -8,7 +8,7 @@ export declare const barChartLinesClassNames: {
8
8
  barChartArea: string;
9
9
  };
10
10
  export declare const drawLines: ({ svg, lineData, min, yScale, xScale, curve, stackedLine, }: DrawLinesProps) => {
11
- areasSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLinetData, SVGGElement, unknown> | null;
12
- linesSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLinetData, SVGGElement, unknown> | null;
11
+ areasSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLineData, SVGGElement, unknown> | null;
12
+ linesSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLineData, SVGGElement, unknown> | null;
13
13
  area: d3.Area<[number, number]> | null;
14
14
  };
@@ -1,9 +1,9 @@
1
1
  import * as d3 from 'd3';
2
- import { BarChartProps, BarChartLinetData } from '../types';
2
+ import { BarChartProps, BarChartLineData } from '../types';
3
3
  export declare type DrawLinesProps = {
4
4
  min: number;
5
5
  svg: d3.Selection<SVGSVGElement, unknown, null, undefined>;
6
6
  yScale: d3.ScaleLinear<number, number>;
7
7
  xScale: d3.ScaleBand<string>;
8
- lineData: BarChartLinetData[];
8
+ lineData: BarChartLineData[];
9
9
  } & Pick<BarChartProps, 'stackedLine' | 'curve'>;
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import { FC } from 'react';
2
2
  import { BarChartProps } from './types';
3
- export declare const BarChart: React.FC<BarChartProps>;
3
+ export declare const BarChart: FC<BarChartProps>;
@@ -20,11 +20,18 @@ export declare type BarChartLabelSetTooltipPosition = (position: {
20
20
  top: number;
21
21
  svgWidth: number;
22
22
  }) => void;
23
+ export interface BarChartMarker {
24
+ label: string;
25
+ value: number;
26
+ color?: string;
27
+ className?: string;
28
+ }
23
29
  export declare type BarChartProps = {
24
30
  className?: string;
25
31
  style?: CSSProperties;
26
32
  data: BarChartData[];
27
- lineData?: BarChartLinetData[];
33
+ markers?: BarChartMarker[];
34
+ lineData?: BarChartLineData[];
28
35
  colors: BarChartColors;
29
36
  margin?: Margin;
30
37
  barWidth?: number;
@@ -50,11 +57,11 @@ export declare type BarChartProps = {
50
57
  bars: d3.Selection<Element | d3.EnterElement | Document | Window | SVGRectElement | null, BarChartMarshalledGroup, SVGGElement, BarChartMarshalledGroup[]> | d3.Transition<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartMarshalledGroup, SVGGElement, BarChartMarshalledGroup[]>;
51
58
  yScale: (value: number) => number;
52
59
  lines: null | {
53
- linesSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLinetData, SVGGElement, unknown> | null;
54
- areasSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLinetData, SVGGElement, unknown> | null;
60
+ linesSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLineData, SVGGElement, unknown> | null;
61
+ areasSelection: d3.Selection<Element | d3.EnterElement | Document | Window | SVGPathElement | null, BarChartLineData, SVGGElement, unknown> | null;
55
62
  area: d3.Area<[number, number]> | null;
56
63
  };
57
- lineData?: BarChartLinetData[];
64
+ lineData?: BarChartLineData[];
58
65
  marshalledData: BarChartMarshalledGroup[][];
59
66
  }) => void;
60
67
  minValue?: number;
@@ -81,7 +88,7 @@ export declare type BarChartProps = {
81
88
  formatTooltipValue?: (value: number) => number | string | ReactNode;
82
89
  tooltipYDomain?: ((data: {
83
90
  data: BarChartMarshalledGroup[][];
84
- lineData?: BarChartLinetData[];
91
+ lineData?: BarChartLineData[];
85
92
  yScale: (value: number) => number;
86
93
  }) => number[]) | null;
87
94
  marshalledMap?: (data: BarChartMarshalledGroup[][]) => BarChartMarshalledGroup[][];
@@ -96,7 +103,7 @@ export declare type BarChartProps = {
96
103
  marshalledData: BarChartMarshalledGroup[][];
97
104
  yScale: (value: number) => number;
98
105
  xScale: d3.ScaleBand<string>;
99
- lineData?: BarChartLinetData[];
106
+ lineData?: BarChartLineData[];
100
107
  }) => void;
101
108
  onLabelItem?: (data: BarChartMarshalledGroup[]) => BarChartMarshalledGroup[];
102
109
  isBarTooltip?: boolean;
@@ -104,7 +111,7 @@ export declare type BarChartProps = {
104
111
  tooltipRoot?: Element;
105
112
  tooltipClassName?: string;
106
113
  };
107
- export declare type BarChartMergedData = (BarChartMarshalledGroup & BarChartLinetData & {
114
+ export declare type BarChartMergedData = (BarChartMarshalledGroup & BarChartLineData & {
108
115
  groupName: string;
109
116
  })[];
110
117
  export declare type BarChartMarshaling = {
@@ -123,7 +130,7 @@ export declare type BarChartMarshalledGroup = {
123
130
  stackIndex: number;
124
131
  groupIndex: number;
125
132
  };
126
- export declare type BarChartLinetData = {
133
+ export declare type BarChartLineData = {
127
134
  lineType: 'line' | 'area';
128
135
  name: string;
129
136
  values: (number | null)[];