@gravity-ui/chartkit 5.10.1 → 5.10.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.
@@ -423,7 +423,10 @@ function getTooltip(tooltip, options, comments, holidays) {
423
423
  unsafe: Boolean(options.unsafe),
424
424
  };
425
425
  if (typeof options.manageTooltipConfig === 'function') {
426
- json = callManageTooltipConfig(options, json, chart);
426
+ // manageTooltipConfig could accidently break json variable
427
+ // and because of it we create new object as an argument
428
+ const updatedJSON = callManageTooltipConfig(options, Object.assign({}, json), chart);
429
+ merge(json, updatedJSON);
427
430
  }
428
431
  const usersPointFormat = get(options.highcharts, 'tooltip.pointFormat');
429
432
  if (tooltipOptions.pointFormatter || usersPointFormat) {
@@ -640,7 +643,10 @@ function getTooltip(tooltip, options, comments, holidays) {
640
643
  delete json.pre_lines;
641
644
  if (json.lines && json.lines.length > 0) {
642
645
  if (typeof options.manageTooltipConfig === 'function') {
643
- json = callManageTooltipConfig(options, json, chart);
646
+ // manageTooltipConfig could accidently break json variable
647
+ // and because of it we create new object as an argument
648
+ const updatedJSON = callManageTooltipConfig(options, Object.assign({}, json), chart);
649
+ merge(json, updatedJSON);
644
650
  }
645
651
  let hiddenRowsSum = 0;
646
652
  let maxChartKitPrecision = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "5.10.1",
3
+ "version": "5.10.2",
4
4
  "description": "React component used to render charts based on any sources you need",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:gravity-ui/ChartKit.git",