@gravity-ui/charts 1.41.0 → 1.41.1

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.
Files changed (205) hide show
  1. package/dist/cjs/components/AxisX/AxisX.js +2 -1
  2. package/dist/cjs/components/AxisY/AxisY.js +2 -1
  3. package/dist/cjs/components/ChartInner/useChartInnerHandlers.d.ts +1 -1
  4. package/dist/cjs/components/ChartInner/useChartInnerHandlers.js +1 -1
  5. package/dist/cjs/components/ChartInner/useChartInnerProps.d.ts +1 -1
  6. package/dist/cjs/components/ChartInner/useChartInnerState.d.ts +1 -1
  7. package/dist/cjs/components/ChartInner/useDefaultState.d.ts +1 -1
  8. package/dist/cjs/components/Legend/index.js +3 -1
  9. package/dist/cjs/components/RangeSlider/utils.js +1 -1
  10. package/dist/cjs/components/Tooltip/index.d.ts +1 -1
  11. package/dist/cjs/components/index.js +1 -1
  12. package/dist/cjs/components/utils/index.js +1 -1
  13. package/dist/cjs/hooks/useAxis/x-axis.js +5 -2
  14. package/dist/cjs/hooks/useAxisScales/types.d.ts +1 -1
  15. package/dist/cjs/hooks/useAxisScales/x-scale.js +2 -1
  16. package/dist/cjs/hooks/useAxisScales/y-scale.js +2 -1
  17. package/dist/cjs/hooks/useBrush/index.js +2 -1
  18. package/dist/cjs/hooks/useBrush/types.d.ts +1 -1
  19. package/dist/cjs/hooks/useBrush/utils.d.ts +1 -1
  20. package/dist/cjs/hooks/useBrush/utils.js +2 -1
  21. package/dist/cjs/hooks/useCrosshair/index.d.ts +1 -1
  22. package/dist/cjs/hooks/useCrosshair/index.js +2 -1
  23. package/dist/cjs/hooks/useCrosshair/useCrosshairHover.d.ts +1 -1
  24. package/dist/cjs/hooks/useRangeSlider/index.js +1 -1
  25. package/dist/cjs/hooks/useSeries/index.js +2 -1
  26. package/dist/cjs/hooks/useSeries/prepare-area.d.ts +1 -1
  27. package/dist/cjs/hooks/useSeries/prepare-bar-x.d.ts +1 -1
  28. package/dist/cjs/hooks/useSeries/prepare-bar-y.d.ts +1 -1
  29. package/dist/cjs/hooks/useSeries/prepare-funnel.js +1 -1
  30. package/dist/cjs/hooks/useSeries/prepare-heatmap.d.ts +1 -1
  31. package/dist/cjs/hooks/useSeries/prepare-line.d.ts +1 -1
  32. package/dist/cjs/hooks/useSeries/prepare-pie.js +1 -1
  33. package/dist/cjs/hooks/useSeries/prepare-radar.js +1 -1
  34. package/dist/cjs/hooks/useSeries/prepare-sankey.d.ts +1 -1
  35. package/dist/cjs/hooks/useSeries/prepare-scatter.d.ts +1 -1
  36. package/dist/cjs/hooks/useSeries/prepare-treemap.d.ts +1 -1
  37. package/dist/cjs/hooks/useSeries/prepare-waterfall.d.ts +1 -1
  38. package/dist/cjs/hooks/useSeries/prepareSeries.d.ts +1 -1
  39. package/dist/cjs/hooks/useShapes/area/index.d.ts +1 -1
  40. package/dist/cjs/hooks/useShapes/area/index.js +3 -1
  41. package/dist/cjs/hooks/useShapes/area/prepare-data.d.ts +0 -1
  42. package/dist/cjs/hooks/useShapes/area/prepare-data.js +61 -31
  43. package/dist/cjs/hooks/useShapes/bar-x/index.d.ts +1 -1
  44. package/dist/cjs/hooks/useShapes/bar-x/index.js +2 -1
  45. package/dist/cjs/hooks/useShapes/bar-x/prepare-data.js +1 -1
  46. package/dist/cjs/hooks/useShapes/bar-y/index.d.ts +1 -1
  47. package/dist/cjs/hooks/useShapes/bar-y/index.js +2 -1
  48. package/dist/cjs/hooks/useShapes/bar-y/prepare-data.js +1 -1
  49. package/dist/cjs/hooks/useShapes/funnel/index.d.ts +1 -1
  50. package/dist/cjs/hooks/useShapes/funnel/index.js +2 -1
  51. package/dist/cjs/hooks/useShapes/funnel/prepare-data.js +1 -1
  52. package/dist/cjs/hooks/useShapes/funnel/types.d.ts +1 -1
  53. package/dist/cjs/hooks/useShapes/heatmap/index.d.ts +1 -1
  54. package/dist/cjs/hooks/useShapes/heatmap/index.js +2 -1
  55. package/dist/cjs/hooks/useShapes/index.d.ts +1 -1
  56. package/dist/cjs/hooks/useShapes/index.js +1 -2
  57. package/dist/cjs/hooks/useShapes/line/index.d.ts +1 -1
  58. package/dist/cjs/hooks/useShapes/line/index.js +3 -1
  59. package/dist/cjs/hooks/useShapes/marker.d.ts +1 -1
  60. package/dist/cjs/hooks/useShapes/marker.js +1 -1
  61. package/dist/cjs/hooks/useShapes/pie/index.d.ts +2 -1
  62. package/dist/cjs/hooks/useShapes/pie/index.js +3 -1
  63. package/dist/cjs/hooks/useShapes/pie/prepare-data.js +2 -1
  64. package/dist/cjs/hooks/useShapes/pie/types.d.ts +1 -1
  65. package/dist/cjs/hooks/useShapes/pie/utils.d.ts +1 -1
  66. package/dist/cjs/hooks/useShapes/pie/utils.js +1 -1
  67. package/dist/cjs/hooks/useShapes/radar/index.d.ts +1 -1
  68. package/dist/cjs/hooks/useShapes/radar/index.js +3 -1
  69. package/dist/cjs/hooks/useShapes/radar/prepare-data.js +3 -1
  70. package/dist/cjs/hooks/useShapes/sankey/index.d.ts +1 -1
  71. package/dist/cjs/hooks/useShapes/sankey/index.js +1 -1
  72. package/dist/cjs/hooks/useShapes/scatter/index.d.ts +1 -1
  73. package/dist/cjs/hooks/useShapes/scatter/index.js +1 -1
  74. package/dist/cjs/hooks/useShapes/treemap/index.d.ts +1 -1
  75. package/dist/cjs/hooks/useShapes/treemap/index.js +2 -1
  76. package/dist/cjs/hooks/useShapes/treemap/prepare-data.js +2 -1
  77. package/dist/cjs/hooks/useShapes/treemap/types.d.ts +1 -1
  78. package/dist/cjs/hooks/useShapes/utils.d.ts +1 -1
  79. package/dist/cjs/hooks/useShapes/utils.js +2 -1
  80. package/dist/cjs/hooks/useShapes/waterfall/index.d.ts +1 -1
  81. package/dist/cjs/hooks/useShapes/waterfall/index.js +3 -1
  82. package/dist/cjs/hooks/useTooltip/index.d.ts +1 -1
  83. package/dist/cjs/hooks/useZoom/index.js +1 -1
  84. package/dist/cjs/hooks/useZoom/utils.d.ts +1 -1
  85. package/dist/cjs/hooks/utils/bar-y.js +1 -1
  86. package/dist/cjs/hooks/utils/get-band-size.d.ts +1 -1
  87. package/dist/cjs/types/chart/pie.d.ts +1 -1
  88. package/dist/cjs/utils/chart/axis/common.d.ts +2 -1
  89. package/dist/cjs/utils/chart/axis/common.js +1 -1
  90. package/dist/cjs/utils/chart/axis-generators/bottom.d.ts +2 -1
  91. package/dist/cjs/utils/chart/axis-generators/bottom.js +2 -1
  92. package/dist/cjs/utils/chart/color.js +2 -1
  93. package/dist/cjs/utils/chart/common.js +2 -1
  94. package/dist/cjs/utils/chart/format.d.ts +1 -1
  95. package/dist/cjs/utils/chart/get-closest-data.js +2 -1
  96. package/dist/cjs/utils/chart/legend.d.ts +1 -1
  97. package/dist/cjs/utils/chart/series/sorting.js +1 -1
  98. package/dist/cjs/utils/chart/symbol.js +1 -1
  99. package/dist/cjs/utils/chart/text.d.ts +1 -1
  100. package/dist/cjs/utils/chart/ticks/datetime.js +2 -1
  101. package/dist/cjs/utils/chart/ticks/index.d.ts +1 -1
  102. package/dist/cjs/utils/dispatcher.js +1 -1
  103. package/dist/esm/components/AxisX/AxisX.js +2 -1
  104. package/dist/esm/components/AxisY/AxisY.js +2 -1
  105. package/dist/esm/components/ChartInner/useChartInnerHandlers.d.ts +1 -1
  106. package/dist/esm/components/ChartInner/useChartInnerHandlers.js +1 -1
  107. package/dist/esm/components/ChartInner/useChartInnerProps.d.ts +1 -1
  108. package/dist/esm/components/ChartInner/useChartInnerState.d.ts +1 -1
  109. package/dist/esm/components/ChartInner/useDefaultState.d.ts +1 -1
  110. package/dist/esm/components/Legend/index.js +3 -1
  111. package/dist/esm/components/RangeSlider/utils.js +1 -1
  112. package/dist/esm/components/Tooltip/index.d.ts +1 -1
  113. package/dist/esm/components/index.js +1 -1
  114. package/dist/esm/components/utils/index.js +1 -1
  115. package/dist/esm/hooks/useAxis/x-axis.js +5 -2
  116. package/dist/esm/hooks/useAxisScales/types.d.ts +1 -1
  117. package/dist/esm/hooks/useAxisScales/x-scale.js +2 -1
  118. package/dist/esm/hooks/useAxisScales/y-scale.js +2 -1
  119. package/dist/esm/hooks/useBrush/index.js +2 -1
  120. package/dist/esm/hooks/useBrush/types.d.ts +1 -1
  121. package/dist/esm/hooks/useBrush/utils.d.ts +1 -1
  122. package/dist/esm/hooks/useBrush/utils.js +2 -1
  123. package/dist/esm/hooks/useCrosshair/index.d.ts +1 -1
  124. package/dist/esm/hooks/useCrosshair/index.js +2 -1
  125. package/dist/esm/hooks/useCrosshair/useCrosshairHover.d.ts +1 -1
  126. package/dist/esm/hooks/useRangeSlider/index.js +1 -1
  127. package/dist/esm/hooks/useSeries/index.js +2 -1
  128. package/dist/esm/hooks/useSeries/prepare-area.d.ts +1 -1
  129. package/dist/esm/hooks/useSeries/prepare-bar-x.d.ts +1 -1
  130. package/dist/esm/hooks/useSeries/prepare-bar-y.d.ts +1 -1
  131. package/dist/esm/hooks/useSeries/prepare-funnel.js +1 -1
  132. package/dist/esm/hooks/useSeries/prepare-heatmap.d.ts +1 -1
  133. package/dist/esm/hooks/useSeries/prepare-line.d.ts +1 -1
  134. package/dist/esm/hooks/useSeries/prepare-pie.js +1 -1
  135. package/dist/esm/hooks/useSeries/prepare-radar.js +1 -1
  136. package/dist/esm/hooks/useSeries/prepare-sankey.d.ts +1 -1
  137. package/dist/esm/hooks/useSeries/prepare-scatter.d.ts +1 -1
  138. package/dist/esm/hooks/useSeries/prepare-treemap.d.ts +1 -1
  139. package/dist/esm/hooks/useSeries/prepare-waterfall.d.ts +1 -1
  140. package/dist/esm/hooks/useSeries/prepareSeries.d.ts +1 -1
  141. package/dist/esm/hooks/useShapes/area/index.d.ts +1 -1
  142. package/dist/esm/hooks/useShapes/area/index.js +3 -1
  143. package/dist/esm/hooks/useShapes/area/prepare-data.d.ts +0 -1
  144. package/dist/esm/hooks/useShapes/area/prepare-data.js +61 -31
  145. package/dist/esm/hooks/useShapes/bar-x/index.d.ts +1 -1
  146. package/dist/esm/hooks/useShapes/bar-x/index.js +2 -1
  147. package/dist/esm/hooks/useShapes/bar-x/prepare-data.js +1 -1
  148. package/dist/esm/hooks/useShapes/bar-y/index.d.ts +1 -1
  149. package/dist/esm/hooks/useShapes/bar-y/index.js +2 -1
  150. package/dist/esm/hooks/useShapes/bar-y/prepare-data.js +1 -1
  151. package/dist/esm/hooks/useShapes/funnel/index.d.ts +1 -1
  152. package/dist/esm/hooks/useShapes/funnel/index.js +2 -1
  153. package/dist/esm/hooks/useShapes/funnel/prepare-data.js +1 -1
  154. package/dist/esm/hooks/useShapes/funnel/types.d.ts +1 -1
  155. package/dist/esm/hooks/useShapes/heatmap/index.d.ts +1 -1
  156. package/dist/esm/hooks/useShapes/heatmap/index.js +2 -1
  157. package/dist/esm/hooks/useShapes/index.d.ts +1 -1
  158. package/dist/esm/hooks/useShapes/index.js +1 -2
  159. package/dist/esm/hooks/useShapes/line/index.d.ts +1 -1
  160. package/dist/esm/hooks/useShapes/line/index.js +3 -1
  161. package/dist/esm/hooks/useShapes/marker.d.ts +1 -1
  162. package/dist/esm/hooks/useShapes/marker.js +1 -1
  163. package/dist/esm/hooks/useShapes/pie/index.d.ts +2 -1
  164. package/dist/esm/hooks/useShapes/pie/index.js +3 -1
  165. package/dist/esm/hooks/useShapes/pie/prepare-data.js +2 -1
  166. package/dist/esm/hooks/useShapes/pie/types.d.ts +1 -1
  167. package/dist/esm/hooks/useShapes/pie/utils.d.ts +1 -1
  168. package/dist/esm/hooks/useShapes/pie/utils.js +1 -1
  169. package/dist/esm/hooks/useShapes/radar/index.d.ts +1 -1
  170. package/dist/esm/hooks/useShapes/radar/index.js +3 -1
  171. package/dist/esm/hooks/useShapes/radar/prepare-data.js +3 -1
  172. package/dist/esm/hooks/useShapes/sankey/index.d.ts +1 -1
  173. package/dist/esm/hooks/useShapes/sankey/index.js +1 -1
  174. package/dist/esm/hooks/useShapes/scatter/index.d.ts +1 -1
  175. package/dist/esm/hooks/useShapes/scatter/index.js +1 -1
  176. package/dist/esm/hooks/useShapes/treemap/index.d.ts +1 -1
  177. package/dist/esm/hooks/useShapes/treemap/index.js +2 -1
  178. package/dist/esm/hooks/useShapes/treemap/prepare-data.js +2 -1
  179. package/dist/esm/hooks/useShapes/treemap/types.d.ts +1 -1
  180. package/dist/esm/hooks/useShapes/utils.d.ts +1 -1
  181. package/dist/esm/hooks/useShapes/utils.js +2 -1
  182. package/dist/esm/hooks/useShapes/waterfall/index.d.ts +1 -1
  183. package/dist/esm/hooks/useShapes/waterfall/index.js +3 -1
  184. package/dist/esm/hooks/useTooltip/index.d.ts +1 -1
  185. package/dist/esm/hooks/useZoom/index.js +1 -1
  186. package/dist/esm/hooks/useZoom/utils.d.ts +1 -1
  187. package/dist/esm/hooks/utils/bar-y.js +1 -1
  188. package/dist/esm/hooks/utils/get-band-size.d.ts +1 -1
  189. package/dist/esm/types/chart/pie.d.ts +1 -1
  190. package/dist/esm/utils/chart/axis/common.d.ts +2 -1
  191. package/dist/esm/utils/chart/axis/common.js +1 -1
  192. package/dist/esm/utils/chart/axis-generators/bottom.d.ts +2 -1
  193. package/dist/esm/utils/chart/axis-generators/bottom.js +2 -1
  194. package/dist/esm/utils/chart/color.js +2 -1
  195. package/dist/esm/utils/chart/common.js +2 -1
  196. package/dist/esm/utils/chart/format.d.ts +1 -1
  197. package/dist/esm/utils/chart/get-closest-data.js +2 -1
  198. package/dist/esm/utils/chart/legend.d.ts +1 -1
  199. package/dist/esm/utils/chart/series/sorting.js +1 -1
  200. package/dist/esm/utils/chart/symbol.js +1 -1
  201. package/dist/esm/utils/chart/text.d.ts +1 -1
  202. package/dist/esm/utils/chart/ticks/datetime.js +2 -1
  203. package/dist/esm/utils/chart/ticks/index.d.ts +1 -1
  204. package/dist/esm/utils/dispatcher.js +1 -1
  205. package/package.json +14 -2
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
- import { color, line as lineGenerator, select } from 'd3';
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,4 +1,4 @@
1
- import { symbol } from 'd3';
1
+ import { symbol } from 'd3-shape';
2
2
  import get from 'lodash/get';
