@gravity-ui/chartkit 5.5.0 → 5.6.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.
- package/build/i18n/keysets/en.json +2 -1
- package/build/i18n/keysets/ru.json +2 -4
- package/build/plugins/d3/examples/area/TwoYAxis.d.ts +2 -0
- package/build/plugins/d3/examples/area/TwoYAxis.js +58 -0
- package/build/plugins/d3/examples/bar-x/TwoYAxis.d.ts +2 -0
- package/build/plugins/d3/examples/bar-x/TwoYAxis.js +58 -0
- package/build/plugins/d3/examples/line/TwoYAxis.d.ts +2 -0
- package/build/plugins/d3/examples/line/TwoYAxis.js +58 -0
- package/build/plugins/d3/examples/mars-weather.d.ts +13 -0
- package/build/plugins/d3/examples/mars-weather.js +1203 -0
- package/build/plugins/d3/examples/scatter/TwoYAxis.d.ts +2 -0
- package/build/plugins/d3/examples/scatter/TwoYAxis.js +58 -0
- package/build/plugins/d3/renderer/components/AxisY.d.ts +1 -1
- package/build/plugins/d3/renderer/components/AxisY.js +112 -79
- package/build/plugins/d3/renderer/components/Chart.js +4 -3
- package/build/plugins/d3/renderer/hooks/useAxisScales/index.d.ts +1 -1
- package/build/plugins/d3/renderer/hooks/useAxisScales/index.js +8 -1
- package/build/plugins/d3/renderer/hooks/useChartDimensions/utils.d.ts +1 -0
- package/build/plugins/d3/renderer/hooks/useChartDimensions/utils.js +11 -10
- package/build/plugins/d3/renderer/hooks/useChartOptions/types.d.ts +1 -0
- package/build/plugins/d3/renderer/hooks/useChartOptions/x-axis.js +1 -0
- package/build/plugins/d3/renderer/hooks/useChartOptions/y-axis.js +56 -50
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.d.ts +1 -1
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.js +1 -0
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-bar-x.js +1 -0
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-legend.js +3 -3
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-line.d.ts +1 -1
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-line.js +1 -0
- package/build/plugins/d3/renderer/hooks/useSeries/prepare-scatter.js +1 -0
- package/build/plugins/d3/renderer/hooks/useSeries/types.d.ts +4 -0
- package/build/plugins/d3/renderer/hooks/useShapes/area/prepare-data.d.ts +2 -1
- package/build/plugins/d3/renderer/hooks/useShapes/area/prepare-data.js +7 -6
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/prepare-data.d.ts +2 -1
- package/build/plugins/d3/renderer/hooks/useShapes/bar-x/prepare-data.js +4 -4
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/prepare-data.d.ts +1 -1
- package/build/plugins/d3/renderer/hooks/useShapes/bar-y/prepare-data.js +1 -1
- package/build/plugins/d3/renderer/hooks/useShapes/index.d.ts +1 -1
- package/build/plugins/d3/renderer/hooks/useShapes/index.js +3 -1
- package/build/plugins/d3/renderer/hooks/useShapes/line/prepare-data.d.ts +1 -1
- package/build/plugins/d3/renderer/hooks/useShapes/line/prepare-data.js +2 -1
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.d.ts +2 -2
- package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.js +5 -2
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/prepare-data.d.ts +1 -1
- package/build/plugins/d3/renderer/hooks/useShapes/waterfall/prepare-data.js +1 -1
- package/build/plugins/d3/renderer/utils/text.js +1 -1
- package/build/plugins/d3/renderer/validation/index.js +13 -4
- package/build/plugins/d3/utils/pie-center-text.js +1 -1
- package/build/types/widget-data/area.d.ts +2 -0
- package/build/types/widget-data/bar-x.d.ts +2 -0
- package/build/types/widget-data/line.d.ts +2 -0
- package/build/types/widget-data/scatter.d.ts +2 -0
- package/package.json +2 -1
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"label_invalid-series-type": "It seems you haven't defined \"series.type\" property, or defined it incorrectly. Available values: [{{types}}].",
|
|
37
37
|
"label_invalid-series-property": "It seems you are trying to use inappropriate value for \"{{key}}\", or defined it incorrectly. Available values: [{{values}}].",
|
|
38
38
|
"label_invalid-treemap-redundant-value": "It seems you are trying to set \"value\" for container node. Check node with this properties: { id: \"{{id}}\", name: \"{{name}}\" }",
|
|
39
|
-
"label_invalid-treemap-missing-value": "It seems you are trying to use node without \"value\". Check node with this properties: { id: \"{{id}}\", name: \"{{name}}\" }"
|
|
39
|
+
"label_invalid-treemap-missing-value": "It seems you are trying to use node without \"value\". Check node with this properties: { id: \"{{id}}\", name: \"{{name}}\" }",
|
|
40
|
+
"label_invalid-y-axis-index": "It seems you are trying to use inappropriate index for Y axis: \"{{index}}\""
|
|
40
41
|
},
|
|
41
42
|
"highcharts": {
|
|
42
43
|
"reset-zoom-title": "Reset zoom",
|
|
@@ -7,13 +7,10 @@
|
|
|
7
7
|
"error": "Ошибка",
|
|
8
8
|
"legend-series-hide": "Скрыть все линии",
|
|
9
9
|
"legend-series-show": "Показать все линии",
|
|
10
|
-
|
|
11
10
|
"loading": "Загрузка",
|
|
12
|
-
|
|
13
11
|
"tooltip-point-format-size": "Размер",
|
|
14
12
|
"tooltip-sum": "Сумма",
|
|
15
13
|
"tooltip-rest": "Остальные",
|
|
16
|
-
|
|
17
14
|
"error-incorrect-key-value-intro": "Некорректный формат объекта переданного как значение в",
|
|
18
15
|
"error-incorrect-key": ", ключи объекта должны быть преобразуемы в целое число",
|
|
19
16
|
"error-incorrect-value": ", значением объекта может быть либо строка, либо функция возвращающая строку"
|
|
@@ -38,7 +35,8 @@
|
|
|
38
35
|
"label_invalid-series-type": "Похоже, что вы не указали значение \"series.type\" или указали его неверно. Доступные значения: [{{types}}].",
|
|
39
36
|
"label_invalid-series-property": "Похоже, что вы пытаетесь использовать недопустимое значение для \"{{key}}\", или указали его неверно. Доступные значения: [{{values}}].",
|
|
40
37
|
"label_invalid-treemap-redundant-value": "Похоже, что вы пытаетесь установить значение \"value\" для узла, используемого в качестве контейнера. Проверьте узел с этими свойствами: { id: \"{{id}}\", name: \"{{name}}\" }",
|
|
41
|
-
"label_invalid-treemap-missing-value": "Похоже, что вы пытаетесь использовать узел без значения \"value\". Проверьте узел с этими свойствами: { id: \"{{id}}\", name: \"{{name}}\" }"
|
|
38
|
+
"label_invalid-treemap-missing-value": "Похоже, что вы пытаетесь использовать узел без значения \"value\". Проверьте узел с этими свойствами: { id: \"{{id}}\", name: \"{{name}}\" }",
|
|
39
|
+
"label_invalid-y-axis-index": "Похоже, что вы пытаетесь использовать некорректный индекс для оси Y: \"{{index}}\""
|
|
42
40
|
},
|
|
43
41
|
"highcharts": {
|
|
44
42
|
"reset-zoom-title": "Сбросить увеличение",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { dateTime } from '@gravity-ui/date-utils';
|
|
3
|
+
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
+
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
+
import marsWeatherData from '../mars-weather';
|
|
6
|
+
export const TwoYAxis = () => {
|
|
7
|
+
const data = marsWeatherData;
|
|
8
|
+
const pressureData = data.map((d) => ({
|
|
9
|
+
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
10
|
+
y: d.pressure,
|
|
11
|
+
}));
|
|
12
|
+
const tempData = data.map((d) => ({
|
|
13
|
+
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
14
|
+
y: d.max_temp - d.min_temp,
|
|
15
|
+
}));
|
|
16
|
+
const widgetData = {
|
|
17
|
+
series: {
|
|
18
|
+
data: [
|
|
19
|
+
{
|
|
20
|
+
type: 'area',
|
|
21
|
+
data: pressureData,
|
|
22
|
+
name: 'Pressure',
|
|
23
|
+
yAxis: 0,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'area',
|
|
27
|
+
data: tempData,
|
|
28
|
+
name: 'Temperature range',
|
|
29
|
+
yAxis: 1,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
yAxis: [
|
|
34
|
+
{
|
|
35
|
+
title: {
|
|
36
|
+
text: 'Pressure',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: {
|
|
41
|
+
text: 'Temperature range',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
xAxis: {
|
|
46
|
+
type: 'datetime',
|
|
47
|
+
title: {
|
|
48
|
+
text: 'Terrestrial date',
|
|
49
|
+
},
|
|
50
|
+
ticks: { pixelInterval: 200 },
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
text: 'Mars weather',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
return (React.createElement(ExampleWrapper, null,
|
|
57
|
+
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
58
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { dateTime } from '@gravity-ui/date-utils';
|
|
3
|
+
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
+
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
+
import marsWeatherData from '../mars-weather';
|
|
6
|
+
export const TwoYAxis = () => {
|
|
7
|
+
const data = marsWeatherData;
|
|
8
|
+
const pressureData = data.map((d) => ({
|
|
9
|
+
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
10
|
+
y: d.pressure,
|
|
11
|
+
}));
|
|
12
|
+
const tempData = data.map((d) => ({
|
|
13
|
+
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
14
|
+
y: d.max_temp - d.min_temp,
|
|
15
|
+
}));
|
|
16
|
+
const widgetData = {
|
|
17
|
+
series: {
|
|
18
|
+
data: [
|
|
19
|
+
{
|
|
20
|
+
type: 'bar-x',
|
|
21
|
+
data: pressureData,
|
|
22
|
+
name: 'Pressure',
|
|
23
|
+
yAxis: 0,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'bar-x',
|
|
27
|
+
data: tempData,
|
|
28
|
+
name: 'Temperature range',
|
|
29
|
+
yAxis: 1,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
yAxis: [
|
|
34
|
+
{
|
|
35
|
+
title: {
|
|
36
|
+
text: 'Pressure',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: {
|
|
41
|
+
text: 'Temperature range',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
xAxis: {
|
|
46
|
+
type: 'datetime',
|
|
47
|
+
title: {
|
|
48
|
+
text: 'Terrestrial date',
|
|
49
|
+
},
|
|
50
|
+
ticks: { pixelInterval: 200 },
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
text: 'Mars weather',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
return (React.createElement(ExampleWrapper, null,
|
|
57
|
+
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
58
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { dateTime } from '@gravity-ui/date-utils';
|
|
3
|
+
import { ChartKit } from '../../../../components/ChartKit';
|
|
4
|
+
import { ExampleWrapper } from '../ExampleWrapper';
|
|
5
|
+
import marsWeatherData from '../mars-weather';
|
|
6
|
+
export const TwoYAxis = () => {
|
|
7
|
+
const data = marsWeatherData;
|
|
8
|
+
const minTempData = data.map((d) => ({
|
|
9
|
+
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
10
|
+
y: d.min_temp,
|
|
11
|
+
}));
|
|
12
|
+
const maxTempData = data.map((d) => ({
|
|
13
|
+
x: dateTime({ input: d.terrestrial_date, format: 'YYYY-MM-DD' }).valueOf(),
|
|
14
|
+
y: d.max_temp,
|
|
15
|
+
}));
|
|
16
|
+
const widgetData = {
|
|
17
|
+
series: {
|
|
18
|
+
data: [
|
|
19
|
+
{
|
|
20
|
+
type: 'line',
|
|
21
|
+
data: minTempData,
|
|
22
|
+
name: 'Min Temperature',
|
|
23
|
+
yAxis: 0,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'line',
|
|
27
|
+
data: maxTempData,
|
|
28
|
+
name: 'Max Temperature',
|
|
29
|
+
yAxis: 1,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
yAxis: [
|
|
34
|
+
{
|
|
35
|
+
title: {
|
|
36
|
+
text: 'Min',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: {
|
|
41
|
+
text: 'Max',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
xAxis: {
|
|
46
|
+
type: 'datetime',
|
|
47
|
+
title: {
|
|
48
|
+
text: 'Terrestrial date',
|
|
49
|
+
},
|
|
50
|
+
ticks: { pixelInterval: 200 },
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
text: 'Mars weather',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
return (React.createElement(ExampleWrapper, null,
|
|
57
|
+
React.createElement(ChartKit, { type: "d3", data: widgetData })));
|
|
58
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
id: string;
|
|
3
|
+
terrestrial_date: string;
|
|
4
|
+
sol: number;
|
|
5
|
+
ls: number;
|
|
6
|
+
season: string;
|
|
7
|
+
min_temp: number;
|
|
8
|
+
max_temp: number;
|
|
9
|
+
pressure: number;
|
|
10
|
+
wind_speed: null;
|
|
11
|
+
atmo_opacity: string;
|
|
12
|
+
}[];
|
|
13
|
+
export default _default;
|