@gravity-ui/charts 1.41.0 → 1.41.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.
- package/dist/cjs/components/AxisX/AxisX.js +2 -1
- package/dist/cjs/components/AxisY/AxisY.js +2 -1
- package/dist/cjs/components/ChartInner/index.js +2 -2
- package/dist/cjs/components/ChartInner/useChartInnerHandlers.d.ts +1 -1
- package/dist/cjs/components/ChartInner/useChartInnerHandlers.js +1 -1
- package/dist/cjs/components/ChartInner/useChartInnerProps.d.ts +1 -1
- package/dist/cjs/components/ChartInner/useChartInnerState.d.ts +1 -1
- package/dist/cjs/components/ChartInner/useDefaultState.d.ts +1 -1
- package/dist/cjs/components/ChartInner/useDefaultState.js +4 -1
- package/dist/cjs/components/Legend/index.js +3 -1
- package/dist/cjs/components/RangeSlider/utils.js +1 -1
- package/dist/cjs/components/Tooltip/index.d.ts +1 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/utils/index.js +1 -1
- package/dist/cjs/hooks/useAxis/x-axis.js +5 -2
- package/dist/cjs/hooks/useAxisScales/types.d.ts +1 -1
- package/dist/cjs/hooks/useAxisScales/x-scale.js +2 -1
- package/dist/cjs/hooks/useAxisScales/y-scale.js +2 -1
- package/dist/cjs/hooks/useBrush/index.js +2 -1
- package/dist/cjs/hooks/useBrush/types.d.ts +1 -1
- package/dist/cjs/hooks/useBrush/utils.d.ts +1 -1
- package/dist/cjs/hooks/useBrush/utils.js +2 -1
- package/dist/cjs/hooks/useCrosshair/index.d.ts +1 -1
- package/dist/cjs/hooks/useCrosshair/index.js +2 -1
- package/dist/cjs/hooks/useCrosshair/useCrosshairHover.d.ts +1 -1
- package/dist/cjs/hooks/useRangeSlider/index.js +6 -3
- package/dist/cjs/hooks/useRangeSlider/types.d.ts +1 -0
- package/dist/cjs/hooks/useSeries/index.js +2 -1
- package/dist/cjs/hooks/useSeries/prepare-area.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-bar-x.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-bar-y.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-funnel.js +1 -1
- package/dist/cjs/hooks/useSeries/prepare-heatmap.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-line.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-pie.js +1 -1
- package/dist/cjs/hooks/useSeries/prepare-radar.js +1 -1
- package/dist/cjs/hooks/useSeries/prepare-sankey.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-scatter.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-treemap.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepare-waterfall.d.ts +1 -1
- package/dist/cjs/hooks/useSeries/prepareSeries.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/area/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/area/index.js +3 -1
- package/dist/cjs/hooks/useShapes/area/prepare-data.d.ts +0 -1
- package/dist/cjs/hooks/useShapes/area/prepare-data.js +61 -31
- package/dist/cjs/hooks/useShapes/bar-x/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/bar-x/index.js +2 -1
- package/dist/cjs/hooks/useShapes/bar-x/prepare-data.js +1 -1
- package/dist/cjs/hooks/useShapes/bar-y/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/bar-y/index.js +2 -1
- package/dist/cjs/hooks/useShapes/bar-y/prepare-data.js +1 -1
- package/dist/cjs/hooks/useShapes/funnel/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/funnel/index.js +2 -1
- package/dist/cjs/hooks/useShapes/funnel/prepare-data.js +1 -1
- package/dist/cjs/hooks/useShapes/funnel/types.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/heatmap/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/heatmap/index.js +2 -1
- package/dist/cjs/hooks/useShapes/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/index.js +1 -2
- package/dist/cjs/hooks/useShapes/line/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/line/index.js +3 -1
- package/dist/cjs/hooks/useShapes/marker.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/marker.js +1 -1
- package/dist/cjs/hooks/useShapes/pie/index.d.ts +2 -1
- package/dist/cjs/hooks/useShapes/pie/index.js +3 -1
- package/dist/cjs/hooks/useShapes/pie/prepare-data.js +2 -1
- package/dist/cjs/hooks/useShapes/pie/types.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/pie/utils.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/pie/utils.js +1 -1
- package/dist/cjs/hooks/useShapes/radar/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/radar/index.js +3 -1
- package/dist/cjs/hooks/useShapes/radar/prepare-data.js +3 -1
- package/dist/cjs/hooks/useShapes/sankey/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/sankey/index.js +1 -1
- package/dist/cjs/hooks/useShapes/scatter/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/scatter/index.js +1 -1
- package/dist/cjs/hooks/useShapes/treemap/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/treemap/index.js +2 -1
- package/dist/cjs/hooks/useShapes/treemap/prepare-data.js +2 -1
- package/dist/cjs/hooks/useShapes/treemap/types.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/utils.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/utils.js +2 -1
- package/dist/cjs/hooks/useShapes/waterfall/index.d.ts +1 -1
- package/dist/cjs/hooks/useShapes/waterfall/index.js +3 -1
- package/dist/cjs/hooks/useTooltip/index.d.ts +1 -1
- package/dist/cjs/hooks/useZoom/index.js +1 -1
- package/dist/cjs/hooks/useZoom/utils.d.ts +1 -1
- package/dist/cjs/hooks/utils/bar-y.js +1 -1
- package/dist/cjs/hooks/utils/get-band-size.d.ts +1 -1
- package/dist/cjs/types/chart/pie.d.ts +1 -1
- package/dist/cjs/utils/chart/axis/common.d.ts +2 -1
- package/dist/cjs/utils/chart/axis/common.js +1 -1
- package/dist/cjs/utils/chart/axis-generators/bottom.d.ts +2 -1
- package/dist/cjs/utils/chart/axis-generators/bottom.js +2 -1
- package/dist/cjs/utils/chart/color.js +2 -1
- package/dist/cjs/utils/chart/common.js +2 -1
- package/dist/cjs/utils/chart/format.d.ts +1 -1
- package/dist/cjs/utils/chart/get-closest-data.js +2 -1
- package/dist/cjs/utils/chart/legend.d.ts +1 -1
- package/dist/cjs/utils/chart/series/sorting.js +1 -1
- package/dist/cjs/utils/chart/symbol.js +1 -1
- package/dist/cjs/utils/chart/text.d.ts +1 -1
- package/dist/cjs/utils/chart/ticks/datetime.js +2 -1
- package/dist/cjs/utils/chart/ticks/index.d.ts +1 -1
- package/dist/cjs/utils/dispatcher.js +1 -1
- package/dist/esm/components/AxisX/AxisX.js +2 -1
- package/dist/esm/components/AxisY/AxisY.js +2 -1
- package/dist/esm/components/ChartInner/index.js +2 -2
- package/dist/esm/components/ChartInner/useChartInnerHandlers.d.ts +1 -1
- package/dist/esm/components/ChartInner/useChartInnerHandlers.js +1 -1
- package/dist/esm/components/ChartInner/useChartInnerProps.d.ts +1 -1
- package/dist/esm/components/ChartInner/useChartInnerState.d.ts +1 -1
- package/dist/esm/components/ChartInner/useDefaultState.d.ts +1 -1
- package/dist/esm/components/ChartInner/useDefaultState.js +4 -1
- package/dist/esm/components/Legend/index.js +3 -1
- package/dist/esm/components/RangeSlider/utils.js +1 -1
- package/dist/esm/components/Tooltip/index.d.ts +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/utils/index.js +1 -1
- package/dist/esm/hooks/useAxis/x-axis.js +5 -2
- package/dist/esm/hooks/useAxisScales/types.d.ts +1 -1
- package/dist/esm/hooks/useAxisScales/x-scale.js +2 -1
- package/dist/esm/hooks/useAxisScales/y-scale.js +2 -1
- package/dist/esm/hooks/useBrush/index.js +2 -1
- package/dist/esm/hooks/useBrush/types.d.ts +1 -1
- package/dist/esm/hooks/useBrush/utils.d.ts +1 -1
- package/dist/esm/hooks/useBrush/utils.js +2 -1
- package/dist/esm/hooks/useCrosshair/index.d.ts +1 -1
- package/dist/esm/hooks/useCrosshair/index.js +2 -1
- package/dist/esm/hooks/useCrosshair/useCrosshairHover.d.ts +1 -1
- package/dist/esm/hooks/useRangeSlider/index.js +6 -3
- package/dist/esm/hooks/useRangeSlider/types.d.ts +1 -0
- package/dist/esm/hooks/useSeries/index.js +2 -1
- package/dist/esm/hooks/useSeries/prepare-area.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-bar-x.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-bar-y.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-funnel.js +1 -1
- package/dist/esm/hooks/useSeries/prepare-heatmap.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-line.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-pie.js +1 -1
- package/dist/esm/hooks/useSeries/prepare-radar.js +1 -1
- package/dist/esm/hooks/useSeries/prepare-sankey.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-scatter.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-treemap.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepare-waterfall.d.ts +1 -1
- package/dist/esm/hooks/useSeries/prepareSeries.d.ts +1 -1
- package/dist/esm/hooks/useShapes/area/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/area/index.js +3 -1
- package/dist/esm/hooks/useShapes/area/prepare-data.d.ts +0 -1
- package/dist/esm/hooks/useShapes/area/prepare-data.js +61 -31
- package/dist/esm/hooks/useShapes/bar-x/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/bar-x/index.js +2 -1
- package/dist/esm/hooks/useShapes/bar-x/prepare-data.js +1 -1
- package/dist/esm/hooks/useShapes/bar-y/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/bar-y/index.js +2 -1
- package/dist/esm/hooks/useShapes/bar-y/prepare-data.js +1 -1
- package/dist/esm/hooks/useShapes/funnel/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/funnel/index.js +2 -1
- package/dist/esm/hooks/useShapes/funnel/prepare-data.js +1 -1
- package/dist/esm/hooks/useShapes/funnel/types.d.ts +1 -1
- package/dist/esm/hooks/useShapes/heatmap/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/heatmap/index.js +2 -1
- package/dist/esm/hooks/useShapes/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/index.js +1 -2
- package/dist/esm/hooks/useShapes/line/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/line/index.js +3 -1
- package/dist/esm/hooks/useShapes/marker.d.ts +1 -1
- package/dist/esm/hooks/useShapes/marker.js +1 -1
- package/dist/esm/hooks/useShapes/pie/index.d.ts +2 -1
- package/dist/esm/hooks/useShapes/pie/index.js +3 -1
- package/dist/esm/hooks/useShapes/pie/prepare-data.js +2 -1
- package/dist/esm/hooks/useShapes/pie/types.d.ts +1 -1
- package/dist/esm/hooks/useShapes/pie/utils.d.ts +1 -1
- package/dist/esm/hooks/useShapes/pie/utils.js +1 -1
- package/dist/esm/hooks/useShapes/radar/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/radar/index.js +3 -1
- package/dist/esm/hooks/useShapes/radar/prepare-data.js +3 -1
- package/dist/esm/hooks/useShapes/sankey/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/sankey/index.js +1 -1
- package/dist/esm/hooks/useShapes/scatter/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/scatter/index.js +1 -1
- package/dist/esm/hooks/useShapes/treemap/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/treemap/index.js +2 -1
- package/dist/esm/hooks/useShapes/treemap/prepare-data.js +2 -1
- package/dist/esm/hooks/useShapes/treemap/types.d.ts +1 -1
- package/dist/esm/hooks/useShapes/utils.d.ts +1 -1
- package/dist/esm/hooks/useShapes/utils.js +2 -1
- package/dist/esm/hooks/useShapes/waterfall/index.d.ts +1 -1
- package/dist/esm/hooks/useShapes/waterfall/index.js +3 -1
- package/dist/esm/hooks/useTooltip/index.d.ts +1 -1
- package/dist/esm/hooks/useZoom/index.js +1 -1
- package/dist/esm/hooks/useZoom/utils.d.ts +1 -1
- package/dist/esm/hooks/utils/bar-y.js +1 -1
- package/dist/esm/hooks/utils/get-band-size.d.ts +1 -1
- package/dist/esm/types/chart/pie.d.ts +1 -1
- package/dist/esm/utils/chart/axis/common.d.ts +2 -1
- package/dist/esm/utils/chart/axis/common.js +1 -1
- package/dist/esm/utils/chart/axis-generators/bottom.d.ts +2 -1
- package/dist/esm/utils/chart/axis-generators/bottom.js +2 -1
- package/dist/esm/utils/chart/color.js +2 -1
- package/dist/esm/utils/chart/common.js +2 -1
- package/dist/esm/utils/chart/format.d.ts +1 -1
- package/dist/esm/utils/chart/get-closest-data.js +2 -1
- package/dist/esm/utils/chart/legend.d.ts +1 -1
- package/dist/esm/utils/chart/series/sorting.js +1 -1
- package/dist/esm/utils/chart/symbol.js +1 -1
- package/dist/esm/utils/chart/text.d.ts +1 -1
- package/dist/esm/utils/chart/ticks/datetime.js +2 -1
- package/dist/esm/utils/chart/ticks/index.d.ts +1 -1
- package/dist/esm/utils/dispatcher.js +1 -1
- package/package.json +14 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { color
|
|
2
|
+
import { color } from 'd3-color';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
3
4
|
import { block, getLineDashArray } from '../../../utils';
|
|
4
5
|
export { prepareFunnelData } from './prepare-data';
|
|
5
6
|
export * from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
3
|
import type { PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
4
|
import type { PreparedHeatmapData } from './types';
|
|
5
5
|
export { prepareHeatmapData } from './prepare-data';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { color
|
|
2
|
+
import { color } from 'd3-color';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
3
4
|
import { block } from '../../../utils';
|
|
4
5
|
import { HtmlLayer } from '../HtmlLayer';
|
|
5
6
|
export { prepareHeatmapData } from './prepare-data';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
3
|
import type { SeriesType } from '../../constants';
|
|
4
4
|
import type { PreparedXAxis, PreparedYAxis } from '../useAxis/types';
|
|
5
5
|
import type { ChartScale } from '../useAxisScales/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { group } from 'd3';
|
|
2
|
+
import { group } from 'd3-array';
|
|
3
3
|
import { SERIES_TYPE } from '../../constants';
|
|
4
4
|
import { ChartError } from '../../libs';
|
|
5
5
|
import { getOnlyVisibleSeries } from '../../utils';
|
|
@@ -119,7 +119,6 @@ export async function getShapes(args) {
|
|
|
119
119
|
xScale,
|
|
120
120
|
yAxis,
|
|
121
121
|
yScale,
|
|
122
|
-
boundsHeight,
|
|
123
122
|
split,
|
|
124
123
|
isOutsideBounds,
|
|
125
124
|
isRangeSlider,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { color
|
|
2
|
+
import { color } from 'd3-color';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
4
|
+
import { line as lineGenerator } from 'd3-shape';
|
|
3
5
|
import get from 'lodash/get';
|
|
4
6
|
import { block, filterOverlappingLabels, getLineDashArray } from '../../../utils';
|
|
5
7
|
import { HtmlLayer } from '../HtmlLayer';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseType, Selection } from 'd3';
|
|
1
|
+
import type { BaseType, Selection } from 'd3-selection';
|
|
2
2
|
import { SymbolType } from '../../constants';
|
|
3
3
|
import type { MarkerData as AreaMarkerData } from './area/types';
|
|
4
4
|
import type { MarkerData as LineMarkerData } from './line/types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
+
import type { PieArcDatum } from 'd3-shape';
|
|
3
4
|
import type { PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
5
|
import type { PreparedPieData, SegmentData } from './types';
|
|
5
6
|
type PreparePieSeriesArgs = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { color } from 'd3-color';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
4
|
+
import { arc } from 'd3-shape';
|
|
3
5
|
import get from 'lodash/get';
|
|
4
6
|
import { block, setEllipsisForOverflowTexts } from '../../../utils';
|
|
5
7
|
import { HtmlLayer } from '../HtmlLayer';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { group, max } from 'd3-array';
|
|
2
|
+
import { arc, line as lineGenerator } from 'd3-shape';
|
|
2
3
|
import merge from 'lodash/merge';
|
|
3
4
|
import { DEFAULT_DATALABELS_STYLE } from '../../../constants';
|
|
4
5
|
import { calculateNumericProperty, getLabelsSize, getLeftPosition, getTextSizeFn, isLabelsOverlapping, } from '../../../utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CurveFactory } from 'd3';
|
|
1
|
+
import type { CurveFactory } from 'd3-shape';
|
|
2
2
|
import type { PointPosition } from '../../../types';
|
|
3
3
|
import type { PreparedPieData, SegmentData } from './types';
|
|
4
4
|
export declare const pieGenerator: import("d3-shape").Pie<any, SegmentData>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { color
|
|
2
|
+
import { color } from 'd3-color';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
4
|
+
import { line } from 'd3-shape';
|
|
3
5
|
import get from 'lodash/get';
|
|
4
6
|
import { block } from '../../../utils';
|
|
5
7
|
import { HtmlLayer } from '../HtmlLayer';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { range } from 'd3-array';
|
|
2
|
+
import { scaleLinear } from 'd3-scale';
|
|
3
|
+
import { curveLinearClosed, line } from 'd3-shape';
|
|
2
4
|
import { getLabelsSize } from '../../../utils';
|
|
3
5
|
import { getFormattedValue } from '../../../utils/chart/format';
|
|
4
6
|
export async function prepareRadarData(args) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
3
|
import type { PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
4
|
import type { PreparedScatterData } from './types';
|
|
5
5
|
export { prepareScatterData } from './prepare-data';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ascending, descending, sort
|
|
1
|
+
import { ascending, descending, sort } from 'd3-array';
|
|
2
|
+
import { stratify, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, } from 'd3-hierarchy';
|
|
2
3
|
import { LayoutAlgorithm } from '../../../constants';
|
|
3
4
|
import { getLabelsSize, getTextSizeFn, getTextWithElipsis } from '../../../utils';
|
|
4
5
|
import { getFormattedValue } from '../../../utils/chart/format';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HierarchyRectangularNode } from 'd3';
|
|
1
|
+
import type { HierarchyRectangularNode } from 'd3-hierarchy';
|
|
2
2
|
import type { HtmlItem, TreemapSeriesData } from '../../../types';
|
|
3
3
|
import type { PreparedTreemapSeries } from '../../useSeries/types';
|
|
4
4
|
export type TreemapLabelData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseType } from 'd3';
|
|
1
|
+
import type { BaseType } from 'd3-selection';
|
|
2
2
|
import type { BasicInactiveState } from '../../types';
|
|
3
3
|
import type { PreparedXAxis, PreparedYAxis } from '../useAxis/types';
|
|
4
4
|
import type { ChartScale } from '../useAxisScales/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
3
|
import type { PreparedSeriesOptions } from '../../useSeries/types';
|
|
4
4
|
import type { PreparedWaterfallData } from './types';
|
|
5
5
|
export { prepareWaterfallData } from './prepare-data';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { color
|
|
2
|
+
import { color } from 'd3-color';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
4
|
+
import { line as lineGenerator } from 'd3-shape';
|
|
3
5
|
import get from 'lodash/get';
|
|
4
6
|
import { DASH_STYLE } from '../../../constants';
|
|
5
7
|
import { block, filterOverlappingLabels, getLineDashArray, getWaterfallPointColor, } from '../../../utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Dispatch } from 'd3';
|
|
1
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
2
2
|
import type { AxisPlotBand, AxisPlotLine, PointPosition, TooltipDataChunk } from '../../types';
|
|
3
3
|
import type { PreparedTooltip } from '../types';
|
|
4
4
|
import type { PreparedXAxis, PreparedYAxis } from '../useAxis/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BrushSelection } from 'd3';
|
|
1
|
+
import type { BrushSelection } from 'd3-brush';
|
|
2
2
|
import type { ZoomType } from '../../constants';
|
|
3
3
|
import type { PreparedXAxis, PreparedYAxis } from '../useAxis/types';
|
|
4
4
|
import type { ChartScale } from '../useAxisScales/types';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AxisDomain, AxisScale
|
|
1
|
+
import type { AxisDomain, AxisScale } from 'd3-axis';
|
|
2
|
+
import type { ScaleBand, ScaleTime } from 'd3-scale';
|
|
2
3
|
import type { ChartScale, PreparedAxis, PreparedAxisPlotBand, PreparedSplit } from '../../../hooks';
|
|
3
4
|
import type { ChartAxis } from '../../../types';
|
|
4
5
|
import type { AxisDirection } from '../types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ascending, descending, reverse, sort } from 'd3';
|
|
1
|
+
import { ascending, descending, reverse, sort } from 'd3-array';
|
|
2
2
|
import clamp from 'lodash/clamp';
|
|
3
3
|
import { getScaleTicks } from '../ticks';
|
|
4
4
|
export function getTicksCountByPixelInterval({ axis, axisWidth, }) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AxisDomain, AxisScale
|
|
1
|
+
import type { AxisDomain, AxisScale } from 'd3-axis';
|
|
2
|
+
import type { Selection } from 'd3-selection';
|
|
2
3
|
import type { BaseTextStyle, MeaningfulAny } from '../../../types';
|
|
3
4
|
interface AxisBottomArgs {
|
|
4
5
|
domain: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { path
|
|
1
|
+
import { path } from 'd3-path';
|
|
2
|
+
import { select } from 'd3-selection';
|
|
2
3
|
import { getAxisItems, getXAxisOffset, getXTickPosition } from '../axis/common';
|
|
3
4
|
import { calculateCos, calculateSin } from '../math';
|
|
4
5
|
import { getLabelsSize, setEllipsisForOverflowText } from '../text';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { symbolCircle, symbolDiamond2, symbolSquare, symbolTriangle2 } from 'd3';
|
|
1
|
+
import { symbolCircle, symbolDiamond2, symbolSquare, symbolTriangle2 } from 'd3-shape';
|
|
2
2
|
import { SymbolType } from '../../constants';
|
|
3
3
|
export const getSymbolType = (index) => {
|
|
4
4
|
const scatterStyles = Object.values(SymbolType);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Selection } from 'd3';
|
|
1
|
+
import type { Selection } from 'd3-selection';
|
|
2
2
|
import type { BaseTextStyle, MeaningfulAny } from '../../types';
|
|
3
3
|
export declare function handleOverflowingText(tSpan: SVGTSpanElement | null, maxWidth: number, textWidth?: number): void;
|
|
4
4
|
export declare function setEllipsisForOverflowText<T>(selection: Selection<SVGTextElement, T, null, unknown>, maxWidth: number, textWidth?: number): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { bisector, tickStep
|
|
1
|
+
import { bisector, tickStep } from 'd3-array';
|
|
2
|
+
import { utcDay, utcHour, utcMillisecond, utcMinute, utcMonth, utcSecond, utcMonday as utcWeek, utcYear, } from 'd3-time';
|
|
2
3
|
import { DAY, HOUR, MINUTE, MONTH, SECOND, WEEK, YEAR } from '../../../constants';
|
|
3
4
|
const tickIntervals = [
|
|
4
5
|
[utcSecond, 1, SECOND],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { select } from 'd3-selection';
|
|
3
|
+
import { line } from 'd3-shape';
|
|
3
4
|
import { HtmlLayer } from '../../hooks/useShapes/HtmlLayer';
|
|
4
5
|
import { block, getLineDashArray } from '../../utils';
|
|
5
6
|
import './styles.css';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { select } from 'd3-selection';
|
|
3
|
+
import { line } from 'd3-shape';
|
|
3
4
|
import { HtmlLayer } from '../../hooks/useShapes/HtmlLayer';
|
|
4
5
|
import { block, getLineDashArray } from '../../utils';
|
|
5
6
|
import './styles.css';
|
|
@@ -61,7 +61,7 @@ export const ChartInner = (props) => {
|
|
|
61
61
|
preparedRangeSlider,
|
|
62
62
|
tooltip: preparedTooltip,
|
|
63
63
|
});
|
|
64
|
-
const { allPreparedSeries, boundsHeight, boundsOffsetLeft, boundsOffsetTop, boundsWidth, handleLegendItemClick, legendConfig, legendItems, preparedLegend, preparedSeries, preparedSeriesOptions, preparedSplit, shapes, shapesData, shapesReady, xAxis, xScale, yAxis, yScale, } = useChartInnerProps(Object.assign(Object.assign({}, props), { clipPathId,
|
|
64
|
+
const { activeLegendItems, allPreparedSeries, boundsHeight, boundsOffsetLeft, boundsOffsetTop, boundsWidth, handleLegendItemClick, legendConfig, legendItems, preparedLegend, preparedSeries, preparedSeriesOptions, preparedSplit, shapes, shapesData, shapesReady, xAxis, xScale, yAxis, yScale, } = useChartInnerProps(Object.assign(Object.assign({}, props), { clipPathId,
|
|
65
65
|
dispatcher,
|
|
66
66
|
htmlLayout, plotNode: plotRef.current, preparedChart,
|
|
67
67
|
rangeSliderState,
|
|
@@ -270,7 +270,7 @@ export const ChartInner = (props) => {
|
|
|
270
270
|
((_e = xAxis === null || xAxis === void 0 ? void 0 : xAxis.rangeSlider) === null || _e === void 0 ? void 0 : _e.enabled) &&
|
|
271
271
|
preparedLegend &&
|
|
272
272
|
debouncedAllPreparedSeries &&
|
|
273
|
-
preparedSeriesOptions && (React.createElement(RangeSlider, { boundsOffsetLeft: debouncedOffsetLeft, boundsWidth: debouncedBoundsWidth, height: height, htmlLayout: htmlLayout, onUpdate: updateRangeSliderState, preparedChart: preparedChart, preparedLegend: preparedLegend, preparedSeries: debouncedAllPreparedSeries, preparedSeriesOptions: preparedSeriesOptions, preparedRangeSlider: xAxis.rangeSlider, rangeSliderState: rangeSliderState, ref: rangeSliderRef, width: width, xAxis: data.xAxis, yAxis: data.yAxis, legendConfig: legendConfig })),
|
|
273
|
+
preparedSeriesOptions && (React.createElement(RangeSlider, { activeLegendItems: activeLegendItems !== null && activeLegendItems !== void 0 ? activeLegendItems : [], boundsOffsetLeft: debouncedOffsetLeft, boundsWidth: debouncedBoundsWidth, height: height, htmlLayout: htmlLayout, onUpdate: updateRangeSliderState, preparedChart: preparedChart, preparedLegend: preparedLegend, preparedSeries: debouncedAllPreparedSeries, preparedSeriesOptions: preparedSeriesOptions, preparedRangeSlider: xAxis.rangeSlider, rangeSliderState: rangeSliderState, ref: rangeSliderRef, width: width, xAxis: data.xAxis, yAxis: data.yAxis, legendConfig: legendConfig })),
|
|
274
274
|
(preparedLegend === null || preparedLegend === void 0 ? void 0 : preparedLegend.enabled) && legendConfig && (React.createElement(Legend, { chartSeries: preparedSeries, legend: preparedLegend, items: legendItems, config: legendConfig, onItemClick: handleLegendItemClick, onUpdate: unpinTooltip, htmlLayout: htmlLayout }))));
|
|
275
275
|
return (React.createElement("div", { className: b() },
|
|
276
276
|
React.createElement("svg", { ref: svgRef, width: width, height: height,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
3
|
import type { PreparedXAxis, PreparedYAxis, ShapeData } from '../../hooks';
|
|
4
4
|
import type { ChartScale } from '../../hooks/useAxisScales/types';
|
|
5
5
|
import type { useChartInnerState } from './useChartInnerState';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
3
|
import type { ChartScale, LegendItem, OnLegendItemClick, PreparedLegend, PreparedSeries, PreparedSplit, PreparedXAxis, PreparedYAxis, RangeSliderState, ShapeData, ZoomState } from '../../hooks';
|
|
4
4
|
import type { PreparedChart } from '../../hooks/types';
|
|
5
5
|
import type { LegendConfig } from '../../types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3';
|
|
2
|
+
import type { Dispatch } from 'd3-dispatch';
|
|
3
3
|
import type { PreparedXAxis, PreparedYAxis, ShapeData } from '../../hooks';
|
|
4
4
|
import type { ChartScale } from '../../hooks/useAxisScales/types';
|
|
5
5
|
type Props = {
|
|
@@ -16,7 +16,7 @@ export function useDefaultState(props) {
|
|
|
16
16
|
// Defer dispatch so shape components (Area, Line, etc.) register their hover-shape.*
|
|
17
17
|
// listeners first; parent effects run before child effects in React.
|
|
18
18
|
queueMicrotask(() => {
|
|
19
|
-
var _a;
|
|
19
|
+
var _a, _b;
|
|
20
20
|
const x = calculateNumericProperty({ value: hoveredPosition.x, base: boundsWidth });
|
|
21
21
|
const y = calculateNumericProperty({ value: hoveredPosition.y, base: boundsHeight });
|
|
22
22
|
if (x === undefined || y === undefined) {
|
|
@@ -48,6 +48,9 @@ export function useDefaultState(props) {
|
|
|
48
48
|
clientX: rect.left + svgPointerX,
|
|
49
49
|
clientY: rect.top + svgPointerY,
|
|
50
50
|
});
|
|
51
|
+
if (syntheticEvent) {
|
|
52
|
+
(_b = svgRef.current) === null || _b === void 0 ? void 0 : _b.dispatchEvent(syntheticEvent);
|
|
53
|
+
}
|
|
51
54
|
dispatcher.call(EventType.POINTERMOVE_CHART, {}, {
|
|
52
55
|
hovered: closest,
|
|
53
56
|
xAxis,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { scaleLinear
|
|
2
|
+
import { scaleLinear } from 'd3-scale';
|
|
3
|
+
import { select } from 'd3-selection';
|
|
4
|
+
import { symbol } from 'd3-shape';
|
|
3
5
|
import { CONTINUOUS_LEGEND_SIZE } from '../../constants';
|
|
4
6
|
import { formatNumber } from '../../libs';
|
|
5
7
|
import { block, createGradientRect, getContinuesColorFn, getLabelsSize, getSymbol, getUniqId, } from '../../utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { duration } from '@gravity-ui/date-utils';
|
|
2
|
-
import { line as lineGenerator } from 'd3';
|
|
3
2
|
import { select } from 'd3-selection';
|
|
3
|
+
import { line as lineGenerator } from 'd3-shape';
|
|
4
4
|
import { getLineDashArray, isTimeScale } from '../../utils';
|
|
5
5
|
export function getInitialRangeSliderState(args) {
|
|
6
6
|
const { defaultRange, xScale } = args;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import get from 'lodash/get';
|
|
2
2
|
import { DASH_STYLE, DEFAULT_AXIS_LABEL_FONT_SIZE, SERIES_TYPE, axisCrosshairDefaults, axisLabelsDefaults, axisTickMarksDefaults, xAxisTitleDefaults, } from '../../constants';
|
|
3
|
-
import { TIME_UNITS, calculateCos, calculateNumericProperty, formatAxisTickLabel, getDefaultDateFormat, getHorizontalHtmlTextHeight, getHorizontalSvgTextHeight, getLabelsSize, getMinSpaceBetween, getTextSizeFn, isAxisRelatedSeries, wrapText, } from '../../utils';
|
|
3
|
+
import { TIME_UNITS, calculateCos, calculateNumericProperty, calculateSin, formatAxisTickLabel, getDefaultDateFormat, getHorizontalHtmlTextHeight, getHorizontalSvgTextHeight, getLabelsSize, getMinSpaceBetween, getTextSizeFn, isAxisRelatedSeries, wrapText, } from '../../utils';
|
|
4
4
|
import { getXAxisTickValues } from '../../utils/chart/axis/x-axis';
|
|
5
5
|
import { createXScale } from '../useAxisScales';
|
|
6
6
|
import { getPreparedRangeSlider } from './range-slider';
|
|
@@ -49,7 +49,10 @@ async function setLabelSettings({ axis, seriesData, width, axisLabels, }) {
|
|
|
49
49
|
html: axis.labels.html,
|
|
50
50
|
})).maxHeight
|
|
51
51
|
: axis.labels.lineHeight;
|
|
52
|
-
const maxHeight = rotation
|
|
52
|
+
const maxHeight = rotation
|
|
53
|
+
? Math.abs(calculateSin(rotation)) * axis.labels.maxWidth +
|
|
54
|
+
Math.abs(calculateCos(rotation)) * axis.labels.lineHeight
|
|
55
|
+
: labelsHeight;
|
|
53
56
|
axis.labels.height = Math.min(maxHeight, labelsHeight);
|
|
54
57
|
axis.labels.rotation = rotation;
|
|
55
58
|
}
|