@gravity-ui/chartkit 6.1.1 → 7.0.0
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/build/plugins/{d3 → gravity-charts}/index.d.ts +1 -1
- package/build/plugins/{d3 → gravity-charts}/index.js +3 -4
- package/build/plugins/{d3/renderer/D3Widget.d.ts → gravity-charts/renderer/GravityChartsWidget.d.ts} +5 -5
- package/build/plugins/{d3/renderer/D3Widget.js → gravity-charts/renderer/GravityChartsWidget.js} +2 -2
- package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/withSplitPane.js +2 -1
- package/build/plugins/{d3 → gravity-charts}/types.d.ts +1 -1
- package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.js +3 -2
- package/build/types/widget.d.ts +1 -1
- package/package.json +5 -5
- /package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/TooltipContent.d.ts +0 -0
- /package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/TooltipContent.js +0 -0
- /package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/useWithSplitPaneState.d.ts +0 -0
- /package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/useWithSplitPaneState.js +0 -0
- /package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/withSplitPane.d.ts +0 -0
- /package/build/plugins/{d3 → gravity-charts}/types.js +0 -0
|
@@ -6,8 +6,7 @@ export * from './types';
|
|
|
6
6
|
*
|
|
7
7
|
* DO NOT USE IT IN YOUR PRODUCTION
|
|
8
8
|
* */
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
renderer: React.lazy(() => import('./renderer/D3Widget')),
|
|
9
|
+
export const GravityChartsPlugin = {
|
|
10
|
+
type: 'gravity-charts',
|
|
11
|
+
renderer: React.lazy(() => import('./renderer/GravityChartsWidget')),
|
|
13
12
|
};
|
package/build/plugins/{d3/renderer/D3Widget.d.ts → gravity-charts/renderer/GravityChartsWidget.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ChartKitWidgetRef } from '../../../types';
|
|
3
|
-
declare const
|
|
4
|
-
type: "
|
|
3
|
+
export declare const GravityChartsWidget: React.ForwardRefExoticComponent<{
|
|
4
|
+
type: "gravity-charts";
|
|
5
5
|
data: import("@gravity-ui/charts").ChartData<any>;
|
|
6
6
|
id?: string | undefined;
|
|
7
7
|
isMobile?: boolean | undefined;
|
|
8
|
-
onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"
|
|
8
|
+
onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"gravity-charts"> | undefined) => void) | undefined;
|
|
9
9
|
onRender?: ((data: import("../../../types").ChartKitOnRenderData) => void) | undefined;
|
|
10
|
-
onChartLoad?: ((data: import("../../../types").ChartKitOnChartLoad<"
|
|
10
|
+
onChartLoad?: ((data: import("../../../types").ChartKitOnChartLoad<"gravity-charts">) => void) | undefined;
|
|
11
11
|
onError?: import("../../../types").ChartKitOnError | undefined;
|
|
12
12
|
renderError?: import("../../../types").RenderError | undefined;
|
|
13
13
|
renderPluginLoader?: import("../../../types").ChartKitRenderPluginLoader | undefined;
|
|
@@ -16,4 +16,4 @@ declare const D3Widget: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
splitted?: boolean | undefined;
|
|
17
17
|
} | undefined;
|
|
18
18
|
} & React.RefAttributes<ChartKitWidgetRef | undefined>>;
|
|
19
|
-
export default
|
|
19
|
+
export default GravityChartsWidget;
|
package/build/plugins/{d3/renderer/D3Widget.js → gravity-charts/renderer/GravityChartsWidget.js}
RENAMED
|
@@ -5,7 +5,7 @@ import { settings } from '../../../libs';
|
|
|
5
5
|
import { measurePerformance } from '../../../utils';
|
|
6
6
|
import { withSplitPane } from './withSplitPane/withSplitPane';
|
|
7
7
|
const ChartWithSplitPane = withSplitPane(Chart);
|
|
8
|
-
const
|
|
8
|
+
export const GravityChartsWidget = React.forwardRef(function GravityChartsWidget(props, forwardedRef) {
|
|
9
9
|
const { data, tooltip, onLoad, onRender, onChartLoad } = props;
|
|
10
10
|
const lang = settings.get('lang');
|
|
11
11
|
const performanceMeasure = React.useRef(measurePerformance());
|
|
@@ -43,4 +43,4 @@ const D3Widget = React.forwardRef(function D3Widget(props, forwardedRef) {
|
|
|
43
43
|
}, [onChartLoad]);
|
|
44
44
|
return React.createElement(ChartComponent, { ref: chartRef, data: data, lang: lang, onResize: handleResize });
|
|
45
45
|
});
|
|
46
|
-
export default
|
|
46
|
+
export default GravityChartsWidget;
|
|
@@ -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/build/types/widget.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/chartkit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
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",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"types": "build/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./build/index.js",
|
|
11
|
-
"./
|
|
11
|
+
"./gravity-charts": "./build/plugins/gravity-charts/index.js",
|
|
12
12
|
"./highcharts": "./build/plugins/highcharts/index.js",
|
|
13
13
|
"./indicator": "./build/plugins/indicator/index.js",
|
|
14
14
|
"./yagr": "./build/plugins/yagr/index.js"
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"index.d.ts": [
|
|
19
19
|
"./build/index.d.ts"
|
|
20
20
|
],
|
|
21
|
-
"
|
|
22
|
-
"./build/plugins/
|
|
21
|
+
"gravity-charts": [
|
|
22
|
+
"./build/plugins/gravity-charts/index.d.ts"
|
|
23
23
|
],
|
|
24
24
|
"highcharts": [
|
|
25
25
|
"./build/plugins/highcharts/index.d.ts"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@bem-react/classname": "^1.6.0",
|
|
50
|
-
"@gravity-ui/charts": "^0.
|
|
50
|
+
"@gravity-ui/charts": "^1.0.1",
|
|
51
51
|
"@gravity-ui/date-utils": "^2.1.0",
|
|
52
52
|
"@gravity-ui/i18n": "^1.0.0",
|
|
53
53
|
"@gravity-ui/yagr": "^4.7.1",
|
|
File without changes
|
|
File without changes
|
/package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/useWithSplitPaneState.d.ts
RENAMED
|
File without changes
|
/package/build/plugins/{d3 → gravity-charts}/renderer/withSplitPane/useWithSplitPaneState.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|