@gravity-ui/charts 1.36.0 → 1.37.1

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.
@@ -6,7 +6,14 @@ export const ChartTooltipContent = React.memo((props) => {
6
6
  if (!hovered) {
7
7
  return null;
8
8
  }
9
- const customTooltip = renderer === null || renderer === void 0 ? void 0 : renderer({ hovered, hoveredPlotLines, hoveredPlotBands, xAxis, yAxis });
9
+ const customTooltip = renderer === null || renderer === void 0 ? void 0 : renderer({
10
+ headerFormat,
11
+ hovered,
12
+ hoveredPlotLines,
13
+ hoveredPlotBands,
14
+ xAxis,
15
+ yAxis,
16
+ });
10
17
  return isNil(customTooltip) ? (React.createElement(DefaultTooltipContent, { hovered: hovered, pinned: pinned, rowRenderer: rowRenderer, totals: totals, valueFormat: valueFormat, headerFormat: headerFormat, xAxis: xAxis, yAxis: yAxis, qa: qa })) : (customTooltip);
11
18
  });
12
19
  ChartTooltipContent.displayName = 'ChartTooltipContent';
@@ -1,12 +1,12 @@
1
1
  .gcharts-tooltip {
2
2
  padding: var(--gcharts-tooltip-content-padding, 8px 0);
3
+ background-color: var(--g-color-infographics-tooltip-bg);
3
4
  box-shadow: 0 2px 12px var(--g-color-sfx-shadow);
4
5
  }
5
6
  .gcharts-tooltip__popup-content {
6
7
  max-width: 450px;
7
8
  text-wrap: nowrap;
8
9
  border-radius: 4px;
9
- background-color: var(--g-color-infographics-tooltip-bg);
10
10
  }
11
11
  .gcharts-tooltip__content {
12
12
  display: flex;
@@ -97,6 +97,8 @@ export interface ChartTooltipRendererArgs<T = MeaningfulAny> {
97
97
  hoveredPlotBands?: AxisPlotBand[];
98
98
  xAxis?: ChartXAxis | null;
99
99
  yAxis?: ChartYAxis;
100
+ /** Formatting settings for tooltip header row (includes computed default). */
101
+ headerFormat?: ValueFormat | CustomFormat;
100
102
  }
101
103
  export interface ChartTooltipTotalsAggregationArgs<T = MeaningfulAny> extends ChartTooltipRendererArgs<T> {
102
104
  }
@@ -6,7 +6,14 @@ export const ChartTooltipContent = React.memo((props) => {
6
6
  if (!hovered) {
7
7
  return null;
8
8
  }
9
- const customTooltip = renderer === null || renderer === void 0 ? void 0 : renderer({ hovered, hoveredPlotLines, hoveredPlotBands, xAxis, yAxis });
9
+ const customTooltip = renderer === null || renderer === void 0 ? void 0 : renderer({
10
+ headerFormat,
11
+ hovered,
12
+ hoveredPlotLines,
13
+ hoveredPlotBands,
14
+ xAxis,
15
+ yAxis,
16
+ });
10
17
  return isNil(customTooltip) ? (React.createElement(DefaultTooltipContent, { hovered: hovered, pinned: pinned, rowRenderer: rowRenderer, totals: totals, valueFormat: valueFormat, headerFormat: headerFormat, xAxis: xAxis, yAxis: yAxis, qa: qa })) : (customTooltip);
11
18
  });
12
19
  ChartTooltipContent.displayName = 'ChartTooltipContent';
@@ -1,12 +1,12 @@
1
1
  .gcharts-tooltip {
2
2
  padding: var(--gcharts-tooltip-content-padding, 8px 0);
3
+ background-color: var(--g-color-infographics-tooltip-bg);
3
4
  box-shadow: 0 2px 12px var(--g-color-sfx-shadow);
4
5
  }
5
6
  .gcharts-tooltip__popup-content {
6
7
  max-width: 450px;
7
8
  text-wrap: nowrap;
8
9
  border-radius: 4px;
9
- background-color: var(--g-color-infographics-tooltip-bg);
10
10
  }
11
11
  .gcharts-tooltip__content {
12
12
  display: flex;
@@ -97,6 +97,8 @@ export interface ChartTooltipRendererArgs<T = MeaningfulAny> {
97
97
  hoveredPlotBands?: AxisPlotBand[];
98
98
  xAxis?: ChartXAxis | null;
99
99
  yAxis?: ChartYAxis;
100
+ /** Formatting settings for tooltip header row (includes computed default). */
101
+ headerFormat?: ValueFormat | CustomFormat;
100
102
  }
101
103
  export interface ChartTooltipTotalsAggregationArgs<T = MeaningfulAny> extends ChartTooltipRendererArgs<T> {
102
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/charts",
3
- "version": "1.36.0",
3
+ "version": "1.37.1",
4
4
  "description": "A flexible JavaScript library for data visualization and chart rendering using React",
5
5
  "license": "MIT",
6
6
  "main": "dist/cjs/index.js",