@gravity-ui/chartkit 7.5.0 → 7.5.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.
@@ -46,4 +46,5 @@
46
46
 
47
47
  .styled-split-pane .Pane {
48
48
  height: 100%;
49
+ background: var(--ck-split-pane-background);
49
50
  }
@@ -1,6 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import { getComponentName, useResizeObserver } from '@gravity-ui/uikit';
4
+ import isEmpty from 'lodash/isEmpty';
4
5
  import { SplitLayout, StyledSplitPane, mapScreenOrientationTypeToSplitLayout, } from '../../../../components/SplitPane';
5
6
  import { IS_SCREEN_ORIENTATION_AVAILABLE, IS_WINDOW_AVAILABLE } from '../../../../constants';
6
7
  import { usePrevious } from '../../../../hooks';
@@ -14,6 +15,7 @@ const SplitPaneContent = (props) => {
14
15
  const tooltipContainerRef = React.useRef(null);
15
16
  const chartRef = React.useRef(null);
16
17
  const tooltipRef = React.useRef(null);
18
+ const shouldShowTooltip = React.useRef(false);
17
19
  const { allowResize, minSize, maxSize, tooltipHeight, split, size, setTooltipHeight, setSplit, setSize, } = useWithSplitPaneState({
18
20
  containerHeight: height,
19
21
  });
@@ -47,6 +49,7 @@ const SplitPaneContent = (props) => {
47
49
  const userPointerMoveHandler = (_b = (_a = data.chart) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b.pointermove;
48
50
  const pointerMoveHandler = (pointerMoveData, event) => {
49
51
  var _a;
52
+ shouldShowTooltip.current = !isEmpty(pointerMoveData === null || pointerMoveData === void 0 ? void 0 : pointerMoveData.hovered);
50
53
  (_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.redraw(pointerMoveData);
51
54
  userPointerMoveHandler === null || userPointerMoveHandler === void 0 ? void 0 : userPointerMoveHandler(pointerMoveData, event);
52
55
  };
@@ -88,7 +91,7 @@ const SplitPaneContent = (props) => {
88
91
  }
89
92
  };
90
93
  }, [handleOrientationChange, handleScreenOrientationChange]);
91
- return (React.createElement(StyledSplitPane, { allowResize: allowResize, maxSize: maxSize, minSize: minSize, size: size, split: split, onChange: handleSizeChange, paneOneRender: () => React.createElement(ChartComponent, Object.assign({}, restProps, { ref: chartRef, data: resultData })), paneTwoRender: () => (React.createElement("div", { ref: tooltipContainerRef },
94
+ return (React.createElement(StyledSplitPane, { allowResize: allowResize, maxSize: maxSize, minSize: minSize, size: size, split: split, onChange: handleSizeChange, resizerStyle: shouldShowTooltip.current ? undefined : { display: 'none' }, paneOneRender: () => React.createElement(ChartComponent, Object.assign({}, restProps, { ref: chartRef, data: resultData })), paneTwoRender: () => (React.createElement("div", { ref: tooltipContainerRef },
92
95
  React.createElement(TooltipContent, { ref: tooltipRef, renderer: resultData.tooltip.renderer }))), pane2Style: tooltipPaneStyles }));
93
96
  };
94
97
  export function withSplitPane(ChartComponent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "7.5.0",
3
+ "version": "7.5.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",
@@ -47,7 +47,7 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@bem-react/classname": "^1.6.0",
50
- "@gravity-ui/charts": "^1.5.0",
50
+ "@gravity-ui/charts": "^1.5.1",
51
51
  "@gravity-ui/date-utils": "^2.1.0",
52
52
  "@gravity-ui/i18n": "^1.0.0",
53
53
  "@gravity-ui/yagr": "^4.8.5",