@gravity-ui/chartkit 4.23.0 → 4.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,9 +28,9 @@ const D3Widget = React.forwardRef(function D3Widget(props, forwardedRef) {
28
28
  }, [handleResize]);
29
29
  React.useImperativeHandle(forwardedRef, () => ({
30
30
  reflow() {
31
- handleResize();
31
+ debuncedHandleResize();
32
32
  },
33
- }), [handleResize]);
33
+ }), [debuncedHandleResize]);
34
34
  React.useEffect(() => {
35
35
  const selection = select(window);
36
36
  // https://github.com/d3/d3-selection/blob/main/README.md#handling-events
@@ -43,8 +43,8 @@ const D3Widget = React.forwardRef(function D3Widget(props, forwardedRef) {
43
43
  }, [debuncedHandleResize]);
44
44
  React.useEffect(() => {
45
45
  // dimensions initialize
46
- handleResize();
47
- }, [handleResize]);
46
+ debuncedHandleResize();
47
+ }, [debuncedHandleResize]);
48
48
  if (validatedData.current !== data) {
49
49
  validateData(data);
50
50
  validatedData.current = data;
@@ -1,3 +1,7 @@
1
+ .chartkit-d3 {
2
+ position: absolute;
3
+ }
4
+
1
5
  .chartkit-d3-axis .domain {
2
6
  stroke: var(--g-color-line-generic-active);
3
7
  }
@@ -1056,21 +1056,24 @@ function drillOnClick(event, { options, chartType }) {
1056
1056
  }
1057
1057
  const drillDownFilters = filters.map((filter, index) => {
1058
1058
  if (level === index) {
1059
+ const point = event.point;
1060
+ const series = point.series;
1059
1061
  if (isColorDrillDown) {
1060
- return event.point.series.name;
1062
+ return series.name;
1061
1063
  }
1062
- let drillDownFilter = event.point.options.drillDownFilterValue ||
1063
- event.point.category ||
1064
- event.point.name;
1064
+ let drillDownFilter = point.options.drillDownFilterValue || point.category || point.name;
1065
1065
  const isDateTime = chartType !== 'pie' &&
1066
- event.point.series.userOptions.type !== 'pie' &&
1067
- event.point.series.xAxis.options.type === 'datetime';
1066
+ series.userOptions.type !== 'pie' &&
1067
+ series.xAxis.options.type === 'datetime';
1068
1068
  if (isDateTime) {
1069
1069
  drillDownFilter =
1070
1070
  chartType === 'scatter' ? drillDownFilter - 180 * 60 * 1000 : drillDownFilter;
1071
1071
  }
1072
+ const dateTimeFormat = get(options.drillDownData, 'dateFormat', 'YYYY-MM-DD');
1073
+ const useUTC = get(series, 'chart.time.useUTC');
1074
+ const dateTimeOptions = useUTC ? { timeZone: 'UTC' } : {};
1072
1075
  return isDateTime
1073
- ? dateTime({ input: drillDownFilter }).format('YYYY-MM-DD')
1076
+ ? dateTime(Object.assign({ input: drillDownFilter }, dateTimeOptions)).format(dateTimeFormat)
1074
1077
  : drillDownFilter;
1075
1078
  }
1076
1079
  return filter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "4.23.0",
3
+ "version": "4.23.2",
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",