@gravity-ui/chartkit 4.14.0 → 4.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/build/constants/index.d.ts +1 -0
  2. package/build/constants/index.js +1 -0
  3. package/build/constants/widget-data.d.ts +34 -0
  4. package/build/constants/widget-data.js +37 -0
  5. package/build/plugins/d3/examples/ExampleWrapper.d.ts +7 -0
  6. package/build/plugins/d3/examples/ExampleWrapper.js +5 -0
  7. package/build/plugins/d3/examples/area/Basic.js +3 -4
  8. package/build/plugins/d3/examples/area/StackedArea.js +3 -4
  9. package/build/plugins/d3/examples/bar-x/Basic.js +8 -4
  10. package/build/plugins/d3/examples/bar-x/DataLabels.js +4 -2
  11. package/build/plugins/d3/examples/bar-x/GroupedColumns.js +4 -2
  12. package/build/plugins/d3/examples/bar-x/StackedColumns.js +4 -2
  13. package/build/plugins/d3/examples/bar-y/Basic.js +4 -2
  14. package/build/plugins/d3/examples/bar-y/GroupedColumns.js +4 -2
  15. package/build/plugins/d3/examples/bar-y/StackedColumns.js +4 -2
  16. package/build/plugins/d3/examples/combined/LineAndBarX.js +5 -3
  17. package/build/plugins/d3/examples/line/Basic.js +4 -2
  18. package/build/plugins/d3/examples/line/DataLabels.js +4 -2
  19. package/build/plugins/d3/examples/line/LineWithMarkers.js +4 -2
  20. package/build/plugins/d3/examples/line/Shapes.d.ts +2 -0
  21. package/build/plugins/d3/examples/line/Shapes.js +93 -0
  22. package/build/plugins/d3/examples/pie/Basic.js +4 -2
  23. package/build/plugins/d3/examples/pie/Donut.js +4 -2
  24. package/build/plugins/d3/examples/scatter/Basic.js +4 -2
  25. package/build/plugins/d3/renderer/components/Legend.js +23 -1
  26. package/build/plugins/d3/renderer/components/styles.css +4 -0
  27. package/build/plugins/d3/renderer/hooks/useSeries/constants.d.ts +2 -3
  28. package/build/plugins/d3/renderer/hooks/useSeries/constants.js +1 -1
  29. package/build/plugins/d3/renderer/hooks/useSeries/prepare-line-series.d.ts +2 -0
  30. package/build/plugins/d3/renderer/hooks/useSeries/prepare-line-series.js +11 -0
  31. package/build/plugins/d3/renderer/hooks/useSeries/prepare-pie.d.ts +2 -1
  32. package/build/plugins/d3/renderer/hooks/useSeries/prepare-pie.js +11 -1
  33. package/build/plugins/d3/renderer/hooks/useSeries/prepareSeries.js +8 -5
  34. package/build/plugins/d3/renderer/hooks/useSeries/types.d.ts +23 -12
  35. package/build/plugins/d3/renderer/hooks/useSeries/utils.d.ts +2 -1
  36. package/build/plugins/d3/renderer/hooks/useSeries/utils.js +5 -6
  37. package/build/plugins/d3/renderer/hooks/useShapes/area/index.js +5 -62
  38. package/build/plugins/d3/renderer/hooks/useShapes/line/index.js +9 -65
  39. package/build/plugins/d3/renderer/hooks/useShapes/line/prepare-data.js +5 -2
  40. package/build/plugins/d3/renderer/hooks/useShapes/line/types.d.ts +3 -0
  41. package/build/plugins/d3/renderer/hooks/useShapes/marker.d.ts +12 -0
  42. package/build/plugins/d3/renderer/hooks/useShapes/marker.js +70 -0
  43. package/build/plugins/d3/renderer/hooks/useShapes/pie/index.d.ts +3 -2
  44. package/build/plugins/d3/renderer/hooks/useShapes/pie/index.js +28 -0
  45. package/build/plugins/d3/renderer/hooks/useShapes/pie/prepare-data.js +9 -3
  46. package/build/plugins/d3/renderer/hooks/useShapes/pie/types.d.ts +5 -0
  47. package/build/plugins/d3/renderer/hooks/useShapes/scatter/index.js +16 -9
  48. package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.d.ts +1 -0
  49. package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.js +3 -0
  50. package/build/plugins/d3/renderer/hooks/useShapes/utils.d.ts +2 -0
  51. package/build/plugins/d3/renderer/hooks/useShapes/utils.js +17 -0
  52. package/build/plugins/d3/renderer/utils/index.d.ts +1 -0
  53. package/build/plugins/d3/renderer/utils/index.js +1 -0
  54. package/build/plugins/d3/renderer/utils/symbol.d.ts +5 -0
  55. package/build/plugins/d3/renderer/utils/symbol.js +36 -0
  56. package/build/plugins/d3/renderer/validation/index.js +2 -8
  57. package/build/plugins/highcharts/renderer/helpers/config/config.js +0 -3
  58. package/build/types/widget-data/area.d.ts +2 -1
  59. package/build/types/widget-data/bar-x.d.ts +2 -1
  60. package/build/types/widget-data/bar-y.d.ts +2 -1
  61. package/build/types/widget-data/halo.d.ts +9 -0
  62. package/build/types/widget-data/halo.js +1 -0
  63. package/build/types/widget-data/index.d.ts +1 -0
  64. package/build/types/widget-data/index.js +1 -0
  65. package/build/types/widget-data/legend.d.ts +8 -0
  66. package/build/types/widget-data/line.d.ts +6 -1
  67. package/build/types/widget-data/marker.d.ts +0 -8
  68. package/build/types/widget-data/pie.d.ts +2 -1
  69. package/build/types/widget-data/scatter.d.ts +3 -2
  70. package/build/types/widget-data/series.d.ts +19 -4
  71. package/package.json +8 -2
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import get from 'lodash/get';
3
- import { color, pointer, select } from 'd3';
3
+ import { symbol, color, pointer, select } from 'd3';
4
4
  import { block } from '../../../../../../utils/cn';
