@gravity-ui/chartkit 5.22.2 → 5.22.4
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.
|
@@ -26,7 +26,9 @@ export class ErrorBoundary extends React.Component {
|
|
|
26
26
|
componentDidUpdate(prevProps) {
|
|
27
27
|
if (prevProps.data !== this.props.data) {
|
|
28
28
|
const { error } = this.state;
|
|
29
|
-
if (error &&
|
|
29
|
+
if (error &&
|
|
30
|
+
'code' in error &&
|
|
31
|
+
[CHARTKIT_ERROR_CODE.NO_DATA, CHARTKIT_ERROR_CODE.INVALID_DATA].includes(String(error.code))) {
|
|
30
32
|
this.resetError();
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -7,6 +7,7 @@ import { usePrevious } from '../../../../hooks';
|
|
|
7
7
|
import { isScreenOrientationEventType } from '../../../../utils';
|
|
8
8
|
import { TooltipContent } from './TooltipContent';
|
|
9
9
|
import { RESIZER_HEIGHT, getVerticalSize, useWithSplitPaneState } from './useWithSplitPaneState';
|
|
10
|
+
const tooltipPaneStyles = { overflow: 'auto' };
|
|
10
11
|
export function withSplitPane(ChartComponent) {
|
|
11
12
|
const componentName = getComponentName(ChartComponent);
|
|
12
13
|
const component = React.forwardRef(function WithSplitPaneComponent(props, _ref) {
|
|
@@ -93,7 +94,7 @@ export function withSplitPane(ChartComponent) {
|
|
|
93
94
|
}, [handleOrientationChange, handleScreenOrientationChange]);
|
|
94
95
|
return (React.createElement("div", { ref: containerRef, style: { position: 'relative', height: '100%' } },
|
|
95
96
|
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 },
|
|
96
|
-
React.createElement(TooltipContent, { ref: tooltipRef, renderer: resultData.tooltip.renderer }))) })));
|
|
97
|
+
React.createElement(TooltipContent, { ref: tooltipRef, renderer: resultData.tooltip.renderer }))), pane2Style: tooltipPaneStyles })));
|
|
97
98
|
});
|
|
98
99
|
component.displayName = `withSplitPane(${componentName})`;
|
|
99
100
|
return component;
|
|
@@ -13,6 +13,7 @@ const CHART_SECTION_PERCENTAGE = 0.6;
|
|
|
13
13
|
const MIN_TOOLTIP_SECTION_HEIGHT = 62;
|
|
14
14
|
const seriesTypesNeedsOnlyHoverState = ['line', 'area', 'arearange', 'bubble', 'map'];
|
|
15
15
|
const deviceWithNavBarHeight = window.innerHeight;
|
|
16
|
+
const tooltipPaneStyles = { overflow: 'auto' };
|
|
16
17
|
function getPointsForInitialRefresh(chart) {
|
|
17
18
|
let minX = Infinity;
|
|
18
19
|
let points = null;
|
|
@@ -202,12 +203,12 @@ export const withSplitPane = (ComposedComponent) => {
|
|
|
202
203
|
renderHorizontal() {
|
|
203
204
|
const { paneSize, maxPaneSize, componentKey } = this.state;
|
|
204
205
|
const thirdOfViewport = window.innerHeight / 3;
|
|
205
|
-
return (React.createElement(StyledSplitPane, { split: "horizontal", onChange: this.debouncedHandlePaneChange, minSize: thirdOfViewport, maxSize: maxPaneSize || undefined, size: paneSize, paneOneRender: () => (React.createElement(ComposedComponent, Object.assign({}, this.props, { key: componentKey, ref: this.props.forwardedRef, callback: this.afterCreateCallback }))), paneTwoRender: () => React.createElement("div", { ref: this.tooltipContainerRef }) }));
|
|
206
|
+
return (React.createElement(StyledSplitPane, { split: "horizontal", onChange: this.debouncedHandlePaneChange, minSize: thirdOfViewport, maxSize: maxPaneSize || undefined, size: paneSize, paneOneRender: () => (React.createElement(ComposedComponent, Object.assign({}, this.props, { key: componentKey, ref: this.props.forwardedRef, callback: this.afterCreateCallback }))), paneTwoRender: () => React.createElement("div", { ref: this.tooltipContainerRef }), pane2Style: tooltipPaneStyles }));
|
|
206
207
|
}
|
|
207
208
|
renderVertical() {
|
|
208
209
|
const { componentKey } = this.state;
|
|
209
210
|
const paneSize = window.innerWidth * CHART_SECTION_PERCENTAGE;
|
|
210
|
-
return (React.createElement(StyledSplitPane, { split: "vertical", allowResize: false, size: paneSize, paneOneRender: () => (React.createElement(ComposedComponent, Object.assign({}, this.props, { key: componentKey, ref: this.props.forwardedRef, callback: this.afterCreateCallback }))), paneTwoRender: () => React.createElement("div", { ref: this.tooltipContainerRef }) }));
|
|
211
|
+
return (React.createElement(StyledSplitPane, { split: "vertical", allowResize: false, size: paneSize, paneOneRender: () => (React.createElement(ComposedComponent, Object.assign({}, this.props, { key: componentKey, ref: this.props.forwardedRef, callback: this.afterCreateCallback }))), paneTwoRender: () => React.createElement("div", { ref: this.tooltipContainerRef }), pane2Style: tooltipPaneStyles }));
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
return React.forwardRef((props, ref) => {
|
package/package.json
CHANGED