@gravity-ui/charts 1.51.1 → 1.51.5

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 (197) hide show
  1. package/dist/cjs/components/index.js +25 -17
  2. package/dist/cjs/core/series/plugin.d.ts +14 -0
  3. package/dist/cjs/core/series/plugin.js +1 -0
  4. package/dist/cjs/core/series/prepareSeries.d.ts +3 -10
  5. package/dist/cjs/core/series/prepareSeries.js +3 -126
  6. package/dist/cjs/core/series/seriesRegistry.d.ts +3 -0
  7. package/dist/cjs/core/series/seriesRegistry.js +12 -0
  8. package/dist/cjs/core/shapes/area/get-tooltip-data.d.ts +3 -0
  9. package/dist/cjs/core/shapes/area/get-tooltip-data.js +19 -0
  10. package/dist/cjs/core/shapes/bar-x/get-tooltip-data.d.ts +3 -0
  11. package/dist/cjs/core/shapes/bar-x/get-tooltip-data.js +20 -0
  12. package/dist/cjs/core/shapes/bar-y/get-tooltip-data.d.ts +3 -0
  13. package/dist/cjs/core/shapes/bar-y/get-tooltip-data.js +32 -0
  14. package/dist/cjs/core/shapes/funnel/get-tooltip-data.d.ts +3 -0
  15. package/dist/cjs/core/shapes/funnel/get-tooltip-data.js +21 -0
  16. package/dist/cjs/core/shapes/funnel/prepare-data.js +6 -4
  17. package/dist/cjs/core/shapes/heatmap/get-tooltip-data.d.ts +3 -0
  18. package/dist/cjs/core/shapes/heatmap/get-tooltip-data.js +21 -0
  19. package/dist/cjs/core/shapes/line/get-tooltip-data.d.ts +3 -0
  20. package/dist/cjs/core/shapes/line/get-tooltip-data.js +18 -0
  21. package/dist/cjs/core/shapes/pie/get-tooltip-data.d.ts +3 -0
  22. package/dist/cjs/core/shapes/pie/get-tooltip-data.js +27 -0
  23. package/dist/cjs/core/shapes/radar/get-tooltip-data.d.ts +3 -0
  24. package/dist/cjs/core/shapes/radar/get-tooltip-data.js +35 -0
  25. package/dist/cjs/core/shapes/sankey/get-tooltip-data.d.ts +3 -0
  26. package/dist/cjs/core/shapes/sankey/get-tooltip-data.js +32 -0
  27. package/dist/cjs/core/shapes/scatter/get-tooltip-data.d.ts +3 -0
  28. package/dist/cjs/core/shapes/scatter/get-tooltip-data.js +19 -0
  29. package/dist/cjs/core/shapes/treemap/get-tooltip-data.d.ts +3 -0
  30. package/dist/cjs/core/shapes/treemap/get-tooltip-data.js +18 -0
  31. package/dist/cjs/core/shapes/waterfall/get-tooltip-data.d.ts +3 -0
  32. package/dist/cjs/core/shapes/waterfall/get-tooltip-data.js +15 -0
  33. package/dist/cjs/core/shapes/x-range/get-tooltip-data.d.ts +3 -0
  34. package/dist/cjs/core/shapes/x-range/get-tooltip-data.js +22 -0
  35. package/dist/cjs/core/types/chart/funnel.d.ts +9 -4
  36. package/dist/cjs/core/utils/get-closest-data.d.ts +2 -11
  37. package/dist/cjs/core/utils/get-closest-data.js +47 -326
  38. package/dist/cjs/core/utils/tooltip-helpers.d.ts +43 -0
  39. package/dist/cjs/core/utils/tooltip-helpers.js +72 -0
  40. package/dist/cjs/index.d.ts +1 -0
  41. package/dist/cjs/index.js +1 -0
  42. package/dist/cjs/plugins/area/index.d.ts +3 -0
  43. package/dist/cjs/plugins/area/index.js +5 -0
  44. package/dist/cjs/{core/series/prepare-area.d.ts → plugins/area/prepare.d.ts} +2 -2
  45. package/dist/cjs/{core/series/prepare-area.js → plugins/area/prepare.js} +4 -4
  46. package/dist/cjs/plugins/bar-x/index.d.ts +3 -0
  47. package/dist/cjs/plugins/bar-x/index.js +5 -0
  48. package/dist/{esm/core/series/prepare-bar-x.d.ts → cjs/plugins/bar-x/prepare.d.ts} +1 -1
  49. package/dist/{esm/core/series/prepare-bar-x.js → cjs/plugins/bar-x/prepare.js} +4 -4
  50. package/dist/cjs/plugins/bar-y/index.d.ts +3 -0
  51. package/dist/cjs/plugins/bar-y/index.js +5 -0
  52. package/dist/cjs/{core/series/prepare-bar-y.d.ts → plugins/bar-y/prepare.d.ts} +2 -2
  53. package/dist/cjs/{core/series/prepare-bar-y.js → plugins/bar-y/prepare.js} +4 -4
  54. package/dist/cjs/plugins/funnel/index.d.ts +3 -0
  55. package/dist/cjs/plugins/funnel/index.js +5 -0
  56. package/dist/cjs/{core/series/prepare-funnel.d.ts → plugins/funnel/prepare.d.ts} +2 -2
  57. package/dist/{esm/core/series/prepare-funnel.js → cjs/plugins/funnel/prepare.js} +15 -9
  58. package/dist/cjs/plugins/heatmap/index.d.ts +3 -0
  59. package/dist/cjs/plugins/heatmap/index.js +10 -0
  60. package/dist/{esm/core/series/prepare-heatmap.d.ts → cjs/plugins/heatmap/prepare.d.ts} +1 -1
  61. package/dist/{esm/core/series/prepare-heatmap.js → cjs/plugins/heatmap/prepare.js} +4 -4
  62. package/dist/cjs/plugins/index.d.ts +1 -0
  63. package/dist/cjs/plugins/index.js +27 -0
  64. package/dist/cjs/plugins/line/index.d.ts +3 -0
  65. package/dist/cjs/plugins/line/index.js +5 -0
  66. package/dist/cjs/{core/series/prepare-line.d.ts → plugins/line/prepare.d.ts} +2 -2
  67. package/dist/cjs/{core/series/prepare-line.js → plugins/line/prepare.js} +3 -3
  68. package/dist/cjs/plugins/pie/index.d.ts +3 -0
  69. package/dist/cjs/plugins/pie/index.js +5 -0
  70. package/dist/cjs/{core/series/prepare-pie.d.ts → plugins/pie/prepare.d.ts} +2 -2
  71. package/dist/cjs/plugins/pie/prepare.js +84 -0
  72. package/dist/cjs/plugins/radar/index.d.ts +3 -0
  73. package/dist/cjs/plugins/radar/index.js +5 -0
  74. package/dist/cjs/{core/series/prepare-radar.d.ts → plugins/radar/prepare.d.ts} +2 -2
  75. package/dist/cjs/{core/series/prepare-radar.js → plugins/radar/prepare.js} +4 -4
  76. package/dist/cjs/plugins/sankey/index.d.ts +3 -0
  77. package/dist/cjs/plugins/sankey/index.js +5 -0
  78. package/dist/cjs/{core/series/prepare-sankey.d.ts → plugins/sankey/prepare.d.ts} +1 -1
  79. package/dist/cjs/{core/series/prepare-sankey.js → plugins/sankey/prepare.js} +3 -3
  80. package/dist/cjs/plugins/scatter/index.d.ts +3 -0
  81. package/dist/cjs/plugins/scatter/index.js +10 -0
  82. package/dist/cjs/{core/series/prepare-scatter.d.ts → plugins/scatter/prepare.d.ts} +1 -1
  83. package/dist/{esm/core/series/prepare-scatter.js → cjs/plugins/scatter/prepare.js} +4 -4
  84. package/dist/cjs/plugins/treemap/index.d.ts +3 -0
  85. package/dist/cjs/plugins/treemap/index.js +5 -0
  86. package/dist/{esm/core/series/prepare-treemap.d.ts → cjs/plugins/treemap/prepare.d.ts} +1 -1
  87. package/dist/cjs/{core/series/prepare-treemap.js → plugins/treemap/prepare.js} +4 -4
  88. package/dist/cjs/plugins/waterfall/index.d.ts +3 -0
  89. package/dist/cjs/plugins/waterfall/index.js +5 -0
  90. package/dist/cjs/{core/series/prepare-waterfall.d.ts → plugins/waterfall/prepare.d.ts} +1 -1
  91. package/dist/{esm/core/series/prepare-waterfall.js → cjs/plugins/waterfall/prepare.js} +4 -4
  92. package/dist/cjs/plugins/x-range/index.d.ts +3 -0
  93. package/dist/cjs/plugins/x-range/index.js +5 -0
  94. package/dist/cjs/{core/series/prepare-x-range.d.ts → plugins/x-range/prepare.d.ts} +1 -1
  95. package/dist/cjs/{core/series/prepare-x-range.js → plugins/x-range/prepare.js} +4 -4
  96. package/dist/cjs/setup-jsdom.d.ts +1 -0
  97. package/dist/cjs/setup-jsdom.js +30 -4
  98. package/dist/esm/components/index.js +25 -17
  99. package/dist/esm/core/series/plugin.d.ts +14 -0
  100. package/dist/esm/core/series/plugin.js +1 -0
  101. package/dist/esm/core/series/prepareSeries.d.ts +3 -10
  102. package/dist/esm/core/series/prepareSeries.js +3 -126
  103. package/dist/esm/core/series/seriesRegistry.d.ts +3 -0
  104. package/dist/esm/core/series/seriesRegistry.js +12 -0
  105. package/dist/esm/core/shapes/area/get-tooltip-data.d.ts +3 -0
  106. package/dist/esm/core/shapes/area/get-tooltip-data.js +19 -0
  107. package/dist/esm/core/shapes/bar-x/get-tooltip-data.d.ts +3 -0
  108. package/dist/esm/core/shapes/bar-x/get-tooltip-data.js +20 -0
  109. package/dist/esm/core/shapes/bar-y/get-tooltip-data.d.ts +3 -0
  110. package/dist/esm/core/shapes/bar-y/get-tooltip-data.js +32 -0
  111. package/dist/esm/core/shapes/funnel/get-tooltip-data.d.ts +3 -0
  112. package/dist/esm/core/shapes/funnel/get-tooltip-data.js +21 -0
  113. package/dist/esm/core/shapes/funnel/prepare-data.js +6 -4
  114. package/dist/esm/core/shapes/heatmap/get-tooltip-data.d.ts +3 -0
  115. package/dist/esm/core/shapes/heatmap/get-tooltip-data.js +21 -0
  116. package/dist/esm/core/shapes/line/get-tooltip-data.d.ts +3 -0
  117. package/dist/esm/core/shapes/line/get-tooltip-data.js +18 -0
  118. package/dist/esm/core/shapes/pie/get-tooltip-data.d.ts +3 -0
  119. package/dist/esm/core/shapes/pie/get-tooltip-data.js +27 -0
  120. package/dist/esm/core/shapes/radar/get-tooltip-data.d.ts +3 -0
  121. package/dist/esm/core/shapes/radar/get-tooltip-data.js +35 -0
  122. package/dist/esm/core/shapes/sankey/get-tooltip-data.d.ts +3 -0
  123. package/dist/esm/core/shapes/sankey/get-tooltip-data.js +32 -0
  124. package/dist/esm/core/shapes/scatter/get-tooltip-data.d.ts +3 -0
  125. package/dist/esm/core/shapes/scatter/get-tooltip-data.js +19 -0
  126. package/dist/esm/core/shapes/treemap/get-tooltip-data.d.ts +3 -0
  127. package/dist/esm/core/shapes/treemap/get-tooltip-data.js +18 -0
  128. package/dist/esm/core/shapes/waterfall/get-tooltip-data.d.ts +3 -0
  129. package/dist/esm/core/shapes/waterfall/get-tooltip-data.js +15 -0
  130. package/dist/esm/core/shapes/x-range/get-tooltip-data.d.ts +3 -0
  131. package/dist/esm/core/shapes/x-range/get-tooltip-data.js +22 -0
  132. package/dist/esm/core/types/chart/funnel.d.ts +9 -4
  133. package/dist/esm/core/utils/get-closest-data.d.ts +2 -11
  134. package/dist/esm/core/utils/get-closest-data.js +47 -326
  135. package/dist/esm/core/utils/tooltip-helpers.d.ts +43 -0
  136. package/dist/esm/core/utils/tooltip-helpers.js +72 -0
  137. package/dist/esm/index.d.ts +1 -0
  138. package/dist/esm/index.js +1 -0
  139. package/dist/esm/plugins/area/index.d.ts +3 -0
  140. package/dist/esm/plugins/area/index.js +5 -0
  141. package/dist/esm/{core/series/prepare-area.d.ts → plugins/area/prepare.d.ts} +2 -2
  142. package/dist/esm/{core/series/prepare-area.js → plugins/area/prepare.js} +4 -4
  143. package/dist/esm/plugins/bar-x/index.d.ts +3 -0
  144. package/dist/esm/plugins/bar-x/index.js +5 -0
  145. package/dist/{cjs/core/series/prepare-bar-x.d.ts → esm/plugins/bar-x/prepare.d.ts} +1 -1
  146. package/dist/{cjs/core/series/prepare-bar-x.js → esm/plugins/bar-x/prepare.js} +4 -4
  147. package/dist/esm/plugins/bar-y/index.d.ts +3 -0
  148. package/dist/esm/plugins/bar-y/index.js +5 -0
  149. package/dist/esm/{core/series/prepare-bar-y.d.ts → plugins/bar-y/prepare.d.ts} +5 -5
  150. package/dist/esm/{core/series/prepare-bar-y.js → plugins/bar-y/prepare.js} +4 -4
  151. package/dist/esm/plugins/funnel/index.d.ts +3 -0
  152. package/dist/esm/plugins/funnel/index.js +5 -0
  153. package/dist/esm/{core/series/prepare-funnel.d.ts → plugins/funnel/prepare.d.ts} +2 -2
  154. package/dist/{cjs/core/series/prepare-funnel.js → esm/plugins/funnel/prepare.js} +15 -9
  155. package/dist/esm/plugins/heatmap/index.d.ts +3 -0
  156. package/dist/esm/plugins/heatmap/index.js +10 -0
  157. package/dist/{cjs/core/series/prepare-heatmap.d.ts → esm/plugins/heatmap/prepare.d.ts} +1 -1
  158. package/dist/{cjs/core/series/prepare-heatmap.js → esm/plugins/heatmap/prepare.js} +4 -4
  159. package/dist/esm/plugins/index.d.ts +1 -0
  160. package/dist/esm/plugins/index.js +27 -0
  161. package/dist/esm/plugins/line/index.d.ts +3 -0
  162. package/dist/esm/plugins/line/index.js +5 -0
  163. package/dist/esm/{core/series/prepare-line.d.ts → plugins/line/prepare.d.ts} +2 -2
  164. package/dist/esm/{core/series/prepare-line.js → plugins/line/prepare.js} +3 -3
  165. package/dist/esm/plugins/pie/index.d.ts +3 -0
  166. package/dist/esm/plugins/pie/index.js +5 -0
  167. package/dist/esm/{core/series/prepare-pie.d.ts → plugins/pie/prepare.d.ts} +2 -2
  168. package/dist/esm/plugins/pie/prepare.js +84 -0
  169. package/dist/esm/plugins/radar/index.d.ts +3 -0
  170. package/dist/esm/plugins/radar/index.js +5 -0
  171. package/dist/esm/{core/series/prepare-radar.d.ts → plugins/radar/prepare.d.ts} +2 -2
  172. package/dist/esm/{core/series/prepare-radar.js → plugins/radar/prepare.js} +4 -4
  173. package/dist/esm/plugins/sankey/index.d.ts +3 -0
  174. package/dist/esm/plugins/sankey/index.js +5 -0
  175. package/dist/esm/{core/series/prepare-sankey.d.ts → plugins/sankey/prepare.d.ts} +1 -1
  176. package/dist/esm/{core/series/prepare-sankey.js → plugins/sankey/prepare.js} +3 -3
  177. package/dist/esm/plugins/scatter/index.d.ts +3 -0
  178. package/dist/esm/plugins/scatter/index.js +10 -0
  179. package/dist/esm/{core/series/prepare-scatter.d.ts → plugins/scatter/prepare.d.ts} +1 -1
  180. package/dist/{cjs/core/series/prepare-scatter.js → esm/plugins/scatter/prepare.js} +4 -4
  181. package/dist/esm/plugins/treemap/index.d.ts +3 -0
  182. package/dist/esm/plugins/treemap/index.js +5 -0
  183. package/dist/{cjs/core/series/prepare-treemap.d.ts → esm/plugins/treemap/prepare.d.ts} +1 -1
  184. package/dist/esm/{core/series/prepare-treemap.js → plugins/treemap/prepare.js} +4 -4
  185. package/dist/esm/plugins/waterfall/index.d.ts +3 -0
  186. package/dist/esm/plugins/waterfall/index.js +5 -0
  187. package/dist/esm/{core/series/prepare-waterfall.d.ts → plugins/waterfall/prepare.d.ts} +1 -1
  188. package/dist/{cjs/core/series/prepare-waterfall.js → esm/plugins/waterfall/prepare.js} +4 -4
  189. package/dist/esm/plugins/x-range/index.d.ts +3 -0
  190. package/dist/esm/plugins/x-range/index.js +5 -0
  191. package/dist/esm/{core/series/prepare-x-range.d.ts → plugins/x-range/prepare.d.ts} +1 -1
  192. package/dist/esm/{core/series/prepare-x-range.js → plugins/x-range/prepare.js} +4 -4
  193. package/dist/esm/setup-jsdom.d.ts +1 -0
  194. package/dist/esm/setup-jsdom.js +30 -4
  195. package/package.json +4 -2
  196. package/dist/cjs/core/series/prepare-pie.js +0 -83
  197. package/dist/esm/core/series/prepare-pie.js +0 -83
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedSeries } from '../../core/series/types';
2
3
  import type { BarXSeries, ChartSeriesOptions } from '../../types';