5
- import { extractD3DataFromNode, isNodeContainsD3Data } from '../../../utils';
5
+ import { extractD3DataFromNode, isNodeContainsD3Data, getSymbol } from '../../../utils';
6
6
  import { shapeKey } from '../utils';
7
+ import { SymbolType } from '../../../../../../constants';
7
8
  export { prepareScatterData } from './prepare-data';
8
9
  const b = block('d3-scatter');
9
- const DEFAULT_SCATTER_POINT_RADIUS = 4;
10
10
  const EMPTY_SELECTION = null;
11
11
  const isNodeContainsScatterData = (node) => {
12
12
  return isNodeContainsD3Data(node);
@@ -22,13 +22,20 @@ export function ScatterSeriesShape(props) {
22
22
  const hoverOptions = get(seriesOptions, 'scatter.states.hover');
23
23
  const inactiveOptions = get(seriesOptions, 'scatter.states.inactive');
24
24
  const selection = svgElement
25
- .selectAll(`circle`)
25
+ .selectAll('path')
26
26
  .data(preparedData, shapeKey)
27
- .join((enter) => enter.append('circle').attr('class', b('point')), (update) => update, (exit) => exit.remove())
28
- .attr('fill', (d) => d.data.color || d.series.color || '')
29
- .attr('r', (d) => d.data.radius || DEFAULT_SCATTER_POINT_RADIUS)
30
- .attr('cx', (d) => d.cx)
31
- .attr('cy', (d) => d.cy);
27
+ .join((enter) => enter.append('path').attr('class', b('point')), (update) => update, (exit) => exit.remove())
28
+ .attr('d', (d) => {
29
+ const symbolType = d.series.symbolType || SymbolType.Circle;
30
+ const scatterSymbol = getSymbol(symbolType);
31
+ // D3 takes size as square pixels, so we need to make square pixels size by multiplying
32
+ // https://d3js.org/d3-shape/symbol#symbol
33
+ return symbol(scatterSymbol, d.size * d.size)();
34
+ })
35
+ .attr('transform', (d) => {
36
+ return 'translate(' + d.cx + ',' + d.cy + ')';
37
+ })
38
+ .attr('fill', (d) => d.data.color || d.series.color || '');
32
39
  svgElement
33
40
  .on('mousemove', (e) => {
34
41
  const point = e.target;
@@ -9,6 +9,7 @@ export type PreparedScatterData = Omit<TooltipDataChunkScatter, 'series'> & {
9
9
  hovered: boolean;
10
10
  active: boolean;
11
11
  id: number;
12
+ size: number;
12
13
  };
13
14
  export declare const prepareScatterData: (args: {
14
15
  series: PreparedScatterSeries[];
@@ -1,4 +1,5 @@
1
1
  import { getXValue, getYValue } from '../utils';
2
+ const DEFAULT_SCATTER_POINT_SIZE = 7;
2
3
  const getFilteredLinearScatterData = (data) => {
3
4
  return data.filter((d) => typeof d.x === 'number' && typeof d.y === 'number');
4
5
  };
@@ -9,6 +10,7 @@ export const prepareScatterData = (args) => {
9
10
  ? s.data
10
11
  : getFilteredLinearScatterData(s.data);
11
12
  filteredData.forEach((d) => {
13
+ const size = d.radius ? d.radius * 2 : DEFAULT_SCATTER_POINT_SIZE;
12
14
  acc.push({
13
15
  data: d,
14
16
  series: s,
@@ -17,6 +19,7 @@ export const prepareScatterData = (args) => {
17
19
  hovered: false,
18
20
  active: true,
19
21
  id: acc.length - 1,
22
+ size,
20
23
  });
21
24
  });
22
25
  return acc;
@@ -2,6 +2,7 @@ import type { BaseType } from 'd3';
2
2
  import type { BasicInactiveState } from '../../../../../types';
3
3
  import type { ChartScale } from '../useAxisScales';
4
4
  import type { PreparedAxis } from '../useChartOptions/types';
5
+ import { DashStyle } from '../../../../../constants';
5
6
  export declare function getXValue(args: {
6
7
  point: {
7
8
  x?: number | string;
@@ -25,3 +26,4 @@ export declare function setActiveState<T extends {
25
26
  state: BasicInactiveState | undefined;
26
27
  active: boolean;
27
28
  }): T;
29
+ export declare const getLineDashArray: (dashStyle: DashStyle, strokeWidth?: number) => string;
@@ -34,3 +34,20 @@ export function setActiveState(args) {
34
34
  }
35
35
  return datum;
36
36
  }
37
+ export const getLineDashArray = (dashStyle, strokeWidth = 2) => {
38
+ const value = dashStyle.toLowerCase();
39
+ const arrayValue = value
40
+ .replace('shortdashdotdot', '3,1,1,1,1,1,')
41
+ .replace('shortdashdot', '3,1,1,1')
42
+ .replace('shortdot', '1,1,')
43
+ .replace('shortdash', '3,1,')
44
+ .replace('longdash', '8,3,')
45
+ .replace(/dot/g, '1,3,')
46
+ .replace('dash', '4,3,')
47
+ .replace(/,$/, '')
48
+ .split(',')
49
+ .map((part) => {
50
+ return `${parseInt(part, 10) * strokeWidth}`;
51
+ });
52
+ return arrayValue.join(',').replace(/NaN/g, 'none');
53
+ };
@@ -6,6 +6,7 @@ export * from './text';
6
6
  export * from './time';
7
7
  export * from './axis';
8
8
  export * from './labels';
9
+ export * from './symbol';
9
10
  export type AxisDirection = 'x' | 'y';
10
11
  export type NodeWithD3Data<T = unknown> = Element & {
11
12
  __data__: T;
@@ -12,6 +12,7 @@ export * from './text';
12
12
  export * from './time';
13
13
  export * from './axis';
14
14
  export * from './labels';
15
+ export * from './symbol';
15
16
  const CHARTS_WITHOUT_AXIS = ['pie'];
16
17
  /**
17
18
  * Checks whether the series should be drawn with axes.
@@ -0,0 +1,5 @@
1
+ import { SymbolType } from '../../../../constants';
2
+ export declare const getSymbolType: (index: number) => SymbolType;
3
+ export declare const getSymbol: (symbolType: SymbolType) => {
4
+ draw: (context: CanvasPath, size: number) => void;
5
+ };
@@ -0,0 +1,36 @@
1
+ import { symbolDiamond2, symbolCircle, symbolSquare, symbolTriangle2 } from 'd3';
2
+ import { SymbolType } from '../../../../constants';
3
+ export const getSymbolType = (index) => {
4
+ const scatterStyles = Object.values(SymbolType);
5
+ return scatterStyles[index % scatterStyles.length];
6
+ };
7
+ // This is an inverted triangle
8
+ // Based on https://github.com/d3/d3-shape/blob/main/src/symbol/triangle2.js
9
+ const sqrt3 = Math.sqrt(3);
10
+ const triangleDown = {
11
+ draw: (context, size) => {
12
+ const s = Math.sqrt(size) * 0.6824;
13
+ const t = s / 2;
14
+ const u = (s * sqrt3) / 2;
15
+ context.moveTo(0, s);
16
+ context.lineTo(u, -t);
17
+ context.lineTo(-u, -t);
18
+ context.closePath();
19
+ },
20
+ };
21
+ export const getSymbol = (symbolType) => {
22
+ switch (symbolType) {
23
+ case SymbolType.Diamond:
24
+ return symbolDiamond2;
25
+ case SymbolType.Circle:
26
+ return symbolCircle;
27
+ case SymbolType.Square:
28
+ return symbolSquare;
29
+ case SymbolType.Triangle:
30
+ return symbolTriangle2;
31
+ case SymbolType.TriangleDown:
32
+ return triangleDown;
33
+ default:
34
+ return symbolCircle;
35
+ }
36
+ };
@@ -1,16 +1,10 @@
1
1
  import get from 'lodash/get';
2
2
  import isEmpty from 'lodash/isEmpty';
3
+ import { SeriesType } from '../../../../constants';
3
4
  import { ChartKitError, CHARTKIT_ERROR_CODE } from '../../../../libs';
4
5
  import { i18n } from '../../../../i18n';
5
6
  import { DEFAULT_AXIS_TYPE } from '../constants';
6
- const AVAILABLE_SERIES_TYPES = [
7
- 'area',
8
- 'bar-x',
9
- 'bar-y',
10
- 'line',
11
- 'pie',
12
- 'scatter',
13
- ];
7
+ const AVAILABLE_SERIES_TYPES = Object.values(SeriesType);
14
8
  const validateXYSeries = (args) => {
15
9
  const { series, xAxis, yAxis } = args;
16
10
  const xType = get(xAxis, 'type', DEFAULT_AXIS_TYPE);
@@ -1155,9 +1155,6 @@ export function prepareConfig(data, options, isMobile, holidays) {
1155
1155
  var _a;
1156
1156
  if (chartType === 'column' || chartType === 'bar') {
1157
1157
  this.series.forEach((seriesItem) => {
1158
- if (!seriesItem.legendItem) {
1159
- return;
1160
- }
1161
1158
  const color = seriesItem.color;
1162
1159
  // The update method updates all series, and therefore,
1163
1160
  // after working out the handleLegendItemMouseOverAndOut,
@@ -1,3 +1,4 @@
1
+ import { SeriesType } from '../../constants';
1
2
  import type { BaseSeries, BaseSeriesData } from './base';
2
3
  import type { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
3
4
  import type { PointMarkerOptions } from './marker';
@@ -24,7 +25,7 @@ export type AreaMarkerOptions = PointMarkerOptions & {
24
25
  symbol?: AreaMarkerSymbol;
25
26
  };
26
27
  export type AreaSeries<T = any> = BaseSeries & {
27
- type: 'area';
28
+ type: typeof SeriesType.Area;
28
29
  data: AreaSeriesData<T>[];
29
30
  /** The name of the series (used in legend, tooltip etc) */
30
31
  name: string;
@@ -1,3 +1,4 @@
1
+ import { SeriesType } from '../../constants';
1
2
  import type { BaseSeries, BaseSeriesData } from './base';
2
3
  import type { ChartKitWidgetSeriesOptions } from './series';
3
4
  import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
@@ -26,7 +27,7 @@ export type BarXSeriesData<T = any> = BaseSeriesData<T> & {
26
27
  label?: string | number;
27
28
  };
28
29
  export type BarXSeries<T = any> = BaseSeries & {
29
- type: 'bar-x';
30
+ type: typeof SeriesType.BarX;
30
31
  data: BarXSeriesData<T>[];
31
32
  /** The name of the series (used in legend, tooltip etc) */
32
33
  name: string;
@@ -1,3 +1,4 @@
1
+ import { SeriesType } from '../../constants';
1
2
  import type { BaseSeries, BaseSeriesData } from './base';
2
3
  import type { ChartKitWidgetSeriesOptions } from './series';
3
4
  import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
@@ -20,7 +21,7 @@ export type BarYSeriesData<T = any> = BaseSeriesData<T> & {
20
21
  label?: string | number;
21
22
  };
22
23
  export type BarYSeries<T = any> = BaseSeries & {
23
- type: 'bar-y';
24
+ type: typeof SeriesType.BarY;
24
25
  data: BarYSeriesData<T>[];
25
26
  /** The name of the series (used in legend, tooltip etc) */
26
27
  name: string;
@@ -0,0 +1,9 @@
1
+ /** The halo appearing around the hovered part of series(point in line-type series or slice in pie charts) */
2
+ export type Halo = {
3
+ /** Enable or disable the halo */
4
+ enabled?: boolean;
5
+ /** The opacity of halo */
6
+ opacity?: number;
7
+ /** The pixel size of the halo. Radius for point markers or width of the outside slice in pie charts. */
8
+ size?: number;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -17,6 +17,7 @@ export * from './line';
17
17
  export * from './series';
18
18
  export * from './title';
19
19
  export * from './tooltip';
20
+ export * from './halo';
20
21
  export type ChartKitWidgetData<T = any> = {
21
22
  chart?: ChartKitWidgetChart;
22
23
  legend?: ChartKitWidgetLegend;
@@ -11,3 +11,4 @@ export * from './line';
11
11
  export * from './series';
12
12
  export * from './title';
13
13
  export * from './tooltip';
14
+ export * from './halo';
@@ -58,3 +58,11 @@ export type PathLegendSymbolOptions = BaseLegendSymbol & {
58
58
  * */
59
59
  width?: number;
60
60
  };
61
+ export type SymbolLegendSymbolOptions = BaseLegendSymbol & {
62
+ /**
63
+ * The pixel width of the symbol for series types that use a symbol in the legend
64
+ *
65
+ * @default 8
66
+ * */
67
+ width?: number;
68
+ };
@@ -1,6 +1,7 @@
1
1
  import type { BaseSeries, BaseSeriesData } from './base';
2
2
  import type { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
3
3
  import type { PointMarkerOptions } from './marker';
4
+ import { DashStyle, LineCap, SeriesType } from '../../constants';
4
5
  export type LineSeriesData<T = any> = BaseSeriesData<T> & {
5
6
  /**
6
7
  * The `x` value of the point. Depending on the context , it may represents:
@@ -24,7 +25,7 @@ export type LineMarkerOptions = PointMarkerOptions & {
24
25
  symbol?: LineMarkerSymbol;
25
26
  };
26
27
  export type LineSeries<T = any> = BaseSeries & {
27
- type: 'line';
28
+ type: typeof SeriesType.Line;
28
29
  data: LineSeriesData<T>[];
29
30
  /** The name of the series (used in legend, tooltip etc) */
30
31
  name: string;
@@ -41,4 +42,8 @@ export type LineSeries<T = any> = BaseSeries & {
41
42
  };
42
43
  /** Options for the point markers of line series */
43
44
  marker?: LineMarkerOptions;
45
+ /** Option for line stroke style */
46
+ dashStyle?: `${DashStyle}`;
47
+ /** Option for line cap style */
48
+ linecap?: `${LineCap}`;
44
49
  };
@@ -8,11 +8,3 @@ export type PointMarkerOptions = {
8
8
  /** The width of the point marker's border */
9
9
  borderWidth?: number;
10
10
  };
11
- export type PointMarkerHalo = {
12
- /** Enable or disable the halo appearing around the point */
13
- enabled?: boolean;
14
- /** The Opacity of the point halo */
15
- opacity?: number;
16
- /** The radius of the point halo */
17
- radius?: number;
18
- };
@@ -1,3 +1,4 @@
1
+ import { SeriesType } from '../../constants';
1
2
  import type { BaseSeries, BaseSeriesData } from './base';
2
3
  import { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
3
4
  export type PieSeriesData<T = any> = BaseSeriesData<T> & {
@@ -13,7 +14,7 @@ export type PieSeriesData<T = any> = BaseSeriesData<T> & {
13
14
  export type ConnectorShape = 'straight-line' | 'polyline';
14
15
  export type ConnectorCurve = 'linear' | 'basic';
15
16
  export type PieSeries<T = any> = BaseSeries & {
16
- type: 'pie';
17
+ type: typeof SeriesType.Pie;
17
18
  data: PieSeriesData<T>[];
18
19
  /**
19
20
  * The color of the border surrounding each segment.
@@ -1,3 +1,4 @@
1
+ import { SeriesType, SymbolType } from '../../constants';
1
2
  import type { BaseSeries, BaseSeriesData } from './base';
2
3
  import type { ChartKitWidgetLegend, RectLegendSymbolOptions } from './legend';
3
4
  export type ScatterSeriesData<T = any> = BaseSeriesData<T> & {
@@ -24,14 +25,14 @@ export type ScatterSeriesData<T = any> = BaseSeriesData<T> & {
24
25
  radius?: number;
25
26
  };
26
27
  export type ScatterSeries<T = any> = BaseSeries & {
27
- type: 'scatter';
28
+ type: typeof SeriesType.Scatter;
28
29
  data: ScatterSeriesData<T>[];
29
30
  /** The name of the series (used in legend, tooltip etc) */
30
31
  name: string;
31
32
  /** The main color of the series (hex, rgba) */
32
33
  color?: string;
33
34
  /** A predefined shape or symbol for the dot */
34
- symbol?: string;
35
+ symbolType?: `${SymbolType}`;
35
36
  /** Individual series legend options. Has higher priority than legend options in widget data */
36
37
  legend?: ChartKitWidgetLegend & {
37
38
  symbol?: RectLegendSymbolOptions;
@@ -4,8 +4,10 @@ import type { ScatterSeries, ScatterSeriesData } from './scatter';
4
4
  import type { BarXSeries, BarXSeriesData } from './bar-x';
5
5
  import type { LineSeries, LineSeriesData, LineMarkerOptions } from './line';
6
6
  import type { BarYSeries, BarYSeriesData } from './bar-y';
7
- import type { PointMarkerOptions, PointMarkerHalo } from './marker';
7
+ import type { PointMarkerOptions } from './marker';
8
8
  import type { AreaSeries, AreaSeriesData } from './area';
9
+ import type { Halo } from './halo';
10
+ import { DashStyle, LineCap } from '../../constants';
9
11
  export type ChartKitWidgetSeries<T = any> = ScatterSeries<T> | PieSeries<T> | BarXSeries<T> | BarYSeries<T> | LineSeries<T> | AreaSeries<T>;
10
12
  export type ChartKitWidgetSeriesData<T = any> = ScatterSeriesData<T> | PieSeriesData<T> | BarXSeriesData<T> | BarYSeriesData<T> | LineSeriesData<T> | AreaSeriesData<T>;
11
13
  export type DataLabelRendererData<T = any> = {
@@ -125,7 +127,10 @@ export type ChartKitWidgetSeriesOptions = {
125
127
  pie?: {
126
128
  /** Options for the series states that provide additional styling information to the series. */
127
129
  states?: {
128
- hover?: BasicHoverState;
130
+ hover?: BasicHoverState & {
131
+ /** Options for the halo appearing outside the hovered slice */
132
+ halo?: Halo;
133
+ };
129
134
  inactive?: BasicInactiveState;
130
135
  };
131
136
  };
@@ -147,13 +152,23 @@ export type ChartKitWidgetSeriesOptions = {
147
152
  hover?: BasicHoverState & {
148
153
  marker?: PointMarkerOptions & {
149
154
  /** Options for the halo appearing around the hovered point */
150
- halo?: PointMarkerHalo;
155
+ halo?: Halo;
151
156
  };
152
157
  };
153
158
  inactive?: BasicInactiveState;
154
159
  };
155
160
  /** Options for the point markers of line series */
156
161
  marker?: LineMarkerOptions;
162
+ /** Options for line style
163
+ *
164
+ * @default 'Solid'
165
+ * */
166
+ dashStyle?: `${DashStyle}`;
167
+ /** Options for line cap style
168
+ *
169
+ * @default 'round' when dashStyle is not 'solid', 'none' when dashStyle is not 'solid'
170
+ * */
171
+ linecap?: `${LineCap}`;
157
172
  };
158
173
  area?: {
159
174
  /** Pixel width of the graph line.
@@ -166,7 +181,7 @@ export type ChartKitWidgetSeriesOptions = {
166
181
  hover?: BasicHoverState & {
167
182
  marker?: PointMarkerOptions & {
168
183
  /** Options for the halo appearing around the hovered point */
169
- halo?: PointMarkerHalo;
184
+ halo?: Halo;
170
185
  };
171
186
  };
172
187
  inactive?: BasicInactiveState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "4.14.0",
3
+ "version": "4.16.0",
4
4
  "description": "React component used to render charts based on any sources you need",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:gravity-ui/ChartKit.git",
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@bem-react/classname": "^1.6.0",
50
50
  "@gravity-ui/date-utils": "^1.4.1",
51
- "@gravity-ui/yagr": "^4.1.0",
51
+ "@gravity-ui/yagr": "^4.1.1",
52
52
  "afterframe": "^1.0.2",
53
53
  "d3": "^7.8.5",
54
54
  "lodash": "^4.17.21",
@@ -120,6 +120,12 @@
120
120
  "lint:prettier": "prettier --check --loglevel=error '**/*.{js,jsx,ts,tsx,scss}'",
121
121
  "lint": "run-p lint:*",
122
122
  "typecheck": "tsc --noEmit",
123
+ "docs:deps": "cd ./documentation && npm ci",
124
+ "docs:start": "cd ./documentation && npm run start",
125
+ "docs:start:ru": "cd ./documentation && npm run start:ru",
126
+ "docs:build": "cd ./documentation && npm run build",
127
+ "docs:serve": "cd ./documentation && npm run serve",
128
+ "docs:deploy": "cd ./documentation && npm run deploy",
123
129
  "prepublishOnly": "npm run build"
124
130
  },
125
131
  "husky": {