@gravity-ui/chartkit 0.9.1 → 0.10.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/CHANGELOG.md +13 -0
- package/build/components/ChartKit.css +23 -0
- package/build/components/ChartKit.d.ts +0 -1
- package/build/components/ChartKit.js +4 -5
- package/build/i18n/keysets/en.json +60 -0
- package/build/i18n/keysets/ru.json +62 -0
- package/build/libs/chartkit-error/chartkit-error.d.ts +1 -0
- package/build/libs/chartkit-error/chartkit-error.js +1 -0
- package/build/libs/settings/__tests__/settings.test.js +1 -1
- package/build/libs/settings/settings.d.ts +6 -3
- package/build/libs/settings/settings.js +4 -2
- package/build/plugins/highcharts/__stories__/AreaRange.stories.d.ts +4 -0
- package/build/plugins/highcharts/__stories__/AreaRange.stories.js +22 -0
- package/build/plugins/highcharts/__stories__/Line.stories.d.ts +4 -0
- package/build/plugins/highcharts/__stories__/Line.stories.js +21 -0
- package/build/plugins/highcharts/__stories__/mocks/area-range.d.ts +2 -0
- package/build/plugins/highcharts/__stories__/mocks/area-range.js +61 -0
- package/build/plugins/highcharts/__stories__/mocks/holidays.d.ts +7070 -0
- package/build/plugins/highcharts/__stories__/mocks/holidays.js +7065 -0
- package/build/plugins/highcharts/__stories__/mocks/line.d.ts +2 -0
- package/build/plugins/highcharts/__stories__/mocks/line.js +129 -0
- package/build/plugins/highcharts/index.d.ts +2 -0
- package/build/plugins/highcharts/index.js +5 -0
- package/build/plugins/highcharts/renderer/HighchartsWidget.d.ts +23 -0
- package/build/plugins/highcharts/renderer/HighchartsWidget.js +6 -0
- package/build/plugins/highcharts/renderer/components/HighchartsComponent.css +4 -0
- package/build/plugins/highcharts/renderer/components/HighchartsComponent.d.ts +575 -0
- package/build/plugins/highcharts/renderer/components/HighchartsComponent.js +115 -0
- package/build/plugins/highcharts/renderer/components/StyledSplitPane/StyledSplitPane.css +50 -0
- package/build/plugins/highcharts/renderer/components/StyledSplitPane/StyledSplitPane.d.ts +10 -0
- package/build/plugins/highcharts/renderer/components/StyledSplitPane/StyledSplitPane.js +32 -0
- package/build/plugins/highcharts/renderer/components/withSplitPane/WithSplitPane.css +4 -0
- package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.d.ts +10 -0
- package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.js +207 -0
- package/build/plugins/highcharts/renderer/helpers/add-holidays.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/add-holidays.js +43 -0
- package/build/plugins/highcharts/renderer/helpers/comments/drawing.d.ts +11 -0
- package/build/plugins/highcharts/renderer/helpers/comments/drawing.js +571 -0
- package/build/plugins/highcharts/renderer/helpers/config/config.d.ts +575 -0
- package/build/plugins/highcharts/renderer/helpers/config/config.js +1483 -0
- package/build/plugins/highcharts/renderer/helpers/config/handleLegendItemClick.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/handleLegendItemClick.js +57 -0
- package/build/plugins/highcharts/renderer/helpers/config/options.d.ts +465 -0
- package/build/plugins/highcharts/renderer/helpers/config/options.js +350 -0
- package/build/plugins/highcharts/renderer/helpers/config/types.d.ts +6 -0
- package/build/plugins/highcharts/renderer/helpers/config/types.js +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.d.ts +10 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.js +42 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.test.js +99 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.js +17 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.test.js +28 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.d.ts +5 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.js +20 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.test.js +27 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/concatStrings.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/concatStrings.js +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getChartKitFormattedValue.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getChartKitFormattedValue.js +15 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.d.ts +3 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.js +15 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.test.js +11 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.js +9 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.test.js +20 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/index.d.ts +13 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/index.js +13 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isNavigatorSeries.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isNavigatorSeries.js +3 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isSafari.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isSafari.js +12 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.js +8 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.test.js +31 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/localStorage.d.ts +5 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/localStorage.js +23 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/mergeArrayWithObject.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/mergeArrayWithObject.js +10 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.js +19 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.test.js +20 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.d.ts +13 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.js +27 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.test.js +45 -0
- package/build/plugins/highcharts/renderer/helpers/constants.d.ts +28 -0
- package/build/plugins/highcharts/renderer/helpers/constants.js +30 -0
- package/build/plugins/highcharts/renderer/helpers/graph.css +89 -0
- package/build/plugins/highcharts/renderer/helpers/graph.d.ts +552 -0
- package/build/plugins/highcharts/renderer/helpers/graph.js +85 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/colors.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/colors.js +17 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/highcharts.d.ts +4 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/highcharts.js +346 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calcucalteClosestPointManually.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calcucalteClosestPointManually.js +19 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calculateClosestPointManually.test.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calculateClosestPointManually.test.js +42 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/utils/index.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/highcharts/utils/index.js +1 -0
- package/build/plugins/highcharts/renderer/helpers/init-highcharts-modules.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/init-highcharts-modules.js +49 -0
- package/build/plugins/highcharts/renderer/helpers/prepare-data.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/prepare-data.js +175 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/constants.d.ts +13 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/constants.js +14 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/helpers.d.ts +1 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/helpers.js +5 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/index.d.ts +13 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/index.js +253 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/index.d.ts +6 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/index.js +22 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashDotLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashDotLineIcon.js +20 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashLineIcon.js +25 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DotLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DotLineIcon.js +20 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotDotLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotDotLineIcon.js +18 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotLineIcon.js +18 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashLineIcon.js +15 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotDotLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotDotLineIcon.js +18 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotLineIcon.js +18 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashLineIcon.js +18 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDotLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDotLineIcon.js +20 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/SolidLineIcon.d.ts +2 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/SolidLineIcon.js +13 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/index.d.ts +11 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/index.js +11 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/types.d.ts +4 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/types.js +1 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/utils.d.ts +7 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/utils.js +5 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/tooltip.css +367 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/types.d.ts +85 -0
- package/build/plugins/highcharts/renderer/helpers/tooltip/types.js +1 -0
- package/build/plugins/highcharts/renderer/helpers/types.d.ts +22 -0
- package/build/plugins/highcharts/renderer/helpers/types.js +1 -0
- package/build/plugins/highcharts/types/comments.d.ts +51 -0
- package/build/plugins/highcharts/types/comments.js +1 -0
- package/build/plugins/highcharts/types/highcharts-extends.d.ts +38 -0
- package/build/plugins/highcharts/types/index.d.ts +4 -0
- package/build/plugins/highcharts/types/index.js +1 -0
- package/build/plugins/highcharts/types/lib.d.ts +1 -0
- package/build/plugins/highcharts/types/lib.js +1 -0
- package/build/plugins/highcharts/types/misc.d.ts +19 -0
- package/build/plugins/highcharts/types/misc.js +1 -0
- package/build/plugins/highcharts/types/widget.d.ts +47 -0
- package/build/plugins/highcharts/types/widget.js +1 -0
- package/build/plugins/index.d.ts +4 -2
- package/build/plugins/index.js +1 -0
- package/build/plugins/indicator/renderer/IndicatorItem.d.ts +3 -2
- package/build/plugins/indicator/renderer/IndicatorWidget.d.ts +10 -2
- package/build/plugins/indicator/renderer/IndicatorWidget.js +1 -1
- package/build/plugins/indicator/types.d.ts +0 -6
- package/build/plugins/shared/format-number/format-number.d.ts +4 -0
- package/build/plugins/shared/format-number/format-number.js +88 -0
- package/build/plugins/shared/format-number/format-number.test.d.ts +1 -0
- package/build/plugins/shared/format-number/format-number.test.js +14 -0
- package/build/plugins/shared/format-number/i18n/en.json +17 -0
- package/build/plugins/shared/format-number/i18n/i18n.d.ts +5 -0
- package/build/plugins/shared/format-number/i18n/i18n.js +8 -0
- package/build/plugins/shared/format-number/i18n/ru.json +17 -0
- package/build/plugins/shared/format-number/types.d.ts +14 -0
- package/build/plugins/shared/format-number/types.js +1 -0
- package/build/plugins/shared/index.d.ts +2 -0
- package/build/plugins/shared/index.js +1 -0
- package/build/plugins/yagr/renderer/YagrWidget.d.ts +11 -3
- package/build/plugins/yagr/renderer/YagrWidget.js +2 -1
- package/build/plugins/yagr/types.d.ts +0 -7
- package/build/types/index.d.ts +1 -2
- package/build/types/misc.d.ts +4 -0
- package/build/types/misc.js +1 -0
- package/build/types/widget.d.ts +17 -0
- package/package.json +4 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Highcharts } from '../../../types';
|
|
2
|
+
import type { TooltipData } from './types';
|
|
3
|
+
import './tooltip.css';
|
|
4
|
+
export declare const SERIES_NAME_DATA_ATTRIBUTE = "data-series-name";
|
|
5
|
+
export declare const SERIES_IDX_DATA_ATTRIBUTE = "data-series-idx";
|
|
6
|
+
export declare const TOOLTIP_CONTAINER_CLASS_NAME = "_tooltip";
|
|
7
|
+
export declare const TOOLTIP_ROW_NAME_CLASS_NANE = "_tooltip-rows__name-td";
|
|
8
|
+
export declare const TOOLTIP_ROW_CLASS_NAME = "_tooltip-row";
|
|
9
|
+
export declare const TOOLTIP_HEADER_CLASS_NAME = "_tooltip-header";
|
|
10
|
+
export declare const TOOLTIP_LIST_CLASS_NAME = "_tooltip-list";
|
|
11
|
+
export declare const TOOLTIP_FOOTER_CLASS_NAME = "_tooltip-footer";
|
|
12
|
+
export declare const formatTooltip: (data: TooltipData, tooltip: Highcharts.Tooltip, isMobile?: boolean | undefined) => string;
|
|
13
|
+
export default formatTooltip;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/* eslint-disable complexity */
|
|
2
|
+
import { escape as _escape, orderBy as _orderBy } from 'lodash';
|
|
3
|
+
import { i18n } from '../../../../../i18n';
|
|
4
|
+
import { renderShapeIcon } from './render-shape-icon';
|
|
5
|
+
import { escapeHTML } from './helpers';
|
|
6
|
+
import './tooltip.css';
|
|
7
|
+
export const SERIES_NAME_DATA_ATTRIBUTE = 'data-series-name';
|
|
8
|
+
export const SERIES_IDX_DATA_ATTRIBUTE = 'data-series-idx';
|
|
9
|
+
export const TOOLTIP_CONTAINER_CLASS_NAME = '_tooltip';
|
|
10
|
+
export const TOOLTIP_ROW_NAME_CLASS_NANE = '_tooltip-rows__name-td';
|
|
11
|
+
export const TOOLTIP_ROW_CLASS_NAME = '_tooltip-row';
|
|
12
|
+
export const TOOLTIP_HEADER_CLASS_NAME = '_tooltip-header';
|
|
13
|
+
export const TOOLTIP_LIST_CLASS_NAME = '_tooltip-list';
|
|
14
|
+
export const TOOLTIP_FOOTER_CLASS_NAME = '_tooltip-footer';
|
|
15
|
+
const renderEmptyCell = () => '<td />';
|
|
16
|
+
const renderColorCell = (line) => `<td class="_tooltip-rows__bubble-td">
|
|
17
|
+
<div class="_tooltip-rows__bubble-div" style="background-color:${line.seriesColor};"></div>
|
|
18
|
+
</td>`;
|
|
19
|
+
const renderLineShapeCell = (line) => `<td class="_tooltip-rows__shape-td">
|
|
20
|
+
<div class="_tooltip-rows__shape-div"
|
|
21
|
+
style="color:${line.seriesColor};">
|
|
22
|
+
${renderShapeIcon({ type: line.seriesShape })}
|
|
23
|
+
</div>
|
|
24
|
+
</td>`;
|
|
25
|
+
const renderNameCell = (line) => `<td class="${TOOLTIP_ROW_NAME_CLASS_NANE}">
|
|
26
|
+
${line.hideSeriesName ? '' : escapeHTML(line.seriesName)}
|
|
27
|
+
</td>`;
|
|
28
|
+
const renderPercentCell = (line) => `<td class="_tooltip-rows__percent-td">
|
|
29
|
+
${line.percentValue ? line.percentValue + '%' : ''}
|
|
30
|
+
</td>`;
|
|
31
|
+
const renderValueCell = (line) => `<td class="_tooltip-rows__value-td">
|
|
32
|
+
${line.value}
|
|
33
|
+
</td>`;
|
|
34
|
+
const renderDiffCell = (line) => `<td class="_tooltip-rows__diff-td">
|
|
35
|
+
${line.diff ? ` (${line.diff})` : ''}
|
|
36
|
+
</td>`;
|
|
37
|
+
const renderAdditionalSection = (data, splitTooltip = false, colspanNumber = 1) => {
|
|
38
|
+
return `<td class="_tooltip-right__td ${splitTooltip ? '_tooltip-right__td_with-split-tooltip' : ''}" colspan="${colspanNumber || 1}">
|
|
39
|
+
${data.holiday
|
|
40
|
+
? `<div class="_tooltip-right__holiday-div">
|
|
41
|
+
<div class="_tooltip-right__holiday-emoji">🎈</div>
|
|
42
|
+
<div>
|
|
43
|
+
${data.holidayText}
|
|
44
|
+
${data.region
|
|
45
|
+
? `<span class="_tooltip-right__holiday-region">[${data.region}]</span>`
|
|
46
|
+
: ''}
|
|
47
|
+
</div>
|
|
48
|
+
</div>`
|
|
49
|
+
: ''}
|
|
50
|
+
|
|
51
|
+
${data.commentDateText
|
|
52
|
+
? `<div class="${data.xComments ? '_tooltip-right__margin-bot' : ''}">${data.commentDateText}</div>`
|
|
53
|
+
: ''}
|
|
54
|
+
|
|
55
|
+
${data.xComments
|
|
56
|
+
? data.xComments
|
|
57
|
+
.map((comment) => `<div class="_tooltip-right__traf-div ${splitTooltip
|
|
58
|
+
? '_tooltip-right__traf-div_for-split-tooltip'
|
|
59
|
+
: ''}" style="border-color: ${comment.color};">${comment.text}</div>`)
|
|
60
|
+
.join('')
|
|
61
|
+
: ''}
|
|
62
|
+
</td>`;
|
|
63
|
+
};
|
|
64
|
+
const renderRow = (line, { isSelectedLine, cellsRenderers, isSingleLine, allowComment, withDarkBackground, rowIndex, }) => {
|
|
65
|
+
const hasComment = line.commentText || line.xyCommentText;
|
|
66
|
+
const needRenderComment = allowComment && hasComment;
|
|
67
|
+
const fullCellsRenderers = cellsRenderers.slice();
|
|
68
|
+
const rowKey = `${String(rowIndex) || ''}-${String(escapeHTML(line.seriesName))
|
|
69
|
+
.slice(0, 20)
|
|
70
|
+
.replace(/(\r\n|\n|\r)/gm, '')}`;
|
|
71
|
+
if (line.insertCellAt) {
|
|
72
|
+
(Object.keys(line.insertCellAt) || []).forEach((index) => {
|
|
73
|
+
fullCellsRenderers.splice(Number(index), 0, renderEmptyCell);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (line.customRender) {
|
|
77
|
+
return `<tr class="${TOOLTIP_ROW_CLASS_NAME}${isSelectedLine ? ' _tooltip-selected-row' : ''}${isSingleLine ? ' _tooltip-uniq-row' : ''}${withDarkBackground ? ' _tooltip-row-dark-bg' : ''}" ${SERIES_NAME_DATA_ATTRIBUTE}="${rowKey}" ${line.seriesIdx ? `${SERIES_IDX_DATA_ATTRIBUTE}="${line.seriesIdx}"` : ''}>
|
|
78
|
+
${line.customRender.trim().indexOf('<td') === 0
|
|
79
|
+
? line.customRender
|
|
80
|
+
: `<td colspan="${cellsRenderers.length}">${line.customRender}</td>`}
|
|
81
|
+
</tr>
|
|
82
|
+
${needRenderComment
|
|
83
|
+
? `<tr class="_tooltip-comment-row${isSelectedLine ? ' _tooltip-selected-row' : ''}${withDarkBackground ? ' _tooltip-row-dark-bg' : ''}">
|
|
84
|
+
<td>
|
|
85
|
+
${line.commentText
|
|
86
|
+
? `<div class="_tooltip-rows__comment-div">${line.commentText}</div>`
|
|
87
|
+
: ''}
|
|
88
|
+
${line.xyCommentText
|
|
89
|
+
? `<div class="_tooltip-rows__comment-div">${line.xyCommentText}</div>`
|
|
90
|
+
: ''}
|
|
91
|
+
</td>
|
|
92
|
+
</tr>`
|
|
93
|
+
: ''}`;
|
|
94
|
+
}
|
|
95
|
+
return `<tr class="${TOOLTIP_ROW_CLASS_NAME}${isSelectedLine ? ' _tooltip-selected-row' : ''}${isSingleLine ? ' _tooltip-uniq-row' : ''}${withDarkBackground ? ' _tooltip-row-dark-bg' : ''}" ${SERIES_NAME_DATA_ATTRIBUTE}="${rowKey}" ${line.seriesIdx ? `${SERIES_IDX_DATA_ATTRIBUTE}="${line.seriesIdx}"` : ''}>
|
|
96
|
+
${fullCellsRenderers
|
|
97
|
+
.map((render, index) => {
|
|
98
|
+
if (line.replaceCellAt && line.replaceCellAt[index]) {
|
|
99
|
+
return typeof line.replaceCellAt[index] === 'string'
|
|
100
|
+
? line.replaceCellAt[index]
|
|
101
|
+
: line.replaceCellAt[index](line);
|
|
102
|
+
}
|
|
103
|
+
else if (line.insertCellAt && line.insertCellAt[index]) {
|
|
104
|
+
return typeof line.insertCellAt[index] === 'string'
|
|
105
|
+
? line.insertCellAt[index]
|
|
106
|
+
: line.insertCellAt[index](line);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return render(line);
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
.join('')}
|
|
113
|
+
</tr>
|
|
114
|
+
|
|
115
|
+
${needRenderComment
|
|
116
|
+
? `<tr class="_tooltip-comment-row${isSelectedLine ? ' _tooltip-selected-row' : ''}${withDarkBackground ? ' _tooltip-row-dark-bg' : ''}">
|
|
117
|
+
<td colspan="4">
|
|
118
|
+
${line.commentText
|
|
119
|
+
? `<div class="_tooltip-rows__comment-div">${line.commentText}</div>`
|
|
120
|
+
: ''}
|
|
121
|
+
${line.xyCommentText
|
|
122
|
+
? `<div class="_tooltip-rows__comment-div">${line.xyCommentText}</div>`
|
|
123
|
+
: ''}
|
|
124
|
+
</td>
|
|
125
|
+
</tr>`
|
|
126
|
+
: ''}`;
|
|
127
|
+
};
|
|
128
|
+
export const formatTooltip = (data, tooltip, isMobile) => {
|
|
129
|
+
var _a, _b, _c;
|
|
130
|
+
const { splitTooltip, activeRowAlwaysFirstInTooltip } = data;
|
|
131
|
+
const selectedLineIndex = data.lines.findIndex(({ selectedSeries }) => selectedSeries);
|
|
132
|
+
const selectedLine = data.lines[selectedLineIndex];
|
|
133
|
+
const lines = data.lines.slice(0, (tooltip.lastVisibleRowIndex || data.lines.length) + 1);
|
|
134
|
+
const sortedLines = _orderBy(lines, ['originalValue'], ['desc']);
|
|
135
|
+
const withShapes = lines.every((line) => line.seriesShape);
|
|
136
|
+
const unsafe = data.unsafe;
|
|
137
|
+
const tooltipHeaderRaw = (_a = data.tooltipHeader) === null || _a === void 0 ? void 0 : _a.trim();
|
|
138
|
+
const tooltipHeaderEscaped = escapeHTML(tooltipHeaderRaw);
|
|
139
|
+
const cellsRenderers = [];
|
|
140
|
+
if (withShapes) {
|
|
141
|
+
cellsRenderers.push(renderLineShapeCell);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
cellsRenderers.push(renderColorCell);
|
|
145
|
+
}
|
|
146
|
+
if (data.shared) {
|
|
147
|
+
cellsRenderers.push(renderNameCell);
|
|
148
|
+
}
|
|
149
|
+
if (data.withPercent) {
|
|
150
|
+
cellsRenderers.push(renderPercentCell);
|
|
151
|
+
}
|
|
152
|
+
cellsRenderers.push(renderValueCell);
|
|
153
|
+
if (data.useCompareFrom) {
|
|
154
|
+
cellsRenderers.push(renderDiffCell);
|
|
155
|
+
}
|
|
156
|
+
const rowRenderingConfig = {
|
|
157
|
+
isSingleLine: lines.length === 1,
|
|
158
|
+
cellsRenderers,
|
|
159
|
+
};
|
|
160
|
+
const rowRenderingConfigForSelectedLine = {
|
|
161
|
+
cellsRenderers,
|
|
162
|
+
useCompareFrom: data.useCompareFrom,
|
|
163
|
+
isSelectedLine: true,
|
|
164
|
+
allowComment: selectedLineIndex > tooltip.lastVisibleRowIndex,
|
|
165
|
+
};
|
|
166
|
+
// @ts-ignore
|
|
167
|
+
const windowHeight = document.body.clientHeight / ((window.visualViewport && window.visualViewport.scale) || 1);
|
|
168
|
+
const tooltipMaxHeight = isMobile && window.innerHeight > window.innerWidth
|
|
169
|
+
? windowHeight - ((_b = tooltip.chart) === null || _b === void 0 ? void 0 : _b.plotSizeY) ||
|
|
170
|
+
((_c = tooltip.yagrChart) === null || _c === void 0 ? void 0 : _c.height) ||
|
|
171
|
+
windowHeight / 2
|
|
172
|
+
: windowHeight - (tooltip.options.padding || 0) * 4;
|
|
173
|
+
function getRowRenderConfig(index) {
|
|
174
|
+
return Object.assign(Object.assign({}, rowRenderingConfig), { rowIndex: index, isSelectedLine: lines.length > 1 && index === selectedLineIndex, withDarkBackground: lines.length > 2 && Boolean(index % 2), allowComment: index !== selectedLineIndex || !rowRenderingConfigForSelectedLine.allowComment });
|
|
175
|
+
}
|
|
176
|
+
let tooltipContainerClassNames = TOOLTIP_CONTAINER_CLASS_NAME;
|
|
177
|
+
if (splitTooltip) {
|
|
178
|
+
tooltipContainerClassNames += ` ${TOOLTIP_CONTAINER_CLASS_NAME}_split-tooltip`;
|
|
179
|
+
}
|
|
180
|
+
return `
|
|
181
|
+
<div class="${tooltipContainerClassNames}" style="${tooltip.preFixationHeight ? `height: ${tooltip.preFixationHeight}px; ` : ''}max-height: ${splitTooltip ? 'auto' : `${tooltipMaxHeight}px`}">
|
|
182
|
+
${tooltipHeaderRaw
|
|
183
|
+
? `<div title="${unsafe ? '' : _escape(tooltipHeaderEscaped)}" class="_tooltip-date">
|
|
184
|
+
${unsafe ? tooltipHeaderRaw : tooltipHeaderEscaped}
|
|
185
|
+
</div>`
|
|
186
|
+
: ''}
|
|
187
|
+
${splitTooltip &&
|
|
188
|
+
(data.holiday || data.commentDateText || (data.xComments && data.xComments.length))
|
|
189
|
+
? `<table border="0" cellpadding="0" cellspacing="0">
|
|
190
|
+
<tbody>
|
|
191
|
+
<tr>
|
|
192
|
+
${renderAdditionalSection(data, true, cellsRenderers.length)}
|
|
193
|
+
</tr>
|
|
194
|
+
</tbody>
|
|
195
|
+
</table>`
|
|
196
|
+
: ''}
|
|
197
|
+
<table border="0" cellpadding="0" cellspacing="0">
|
|
198
|
+
<tr>
|
|
199
|
+
<td class="_tooltip-left__td">
|
|
200
|
+
<table class="_tooltip-rows__table">
|
|
201
|
+
${splitTooltip
|
|
202
|
+
? ''
|
|
203
|
+
: `<thead class=${TOOLTIP_HEADER_CLASS_NAME}>
|
|
204
|
+
${selectedLine &&
|
|
205
|
+
(activeRowAlwaysFirstInTooltip ||
|
|
206
|
+
(tooltip.lastVisibleRowIndex &&
|
|
207
|
+
selectedLineIndex > tooltip.lastVisibleRowIndex))
|
|
208
|
+
? renderRow(selectedLine, rowRenderingConfigForSelectedLine)
|
|
209
|
+
: ''}
|
|
210
|
+
<tr class="_tooltip-fake-row">${Array(cellsRenderers.length)
|
|
211
|
+
.fill('<td></td>')
|
|
212
|
+
.join('')}</tr>
|
|
213
|
+
</thead>`}
|
|
214
|
+
<tbody class="${TOOLTIP_LIST_CLASS_NAME}">
|
|
215
|
+
${sortedLines
|
|
216
|
+
.map((line, index) => renderRow(line, getRowRenderConfig(index)))
|
|
217
|
+
.join('')}
|
|
218
|
+
</tbody>
|
|
219
|
+
${splitTooltip
|
|
220
|
+
? ''
|
|
221
|
+
: `<tbody class="${TOOLTIP_FOOTER_CLASS_NAME}">
|
|
222
|
+
${tooltip.lastVisibleRowIndex && data.hiddenRowsNumber > 0
|
|
223
|
+
? `<tr class="${TOOLTIP_ROW_CLASS_NAME} _hidden-rows-sum${lines.length % 2 ? ' _hidden-rows-sum-dark-bg' : ''}">
|
|
224
|
+
<td colspan="${cellsRenderers.length - 1}" class="_hidden-rows-number">
|
|
225
|
+
${i18n('chartkit', 'tooltip-rest')} ${data.hiddenRowsNumber}
|
|
226
|
+
</td>
|
|
227
|
+
<td class="_hidden-rows-value">${data.hiddenRowsSum}</td>
|
|
228
|
+
</tr>`
|
|
229
|
+
: ''}
|
|
230
|
+
<tr class="_tooltip-fake-row">${Array(cellsRenderers.length)
|
|
231
|
+
.fill('<td></td>')
|
|
232
|
+
.join('')}</tr>
|
|
233
|
+
${data.sum
|
|
234
|
+
? `<tr class="_tooltip-rows__summ-tr">
|
|
235
|
+
<td class="_tooltip-rows__summ-td" colspan="${cellsRenderers.length - 1}">${i18n('chartkit', 'tooltip-sum')}</td>
|
|
236
|
+
<td class="_tooltip-rows__summ-td _tooltip-rows__summ-td-value">
|
|
237
|
+
${data.sum}
|
|
238
|
+
</td>
|
|
239
|
+
</tr>`
|
|
240
|
+
: ''}
|
|
241
|
+
</tbody>`}
|
|
242
|
+
</table>
|
|
243
|
+
</td>
|
|
244
|
+
|
|
245
|
+
${!splitTooltip &&
|
|
246
|
+
(data.holiday || data.commentDateText || (data.xComments && data.xComments.length))
|
|
247
|
+
? renderAdditionalSection(data)
|
|
248
|
+
: ''}
|
|
249
|
+
</tr>
|
|
250
|
+
</table>
|
|
251
|
+
</div>`;
|
|
252
|
+
};
|
|
253
|
+
export default formatTooltip;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LineShapeType } from '../constants';
|
|
2
|
+
import { DashDotLineIcon, DashLineIcon, DotLineIcon, LongDashDotDotLineIcon, LongDashDotLineIcon, LongDashLineIcon, ShortDashDotDotLineIcon, ShortDashDotLineIcon, ShortDashLineIcon, ShortDotLineIcon, SolidLineIcon, } from './template-icons';
|
|
3
|
+
const DEFAULT_ICON_WIDTH = '38px';
|
|
4
|
+
const DEFAULT_ICON_HEIGHT = '2px';
|
|
5
|
+
const TEMPLATE_ICONS = {
|
|
6
|
+
[LineShapeType.DashDot]: DashDotLineIcon,
|
|
7
|
+
[LineShapeType.Dash]: DashLineIcon,
|
|
8
|
+
[LineShapeType.Dot]: DotLineIcon,
|
|
9
|
+
[LineShapeType.LongDashDotDot]: LongDashDotDotLineIcon,
|
|
10
|
+
[LineShapeType.LongDashDot]: LongDashDotLineIcon,
|
|
11
|
+
[LineShapeType.LongDash]: LongDashLineIcon,
|
|
12
|
+
[LineShapeType.ShortDashDotDot]: ShortDashDotDotLineIcon,
|
|
13
|
+
[LineShapeType.ShortDashDot]: ShortDashDotLineIcon,
|
|
14
|
+
[LineShapeType.ShortDash]: ShortDashLineIcon,
|
|
15
|
+
[LineShapeType.ShortDot]: ShortDotLineIcon,
|
|
16
|
+
[LineShapeType.Solid]: SolidLineIcon,
|
|
17
|
+
};
|
|
18
|
+
export const renderShapeIcon = (args) => {
|
|
19
|
+
const { type, width = DEFAULT_ICON_WIDTH, height = DEFAULT_ICON_HEIGHT } = args;
|
|
20
|
+
const templateIcon = type && TEMPLATE_ICONS[type];
|
|
21
|
+
return templateIcon ? templateIcon({ width, height }) : '';
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const DashDotLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `
|
|
5
|
+
<svg
|
|
6
|
+
width="${width}"
|
|
7
|
+
height="${height}"
|
|
8
|
+
fill="none"
|
|
9
|
+
viewBox="0 0 ${parsedWidth} ${parsedHeight}"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M30 2h8V0h-8v2zM8 2h8V0H8v2zM22 2h2V0h-2v2zM0 2h2V0H0v2z"
|
|
16
|
+
fill="currentColor"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
`;
|
|
20
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const DashLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="0 0 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<g clipPath="url(#a)">
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M-5 2h-4V0h4v2zM9 2H1V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm14 0h-8V0h8v2zm10 0h-4V0h4v2z"
|
|
16
|
+
fill="currentColor"
|
|
17
|
+
/>
|
|
18
|
+
</g>
|
|
19
|
+
<defs>
|
|
20
|
+
<clipPath id="a">
|
|
21
|
+
<path fill="#fff" d="M0 0h260v2H0z" />
|
|
22
|
+
</clipPath>
|
|
23
|
+
</defs>
|
|
24
|
+
</svg>`;
|
|
25
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const DotLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="0 0 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<g clipPath="url(#a)" fill="currentColor">
|
|
12
|
+
<path d="M0 0h2v2H0zM8 0h2v2H8zM16 0h2v2h-2zM24 0h2v2h-2zM32 0h2v2h-2z" />
|
|
13
|
+
</g>
|
|
14
|
+
<defs>
|
|
15
|
+
<clipPath id="a">
|
|
16
|
+
<path fill="#fff" d="M0 0h259v2H0z" />
|
|
17
|
+
</clipPath>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>`;
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const LongDashDotDotLineIcon = ({ width, height }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="0 0 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
fillRule="evenodd"
|
|
13
|
+
clipRule="evenodd"
|
|
14
|
+
d="M30 2h16V0H30v2zM-8 2H8V0H-8v2zM22 2h2V0h-2v2zM14 2h2V0h-2v2z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>`;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const LongDashDotLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="0 0 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
fillRule="evenodd"
|
|
13
|
+
clipRule="evenodd"
|
|
14
|
+
d="M26 2h16V0H26v2zM-4 2h16V0H-4v2zM18 2h2V0h-2v2z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>`;
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const LongDashLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="2 2 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<g fill="currentColor">
|
|
12
|
+
<path d="M0 2h16v2H0zM24 2h16v2H24z" />
|
|
13
|
+
</g>
|
|
14
|
+
</svg>`;
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const ShortDashDotDotLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="0 0 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
fillRule="evenodd"
|
|
13
|
+
clipRule="evenodd"
|
|
14
|
+
d="M32 2h6V0h-6v2zM16 2h6V0h-6v2zM28 2h2V0h-2v2zM24 2h2V0h-2v2zM0 2h6V0H0v2zM12 2h2V0h-2v2zM8 2h2V0H8v2z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>`;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const ShortDashDotLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="0 0 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
fillRule="evenodd"
|
|
13
|
+
clipRule="evenodd"
|
|
14
|
+
d="M34 2h6V0h-6v2zM22 2h6V0h-6v2zM30 2h2V0h-2v2zM10 2h6V0h-6v2zM18 2h2V0h-2v2zM-2 2h6V0h-6v2zM6 2h2V0H6v2z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>`;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const ShortDashLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="-2 2 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
fillRule="evenodd"
|
|
13
|
+
clipRule="evenodd"
|
|
14
|
+
d="M-4 4h-3V2h3v2zm8 0h-6V2h6v2zm8 0H6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm8 0h-6V2h6v2zm5 0h-3V2h3v2z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>`;
|
|
18
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const ShortDotLineIcon = ({ height, width }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `
|
|
5
|
+
<svg
|
|
6
|
+
width="${width}"
|
|
7
|
+
height="${height}"
|
|
8
|
+
fill="none"
|
|
9
|
+
viewBox="0 2 ${parsedWidth} ${parsedHeight}"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M-2 4h-1V2h1v2zm4 0H0V2h2v2zm4 0H4V2h2v2zm4 0H8V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm4 0h-2V2h2v2zm3 0h-1V2h1v2z"
|
|
16
|
+
fill="currentColor"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
`;
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getParsedRect } from '../utils';
|
|
2
|
+
export const SolidLineIcon = ({ width, height }) => {
|
|
3
|
+
const { parsedWidth, parsedHeight } = getParsedRect({ width, height });
|
|
4
|
+
return `<svg
|
|
5
|
+
width="${width}"
|
|
6
|
+
height="${height}"
|
|
7
|
+
fill="none"
|
|
8
|
+
viewBox="0 2 ${parsedWidth} ${parsedHeight}"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M38 4H0V2h38v2z" fill="currentColor" />
|
|
12
|
+
</svg>`;
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { DashDotLineIcon } from './DashDotLineIcon';
|
|
2
|
+
export { DashLineIcon } from './DashLineIcon';
|
|
3
|
+
export { DotLineIcon } from './DotLineIcon';
|
|
4
|
+
export { LongDashDotDotLineIcon } from './LongDashDotDotLineIcon';
|
|
5
|
+
export { LongDashDotLineIcon } from './LongDashDotLineIcon';
|
|
6
|
+
export { LongDashLineIcon } from './LongDashLineIcon';
|
|
7
|
+
export { ShortDashDotDotLineIcon } from './ShortDashDotDotLineIcon';
|
|
8
|
+
export { ShortDashDotLineIcon } from './ShortDashDotLineIcon';
|
|
9
|
+
export { ShortDashLineIcon } from './ShortDashLineIcon';
|
|
10
|
+
export { ShortDotLineIcon } from './ShortDotLineIcon';
|
|
11
|
+
export { SolidLineIcon } from './SolidLineIcon';
|
package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { DashDotLineIcon } from './DashDotLineIcon';
|
|
2
|
+
export { DashLineIcon } from './DashLineIcon';
|
|
3
|
+
export { DotLineIcon } from './DotLineIcon';
|
|
4
|
+
export { LongDashDotDotLineIcon } from './LongDashDotDotLineIcon';
|
|
5
|
+
export { LongDashDotLineIcon } from './LongDashDotLineIcon';
|
|
6
|
+
export { LongDashLineIcon } from './LongDashLineIcon';
|
|
7
|
+
export { ShortDashDotDotLineIcon } from './ShortDashDotDotLineIcon';
|
|
8
|
+
export { ShortDashDotLineIcon } from './ShortDashDotLineIcon';
|
|
9
|
+
export { ShortDashLineIcon } from './ShortDashLineIcon';
|
|
10
|
+
export { ShortDotLineIcon } from './ShortDotLineIcon';
|
|
11
|
+
export { SolidLineIcon } from './SolidLineIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const getParsedRect = ({ width, height }) => {
|
|
2
|
+
const parsedWidth = typeof width === 'string' ? Number.parseInt(width, 10) : width;
|
|
3
|
+
const parsedHeight = typeof height === 'string' ? Number.parseInt(height, 10) : height;
|
|
4
|
+
return { parsedWidth, parsedHeight };
|
|
5
|
+
};
|