@techie_doubts/tui.chart.2026 4.6.1
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/README.md +165 -0
- package/dist/esm/animator.d.ts +32 -0
- package/dist/esm/animator.js +102 -0
- package/dist/esm/brushes/axis.d.ts +3 -0
- package/dist/esm/brushes/axis.js +21 -0
- package/dist/esm/brushes/basic.d.ts +9 -0
- package/dist/esm/brushes/basic.js +95 -0
- package/dist/esm/brushes/boxPlot.d.ts +2 -0
- package/dist/esm/brushes/boxPlot.js +22 -0
- package/dist/esm/brushes/circleLegend.d.ts +2 -0
- package/dist/esm/brushes/circleLegend.js +26 -0
- package/dist/esm/brushes/dataLabel.d.ts +6 -0
- package/dist/esm/brushes/dataLabel.js +176 -0
- package/dist/esm/brushes/exportMenu.d.ts +2 -0
- package/dist/esm/brushes/exportMenu.js +55 -0
- package/dist/esm/brushes/gauge.d.ts +2 -0
- package/dist/esm/brushes/gauge.js +39 -0
- package/dist/esm/brushes/label.d.ts +34 -0
- package/dist/esm/brushes/label.js +165 -0
- package/dist/esm/brushes/legend.d.ts +7 -0
- package/dist/esm/brushes/legend.js +162 -0
- package/dist/esm/brushes/lineSeries.d.ts +5 -0
- package/dist/esm/brushes/lineSeries.js +41 -0
- package/dist/esm/brushes/polygon.d.ts +2 -0
- package/dist/esm/brushes/polygon.js +24 -0
- package/dist/esm/brushes/resetButton.d.ts +3 -0
- package/dist/esm/brushes/resetButton.js +112 -0
- package/dist/esm/brushes/scatterSeries.d.ts +2 -0
- package/dist/esm/brushes/scatterSeries.js +125 -0
- package/dist/esm/brushes/sector.d.ts +2 -0
- package/dist/esm/brushes/sector.js +54 -0
- package/dist/esm/brushes/spectrumLegend.d.ts +14 -0
- package/dist/esm/brushes/spectrumLegend.js +199 -0
- package/dist/esm/charts/areaChart.d.ts +254 -0
- package/dist/esm/charts/areaChart.js +358 -0
- package/dist/esm/charts/barChart.d.ts +203 -0
- package/dist/esm/charts/barChart.js +300 -0
- package/dist/esm/charts/boxPlotChart.d.ts +209 -0
- package/dist/esm/charts/boxPlotChart.js +288 -0
- package/dist/esm/charts/bubbleChart.d.ts +188 -0
- package/dist/esm/charts/bubbleChart.js +263 -0
- package/dist/esm/charts/bulletChart.d.ts +199 -0
- package/dist/esm/charts/bulletChart.js +278 -0
- package/dist/esm/charts/chart.d.ts +133 -0
- package/dist/esm/charts/chart.js +484 -0
- package/dist/esm/charts/columnChart.d.ts +205 -0
- package/dist/esm/charts/columnChart.js +299 -0
- package/dist/esm/charts/columnLineChart.d.ts +271 -0
- package/dist/esm/charts/columnLineChart.js +386 -0
- package/dist/esm/charts/gaugeChart.d.ts +191 -0
- package/dist/esm/charts/gaugeChart.js +279 -0
- package/dist/esm/charts/heatmapChart.d.ts +199 -0
- package/dist/esm/charts/heatmapChart.js +292 -0
- package/dist/esm/charts/lineAreaChart.d.ts +271 -0
- package/dist/esm/charts/lineAreaChart.js +374 -0
- package/dist/esm/charts/lineChart.d.ts +253 -0
- package/dist/esm/charts/lineChart.js +360 -0
- package/dist/esm/charts/lineScatterChart.d.ts +200 -0
- package/dist/esm/charts/lineScatterChart.js +285 -0
- package/dist/esm/charts/nestedPieChart.d.ts +192 -0
- package/dist/esm/charts/nestedPieChart.js +268 -0
- package/dist/esm/charts/pieChart.d.ts +156 -0
- package/dist/esm/charts/pieChart.js +224 -0
- package/dist/esm/charts/radarChart.d.ts +169 -0
- package/dist/esm/charts/radarChart.js +240 -0
- package/dist/esm/charts/radialBarChart.d.ts +172 -0
- package/dist/esm/charts/radialBarChart.js +251 -0
- package/dist/esm/charts/scatterChart.d.ts +184 -0
- package/dist/esm/charts/scatterChart.js +279 -0
- package/dist/esm/charts/treemapChart.d.ts +166 -0
- package/dist/esm/charts/treemapChart.js +239 -0
- package/dist/esm/component/areaSeries.d.ts +96 -0
- package/dist/esm/component/areaSeries.js +474 -0
- package/dist/esm/component/axis.d.ts +40 -0
- package/dist/esm/component/axis.js +176 -0
- package/dist/esm/component/axisTitle.d.ts +25 -0
- package/dist/esm/component/axisTitle.js +67 -0
- package/dist/esm/component/axisUsingCenterY.d.ts +32 -0
- package/dist/esm/component/axisUsingCenterY.js +175 -0
- package/dist/esm/component/backButton.d.ts +13 -0
- package/dist/esm/component/backButton.js +26 -0
- package/dist/esm/component/background.d.ts +10 -0
- package/dist/esm/component/background.js +15 -0
- package/dist/esm/component/boxPlotSeries.d.ts +126 -0
- package/dist/esm/component/boxPlotSeries.js +410 -0
- package/dist/esm/component/boxSeries.d.ts +211 -0
- package/dist/esm/component/boxSeries.js +603 -0
- package/dist/esm/component/boxStackSeries.d.ts +62 -0
- package/dist/esm/component/boxStackSeries.js +447 -0
- package/dist/esm/component/bubbleSeries.d.ts +35 -0
- package/dist/esm/component/bubbleSeries.js +174 -0
- package/dist/esm/component/bulletSeries.d.ts +89 -0
- package/dist/esm/component/bulletSeries.js +392 -0
- package/dist/esm/component/circleLegend.d.ts +10 -0
- package/dist/esm/component/circleLegend.js +37 -0
- package/dist/esm/component/component.d.ts +64 -0
- package/dist/esm/component/component.js +170 -0
- package/dist/esm/component/componentManager.d.ts +23 -0
- package/dist/esm/component/componentManager.js +45 -0
- package/dist/esm/component/dataLabels.d.ts +23 -0
- package/dist/esm/component/dataLabels.js +134 -0
- package/dist/esm/component/exportMenu.d.ts +38 -0
- package/dist/esm/component/exportMenu.js +147 -0
- package/dist/esm/component/gaugeSeries.d.ts +160 -0
- package/dist/esm/component/gaugeSeries.js +447 -0
- package/dist/esm/component/heatmapSeries.d.ts +64 -0
- package/dist/esm/component/heatmapSeries.js +152 -0
- package/dist/esm/component/hoveredSeries.d.ts +27 -0
- package/dist/esm/component/hoveredSeries.js +95 -0
- package/dist/esm/component/legend.d.ts +26 -0
- package/dist/esm/component/legend.js +149 -0
- package/dist/esm/component/lineSeries.d.ts +69 -0
- package/dist/esm/component/lineSeries.js +319 -0
- package/dist/esm/component/noDataText.d.ts +9 -0
- package/dist/esm/component/noDataText.js +31 -0
- package/dist/esm/component/pieSeries.d.ts +137 -0
- package/dist/esm/component/pieSeries.js +390 -0
- package/dist/esm/component/plot.d.ts +37 -0
- package/dist/esm/component/plot.js +163 -0
- package/dist/esm/component/radarSeries.d.ts +85 -0
- package/dist/esm/component/radarSeries.js +222 -0
- package/dist/esm/component/radialAxis.d.ts +26 -0
- package/dist/esm/component/radialAxis.js +210 -0
- package/dist/esm/component/radialBarSeries.d.ts +111 -0
- package/dist/esm/component/radialBarSeries.js +349 -0
- package/dist/esm/component/radialPlot.d.ts +55 -0
- package/dist/esm/component/radialPlot.js +188 -0
- package/dist/esm/component/rangeSelection.d.ts +61 -0
- package/dist/esm/component/rangeSelection.js +150 -0
- package/dist/esm/component/resetButton.d.ts +13 -0
- package/dist/esm/component/resetButton.js +26 -0
- package/dist/esm/component/scatterSeries.d.ts +34 -0
- package/dist/esm/component/scatterSeries.js +159 -0
- package/dist/esm/component/selectedSeries.d.ts +26 -0
- package/dist/esm/component/selectedSeries.js +109 -0
- package/dist/esm/component/spectrumLegend.d.ts +15 -0
- package/dist/esm/component/spectrumLegend.js +76 -0
- package/dist/esm/component/title.d.ts +12 -0
- package/dist/esm/component/title.js +53 -0
- package/dist/esm/component/tooltip.d.ts +41 -0
- package/dist/esm/component/tooltip.js +131 -0
- package/dist/esm/component/treemapSeries.d.ts +57 -0
- package/dist/esm/component/treemapSeries.js +191 -0
- package/dist/esm/component/zeroAxis.d.ts +9 -0
- package/dist/esm/component/zeroAxis.js +49 -0
- package/dist/esm/eventEmitter.d.ts +8 -0
- package/dist/esm/eventEmitter.js +15 -0
- package/dist/esm/helpers/arrayUtil.d.ts +10 -0
- package/dist/esm/helpers/arrayUtil.js +54 -0
- package/dist/esm/helpers/axes.d.ts +67 -0
- package/dist/esm/helpers/axes.js +345 -0
- package/dist/esm/helpers/boxSeries.d.ts +5 -0
- package/dist/esm/helpers/boxSeries.js +71 -0
- package/dist/esm/helpers/calculator.d.ts +19 -0
- package/dist/esm/helpers/calculator.js +153 -0
- package/dist/esm/helpers/color.d.ts +153 -0
- package/dist/esm/helpers/color.js +218 -0
- package/dist/esm/helpers/colorSpectrum.d.ts +5 -0
- package/dist/esm/helpers/colorSpectrum.js +17 -0
- package/dist/esm/helpers/coordinate.d.ts +9 -0
- package/dist/esm/helpers/coordinate.js +51 -0
- package/dist/esm/helpers/dataLabels.d.ts +36 -0
- package/dist/esm/helpers/dataLabels.js +405 -0
- package/dist/esm/helpers/dom.d.ts +2 -0
- package/dist/esm/helpers/dom.js +8 -0
- package/dist/esm/helpers/downloader.d.ts +7 -0
- package/dist/esm/helpers/downloader.js +287 -0
- package/dist/esm/helpers/formatDate.d.ts +16 -0
- package/dist/esm/helpers/formatDate.js +140 -0
- package/dist/esm/helpers/geometric.d.ts +3 -0
- package/dist/esm/helpers/geometric.js +35 -0
- package/dist/esm/helpers/googleAnalytics.d.ts +1 -0
- package/dist/esm/helpers/googleAnalytics.js +39 -0
- package/dist/esm/helpers/htmlSanitizer.d.ts +1 -0
- package/dist/esm/helpers/htmlSanitizer.js +86 -0
- package/dist/esm/helpers/legend.d.ts +9 -0
- package/dist/esm/helpers/legend.js +47 -0
- package/dist/esm/helpers/pieSeries.d.ts +15 -0
- package/dist/esm/helpers/pieSeries.js +72 -0
- package/dist/esm/helpers/plot.d.ts +2 -0
- package/dist/esm/helpers/plot.js +4 -0
- package/dist/esm/helpers/radarSeries.d.ts +1 -0
- package/dist/esm/helpers/radarSeries.js +7 -0
- package/dist/esm/helpers/range.d.ts +6 -0
- package/dist/esm/helpers/range.js +16 -0
- package/dist/esm/helpers/responders.d.ts +37 -0
- package/dist/esm/helpers/responders.js +197 -0
- package/dist/esm/helpers/sector.d.ts +55 -0
- package/dist/esm/helpers/sector.js +117 -0
- package/dist/esm/helpers/squarifier.d.ts +8 -0
- package/dist/esm/helpers/squarifier.js +110 -0
- package/dist/esm/helpers/style.d.ts +14 -0
- package/dist/esm/helpers/style.js +48 -0
- package/dist/esm/helpers/theme.d.ts +58 -0
- package/dist/esm/helpers/theme.js +557 -0
- package/dist/esm/helpers/tooltip.d.ts +2 -0
- package/dist/esm/helpers/tooltip.js +18 -0
- package/dist/esm/helpers/tooltipTemplate.d.ts +21 -0
- package/dist/esm/helpers/tooltipTemplate.js +147 -0
- package/dist/esm/helpers/utils.d.ts +42 -0
- package/dist/esm/helpers/utils.js +268 -0
- package/dist/esm/helpers/validation.d.ts +6 -0
- package/dist/esm/helpers/validation.js +16 -0
- package/dist/esm/index.d.ts +40 -0
- package/dist/esm/index.js +75 -0
- package/dist/esm/message.d.ts +11 -0
- package/dist/esm/message.js +11 -0
- package/dist/esm/painter.d.ts +27 -0
- package/dist/esm/painter.js +88 -0
- package/dist/esm/responderDetectors.d.ts +6 -0
- package/dist/esm/responderDetectors.js +124 -0
- package/dist/esm/scale/coordinateScaleCalculator.d.ts +24 -0
- package/dist/esm/scale/coordinateScaleCalculator.js +174 -0
- package/dist/esm/scale/datetimeScaleCalculator.d.ts +20 -0
- package/dist/esm/scale/datetimeScaleCalculator.js +59 -0
- package/dist/esm/store/axes.d.ts +30 -0
- package/dist/esm/store/axes.js +282 -0
- package/dist/esm/store/category.d.ts +4 -0
- package/dist/esm/store/category.js +73 -0
- package/dist/esm/store/colorValueScale.d.ts +3 -0
- package/dist/esm/store/colorValueScale.js +56 -0
- package/dist/esm/store/dataRange.d.ts +4 -0
- package/dist/esm/store/dataRange.js +170 -0
- package/dist/esm/store/gaugeAxes.d.ts +4 -0
- package/dist/esm/store/gaugeAxes.js +175 -0
- package/dist/esm/store/heatmapAxes.d.ts +3 -0
- package/dist/esm/store/heatmapAxes.js +98 -0
- package/dist/esm/store/heatmapSeriesData.d.ts +3 -0
- package/dist/esm/store/heatmapSeriesData.js +34 -0
- package/dist/esm/store/layout.d.ts +12 -0
- package/dist/esm/store/layout.js +487 -0
- package/dist/esm/store/legend.d.ts +3 -0
- package/dist/esm/store/legend.js +435 -0
- package/dist/esm/store/nestedPieSeriesData.d.ts +3 -0
- package/dist/esm/store/nestedPieSeriesData.js +49 -0
- package/dist/esm/store/options.d.ts +3 -0
- package/dist/esm/store/options.js +62 -0
- package/dist/esm/store/plot.d.ts +3 -0
- package/dist/esm/store/plot.js +102 -0
- package/dist/esm/store/radialAxes.d.ts +8 -0
- package/dist/esm/store/radialAxes.js +199 -0
- package/dist/esm/store/reactive.d.ts +11 -0
- package/dist/esm/store/reactive.js +196 -0
- package/dist/esm/store/root.d.ts +3 -0
- package/dist/esm/store/root.js +46 -0
- package/dist/esm/store/scale.d.ts +3 -0
- package/dist/esm/store/scale.js +102 -0
- package/dist/esm/store/seriesData.d.ts +3 -0
- package/dist/esm/store/seriesData.js +299 -0
- package/dist/esm/store/stackSeriesData.d.ts +8 -0
- package/dist/esm/store/stackSeriesData.js +192 -0
- package/dist/esm/store/store.d.ts +20 -0
- package/dist/esm/store/store.js +112 -0
- package/dist/esm/store/theme.d.ts +3 -0
- package/dist/esm/store/theme.js +139 -0
- package/dist/esm/store/treemapSeriesData.d.ts +4 -0
- package/dist/esm/store/treemapSeriesData.js +93 -0
- package/dist/td-chart.css +127 -0
- package/dist/td-chart.js +41463 -0
- package/dist/td-chart.min.css +6 -0
- package/dist/td-chart.min.js +9 -0
- package/package.json +112 -0
- package/types/brushes.d.ts +30 -0
- package/types/charts.d.ts +152 -0
- package/types/components/axis.d.ts +71 -0
- package/types/components/circleLegend.d.ts +9 -0
- package/types/components/dataLabels.d.ts +119 -0
- package/types/components/exportMenu.d.ts +14 -0
- package/types/components/legend.d.ts +27 -0
- package/types/components/plot.d.ts +8 -0
- package/types/components/radialAxis.d.ts +22 -0
- package/types/components/radialPlot.d.ts +11 -0
- package/types/components/rangeSelection.d.ts +3 -0
- package/types/components/resetButton.d.ts +13 -0
- package/types/components/series.d.ts +386 -0
- package/types/components/spectrumLegend.d.ts +25 -0
- package/types/components/tooltip.d.ts +58 -0
- package/types/components/zoom.d.ts +3 -0
- package/types/eventEmitter.d.ts +12 -0
- package/types/index.d.ts +615 -0
- package/types/options.d.ts +833 -0
- package/types/resizeObserver.d.ts +54 -0
- package/types/store/store.d.ts +564 -0
- package/types/theme.d.ts +670 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isObject } from "./utils";
|
|
2
|
+
import { isRangeValue } from "./range";
|
|
3
|
+
function isBubblePointType(value) {
|
|
4
|
+
return value.hasOwnProperty('r');
|
|
5
|
+
}
|
|
6
|
+
export function getValueString(value) {
|
|
7
|
+
let result = '';
|
|
8
|
+
if (isRangeValue(value)) {
|
|
9
|
+
result = `${value[0]} ~ ${value[1]}`;
|
|
10
|
+
}
|
|
11
|
+
else if (isObject(value) && !Array.isArray(value)) {
|
|
12
|
+
result = `(${value.x}, ${value.y})` + (isBubblePointType(value) ? `, r: ${value.r}` : '');
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
result = String(value);
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TooltipModel, TooltipTemplateType } from "../../types/components/tooltip";
|
|
2
|
+
import { DefaultTooltipTemplate } from "../../types/options";
|
|
3
|
+
import { TooltipTheme } from "../../types/theme";
|
|
4
|
+
export declare function getDefaultTemplate(model: TooltipModel, { header, body }: DefaultTooltipTemplate, theme: Required<TooltipTheme>): string;
|
|
5
|
+
export declare function getHeaderTemplate({ category }: TooltipModel, theme: Required<TooltipTheme>): string;
|
|
6
|
+
declare function getDefaultBodyTemplate({ data }: TooltipModel, theme: Required<TooltipTheme>): string;
|
|
7
|
+
declare function getBoxPlotTemplate({ data }: TooltipModel, theme: Required<TooltipTheme>): string;
|
|
8
|
+
declare function getBulletTemplate({ data }: TooltipModel, theme: Required<TooltipTheme>): string;
|
|
9
|
+
declare function getPieTemplate({ data }: TooltipModel, theme: Required<TooltipTheme>): string;
|
|
10
|
+
declare function getHeatmapTemplate({ data }: TooltipModel, theme: Required<TooltipTheme>): string;
|
|
11
|
+
export declare const tooltipTemplates: {
|
|
12
|
+
default: typeof getDefaultTemplate;
|
|
13
|
+
defaultHeader: typeof getHeaderTemplate;
|
|
14
|
+
defaultBody: typeof getDefaultBodyTemplate;
|
|
15
|
+
boxPlot: typeof getBoxPlotTemplate;
|
|
16
|
+
bullet: typeof getBulletTemplate;
|
|
17
|
+
pie: typeof getPieTemplate;
|
|
18
|
+
heatmap: typeof getHeatmapTemplate;
|
|
19
|
+
};
|
|
20
|
+
export declare function getBodyTemplate(type?: TooltipTemplateType): typeof getDefaultBodyTemplate | typeof getBoxPlotTemplate | typeof getBulletTemplate | typeof getPieTemplate | typeof getHeatmapTemplate;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { pieTooltipLabelFormatter } from "./pieSeries";
|
|
2
|
+
import { getFontStyleString } from "./style";
|
|
3
|
+
import { isNumber } from "./utils";
|
|
4
|
+
import { isRangeValue } from "./range";
|
|
5
|
+
function getSeriesNameTemplate(label, color) {
|
|
6
|
+
return `<span class="td-chart-series-name">
|
|
7
|
+
<i class="td-chart-icon" style="background: ${color}"></i>
|
|
8
|
+
<span class="td-chart-name">${label}</span>
|
|
9
|
+
</span>`;
|
|
10
|
+
}
|
|
11
|
+
function getTitleValueTemplate(title, value) {
|
|
12
|
+
return `<div class="td-chart-tooltip-series">
|
|
13
|
+
<span class="td-chart-series-name">${title}</span>
|
|
14
|
+
<span class="td-chart-series-value">${value}</span>
|
|
15
|
+
</div>`;
|
|
16
|
+
}
|
|
17
|
+
function getColorValueTemplate(color, value) {
|
|
18
|
+
return `<div class="td-chart-tooltip-series">
|
|
19
|
+
<i class="td-chart-icon" style="background: ${color}"></i>
|
|
20
|
+
<span class="td-chart-series-value">${value}</span>
|
|
21
|
+
</div>`;
|
|
22
|
+
}
|
|
23
|
+
function makeBulletDataTemplate(data, titleType) {
|
|
24
|
+
return data
|
|
25
|
+
.filter(({ title }) => title === titleType)
|
|
26
|
+
.sort((a, b) => {
|
|
27
|
+
if (isRangeValue(a.value) && isRangeValue(b.value)) {
|
|
28
|
+
return a.value[0] - b.value[0];
|
|
29
|
+
}
|
|
30
|
+
if (isNumber(a.value) && isNumber(b.value)) {
|
|
31
|
+
return a.value - b.value;
|
|
32
|
+
}
|
|
33
|
+
return 0;
|
|
34
|
+
})
|
|
35
|
+
.map(({ formattedValue, color }) => getColorValueTemplate(color, formattedValue))
|
|
36
|
+
.join('');
|
|
37
|
+
}
|
|
38
|
+
export function getDefaultTemplate(model, { header, body }, theme) {
|
|
39
|
+
const { borderColor, borderWidth, background, borderRadius, borderStyle } = theme;
|
|
40
|
+
const style = `border: ${borderWidth}px ${borderStyle} ${borderColor};border-radius: ${borderRadius}px;background: ${background};`;
|
|
41
|
+
return `<div class="td-chart-tooltip" style="${style}">${header}${body}</div>`;
|
|
42
|
+
}
|
|
43
|
+
export function getHeaderTemplate({ category }, theme) {
|
|
44
|
+
return category
|
|
45
|
+
? `<div class="td-chart-tooltip-category" style="${getFontStyleString(theme.header)}">
|
|
46
|
+
${category}
|
|
47
|
+
</div>`
|
|
48
|
+
: '';
|
|
49
|
+
}
|
|
50
|
+
function getDefaultBodyTemplate({ data }, theme) {
|
|
51
|
+
return `
|
|
52
|
+
<div class="td-chart-tooltip-series-wrapper" style="${getFontStyleString(theme.body)}">
|
|
53
|
+
${data
|
|
54
|
+
.map(({ label, color, formattedValue }) => `<div class="td-chart-tooltip-series">
|
|
55
|
+
${getSeriesNameTemplate(label, color)}
|
|
56
|
+
<span class="td-chart-series-value">${formattedValue}</span>
|
|
57
|
+
</div>`)
|
|
58
|
+
.join('')}
|
|
59
|
+
</div>`;
|
|
60
|
+
}
|
|
61
|
+
function getBoxPlotTemplate({ data }, theme) {
|
|
62
|
+
const groupedData = data.reduce((acc, item, index) => {
|
|
63
|
+
if (!index) {
|
|
64
|
+
return item;
|
|
65
|
+
}
|
|
66
|
+
if (acc.category === item.category && acc.label === item.label) {
|
|
67
|
+
acc.value = [...acc.value, ...item.value];
|
|
68
|
+
}
|
|
69
|
+
return acc;
|
|
70
|
+
}, {});
|
|
71
|
+
return `
|
|
72
|
+
<div class="td-chart-tooltip-series-wrapper" style="${getFontStyleString(theme.body)}">
|
|
73
|
+
${[groupedData]
|
|
74
|
+
.map(({ label, color, value: values }) => `<div class="td-chart-tooltip-series">
|
|
75
|
+
${getSeriesNameTemplate(label, color)}
|
|
76
|
+
</div>
|
|
77
|
+
<div>
|
|
78
|
+
${values
|
|
79
|
+
.map(({ title, formattedValue }) => getTitleValueTemplate(title, formattedValue))
|
|
80
|
+
.join('')}
|
|
81
|
+
</div>`)
|
|
82
|
+
.join('')}
|
|
83
|
+
</div>`;
|
|
84
|
+
}
|
|
85
|
+
function getBulletTemplate({ data }, theme) {
|
|
86
|
+
return data.length > 1
|
|
87
|
+
? getBulletGroupedTemplate(data, theme)
|
|
88
|
+
: getBulletBasicTemplate(data, theme);
|
|
89
|
+
}
|
|
90
|
+
function getBulletBasicTemplate(data, theme) {
|
|
91
|
+
return `
|
|
92
|
+
<div class="td-chart-tooltip-series-wrapper" style="${getFontStyleString(theme.body)}">
|
|
93
|
+
${data
|
|
94
|
+
.map(({ label, color, value: values }) => `<div class="td-chart-tooltip-series">${getSeriesNameTemplate(label, color)}</div>
|
|
95
|
+
${values
|
|
96
|
+
.map(({ title, formattedValue }) => getTitleValueTemplate(title, formattedValue))
|
|
97
|
+
.join('')}`)
|
|
98
|
+
.join('')}
|
|
99
|
+
</div>`;
|
|
100
|
+
}
|
|
101
|
+
function getBulletGroupedTemplate(data, theme) {
|
|
102
|
+
const bulletData = data.map(({ value }) => value[0]);
|
|
103
|
+
const [actual, ranges, markers] = ['Actual', 'Range', 'Marker'].map((titleType) => makeBulletDataTemplate(bulletData, titleType));
|
|
104
|
+
return `<div class="td-chart-tooltip-category" style="${getFontStyleString(theme.header)}">
|
|
105
|
+
${data[0].label}
|
|
106
|
+
</div>
|
|
107
|
+
<div class="td-chart-tooltip-series-wrapper" style="${getFontStyleString(theme.body)}">
|
|
108
|
+
${actual ? '<div class="td-chart-tooltip-title">Actual</div>' : ''} ${actual}
|
|
109
|
+
${ranges ? '<div class="td-chart-tooltip-title">Ranges</div>' : ''} ${ranges}
|
|
110
|
+
${markers ? '<div class="td-chart-tooltip-title">Markers</div>' : ''} ${markers}
|
|
111
|
+
</div>`;
|
|
112
|
+
}
|
|
113
|
+
function getPieTemplate({ data }, theme) {
|
|
114
|
+
return `
|
|
115
|
+
<div class="td-chart-tooltip-series-wrapper" style="${getFontStyleString(theme.body)}">
|
|
116
|
+
${data
|
|
117
|
+
.map(({ label, color, formattedValue, percentValue }) => `<div class="td-chart-tooltip-series">
|
|
118
|
+
${getSeriesNameTemplate(label, color)}
|
|
119
|
+
<span class="td-chart-series-value">${pieTooltipLabelFormatter(percentValue)} (${formattedValue})</span>
|
|
120
|
+
</div>`)
|
|
121
|
+
.join('')}
|
|
122
|
+
</div>`;
|
|
123
|
+
}
|
|
124
|
+
function getHeatmapTemplate({ data }, theme) {
|
|
125
|
+
return `${data
|
|
126
|
+
.map(({ label, color, formattedValue }) => `<div class="td-chart-tooltip-category" style="${getFontStyleString(theme.header)}">
|
|
127
|
+
${label}
|
|
128
|
+
</div>
|
|
129
|
+
<div class="td-chart-tooltip-series-wrapper" style="${getFontStyleString(theme.body)}">
|
|
130
|
+
<div class="td-chart-tooltip-series">
|
|
131
|
+
${getSeriesNameTemplate(formattedValue, color)}
|
|
132
|
+
</div>
|
|
133
|
+
</div>`)
|
|
134
|
+
.join('')}`;
|
|
135
|
+
}
|
|
136
|
+
export const tooltipTemplates = {
|
|
137
|
+
default: getDefaultTemplate,
|
|
138
|
+
defaultHeader: getHeaderTemplate,
|
|
139
|
+
defaultBody: getDefaultBodyTemplate,
|
|
140
|
+
boxPlot: getBoxPlotTemplate,
|
|
141
|
+
bullet: getBulletTemplate,
|
|
142
|
+
pie: getPieTemplate,
|
|
143
|
+
heatmap: getHeatmapTemplate,
|
|
144
|
+
};
|
|
145
|
+
export function getBodyTemplate(type) {
|
|
146
|
+
return tooltipTemplates[type || 'defaultBody'];
|
|
147
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChartSizeInput } from "../../types/options";
|
|
2
|
+
export declare function isExist(value: unknown): boolean;
|
|
3
|
+
export declare function isDate(value: unknown): value is Date;
|
|
4
|
+
export declare function isUndefined(value: unknown): value is undefined;
|
|
5
|
+
export declare function isNull(value: unknown): value is null;
|
|
6
|
+
export declare function isBoolean(value: unknown): value is boolean;
|
|
7
|
+
export declare function isNumber(value: unknown): value is number;
|
|
8
|
+
export declare function isString(value: unknown): value is string;
|
|
9
|
+
export declare function isInteger(value: unknown): value is number;
|
|
10
|
+
export declare function isObject(obj: unknown): obj is object;
|
|
11
|
+
export declare function isFunction(value: unknown): value is Function;
|
|
12
|
+
export declare function forEach<T extends object, K extends Extract<keyof T, string>, V extends T[K]>(obj: T, cb: (item: V, key: K) => void): void;
|
|
13
|
+
export declare function forEachArray<T>(arr: Array<T> | ArrayLike<T>, iteratee: (value: T, index: number, targetArr: Array<T> | ArrayLike<T>) => boolean | void, context?: object | null): void;
|
|
14
|
+
export declare function range(start: number, stop?: number, step?: number): number[];
|
|
15
|
+
export declare function toArray<T>(arrayLike: ArrayLike<T>): T[];
|
|
16
|
+
export declare function includes<T>(arr: T[], searchItem: T, searchIndex?: number): boolean;
|
|
17
|
+
export declare function pick<T extends object, K extends keyof T>(obj: T, ...propNames: K[]): Pick<T, K>;
|
|
18
|
+
export declare function omit<T extends object, K extends keyof T>(obj: T, ...propNames: K[]): Pick<T, Exclude<keyof T, K>>;
|
|
19
|
+
export declare function pickProperty(target: Record<string, any>, keys: string[]): Record<string, any> | null;
|
|
20
|
+
export declare function pickPropertyWithMakeup(target: Record<string, any>, args: string[]): Record<string, any>;
|
|
21
|
+
export declare function debounce(fn: Function, delay?: number): (...args: any[]) => void;
|
|
22
|
+
export declare function merge(target: Record<string, any>, ...args: Record<string, any>[]): Record<string, any>;
|
|
23
|
+
export declare function throttle(fn: Function, interval?: number): {
|
|
24
|
+
(...args: any[]): void;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
};
|
|
27
|
+
export declare function deepMergedCopy<T1 extends Record<string, any>, T2 extends Record<string, any>>(targetObj: T1, obj: T2): T1 & T2;
|
|
28
|
+
export declare function deepCopyArray<T extends Array<any>>(items: T): T;
|
|
29
|
+
export declare function deepCopy<T extends Record<string, any>>(obj: T): T;
|
|
30
|
+
export declare function sortCategories(x: number | string, y: number | string): number;
|
|
31
|
+
export declare function sortNumber(x: number, y: number): number;
|
|
32
|
+
export declare function first<T>(items: T[]): T | undefined;
|
|
33
|
+
export declare function last<T>(items: T[]): T | undefined;
|
|
34
|
+
export declare function hasNegative(values?: (number | string)[]): boolean;
|
|
35
|
+
export declare function sum(items: number[]): number;
|
|
36
|
+
export declare function hasPositiveOnly(values: (number | string)[]): boolean;
|
|
37
|
+
export declare function hasNegativeOnly(values: (number | string)[]): boolean;
|
|
38
|
+
export declare function getFirstValidValue(values: any): any;
|
|
39
|
+
export declare function getPercentageValue(text: string): number;
|
|
40
|
+
export declare function calculateSizeWithPercentString(size: number, value: string | number): number;
|
|
41
|
+
export declare function getInitialSize(size?: ChartSizeInput): number;
|
|
42
|
+
export declare function isAutoValue(value?: ChartSizeInput): boolean;
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
export function isExist(value) {
|
|
2
|
+
return !isUndefined(value) && !isNull(value);
|
|
3
|
+
}
|
|
4
|
+
export function isDate(value) {
|
|
5
|
+
return value instanceof Date;
|
|
6
|
+
}
|
|
7
|
+
export function isUndefined(value) {
|
|
8
|
+
return typeof value === 'undefined';
|
|
9
|
+
}
|
|
10
|
+
export function isNull(value) {
|
|
11
|
+
return value === null;
|
|
12
|
+
}
|
|
13
|
+
export function isBoolean(value) {
|
|
14
|
+
return typeof value === 'boolean';
|
|
15
|
+
}
|
|
16
|
+
export function isNumber(value) {
|
|
17
|
+
return typeof value === 'number';
|
|
18
|
+
}
|
|
19
|
+
export function isString(value) {
|
|
20
|
+
return typeof value === 'string';
|
|
21
|
+
}
|
|
22
|
+
export function isInteger(value) {
|
|
23
|
+
return isNumber(value) && isFinite(value) && Math.floor(value) === value;
|
|
24
|
+
}
|
|
25
|
+
export function isObject(obj) {
|
|
26
|
+
return typeof obj === 'object' && obj !== null;
|
|
27
|
+
}
|
|
28
|
+
export function isFunction(value) {
|
|
29
|
+
return typeof value === 'function';
|
|
30
|
+
}
|
|
31
|
+
export function forEach(obj, cb) {
|
|
32
|
+
for (const key in obj) {
|
|
33
|
+
if (obj.hasOwnProperty(key)) {
|
|
34
|
+
cb(obj[key], key);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function forEachArray(arr, iteratee, context = null) {
|
|
39
|
+
for (let index = 0, len = arr.length; index < len; index += 1) {
|
|
40
|
+
if (iteratee.call(context, arr[index], index, arr) === false) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function range(start, stop, step) {
|
|
46
|
+
if (isUndefined(stop)) {
|
|
47
|
+
stop = start || 0;
|
|
48
|
+
start = 0;
|
|
49
|
+
}
|
|
50
|
+
step = step || 1;
|
|
51
|
+
const arr = [];
|
|
52
|
+
if (stop) {
|
|
53
|
+
const flag = step < 0 ? -1 : 1;
|
|
54
|
+
stop *= flag;
|
|
55
|
+
for (; start * flag < stop; start += step) {
|
|
56
|
+
arr.push(start);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return arr;
|
|
60
|
+
}
|
|
61
|
+
export function toArray(arrayLike) {
|
|
62
|
+
let arr = [];
|
|
63
|
+
try {
|
|
64
|
+
arr = Array.prototype.slice.call(arrayLike);
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
forEachArray(arrayLike, function (value) {
|
|
68
|
+
arr.push(value);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return arr;
|
|
72
|
+
}
|
|
73
|
+
export function includes(arr, searchItem, searchIndex) {
|
|
74
|
+
if (typeof searchIndex === 'number' && arr[searchIndex] !== searchItem) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
for (const item of arr) {
|
|
78
|
+
if (item === searchItem) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
export function pick(obj, ...propNames) {
|
|
85
|
+
const resultMap = {};
|
|
86
|
+
Object.keys(obj).forEach((key) => {
|
|
87
|
+
if (includes(propNames, key)) {
|
|
88
|
+
resultMap[key] = obj[key];
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return resultMap;
|
|
92
|
+
}
|
|
93
|
+
export function omit(obj, ...propNames) {
|
|
94
|
+
const resultMap = {};
|
|
95
|
+
Object.keys(obj).forEach((key) => {
|
|
96
|
+
if (!includes(propNames, key)) {
|
|
97
|
+
resultMap[key] = obj[key];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return resultMap;
|
|
101
|
+
}
|
|
102
|
+
export function pickProperty(target, keys) {
|
|
103
|
+
const { length } = keys;
|
|
104
|
+
if (length) {
|
|
105
|
+
for (let i = 0; i < length; i += 1) {
|
|
106
|
+
if (isUndefined(target) || isNull(target)) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
target = target[keys[i]];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return target;
|
|
113
|
+
}
|
|
114
|
+
export function pickPropertyWithMakeup(target, args) {
|
|
115
|
+
const { length } = args;
|
|
116
|
+
if (length) {
|
|
117
|
+
for (let i = 0; i < length; i += 1) {
|
|
118
|
+
if (isUndefined(target[args[i]])) {
|
|
119
|
+
target[args[i]] = {};
|
|
120
|
+
}
|
|
121
|
+
target = target[args[i]];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return target;
|
|
125
|
+
}
|
|
126
|
+
export function debounce(fn, delay = 0) {
|
|
127
|
+
let timer;
|
|
128
|
+
function debounced(...args) {
|
|
129
|
+
window.clearTimeout(timer);
|
|
130
|
+
timer = window.setTimeout(() => {
|
|
131
|
+
fn(...args);
|
|
132
|
+
}, delay);
|
|
133
|
+
}
|
|
134
|
+
return debounced;
|
|
135
|
+
}
|
|
136
|
+
export function merge(target, ...args) {
|
|
137
|
+
target = target || {};
|
|
138
|
+
args.forEach((obj) => {
|
|
139
|
+
if (!obj) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
forEach(obj, (item, key) => {
|
|
143
|
+
if (Object.prototype.toString.call(item) === '[object Object]') {
|
|
144
|
+
target[key] = merge(target[key], item);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
target[key] = item;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
return target;
|
|
152
|
+
}
|
|
153
|
+
export function throttle(fn, interval = 0) {
|
|
154
|
+
let base = null;
|
|
155
|
+
let isLeading = true;
|
|
156
|
+
const tick = function (...args) {
|
|
157
|
+
fn(...args);
|
|
158
|
+
base = null;
|
|
159
|
+
};
|
|
160
|
+
let stamp = 0;
|
|
161
|
+
const debounced = debounce(tick, interval);
|
|
162
|
+
function throttled(...args) {
|
|
163
|
+
if (isLeading) {
|
|
164
|
+
tick(...args);
|
|
165
|
+
isLeading = false;
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
stamp = Number(new Date());
|
|
169
|
+
base = base || stamp;
|
|
170
|
+
debounced(args);
|
|
171
|
+
if (stamp - base >= interval) {
|
|
172
|
+
tick(args);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function reset() {
|
|
176
|
+
// eslint-disable-line require-jsdoc
|
|
177
|
+
isLeading = true;
|
|
178
|
+
base = null;
|
|
179
|
+
}
|
|
180
|
+
throttled.reset = reset;
|
|
181
|
+
return throttled;
|
|
182
|
+
}
|
|
183
|
+
export function deepMergedCopy(targetObj, obj) {
|
|
184
|
+
const resultObj = Object.assign({}, targetObj);
|
|
185
|
+
Object.keys(obj).forEach((prop) => {
|
|
186
|
+
if (isObject(resultObj[prop])) {
|
|
187
|
+
if (Array.isArray(obj[prop])) {
|
|
188
|
+
resultObj[prop] = deepCopyArray(obj[prop]);
|
|
189
|
+
}
|
|
190
|
+
else if (resultObj.hasOwnProperty(prop)) {
|
|
191
|
+
resultObj[prop] = deepMergedCopy(resultObj[prop], obj[prop]);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
resultObj[prop] = deepCopy(obj[prop]);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
resultObj[prop] = obj[prop];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
return resultObj;
|
|
202
|
+
}
|
|
203
|
+
export function deepCopyArray(items) {
|
|
204
|
+
return items.map((item) => {
|
|
205
|
+
if (isObject(item)) {
|
|
206
|
+
return Array.isArray(item) ? deepCopyArray(item) : deepCopy(item);
|
|
207
|
+
}
|
|
208
|
+
return item;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
export function deepCopy(obj) {
|
|
212
|
+
const resultObj = {};
|
|
213
|
+
const keys = Object.keys(obj);
|
|
214
|
+
if (!keys.length) {
|
|
215
|
+
return obj;
|
|
216
|
+
}
|
|
217
|
+
keys.forEach((prop) => {
|
|
218
|
+
if (isObject(obj[prop])) {
|
|
219
|
+
resultObj[prop] = Array.isArray(obj[prop]) ? deepCopyArray(obj[prop]) : deepCopy(obj[prop]);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
resultObj[prop] = obj[prop];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
return resultObj;
|
|
226
|
+
}
|
|
227
|
+
export function sortCategories(x, y) {
|
|
228
|
+
return isInteger(x) ? Number(x) - Number(y) : new Date(x).getTime() - new Date(y).getTime();
|
|
229
|
+
}
|
|
230
|
+
export function sortNumber(x, y) {
|
|
231
|
+
return x - y;
|
|
232
|
+
}
|
|
233
|
+
export function first(items) {
|
|
234
|
+
// eslint-disable-next-line no-undefined
|
|
235
|
+
return items.length ? items[0] : undefined;
|
|
236
|
+
}
|
|
237
|
+
export function last(items) {
|
|
238
|
+
// eslint-disable-next-line no-undefined
|
|
239
|
+
return items.length ? items[items.length - 1] : undefined;
|
|
240
|
+
}
|
|
241
|
+
export function hasNegative(values = []) {
|
|
242
|
+
return values.some((value) => Number(value) < 0);
|
|
243
|
+
}
|
|
244
|
+
export function sum(items) {
|
|
245
|
+
return items.reduce((a, b) => a + b, 0);
|
|
246
|
+
}
|
|
247
|
+
export function hasPositiveOnly(values) {
|
|
248
|
+
return values.every((value) => Number(value) >= 0);
|
|
249
|
+
}
|
|
250
|
+
export function hasNegativeOnly(values) {
|
|
251
|
+
return values.every((value) => Number(value) <= 0);
|
|
252
|
+
}
|
|
253
|
+
export function getFirstValidValue(values) {
|
|
254
|
+
var _a;
|
|
255
|
+
return (_a = values) === null || _a === void 0 ? void 0 : _a.find((value) => value !== null);
|
|
256
|
+
}
|
|
257
|
+
export function getPercentageValue(text) {
|
|
258
|
+
return Number(text.substr(0, text.length - 1));
|
|
259
|
+
}
|
|
260
|
+
export function calculateSizeWithPercentString(size, value) {
|
|
261
|
+
return isNumber(value) ? value : Number(((size * getPercentageValue(value)) / 100).toFixed(2));
|
|
262
|
+
}
|
|
263
|
+
export function getInitialSize(size) {
|
|
264
|
+
return isNumber(size) ? size : 0;
|
|
265
|
+
}
|
|
266
|
+
export function isAutoValue(value) {
|
|
267
|
+
return value === 'auto';
|
|
268
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SelectSeriesInfo } from "../../types/charts";
|
|
2
|
+
import { BoxTypeEventDetectType, LineTypeEventDetectType } from "../../types/options";
|
|
3
|
+
import { Series } from "../../types/store/store";
|
|
4
|
+
export declare function isAvailableShowTooltipInfo(info: SelectSeriesInfo, eventDetectType: LineTypeEventDetectType | BoxTypeEventDetectType, targetChartType: 'area' | 'line' | 'column' | 'radialBar'): boolean;
|
|
5
|
+
export declare function isAvailableSelectSeries(info: SelectSeriesInfo, targetChartType: 'area' | 'line' | 'column' | 'scatter'): boolean;
|
|
6
|
+
export declare function isNoData(series: Series): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isNumber, isUndefined } from "./utils";
|
|
2
|
+
export function isAvailableShowTooltipInfo(info, eventDetectType, targetChartType) {
|
|
3
|
+
const { index, seriesIndex, chartType } = info;
|
|
4
|
+
return (isNumber(index) &&
|
|
5
|
+
(eventDetectType === 'grouped' || isNumber(seriesIndex)) &&
|
|
6
|
+
(isUndefined(chartType) || chartType === targetChartType));
|
|
7
|
+
}
|
|
8
|
+
export function isAvailableSelectSeries(info, targetChartType) {
|
|
9
|
+
const { index, seriesIndex, chartType } = info;
|
|
10
|
+
return (isNumber(index) &&
|
|
11
|
+
isNumber(seriesIndex) &&
|
|
12
|
+
(isUndefined(chartType) || chartType === targetChartType));
|
|
13
|
+
}
|
|
14
|
+
export function isNoData(series) {
|
|
15
|
+
return Object.keys(series).reduce((acc, chartType) => !series[chartType].data.length && acc, true);
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import LineChart from "./charts/lineChart";
|
|
2
|
+
import PieChart from "./charts/pieChart";
|
|
3
|
+
import HeatmapChart from "./charts/heatmapChart";
|
|
4
|
+
import AreaChart from "./charts/areaChart";
|
|
5
|
+
import LineScatterChart from "./charts/lineScatterChart";
|
|
6
|
+
import LineAreaChart from "./charts/lineAreaChart";
|
|
7
|
+
import BarChart from "./charts/barChart";
|
|
8
|
+
import ColumnChart from "./charts/columnChart";
|
|
9
|
+
import ColumnLineChart from "./charts/columnLineChart";
|
|
10
|
+
import BubbleChart from "./charts/bubbleChart";
|
|
11
|
+
import ScatterChart from "./charts/scatterChart";
|
|
12
|
+
import BulletChart from "./charts/bulletChart";
|
|
13
|
+
import NestedPieChart from "./charts/nestedPieChart";
|
|
14
|
+
import RadarChart from "./charts/radarChart";
|
|
15
|
+
import TreemapChart from "./charts/treemapChart";
|
|
16
|
+
import BoxPlotChart from "./charts/boxPlotChart";
|
|
17
|
+
import RadialBarChart from "./charts/radialBarChart";
|
|
18
|
+
import GaugeChart from "./charts/gaugeChart";
|
|
19
|
+
import { LineChartProps, PieChartProps, HeatmapChartProps, AreaChartProps, LineScatterChartProps, LineAreaChartProps, BulletChartProps, NestedPieChartProps, RadarChartProps, RadialBarChartProps, BarChartProps, BoxPlotChartProps, ColumnLineChartProps, BubbleChartProps, TreemapChartProps, ScatterChartProps, ColumnChartProps, GaugeChartProps } from "../types/charts";
|
|
20
|
+
export default class Chart {
|
|
21
|
+
static lineChart: (props: LineChartProps) => LineChart;
|
|
22
|
+
static areaChart: (props: AreaChartProps) => AreaChart;
|
|
23
|
+
static barChart: (props: BarChartProps) => BarChart;
|
|
24
|
+
static boxPlotChart: (props: BoxPlotChartProps) => BoxPlotChart;
|
|
25
|
+
static columnChart: (props: ColumnChartProps) => ColumnChart;
|
|
26
|
+
static pieChart: (props: PieChartProps) => PieChart;
|
|
27
|
+
static heatmapChart: (props: HeatmapChartProps) => HeatmapChart;
|
|
28
|
+
static bubbleChart: (props: BubbleChartProps) => BubbleChart;
|
|
29
|
+
static scatterChart: (props: ScatterChartProps) => ScatterChart;
|
|
30
|
+
static bulletChart: (props: BulletChartProps) => BulletChart;
|
|
31
|
+
static radarChart: (props: RadarChartProps) => RadarChart;
|
|
32
|
+
static treemapChart: (props: TreemapChartProps) => TreemapChart;
|
|
33
|
+
static nestedPieChart: (props: NestedPieChartProps) => NestedPieChart;
|
|
34
|
+
static lineAreaChart: (props: LineAreaChartProps) => LineAreaChart;
|
|
35
|
+
static lineScatterChart: (props: LineScatterChartProps) => LineScatterChart;
|
|
36
|
+
static columnLineChart: (props: ColumnLineChartProps) => ColumnLineChart;
|
|
37
|
+
static radialBarChart: (props: RadialBarChartProps) => RadialBarChart;
|
|
38
|
+
static gaugeChart: (props: GaugeChartProps) => GaugeChart;
|
|
39
|
+
}
|
|
40
|
+
export { LineChart, AreaChart, BarChart, ColumnChart, PieChart, HeatmapChart, BubbleChart, ScatterChart, BulletChart, RadarChart, TreemapChart, NestedPieChart, LineAreaChart, LineScatterChart, ColumnLineChart, BoxPlotChart, RadialBarChart, GaugeChart, };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import LineChart from "./charts/lineChart";
|
|
2
|
+
import PieChart from "./charts/pieChart";
|
|
3
|
+
import HeatmapChart from "./charts/heatmapChart";
|
|
4
|
+
import AreaChart from "./charts/areaChart";
|
|
5
|
+
import LineScatterChart from "./charts/lineScatterChart";
|
|
6
|
+
import LineAreaChart from "./charts/lineAreaChart";
|
|
7
|
+
import BarChart from "./charts/barChart";
|
|
8
|
+
import ColumnChart from "./charts/columnChart";
|
|
9
|
+
import ColumnLineChart from "./charts/columnLineChart";
|
|
10
|
+
import BubbleChart from "./charts/bubbleChart";
|
|
11
|
+
import ScatterChart from "./charts/scatterChart";
|
|
12
|
+
import BulletChart from "./charts/bulletChart";
|
|
13
|
+
import NestedPieChart from "./charts/nestedPieChart";
|
|
14
|
+
import RadarChart from "./charts/radarChart";
|
|
15
|
+
import TreemapChart from "./charts/treemapChart";
|
|
16
|
+
import BoxPlotChart from "./charts/boxPlotChart";
|
|
17
|
+
import RadialBarChart from "./charts/radialBarChart";
|
|
18
|
+
import GaugeChart from "./charts/gaugeChart";
|
|
19
|
+
export default class Chart {
|
|
20
|
+
}
|
|
21
|
+
Chart.lineChart = (props) => {
|
|
22
|
+
return new LineChart(props);
|
|
23
|
+
};
|
|
24
|
+
Chart.areaChart = (props) => {
|
|
25
|
+
return new AreaChart(props);
|
|
26
|
+
};
|
|
27
|
+
Chart.barChart = (props) => {
|
|
28
|
+
return new BarChart(props);
|
|
29
|
+
};
|
|
30
|
+
Chart.boxPlotChart = (props) => {
|
|
31
|
+
return new BoxPlotChart(props);
|
|
32
|
+
};
|
|
33
|
+
Chart.columnChart = (props) => {
|
|
34
|
+
return new ColumnChart(props);
|
|
35
|
+
};
|
|
36
|
+
Chart.pieChart = (props) => {
|
|
37
|
+
return new PieChart(props);
|
|
38
|
+
};
|
|
39
|
+
Chart.heatmapChart = (props) => {
|
|
40
|
+
return new HeatmapChart(props);
|
|
41
|
+
};
|
|
42
|
+
Chart.bubbleChart = (props) => {
|
|
43
|
+
return new BubbleChart(props);
|
|
44
|
+
};
|
|
45
|
+
Chart.scatterChart = (props) => {
|
|
46
|
+
return new ScatterChart(props);
|
|
47
|
+
};
|
|
48
|
+
Chart.bulletChart = (props) => {
|
|
49
|
+
return new BulletChart(props);
|
|
50
|
+
};
|
|
51
|
+
Chart.radarChart = (props) => {
|
|
52
|
+
return new RadarChart(props);
|
|
53
|
+
};
|
|
54
|
+
Chart.treemapChart = (props) => {
|
|
55
|
+
return new TreemapChart(props);
|
|
56
|
+
};
|
|
57
|
+
Chart.nestedPieChart = (props) => {
|
|
58
|
+
return new NestedPieChart(props);
|
|
59
|
+
};
|
|
60
|
+
Chart.lineAreaChart = (props) => {
|
|
61
|
+
return new LineAreaChart(props);
|
|
62
|
+
};
|
|
63
|
+
Chart.lineScatterChart = (props) => {
|
|
64
|
+
return new LineScatterChart(props);
|
|
65
|
+
};
|
|
66
|
+
Chart.columnLineChart = (props) => {
|
|
67
|
+
return new ColumnLineChart(props);
|
|
68
|
+
};
|
|
69
|
+
Chart.radialBarChart = (props) => {
|
|
70
|
+
return new RadialBarChart(props);
|
|
71
|
+
};
|
|
72
|
+
Chart.gaugeChart = (props) => {
|
|
73
|
+
return new GaugeChart(props);
|
|
74
|
+
};
|
|
75
|
+
export { LineChart, AreaChart, BarChart, ColumnChart, PieChart, HeatmapChart, BubbleChart, ScatterChart, BulletChart, RadarChart, TreemapChart, NestedPieChart, LineAreaChart, LineScatterChart, ColumnLineChart, BoxPlotChart, RadialBarChart, GaugeChart, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const message: {
|
|
2
|
+
SELECT_SERIES_API_SELECTABLE_ERROR: string;
|
|
3
|
+
SELECT_SERIES_API_INDEX_ERROR: string;
|
|
4
|
+
ALREADY_OBSERVABLE_ERROR: string;
|
|
5
|
+
CIRCLE_LEGEND_RENDER_ERROR: string;
|
|
6
|
+
noDataError: (chartName: string) => string;
|
|
7
|
+
noBrushError: (brushName: string) => string;
|
|
8
|
+
DASH_SEGMENTS_UNAVAILABLE_ERROR: string;
|
|
9
|
+
SERIES_INDEX_ERROR: string;
|
|
10
|
+
AUTO_LAYOUT_CONTAINER_SIZE_ERROR: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const message = {
|
|
2
|
+
SELECT_SERIES_API_SELECTABLE_ERROR: 'It works only when the selectable option is true.',
|
|
3
|
+
SELECT_SERIES_API_INDEX_ERROR: 'The index value is invalid.',
|
|
4
|
+
ALREADY_OBSERVABLE_ERROR: 'Source object is observable already',
|
|
5
|
+
CIRCLE_LEGEND_RENDER_ERROR: 'circleLegend is only possible when bubble series is present',
|
|
6
|
+
noDataError: (chartName) => `There's no ${chartName} data!`,
|
|
7
|
+
noBrushError: (brushName) => `Brush don't exist in painter: ${brushName}`,
|
|
8
|
+
DASH_SEGMENTS_UNAVAILABLE_ERROR: 'DashSegments option is available from IE11 and above.',
|
|
9
|
+
SERIES_INDEX_ERROR: 'The seriesIndex value is invalid',
|
|
10
|
+
AUTO_LAYOUT_CONTAINER_SIZE_ERROR: 'To use auto layout, the width or height of the container must be specified as a value such as "%" or "vh", "vw".',
|
|
11
|
+
};
|