3
- import type { PreparedLegend, PreparedSeries } from './types';
4
4
  type PrepareBarXSeriesArgs = {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  series: BarXSeries[];
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
- import { DEFAULT_DATALABELS_STYLE, seriesRangeSliderOptionsDefaults } from '../constants';
3
- import { getUniqId } from '../utils';
4
- import { DEFAULT_DATALABELS_PADDING } from './constants';
5
- import { getSeriesStackId, prepareLegendSymbol } from './utils';
2
+ import { DEFAULT_DATALABELS_STYLE, seriesRangeSliderOptionsDefaults } from '../../core/constants';
3
+ import { DEFAULT_DATALABELS_PADDING } from '../../core/series/constants';
4
+ import { getSeriesStackId, prepareLegendSymbol } from '../../core/series/utils';
5
+ import { getUniqId } from '../../core/utils';
6
6
  function prepareSeriesData(series) {
7
7
  var _a;
8
8
  const nullMode = (_a = series.nullMode) !== null && _a !== void 0 ? _a : 'skip';
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { BarYSeries } from '../../types';
3
+ export declare const barYPlugin: SeriesPlugin<BarYSeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareBarYSeries } from './prepare';
2
+ export const barYPlugin = {
3
+ type: 'bar-y',
4
+ prepareSeries: ({ series, seriesOptions, legend, colorScale }) => prepareBarYSeries({ series: series, seriesOptions, legend, colorScale }),
5
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend } from '../../core/series/types';
2
3
  import type { BarYSeries, BarYSeriesData, ChartSeriesOptions } from '../../types';
3
- import type { PreparedLegend } from './types';
4
4
  type PrepareBarYSeriesArgs = {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  series: BarYSeries[];
@@ -36,7 +36,7 @@ export declare function prepareBarYSeries(args: PrepareBarYSeriesArgs): Promise<
36
36
  groupId: string;
37
37
  itemText: string;
38
38
  enabled: boolean;
39
- symbol: import("./types").PreparedLegendSymbol;
39
+ symbol: import("../../core/series/types").PreparedLegendSymbol;
40
40
  };
41
41
  cursor: string | null;
42
42
  tooltip: import("../../types").ChartSeries["tooltip"];
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
- import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
- import { getLabelsSize, getUniqId } from '../utils';
4
- import { getFormattedValue } from '../utils/format';
5
- import { getSeriesStackId, prepareLegendSymbol } from './utils';
2
+ import { DEFAULT_DATALABELS_STYLE } from '../../core/constants';
3
+ import { getSeriesStackId, prepareLegendSymbol } from '../../core/series/utils';
4
+ import { getLabelsSize, getUniqId } from '../../core/utils';
5
+ import { getFormattedValue } from '../../core/utils/format';
6
6
  const DEFAULT_LABEL_PADDING = 7;
7
7
  function prepareSeriesData(series) {
8
8
  var _a;
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { FunnelSeries } from '../../types';
3
+ export declare const funnelPlugin: SeriesPlugin<FunnelSeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareFunnelSeries } from './prepare';
2
+ export const funnelPlugin = {
3
+ type: 'funnel',
4
+ prepareSeries: ({ series, seriesOptions, legend, colors }) => prepareFunnelSeries({ series: series, seriesOptions, legend, colors }),
5
+ };
@@ -1,7 +1,7 @@
1
+ import type { PreparedLegend, PreparedSeries } from '../../core/series/types';
1
2
  import type { ChartSeriesOptions, FunnelSeries } from '../../types';
2
- import type { PreparedLegend, PreparedSeries } from './types';
3
3
  type PrepareFunnelSeriesArgs = {
4
- series: FunnelSeries;
4
+ series: FunnelSeries[];
5
5
  seriesOptions?: ChartSeriesOptions;
6
6
  legend: PreparedLegend;
7
7
  colors: string[];
@@ -1,16 +1,20 @@
1
1
  import { scaleOrdinal } from 'd3-scale';
2
2
  import get from 'lodash/get';
3
- import { DEFAULT_DATALABELS_STYLE } from '../constants';
4
- import { getUniqId } from '../utils';
5
- import { prepareLegendSymbol } from './utils';
3
+ import { DEFAULT_DATALABELS_STYLE } from '../../core/constants';
4
+ import { prepareLegendSymbol } from '../../core/series/utils';
5
+ import { getUniqId } from '../../core/utils';
6
6
  export function prepareFunnelSeries(args) {
7
- var _a, _b, _c;
8
- const { series, legend, colors } = args;
7
+ var _a, _b, _c, _d;
8
+ const { series: seriesList, legend, colors } = args;
9
+ const series = seriesList[0];
9
10
  const dataNames = series.data.map((d) => d.name);
10
11
  const colorScale = scaleOrdinal(dataNames, colors);
11
12
  const shape = (_a = series.shape) !== null && _a !== void 0 ? _a : 'rectangle';
12
13
  const isTrapezoid = shape === 'trapezoid';
13
- const isConnectorsEnabled = (_c = (_b = series.connectors) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : !isTrapezoid;
14
+ const userSpecifiedHeight = ((_b = series.connectors) === null || _b === void 0 ? void 0 : _b.height) !== undefined;
15
+ // For trapezoid: enable connectors only when the user has explicitly set a height or enabled them.
16
+ // For rectangle: enable by default.
17
+ const isConnectorsEnabled = (_d = (_c = series.connectors) === null || _c === void 0 ? void 0 : _c.enabled) !== null && _d !== void 0 ? _d : (isTrapezoid ? userSpecifiedHeight : true);
14
18
  const preparedSeries = series.data.map((dataItem) => {
15
19
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
16
20
  const id = getUniqId();
@@ -42,12 +46,14 @@ export function prepareFunnelSeries(args) {
42
46
  tooltip: series.tooltip,
43
47
  connectors: {
44
48
  enabled: isConnectorsEnabled,
45
- height: isConnectorsEnabled ? ((_q = (_p = series.connectors) === null || _p === void 0 ? void 0 : _p.height) !== null && _q !== void 0 ? _q : '25%') : 0,
49
+ height: isConnectorsEnabled
50
+ ? ((_q = (_p = series.connectors) === null || _p === void 0 ? void 0 : _p.height) !== null && _q !== void 0 ? _q : (isTrapezoid ? 0 : '25%'))
51
+ : 0,
46
52
  lineDashStyle: (_s = (_r = series.connectors) === null || _r === void 0 ? void 0 : _r.lineDashStyle) !== null && _s !== void 0 ? _s : 'Dash',
47
- lineOpacity: (_u = (_t = series.connectors) === null || _t === void 0 ? void 0 : _t.lineOpacity) !== null && _u !== void 0 ? _u : 1,
53
+ lineOpacity: (_u = (_t = series.connectors) === null || _t === void 0 ? void 0 : _t.lineOpacity) !== null && _u !== void 0 ? _u : (isTrapezoid ? 0 : 1),
48
54
  lineColor: (_w = (_v = series.connectors) === null || _v === void 0 ? void 0 : _v.lineColor) !== null && _w !== void 0 ? _w : 'var(--g-color-line-generic-active)',
49
55
  areaColor: (_y = (_x = series.connectors) === null || _x === void 0 ? void 0 : _x.areaColor) !== null && _y !== void 0 ? _y : color,
50
- areaOpacity: (_0 = (_z = series.connectors) === null || _z === void 0 ? void 0 : _z.areaOpacity) !== null && _0 !== void 0 ? _0 : 0.25,
56
+ areaOpacity: (_0 = (_z = series.connectors) === null || _z === void 0 ? void 0 : _z.areaOpacity) !== null && _0 !== void 0 ? _0 : (isTrapezoid ? 0 : 0.25),
51
57
  lineWidth: (_2 = (_1 = series.connectors) === null || _1 === void 0 ? void 0 : _1.lineWidth) !== null && _2 !== void 0 ? _2 : 1,
52
58
  },
53
59
  };
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { HeatmapSeries } from '../../types';
3
+ export declare const heatmapPlugin: SeriesPlugin<HeatmapSeries>;
@@ -0,0 +1,10 @@
1
+ import { prepareHeatmapSeries } from './prepare';
2
+ export const heatmapPlugin = {
3
+ type: 'heatmap',
4
+ prepareSeries: ({ series, seriesOptions, legend, colorScale }) => prepareHeatmapSeries({
5
+ series: series,
6
+ seriesOptions,
7
+ legend,
8
+ colorScale,
9
+ }),
10
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedSeries } from '../../core/series/types';
2
3
  import type { ChartSeriesOptions, HeatmapSeries } from '../../types';
3
- import type { PreparedLegend, PreparedSeries } from './types';
4
4
  type PrepareHeatmapSeriesArgs = {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  series: HeatmapSeries[];
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
- import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
- import { getUniqId } from '../utils';
4
- import { DEFAULT_DATALABELS_PADDING } from './constants';
5
- import { prepareLegendSymbol } from './utils';
2
+ import { DEFAULT_DATALABELS_STYLE } from '../../core/constants';
3
+ import { DEFAULT_DATALABELS_PADDING } from '../../core/series/constants';
4
+ import { prepareLegendSymbol } from '../../core/series/utils';
5
+ import { getUniqId } from '../../core/utils';
6
6
  function prepareSeriesData(series) {
7
7
  var _a;
8
8
  const nullMode = (_a = series.nullMode) !== null && _a !== void 0 ? _a : 'skip';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { registerSeriesPlugin } from '../core/series/seriesRegistry';
2
+ import { areaPlugin } from './area';
3
+ import { barXPlugin } from './bar-x';
4
+ import { barYPlugin } from './bar-y';
5
+ import { funnelPlugin } from './funnel';
6
+ import { heatmapPlugin } from './heatmap';
7
+ import { linePlugin } from './line';
8
+ import { piePlugin } from './pie';
9
+ import { radarPlugin } from './radar';
10
+ import { sankeyPlugin } from './sankey';
11
+ import { scatterPlugin } from './scatter';
12
+ import { treemapPlugin } from './treemap';
13
+ import { waterfallPlugin } from './waterfall';
14
+ import { xRangePlugin } from './x-range';
15
+ registerSeriesPlugin(areaPlugin);
16
+ registerSeriesPlugin(barXPlugin);
17
+ registerSeriesPlugin(barYPlugin);
18
+ registerSeriesPlugin(funnelPlugin);
19
+ registerSeriesPlugin(heatmapPlugin);
20
+ registerSeriesPlugin(linePlugin);
21
+ registerSeriesPlugin(piePlugin);
22
+ registerSeriesPlugin(radarPlugin);
23
+ registerSeriesPlugin(sankeyPlugin);
24
+ registerSeriesPlugin(scatterPlugin);
25
+ registerSeriesPlugin(treemapPlugin);
26
+ registerSeriesPlugin(waterfallPlugin);
27
+ registerSeriesPlugin(xRangePlugin);
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { LineSeries } from '../../types';
3
+ export declare const linePlugin: SeriesPlugin<LineSeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareLineSeries } from './prepare';
2
+ export const linePlugin = {
3
+ type: 'line',
4
+ prepareSeries: ({ series, seriesOptions, legend, colorScale }) => prepareLineSeries({ series: series, seriesOptions, legend, colorScale }),
5
+ };
@@ -1,12 +1,12 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedLineSeries } from '../../core/series/types';
2
3
  import type { ChartSeriesOptions, LineSeries } from '../../types';
3
- import type { PreparedLegend, PreparedLineSeries } from './types';
4
4
  export declare const DEFAULT_LEGEND_SYMBOL_SIZE = 16;
5
5
  export declare const DEFAULT_LINE_WIDTH = 1;
6
6
  export declare const DEFAULT_DASH_STYLE: "Solid";
7
7
  export declare const DEFAULT_MARKER: {
8
8
  enabled: boolean;
9
- symbol: `${import("../constants").SymbolType}`;
9
+ symbol: `${import("../../core/constants").SymbolType}`;
10
10
  borderColor: string;
11
11
  borderWidth: number;
12
12
  radius: number;
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
2
  import merge from 'lodash/merge';
3
- import { DASH_STYLE, DEFAULT_DATALABELS_STYLE, LineCap, LineJoin, seriesRangeSliderOptionsDefaults, } from '../constants';
4
- import { getUniqId } from '../utils';
5
- import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_LEGEND_SYMBOL_PADDING, DEFAULT_POINT_MARKER_OPTIONS, } from './constants';
3
+ import { DASH_STYLE, DEFAULT_DATALABELS_STYLE, LineCap, LineJoin, seriesRangeSliderOptionsDefaults, } from '../../core/constants';
4
+ import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_LEGEND_SYMBOL_PADDING, DEFAULT_POINT_MARKER_OPTIONS, } from '../../core/series/constants';
5
+ import { getUniqId } from '../../core/utils';
6
6
  export const DEFAULT_LEGEND_SYMBOL_SIZE = 16;
7
7
  export const DEFAULT_LINE_WIDTH = 1;
8
8
  export const DEFAULT_DASH_STYLE = DASH_STYLE.Solid;
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { PieSeries } from '../../types';
3
+ export declare const piePlugin: SeriesPlugin<PieSeries>;
@@ -0,0 +1,5 @@
1
+ import { preparePieSeries } from './prepare';
2
+ export const piePlugin = {
3
+ type: 'pie',
4
+ prepareSeries: ({ series, seriesOptions, legend, colors }) => preparePieSeries({ series: series, seriesOptions, legend, colors }),
5
+ };
@@ -1,7 +1,7 @@
1
+ import type { PreparedLegend, PreparedSeries } from '../../core/series/types';
1
2
  import type { ChartSeriesOptions, PieSeries } from '../../types';
2
- import type { PreparedLegend, PreparedSeries } from './types';
3
3
  type PreparePieSeriesArgs = {
4
- series: PieSeries;
4
+ series: PieSeries[];
5
5
  seriesOptions?: ChartSeriesOptions;
6
6
  legend: PreparedLegend;
7
7
  colors: string[];
@@ -0,0 +1,84 @@
1
+ import { scaleOrdinal } from 'd3-scale';
2
+ import get from 'lodash/get';
3
+ import { DEFAULT_DATALABELS_STYLE } from '../../core/constants';
4
+ import { DEFAULT_DATALABELS_PADDING } from '../../core/series/constants';
5
+ import { prepareLegendSymbol } from '../../core/series/utils';
6
+ import { getUniqId } from '../../core/utils';
7
+ function prepareSeriesData(series) {
8
+ var _a;
9
+ const nullMode = (_a = series.nullMode) !== null && _a !== void 0 ? _a : 'skip';
10
+ const data = series.data;
11
+ switch (nullMode) {
12
+ case 'zero':
13
+ return data.map((p) => { var _a; return (Object.assign(Object.assign({}, p), { value: (_a = p.value) !== null && _a !== void 0 ? _a : 0 })); });
14
+ case 'skip':
15
+ default:
16
+ return data.filter((p) => p.value !== null);
17
+ }
18
+ }
19
+ export function preparePieSeries(args) {
20
+ const { series: seriesList, seriesOptions, legend, colors } = args;
21
+ return seriesList.flatMap((series) => {
22
+ const preparedData = prepareSeriesData(series);
23
+ const dataNames = preparedData.map((d) => d.name);
24
+ const colorScale = scaleOrdinal(dataNames, colors);
25
+ const stackId = getUniqId();
26
+ const seriesHoverState = get(seriesOptions, 'pie.states.hover');
27
+ return preparedData.map((dataItem) => {
28
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
29
+ const id = getUniqId();
30
+ const result = {
31
+ type: 'pie',
32
+ data: dataItem,
33
+ dataLabels: {
34
+ enabled: get(series, 'dataLabels.enabled', true),
35
+ style: Object.assign({}, DEFAULT_DATALABELS_STYLE, (_a = series.dataLabels) === null || _a === void 0 ? void 0 : _a.style),
36
+ padding: get(series, 'dataLabels.padding', DEFAULT_DATALABELS_PADDING),
37
+ allowOverlap: get(series, 'dataLabels.allowOverlap', false),
38
+ connectorPadding: get(series, 'dataLabels.connectorPadding', 5),
39
+ connectorShape: get(series, 'dataLabels.connectorShape', 'polyline'),
40
+ distance: get(series, 'dataLabels.distance', 25),
41
+ connectorCurve: get(series, 'dataLabels.connectorCurve', 'basic'),
42
+ html: get(series, 'dataLabels.html', false),
43
+ format: (_b = series.dataLabels) === null || _b === void 0 ? void 0 : _b.format,
44
+ },
45
+ label: dataItem.label,
46
+ value: dataItem.value,
47
+ visible: typeof dataItem.visible === 'boolean' ? dataItem.visible : true,
48
+ name: dataItem.name,
49
+ id,
50
+ color: dataItem.color || colorScale(dataItem.name),
51
+ legend: {
52
+ enabled: (_f = (_d = (_c = dataItem.legend) === null || _c === void 0 ? void 0 : _c.enabled) !== null && _d !== void 0 ? _d : (_e = series.legend) === null || _e === void 0 ? void 0 : _e.enabled) !== null && _f !== void 0 ? _f : legend.enabled,
53
+ symbol: ((_g = dataItem.legend) === null || _g === void 0 ? void 0 : _g.symbol)
54
+ ? prepareLegendSymbol(dataItem)
55
+ : prepareLegendSymbol(series),
56
+ groupId: (_j = (_h = dataItem.legend) === null || _h === void 0 ? void 0 : _h.groupId) !== null && _j !== void 0 ? _j : getUniqId(),
57
+ itemText: (_l = (_k = dataItem.legend) === null || _k === void 0 ? void 0 : _k.itemText) !== null && _l !== void 0 ? _l : dataItem.name,
58
+ },
59
+ center: series.center || ['50%', '50%'],
60
+ borderColor: series.borderColor || '',
61
+ borderRadius: (_m = series.borderRadius) !== null && _m !== void 0 ? _m : 0,
62
+ borderWidth: (_o = series.borderWidth) !== null && _o !== void 0 ? _o : 1,
63
+ radius: (_q = (_p = dataItem.radius) !== null && _p !== void 0 ? _p : series.radius) !== null && _q !== void 0 ? _q : '100%',
64
+ innerRadius: series.innerRadius || 0,
65
+ minRadius: series.minRadius,
66
+ stackId,
67
+ states: {
68
+ hover: {
69
+ halo: {
70
+ enabled: get(seriesHoverState, 'halo.enabled', true),
71
+ opacity: get(seriesHoverState, 'halo.opacity', 0.25),
72
+ size: get(seriesHoverState, 'halo.size', 10),
73
+ },
74
+ },
75
+ },
76
+ renderCustomShape: series.renderCustomShape,
77
+ opacity: get(dataItem, 'opacity', null),
78
+ cursor: get(series, 'cursor', null),
79
+ tooltip: series.tooltip,
80
+ };
81
+ return result;
82
+ });
83
+ });
84
+ }
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { RadarSeries } from '../../types';
3
+ export declare const radarPlugin: SeriesPlugin<RadarSeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareRadarSeries } from './prepare';
2
+ export const radarPlugin = {
3
+ type: 'radar',
4
+ prepareSeries: ({ series, seriesOptions, legend, colors }) => prepareRadarSeries({ series: series, seriesOptions, legend, colors }),
5
+ };
@@ -1,5 +1,5 @@
1
+ import type { PreparedLegend, PreparedRadarSeries } from '../../core/series/types';
1
2
  import type { ChartSeriesOptions, RadarSeries } from '../../types';
2
- import type { PreparedLegend, PreparedRadarSeries } from './types';
3
3
  type PrepareRadarSeriesArgs = {
4
4
  series: RadarSeries[];
5
5
  seriesOptions?: ChartSeriesOptions;
@@ -9,7 +9,7 @@ type PrepareRadarSeriesArgs = {
9
9
  export declare const DEFAULT_MARKER: {
10
10
  enabled: boolean;
11
11
  radius: number;
12
- symbol: `${import("../constants").SymbolType}`;
12
+ symbol: `${import("../../core/constants").SymbolType}`;
13
13
  borderColor: string;
14
14
  borderWidth: number;
15
15
  };
@@ -1,10 +1,10 @@
1
1
  import { scaleOrdinal } from 'd3-scale';
2
2
  import get from 'lodash/get';
3
3
  import merge from 'lodash/merge';
4
- import { DEFAULT_DATALABELS_STYLE } from '../constants';
5
- import { getUniqId } from '../utils';
6
- import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS, } from './constants';
7
- import { prepareLegendSymbol } from './utils';
4
+ import { DEFAULT_DATALABELS_STYLE } from '../../core/constants';
5
+ import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS, } from '../../core/series/constants';
6
+ import { prepareLegendSymbol } from '../../core/series/utils';
7
+ import { getUniqId } from '../../core/utils';
8
8
  export const DEFAULT_MARKER = Object.assign(Object.assign({}, DEFAULT_POINT_MARKER_OPTIONS), { enabled: true, radius: 2 });
9
9
  function prepareMarker(series, seriesOptions) {
10
10
  var _a;
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { SankeySeries } from '../../types';
3
+ export declare const sankeyPlugin: SeriesPlugin<SankeySeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareSankeySeries } from './prepare';
2
+ export const sankeyPlugin = {
3
+ type: 'sankey',
4
+ prepareSeries: ({ series, seriesOptions, legend, colorScale }) => prepareSankeySeries({ series: series, seriesOptions, legend, colorScale }),
5
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedSankeySeries } from '../../core/series/types';
2
3
  import type { ChartSeriesOptions, SankeySeries } from '../../types';
3
- import type { PreparedLegend, PreparedSankeySeries } from './types';
4
4
  type PrepareSankeySeriesArgs = {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  legend: PreparedLegend;
@@ -1,7 +1,7 @@
1
1
  import get from 'lodash/get';
2
- import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
- import { getUniqId } from '../utils';
4
- import { prepareLegendSymbol } from './utils';
2
+ import { DEFAULT_DATALABELS_STYLE } from '../../core/constants';
3
+ import { prepareLegendSymbol } from '../../core/series/utils';
4
+ import { getUniqId } from '../../core/utils';
5
5
  export function prepareSankeySeries(args) {
6
6
  const { colorScale, legend, series } = args;
7
7
  return series.map((s) => {
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { ScatterSeries } from '../../types';
3
+ export declare const scatterPlugin: SeriesPlugin<ScatterSeries>;
@@ -0,0 +1,10 @@
1
+ import { prepareScatterSeries } from './prepare';
2
+ export const scatterPlugin = {
3
+ type: 'scatter',
4
+ prepareSeries: ({ series, seriesOptions, legend, colorScale }) => prepareScatterSeries({
5
+ series: series,
6
+ seriesOptions,
7
+ legend,
8
+ colorScale,
9
+ }),
10
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedScatterSeries } from '../../core/series/types';
2
3
  import type { ChartSeriesOptions, ScatterSeries } from '../../types';
3
- import type { PreparedLegend, PreparedScatterSeries } from './types';
4
4
  interface PrepareScatterSeriesArgs {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  series: ScatterSeries[];
@@ -1,9 +1,9 @@
1
1
  import get from 'lodash/get';
2
2
  import merge from 'lodash/merge';
3
- import { DEFAULT_DATALABELS_STYLE, seriesRangeSliderOptionsDefaults } from '../constants';
4
- import { getSymbolType, getUniqId } from '../utils';
5
- import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS, } from './constants';
6
- import { prepareLegendSymbol } from './utils';
3
+ import { DEFAULT_DATALABELS_STYLE, seriesRangeSliderOptionsDefaults } from '../../core/constants';
4
+ import { DEFAULT_DATALABELS_PADDING, DEFAULT_HALO_OPTIONS, DEFAULT_POINT_MARKER_OPTIONS, } from '../../core/series/constants';
5
+ import { prepareLegendSymbol } from '../../core/series/utils';
6
+ import { getSymbolType, getUniqId } from '../../core/utils';
7
7
  function prepareMarker(series, seriesOptions, index) {
8
8
  const seriesHoverState = get(seriesOptions, 'scatter.states.hover');
9
9
  const markerNormalState = Object.assign(Object.assign({}, DEFAULT_POINT_MARKER_OPTIONS), { enabled: true, symbol: series.symbolType || getSymbolType(index) });
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { TreemapSeries } from '../../types';
3
+ export declare const treemapPlugin: SeriesPlugin<TreemapSeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareTreemap } from './prepare';
2
+ export const treemapPlugin = {
3
+ type: 'treemap',
4
+ prepareSeries: ({ series, seriesOptions, legend, colorScale }) => prepareTreemap({ series: series, seriesOptions, legend, colorScale }),
5
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedTreemapSeries } from '../../core/series/types';
2
3
  import type { ChartSeriesOptions, TreemapSeries } from '../../types';
3
- import type { PreparedLegend, PreparedTreemapSeries } from './types';
4
4
  type PrepareTreemapSeriesArgs = {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  legend: PreparedLegend;
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
- import { DEFAULT_DATALABELS_STYLE, LayoutAlgorithm } from '../constants';
3
- import { getUniqId } from '../utils';
4
- import { DEFAULT_DATALABELS_PADDING } from './constants';
5
- import { prepareLegendSymbol } from './utils';
2
+ import { DEFAULT_DATALABELS_STYLE, LayoutAlgorithm } from '../../core/constants';
3
+ import { DEFAULT_DATALABELS_PADDING } from '../../core/series/constants';
4
+ import { prepareLegendSymbol } from '../../core/series/utils';
5
+ import { getUniqId } from '../../core/utils';
6
6
  export function prepareTreemap(args) {
7
7
  const { colorScale, legend, series } = args;
8
8
  return series.map((s) => {
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { WaterfallSeries } from '../../types';
3
+ export declare const waterfallPlugin: SeriesPlugin<WaterfallSeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareWaterfallSeries } from './prepare';
2
+ export const waterfallPlugin = {
3
+ type: 'waterfall',
4
+ prepareSeries: ({ series, legend, colorScale, colors }) => prepareWaterfallSeries({ series: series, legend, colorScale, colors }),
5
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedSeries } from '../../core/series/types';
2
3
  import type { WaterfallSeries } from '../../types';
3
- import type { PreparedLegend, PreparedSeries } from './types';
4
4
  type PrepareWaterfallSeriesArgs = {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  series: WaterfallSeries[];
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
- import { DEFAULT_DATALABELS_STYLE } from '../constants';
3
- import { getUniqId } from '../utils';
4
- import { DEFAULT_DATALABELS_PADDING } from './constants';
5
- import { prepareLegendSymbol } from './utils';
2
+ import { DEFAULT_DATALABELS_STYLE } from '../../core/constants';
3
+ import { DEFAULT_DATALABELS_PADDING } from '../../core/series/constants';
4
+ import { prepareLegendSymbol } from '../../core/series/utils';
5
+ import { getUniqId } from '../../core/utils';
6
6
  function prepareSeriesData(series) {
7
7
  var _a;
8
8
  const nullMode = (_a = series.nullMode) !== null && _a !== void 0 ? _a : 'skip';
@@ -0,0 +1,3 @@
1
+ import type { SeriesPlugin } from '../../core/series/plugin';
2
+ import type { XRangeSeries } from '../../types';
3
+ export declare const xRangePlugin: SeriesPlugin<XRangeSeries>;
@@ -0,0 +1,5 @@
1
+ import { prepareXRangeSeries } from './prepare';
2
+ export const xRangePlugin = {
3
+ type: 'x-range',
4
+ prepareSeries: ({ series, seriesOptions, legend, colorScale }) => prepareXRangeSeries({ series: series, seriesOptions, legend, colorScale }),
5
+ };
@@ -1,6 +1,6 @@
1
1
  import type { ScaleOrdinal } from 'd3-scale';
2
+ import type { PreparedLegend, PreparedXRangeSeries } from '../../core/series/types';
2
3
  import type { ChartSeriesOptions, XRangeSeries } from '../../types';
3
- import type { PreparedLegend, PreparedXRangeSeries } from './types';
4
4
  type PrepareXRangeSeriesArgs = {
5
5
  colorScale: ScaleOrdinal<string, string>;
6
6
  series: XRangeSeries[];
@@ -1,8 +1,8 @@
1
1
  import get from 'lodash/get';
2
- import { DASH_STYLE, DEFAULT_DATALABELS_STYLE } from '../constants';
3
- import { getUniqId } from '../utils';
4
- import { DEFAULT_DATALABELS_PADDING } from './constants';
5
- import { prepareLegendSymbol } from './utils';
2
+ import { DASH_STYLE, DEFAULT_DATALABELS_STYLE } from '../../core/constants';
3
+ import { DEFAULT_DATALABELS_PADDING } from '../../core/series/constants';
4
+ import { prepareLegendSymbol } from '../../core/series/utils';
5
+ import { getUniqId } from '../../core/utils';
6
6
  export function prepareXRangeSeries(args) {
7
7
  const { colorScale, series: seriesList, seriesOptions, legend } = args;
8
8
  return seriesList.map((series) => {
@@ -0,0 +1 @@
1
+ import './plugins';