3
3
  import { SymbolType } from '../../constants';
4
4
  import { block, getSymbol } from '../../utils';
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import type { Dispatch, PieArcDatum } from 'd3';
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 { arc, color, select } from 'd3';
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 { arc, group, line as lineGenerator, max } from 'd3';
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 { PieArcDatum } from 'd3';
1
+ import type { PieArcDatum } from 'd3-shape';
2
2
  import type { ConnectorCurve, HtmlItem, LabelData } from '../../../types';
3
3
  import type { PreparedPieSeries } from '../../useSeries/types';
4
4
  export type SegmentData = {
@@ -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,4 +1,4 @@
1
- import { curveBasis, curveLinear, pie } from 'd3';
1
+ import { curveBasis, curveLinear, pie } from 'd3-shape';
2
2
  export const pieGenerator = pie()
3
3
  .value((d) => d.value)
4
4
  .sort(null);
@@ -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 { PreparedRadarData } from './types';
5
5
  type PrepareRadarSeriesArgs = {
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
- import { color, line, select } from 'd3';
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 { curveLinearClosed, line, range, scaleLinear } from 'd3';
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 { PreparedSankeyData } from './types';
5
5
  type ShapeProps = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { select } from 'd3';
2
+ import { select } from 'd3-selection';
3
3
  import { block } from '../../../utils';
4
4
  import { HtmlLayer } from '../HtmlLayer';
5
5
  const b = block('sankey');
@@ -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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { select } from 'd3';
2
+ import { select } from 'd3-selection';
3
3
  import get from 'lodash/get';
4
4
  import { block } from '../../../utils';
5
5
  import { HtmlLayer } from '../HtmlLayer';
@@ -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 { PreparedTreemapData } from './types';
5
5
  type ShapeProps = {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { color, select } from 'd3';
2
+ import { color } from 'd3-color';
3
+ import { select } from 'd3-selection';
3
4
  import get from 'lodash/get';
4
5
  import { block } from '../../../utils';
5
6
  import { HtmlLayer } from '../HtmlLayer';
@@ -1,4 +1,5 @@
1
- import { ascending, descending, sort, stratify, treemap, treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, } from 'd3';
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,4 +1,5 @@
1
- import { path, select } from 'd3';
1
+ import { path } from 'd3-path';
2
+ import { select } from 'd3-selection';
2
3
  import get from 'lodash/get';
3
4
  import { getDataCategoryValue } from '../../utils';
4
5
  const ONE_POINT_DOMAIN_DATA_CAPACITY = 3;
@@ -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, line as lineGenerator, select } from 'd3';
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,5 +1,5 @@
1
1
  import React from 'react';
2
- import { select } from 'd3';
2
+ import { select } from 'd3-selection';
3
3
  import { useBrush } from '../useBrush';
4
4
  import { selectionToZoomBounds } from './utils';
5
5
  export function useZoom(props) {
@@ -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,4 @@
1
- import { max } from 'd3';
1
+ import { max } from 'd3-array';
2
2
  import get from 'lodash/get';
3
3
  import { getDataCategoryValue } from '../../utils';
4
4
  import { MIN_BAR_GAP, MIN_BAR_GROUP_GAP, MIN_BAR_WIDTH } from '../constants';
@@ -1,4 +1,4 @@
1
- import type { AxisDomain, AxisScale } from 'd3';
1
+ import type { AxisDomain, AxisScale } from 'd3-axis';
2
2
  export declare function getBandSize({ domain, scale, }: {
3
3
  domain: AxisDomain[];
4
4
  scale: AxisScale<AxisDomain> | undefined;
@@ -1,4 +1,4 @@
1
- import type { BaseType } from 'd3';
1
+ import type { BaseType } from 'd3-selection';
2
2
  import type { SERIES_TYPE } from '../../constants';
3
3
  import type { MeaningfulAny } from '../misc';
4
4
  import type { BaseSeries, BaseSeriesData, BaseSeriesLegend } from './base';
@@ -1,4 +1,5 @@
1
- import type { AxisDomain, AxisScale, ScaleBand, ScaleTime } from 'd3';
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, Selection } from 'd3';
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, select } from 'd3';
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,5 @@
1
- import { range, scaleLinear } from 'd3';
1
+ import { range } from 'd3-array';
2
+ import { scaleLinear } from 'd3-scale';
2
3
  export function getDomainForContinuousColorScale(args) {
3
4
  const { series } = args;
4
5
  const values = series.reduce((acc, s) => {
@@ -1,4 +1,5 @@
1
- import { group, select } from 'd3';
1
+ import { group } from 'd3-array';
2
+ import { select } from 'd3-selection';
2
3
  import get from 'lodash/get';
3
4
  import isNil from 'lodash/isNil';
4
5
  import sortBy from 'lodash/sortBy';
@@ -1,4 +1,4 @@
1
- import type { AxisDomain } from 'd3';
1
+ import type { AxisDomain } from 'd3-axis';
2
2
  import type { PreparedAxis } from '../../hooks';
3
3
  import type { CustomFormat, ValueFormat } from '../../types';
4
4
  export declare function getFormattedValue(args: {
@@ -1,4 +1,5 @@
1
- import { Delaunay, bisector, sort } from 'd3';
1
+ import { bisector, sort } from 'd3-array';
2
+ import { Delaunay } from 'd3-delaunay';
2
3
  import get from 'lodash/get';
3
4
  import groupBy from 'lodash/groupBy';
4
5
  function getClosestYIndex(items, y) {
@@ -1,4 +1,4 @@
1
- import type { Selection } from 'd3';
1
+ import type { Selection } from 'd3-selection';
2
2
  export declare function createGradientRect(container: Selection<SVGGElement, unknown, null, undefined>, args: {
3
3
  x?: number;
4
4
  y?: number;
@@ -1,4 +1,4 @@
1
- import { sort } from 'd3';
1
+ import { sort } from 'd3-array';
2
2
  import { isEmpty } from 'lodash';
3
3
  import get from 'lodash/get';
4
4
  import { SERIES_TYPE } from '../../../constants';
@@ -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, utcDay, utcHour, utcMillisecond, utcMinute, utcMonth, utcSecond, utcMonday as utcWeek, utcYear, } from 'd3';
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,4 +1,4 @@
1
- import type { AxisDomain, AxisScale } from 'd3';
1
+ import type { AxisDomain, AxisScale } from 'd3-axis';
2
2
  import type { ChartScale } from '../../../hooks';
3
3
  export declare function getScaleTicks({ scale, ticksCount, }: {
4
4
  scale: ChartScale | AxisScale<AxisDomain>;
@@ -1,4 +1,4 @@
1
- import { dispatch } from 'd3';
1
+ import { dispatch } from 'd3-dispatch';
2
2
  export const EventType = {
3
3
  CLICK_CHART: 'click-chart',
4
4
  HOVER_SHAPE: 'hover-shape',
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { line, select } from 'd3';
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 { line, select } from 'd3';
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,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 { pointer } from 'd3';
2
+ import { pointer } from 'd3-selection';
3
3
  import get from 'lodash/get';
4
4
  import throttle from 'lodash/throttle';
5
5
  import { IS_TOUCH_ENABLED } from '../../constants';
@@ -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 { PreparedRangeSlider, PreparedTooltip, RangeSliderState, ZoomState } from '../../hooks';
4
4
  type Props = {
5
5
  dispatcher: Dispatch<object>;
@@ -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 = {
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
- import { scaleLinear, select, symbol } from 'd3';
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,4 +1,4 @@
1
- import { path } from 'd3';
1
+ import { path } from 'd3-path';
2
2
  export function getFramedPath(args) {
3
3
  const { height, strokeWidth, width } = args;
4
4
  const p = path();
@@ -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 { PreparedTooltip, PreparedXAxis, PreparedYAxis } from '../../hooks';
4
4
  import './styles.css';
5
5
  type TooltipProps = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { select } from 'd3';
2
+ import { select } from 'd3-selection';
3
3
  import debounce from 'lodash/debounce';
4
4
  import { i18nFactory } from '../i18n';
5
5
  import { 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 ? calculateCos(rotation) * axis.labels.maxWidth : labelsHeight;
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
  }
@@ -1,4 +1,4 @@
1
- import type { ScaleBand, ScaleLinear, ScaleTime } from 'd3';
1
+ import type { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';
2
2
  type ChartScaleBand = ScaleBand<string>;
3
3
  export type ChartScaleLinear = ScaleLinear<number, number>;
4
4
  export type ChartScaleTime = ScaleTime<number, number>;
@@ -1,4 +1,5 @@
1
- import { extent, scaleBand, scaleLinear, scaleLog, scaleUtc } from 'd3';
1
+ import { extent } from 'd3-array';
2
+ import { scaleBand, scaleLinear, scaleLog, scaleUtc } from 'd3-scale';
2
3
  import get from 'lodash/get';
3
4
  import { DEFAULT_AXIS_TYPE, SERIES_TYPE } from '../../constants';
4
5
  import { getDefaultMaxXAxisValue, getDefaultMinXAxisValue, getDomainDataXBySeries, getEffectiveXRange, } from '../../utils';
@@ -1,4 +1,5 @@
1
- import { extent, scaleBand, scaleLinear, scaleLog, scaleUtc, tickStep, ticks } from 'd3';
1
+ import { extent, tickStep, ticks } from 'd3-array';
2
+ import { scaleBand, scaleLinear, scaleLog, scaleUtc } from 'd3-scale';
2
3
  import get from 'lodash/get';
3
4
  import { getTickValues } from '../../components/AxisY/utils';
4
5
  import { SERIES_TYPE } from '../../constants';
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { brush, brushX, brushY, pointer, select } from 'd3';
2
+ import { brush, brushX, brushY } from 'd3-brush';
3
+ import { pointer, select } from 'd3-selection';
3
4
  import { block } from '../../utils';
4
5
  import { getDefaultSelection, getNormalizedSelection, setBrushBorder, setBrushHandles, } from './utils';
5
6
  import './styles.css';
@@ -1,4 +1,4 @@
1
- import type { BrushBehavior } from 'd3';
1
+ import type { BrushBehavior } from 'd3-brush';
2
2
  import type { ZoomType } from '../../constants';
3
3
  import type { ChartBrush, DeepRequired } from '../../types';
4
4
  export type BrushSelection = [number, number] | [[number, number], [number, number]];
@@ -1,4 +1,4 @@
1
- import type { BrushBehavior } from 'd3';
1
+ import type { BrushBehavior } from 'd3-brush';
2
2
  import type { ChartBrush, DeepRequired } from '../../types';
3
3
  import type { BrushSelection } from './types';
4
4
  export declare function isOneDimensionalSelection(selection?: BrushSelection | null): selection is [number, number];
@@ -1,4 +1,5 @@
1
- import { path, select } from 'd3';
1
+ import { path } from 'd3-path';
2
+ import { select } from 'd3-selection';
2
3
  import round from 'lodash/round';
3
4
  export function isOneDimensionalSelection(selection) {
4
5
  if (!Array.isArray(selection)) {
@@ -1,4 +1,4 @@
1
- import type { Dispatch } from 'd3';
1
+ import type { Dispatch } from 'd3-dispatch';
2
2
  import type { ChartScale, PreparedSplit, PreparedXAxis, PreparedYAxis } from '../../hooks';
3
3
  type Props = {
4
4
  xAxis: PreparedXAxis | null;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { line, select } from 'd3';
2
+ import { select } from 'd3-selection';
3
+ import { line } from 'd3-shape';
3
4
  import { getAxisPlotsPosition, getLineDashArray } from '../../utils';
4
5
  import { getXValue, getYValue } from '../useShapes/utils';
5
6
  import { useCrosshairHover } from './useCrosshairHover';
@@ -1,4 +1,4 @@
1
- import type { Dispatch } from 'd3';
1
+ import type { Dispatch } from 'd3-dispatch';
2
2
  import type { PointPosition, TooltipDataChunk } from '../../types';
3
3
  type Args = {
4
4
  dispatcher: Dispatch<object>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { pointer } from 'd3';
2
+ import { pointer } from 'd3-selection';
3
3
  import { isEqual } from 'lodash';
4
4
  import { SERIES_TYPE } from '../../constants';
5
5
  import { isBandScale } from '../../utils';
@@ -1,4 +1,5 @@
1
- import { group, scaleOrdinal } from 'd3';
1
+ import { group } from 'd3-array';
2
+ import { scaleOrdinal } from 'd3-scale';
2
3
  import { getSeriesNames } from '../../utils';
3
4
  import { prepareSeries } from './prepareSeries';
4
5
  export const getVisibleSeries = ({ preparedSeries, activeLegendItems, }) => {
@@ -1,4 +1,4 @@
1
- import type { ScaleOrdinal } from 'd3';
1
+ import type { ScaleOrdinal } from 'd3-scale';
2
2
  import type { AreaSeries, ChartSeriesOptions } from '../../types';
3
3
  import type { PreparedAreaSeries, PreparedLegend } from './types';
4
4
  export declare const DEFAULT_LINE_WIDTH = 1;
@@ -1,4 +1,4 @@
1
- import type { ScaleOrdinal } from 'd3';
1
+ import type { ScaleOrdinal } from 'd3-scale';
2
2
  import type { BarXSeries, ChartSeriesOptions } from '../../types';
3
3
  import type { PreparedLegend, PreparedSeries } from './types';
4
4
  type PrepareBarXSeriesArgs = {
@@ -1,4 +1,4 @@
1
- import type { ScaleOrdinal } from 'd3';
1
+ import type { ScaleOrdinal } from 'd3-scale';
2
2
  import type { BarYSeries, BarYSeriesData, ChartSeriesOptions } from '../../types';
3
3
  import type { PreparedLegend } from './types';
4
4
  type PrepareBarYSeriesArgs = {