@evergis/charts 2.0.117 → 2.0.119

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,2 +1,2 @@
1
1
  import { DrawTooltipProps } from './types';
2
- export declare const drawTooltip: ({ svg, node, data, marshalledData, xScale, yScale, renderTooltip, labelPosition, marginTop, renderLabel, barWidth, barPadding, dynamicTooltipEnable, tooltipY, tooltipBind, lineData, formatTooltipValue, formatTooltipName, tooltipYDomain, setTooltipPosition, onLabelItem, isBarTooltip, bars, tooltipRoot, tooltipClassName, onBarClick, onBarHover, }: DrawTooltipProps) => void;
2
+ export declare const drawTooltip: ({ svg, node, data, marshalledData, xScale, yScale, renderTooltip, labelPosition, marginTop, renderLabel, barWidth, barPadding, dynamicTooltipEnable, hideTooltipGroupName, tooltipY, tooltipBind, lineData, formatTooltipValue, formatTooltipName, tooltipYDomain, setTooltipPosition, onLabelItem, isBarTooltip, bars, tooltipRoot, tooltipClassName, onBarClick, onBarHover, }: DrawTooltipProps) => void;
@@ -10,4 +10,4 @@ export declare type DrawTooltipProps = {
10
10
  marginTop: number;
11
11
  barWidth: number;
12
12
  bars: d3.Selection<SVGGElement, BarChartMarshalledGroup[], SVGGElement, unknown>;
13
- } & Pick<BarChartProps, 'renderTooltip' | 'labelPosition' | 'renderLabel' | 'dynamicTooltipEnable' | 'tooltipY' | 'tooltipBind' | 'lineData' | 'formatTooltipValue' | 'formatTooltipName' | 'tooltipYDomain' | 'data' | 'barPadding' | 'setTooltipPosition' | 'onLabelItem' | 'isBarTooltip' | 'tooltipRoot' | 'tooltipClassName' | 'onBarClick' | 'onBarHover'>;
13
+ } & Pick<BarChartProps, 'renderTooltip' | 'labelPosition' | 'renderLabel' | 'dynamicTooltipEnable' | 'hideTooltipGroupName' | 'tooltipY' | 'tooltipBind' | 'lineData' | 'formatTooltipValue' | 'formatTooltipName' | 'tooltipYDomain' | 'data' | 'barPadding' | 'setTooltipPosition' | 'onLabelItem' | 'isBarTooltip' | 'tooltipRoot' | 'tooltipClassName' | 'onBarClick' | 'onBarHover'>;
@@ -71,6 +71,7 @@ export declare type BarChartProps = {
71
71
  maxDomainValue?: number | undefined;
72
72
  minValuesLine?: number;
73
73
  dynamicTooltipEnable?: boolean;
74
+ hideTooltipGroupName?: boolean;
74
75
  renderTooltip?: (group: BarChartMergedData, position?: {
75
76
  tooltip: d3.Selection<HTMLDivElement, unknown, null, undefined>;
76
77
  left: number;
@@ -86,7 +87,7 @@ export declare type BarChartProps = {
86
87
  stackedLine?: boolean;
87
88
  curve?: d3.CurveFactory;
88
89
  formatTooltipName?: (name: number | string) => number | string | ReactNode;
89
- formatTooltipValue?: (value: number) => number | string | ReactNode;
90
+ formatTooltipValue?: (value: number, name?: string) => number | string | ReactNode;
90
91
  tooltipYDomain?: ((data: {
91
92
  data: BarChartMarshalledGroup[][];
92
93
  lineData?: BarChartLineData[];
@@ -2341,6 +2341,7 @@ const drawTooltip$2 = _ref => {
2341
2341
  barWidth,
2342
2342
  barPadding,
2343
2343
  dynamicTooltipEnable,
2344
+ hideTooltipGroupName,
2344
2345
  tooltipY,
2345
2346
  tooltipBind,
2346
2347
  lineData,
@@ -2511,7 +2512,7 @@ const drawTooltip$2 = _ref => {
2511
2512
  barChartTootipFlex.html(() => {
2512
2513
  const html = ReactDOMServer.renderToString(React__default.createElement(TooltipContainer, {
2513
2514
  className: barChartClassNames.barChartTooltip
2514
- }, currData && currData[0] && React__default.createElement(TooltipGroupName, {
2515
+ }, currData && currData[0] && !hideTooltipGroupName && React__default.createElement(TooltipGroupName, {
2515
2516
  className: barChartClassNames.barChartTooltipGroupName
2516
2517
  }, currData[0].groupName), currData && currData.map(_ref5 => {
2517
2518
  let {
@@ -2541,7 +2542,7 @@ const drawTooltip$2 = _ref => {
2541
2542
  className: barChartClassNames.barChartTooltipName
2542
2543
  }, formatTooltipName ? formatTooltipName(name) : name)), React__default.createElement(Value, {
2543
2544
  className: barChartClassNames.barChartTooltipValue
2544
- }, formatTooltipValue ? formatTooltipValue(value) : format(value)));
2545
+ }, formatTooltipValue ? formatTooltipValue(value, name) : format(value)));
2545
2546
  })));
2546
2547
  return html;
2547
2548
  });
@@ -2683,6 +2684,7 @@ const draw$4 = (node, props) => {
2683
2684
  customBars,
2684
2685
  customize,
2685
2686
  dynamicTooltipEnable,
2687
+ hideTooltipGroupName,
2686
2688
  renderTooltip,
2687
2689
  labelPosition,
2688
2690
  renderLabel,
@@ -2869,6 +2871,7 @@ const draw$4 = (node, props) => {
2869
2871
  barWidth,
2870
2872
  barPadding,
2871
2873
  dynamicTooltipEnable,
2874
+ hideTooltipGroupName,
2872
2875
  tooltipY,
2873
2876
  tooltipBind,
2874
2877
  formatTooltipValue,