@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,14 @@
|
|
|
1
|
+
import { StyleProp } from "../../types/components/series";
|
|
2
|
+
import { FontTheme, BubbleDataLabel, BoxDataLabel } from "../../types/theme";
|
|
3
|
+
export declare function makeStyleObj<T, K>(style: StyleProp<T, K>, styleSet: Record<string, object>): T;
|
|
4
|
+
export declare function getTranslateString(x: number, y: number): string;
|
|
5
|
+
export declare function getTitleFontString(fontTheme: FontTheme): string;
|
|
6
|
+
export declare function getFontStyleString(theme: FontTheme): string;
|
|
7
|
+
export declare function getFont(theme: BubbleDataLabel | BoxDataLabel): string;
|
|
8
|
+
export declare function setLineDash(ctx: CanvasRenderingContext2D, dashSegments: number[]): void;
|
|
9
|
+
export declare function getBoxTypeSeriesPadding(tickDistance: number): number;
|
|
10
|
+
export declare function fillStyle(ctx: CanvasRenderingContext2D, fillOption: string): void;
|
|
11
|
+
export declare function strokeWithOptions(ctx: CanvasRenderingContext2D, style: {
|
|
12
|
+
strokeStyle?: string;
|
|
13
|
+
lineWidth?: number;
|
|
14
|
+
}): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isString, pick } from "./utils";
|
|
2
|
+
import { getAlpha } from "./color";
|
|
3
|
+
export function makeStyleObj(style, styleSet) {
|
|
4
|
+
return style.reduce((acc, curValue) => {
|
|
5
|
+
if (isString(curValue)) {
|
|
6
|
+
return Object.assign(Object.assign({}, acc), styleSet[curValue]);
|
|
7
|
+
}
|
|
8
|
+
return Object.assign(Object.assign({}, acc), curValue);
|
|
9
|
+
}, {});
|
|
10
|
+
}
|
|
11
|
+
export function getTranslateString(x, y) {
|
|
12
|
+
return `translate(${x}px,${y}px)`;
|
|
13
|
+
}
|
|
14
|
+
export function getTitleFontString(fontTheme) {
|
|
15
|
+
const { fontFamily, fontSize, fontWeight } = fontTheme;
|
|
16
|
+
return `${fontWeight} ${fontSize}px ${fontFamily}`;
|
|
17
|
+
}
|
|
18
|
+
export function getFontStyleString(theme) {
|
|
19
|
+
const { color, fontSize, fontFamily, fontWeight } = theme;
|
|
20
|
+
return `font-weight: ${fontWeight}; font-family: ${fontFamily}; font-size: ${fontSize}px; color: ${color};`;
|
|
21
|
+
}
|
|
22
|
+
export function getFont(theme) {
|
|
23
|
+
return getTitleFontString(pick(theme, 'fontFamily', 'fontWeight', 'fontSize'));
|
|
24
|
+
}
|
|
25
|
+
export function setLineDash(ctx, dashSegments) {
|
|
26
|
+
if (ctx.setLineDash) {
|
|
27
|
+
ctx.setLineDash(dashSegments);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function getBoxTypeSeriesPadding(tickDistance) {
|
|
31
|
+
return Math.floor(tickDistance * 0.15);
|
|
32
|
+
}
|
|
33
|
+
export function fillStyle(ctx, fillOption) {
|
|
34
|
+
ctx.fillStyle = fillOption;
|
|
35
|
+
ctx.fill();
|
|
36
|
+
}
|
|
37
|
+
export function strokeWithOptions(ctx, style) {
|
|
38
|
+
const { lineWidth, strokeStyle } = style;
|
|
39
|
+
if (strokeStyle) {
|
|
40
|
+
ctx.strokeStyle = strokeStyle;
|
|
41
|
+
}
|
|
42
|
+
if (lineWidth) {
|
|
43
|
+
ctx.lineWidth = lineWidth;
|
|
44
|
+
}
|
|
45
|
+
if (ctx.lineWidth && getAlpha(String(ctx.strokeStyle))) {
|
|
46
|
+
ctx.stroke();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RawSeries } from "../../types/store/store";
|
|
2
|
+
import { Theme, CheckAnchorPieSeries } from "../../types/theme";
|
|
3
|
+
export declare const DEFAULT_LINE_SERIES_WIDTH = 2;
|
|
4
|
+
export declare const DEFAULT_LINE_SERIES_DOT_RADIUS = 3;
|
|
5
|
+
export declare const radarDefault: {
|
|
6
|
+
LINE_WIDTH: number;
|
|
7
|
+
DOT_RADIUS: number;
|
|
8
|
+
HOVER_DOT_RADIUS: number;
|
|
9
|
+
SELECTED_SERIES_OPACITY: number;
|
|
10
|
+
UNSELECTED_SERIES_OPACITY: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const boxDefault: {
|
|
13
|
+
HOVER_THICKNESS: number;
|
|
14
|
+
BOX_HOVER: {
|
|
15
|
+
shadowColor: string;
|
|
16
|
+
shadowOffsetX: number;
|
|
17
|
+
shadowOffsetY: number;
|
|
18
|
+
shadowBlur: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const DEFAULT_BULLET_RANGE_OPACITY: number[];
|
|
22
|
+
export declare const defaultSeriesTheme: {
|
|
23
|
+
colors: string[];
|
|
24
|
+
startColor: string;
|
|
25
|
+
endColor: string;
|
|
26
|
+
lineWidth: number;
|
|
27
|
+
dashSegments: never[];
|
|
28
|
+
borderWidth: number;
|
|
29
|
+
borderColor: string;
|
|
30
|
+
select: {
|
|
31
|
+
dot: {
|
|
32
|
+
radius: number;
|
|
33
|
+
borderWidth: number;
|
|
34
|
+
};
|
|
35
|
+
areaOpacity: number;
|
|
36
|
+
restSeries: {
|
|
37
|
+
areaOpacity: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
hover: {
|
|
41
|
+
dot: {
|
|
42
|
+
radius: number;
|
|
43
|
+
borderWidth: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
dot: {
|
|
47
|
+
radius: number;
|
|
48
|
+
};
|
|
49
|
+
areaOpacity: number;
|
|
50
|
+
};
|
|
51
|
+
export declare function makeAxisTitleTheme(globalFontFamily?: string): {
|
|
52
|
+
fontSize: number;
|
|
53
|
+
fontFamily: string;
|
|
54
|
+
fontWeight: number;
|
|
55
|
+
color: string;
|
|
56
|
+
};
|
|
57
|
+
export declare function makeDefaultTheme(series: RawSeries, globalFontFamily?: string): Theme;
|
|
58
|
+
export declare function getDefaultTheme(series: RawSeries, pieSeriesOuterAnchors: CheckAnchorPieSeries | Record<string, CheckAnchorPieSeries>, globalFontFamily?: string, isNestedPieChart?: boolean): Theme;
|
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import { getNestedPieChartAliasNames } from "./pieSeries";
|
|
2
|
+
import { includes } from "./utils";
|
|
3
|
+
export const DEFAULT_LINE_SERIES_WIDTH = 2;
|
|
4
|
+
export const DEFAULT_LINE_SERIES_DOT_RADIUS = 3;
|
|
5
|
+
const DEFAULT_AREA_OPACITY = 0.3;
|
|
6
|
+
const DEFAULT_AREA_SELECTED_SERIES_OPACITY = DEFAULT_AREA_OPACITY;
|
|
7
|
+
const DEFAULT_AREA_UNSELECTED_SERIES_OPACITY = 0.06;
|
|
8
|
+
export const radarDefault = {
|
|
9
|
+
LINE_WIDTH: 2,
|
|
10
|
+
DOT_RADIUS: 3,
|
|
11
|
+
HOVER_DOT_RADIUS: 4,
|
|
12
|
+
SELECTED_SERIES_OPACITY: 0.3,
|
|
13
|
+
UNSELECTED_SERIES_OPACITY: 0.05,
|
|
14
|
+
};
|
|
15
|
+
export const boxDefault = {
|
|
16
|
+
HOVER_THICKNESS: 4,
|
|
17
|
+
BOX_HOVER: {
|
|
18
|
+
shadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
19
|
+
shadowOffsetX: 2,
|
|
20
|
+
shadowOffsetY: 2,
|
|
21
|
+
shadowBlur: 6,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const boxplotDefault = {
|
|
25
|
+
OUTLIER_RADIUS: 4,
|
|
26
|
+
OUTLIER_BORDER_WIDTH: 2,
|
|
27
|
+
LINE_TYPE: {
|
|
28
|
+
whisker: { lineWidth: 1 },
|
|
29
|
+
maximum: { lineWidth: 1 },
|
|
30
|
+
minimum: { lineWidth: 1 },
|
|
31
|
+
median: { lineWidth: 1, color: '#ffffff' },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const DEFAULT_BULLET_RANGE_OPACITY = [0.5, 0.3, 0.1];
|
|
35
|
+
const DEFAULT_PIE_LINE_WIDTH = 3;
|
|
36
|
+
function makeDefaultDataLabelsTheme(globalFontFamily = 'Arial') {
|
|
37
|
+
return {
|
|
38
|
+
fontFamily: globalFontFamily,
|
|
39
|
+
fontSize: 11,
|
|
40
|
+
fontWeight: 400,
|
|
41
|
+
color: '#333333',
|
|
42
|
+
useSeriesColor: false,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const DEFAULT_BUBBLE_ARROW = {
|
|
46
|
+
width: 8,
|
|
47
|
+
height: 6,
|
|
48
|
+
};
|
|
49
|
+
export const defaultSeriesTheme = {
|
|
50
|
+
colors: [
|
|
51
|
+
'#00a9ff',
|
|
52
|
+
'#ffb840',
|
|
53
|
+
'#ff5a46',
|
|
54
|
+
'#00bd9f',
|
|
55
|
+
'#785fff',
|
|
56
|
+
'#f28b8c',
|
|
57
|
+
'#989486',
|
|
58
|
+
'#516f7d',
|
|
59
|
+
'#28e6eb',
|
|
60
|
+
'#28695f',
|
|
61
|
+
'#96c85a',
|
|
62
|
+
'#45ba3f',
|
|
63
|
+
'#295ba0',
|
|
64
|
+
'#2a4175',
|
|
65
|
+
'#289399',
|
|
66
|
+
'#66c8d3',
|
|
67
|
+
'#617178',
|
|
68
|
+
'#8a9a9a',
|
|
69
|
+
'#bebebe',
|
|
70
|
+
'#374b5a',
|
|
71
|
+
'#64eba0',
|
|
72
|
+
'#ffe155',
|
|
73
|
+
'#ff9141',
|
|
74
|
+
'#af4beb',
|
|
75
|
+
'#ff73fa',
|
|
76
|
+
'#ff55b2',
|
|
77
|
+
'#2869f5',
|
|
78
|
+
'#3296ff',
|
|
79
|
+
'#8cc3ff',
|
|
80
|
+
'#2828b9',
|
|
81
|
+
'#fa8787',
|
|
82
|
+
'#e13782',
|
|
83
|
+
'#7d5aaa',
|
|
84
|
+
'#643c91',
|
|
85
|
+
'#d25f5f',
|
|
86
|
+
'#fabe6e',
|
|
87
|
+
'#c3a9eb',
|
|
88
|
+
'#b9c8f5',
|
|
89
|
+
'#73a0cd',
|
|
90
|
+
'#0f5a8c',
|
|
91
|
+
],
|
|
92
|
+
startColor: '#ffe98a',
|
|
93
|
+
endColor: '#d74177',
|
|
94
|
+
lineWidth: DEFAULT_LINE_SERIES_WIDTH,
|
|
95
|
+
dashSegments: [],
|
|
96
|
+
borderWidth: 0,
|
|
97
|
+
borderColor: '#ffffff',
|
|
98
|
+
select: {
|
|
99
|
+
dot: {
|
|
100
|
+
radius: DEFAULT_LINE_SERIES_DOT_RADIUS,
|
|
101
|
+
borderWidth: DEFAULT_LINE_SERIES_DOT_RADIUS + 2,
|
|
102
|
+
},
|
|
103
|
+
areaOpacity: DEFAULT_AREA_SELECTED_SERIES_OPACITY,
|
|
104
|
+
restSeries: {
|
|
105
|
+
areaOpacity: DEFAULT_AREA_UNSELECTED_SERIES_OPACITY,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
hover: {
|
|
109
|
+
dot: {
|
|
110
|
+
radius: DEFAULT_LINE_SERIES_DOT_RADIUS,
|
|
111
|
+
borderWidth: DEFAULT_LINE_SERIES_DOT_RADIUS + 2,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
dot: {
|
|
115
|
+
radius: DEFAULT_LINE_SERIES_DOT_RADIUS,
|
|
116
|
+
},
|
|
117
|
+
areaOpacity: DEFAULT_AREA_OPACITY,
|
|
118
|
+
};
|
|
119
|
+
export function makeAxisTitleTheme(globalFontFamily = 'Arial') {
|
|
120
|
+
return {
|
|
121
|
+
fontSize: 11,
|
|
122
|
+
fontFamily: globalFontFamily,
|
|
123
|
+
fontWeight: 700,
|
|
124
|
+
color: '#bbbbbb',
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function makeCommonTextTheme(globalFontFamily = 'Arial') {
|
|
128
|
+
return { fontSize: 11, fontFamily: globalFontFamily, fontWeight: 'normal', color: '#333333' };
|
|
129
|
+
}
|
|
130
|
+
export function makeDefaultTheme(series, globalFontFamily = 'Arial') {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
const axisTitleTheme = makeAxisTitleTheme(globalFontFamily);
|
|
133
|
+
const commonTextTheme = makeCommonTextTheme(globalFontFamily);
|
|
134
|
+
const hasRadarSeries = !!((_a = series) === null || _a === void 0 ? void 0 : _a.radar);
|
|
135
|
+
const hasGaugeSeries = !!((_b = series) === null || _b === void 0 ? void 0 : _b.gauge);
|
|
136
|
+
return {
|
|
137
|
+
chart: {
|
|
138
|
+
fontFamily: globalFontFamily,
|
|
139
|
+
backgroundColor: '#ffffff',
|
|
140
|
+
},
|
|
141
|
+
noData: {
|
|
142
|
+
fontSize: 18,
|
|
143
|
+
fontFamily: globalFontFamily,
|
|
144
|
+
fontWeight: 'normal',
|
|
145
|
+
color: '#333333',
|
|
146
|
+
},
|
|
147
|
+
title: {
|
|
148
|
+
fontSize: 18,
|
|
149
|
+
fontFamily: globalFontFamily,
|
|
150
|
+
fontWeight: 100,
|
|
151
|
+
color: '#333333',
|
|
152
|
+
},
|
|
153
|
+
yAxis: {
|
|
154
|
+
title: Object.assign({}, axisTitleTheme),
|
|
155
|
+
label: Object.assign({}, commonTextTheme),
|
|
156
|
+
width: 1,
|
|
157
|
+
color: '#333333',
|
|
158
|
+
},
|
|
159
|
+
xAxis: {
|
|
160
|
+
title: Object.assign({}, axisTitleTheme),
|
|
161
|
+
label: Object.assign({}, commonTextTheme),
|
|
162
|
+
width: 1,
|
|
163
|
+
color: '#333333',
|
|
164
|
+
},
|
|
165
|
+
verticalAxis: {
|
|
166
|
+
label: Object.assign(Object.assign({}, commonTextTheme), { textBubble: {
|
|
167
|
+
visible: hasRadarSeries,
|
|
168
|
+
backgroundColor: hasRadarSeries ? '#f3f3f3' : 'rgba(0, 0, 0, 0)',
|
|
169
|
+
borderRadius: 7,
|
|
170
|
+
paddingX: 7,
|
|
171
|
+
paddingY: 2,
|
|
172
|
+
borderColor: 'rgba(0, 0, 0, 0)',
|
|
173
|
+
borderWidth: 1,
|
|
174
|
+
} }),
|
|
175
|
+
},
|
|
176
|
+
circularAxis: {
|
|
177
|
+
title: Object.assign({}, axisTitleTheme),
|
|
178
|
+
label: Object.assign({}, commonTextTheme),
|
|
179
|
+
lineWidth: 1,
|
|
180
|
+
strokeStyle: hasGaugeSeries ? 'rgba(0, 0, 0, 0.5)' : 'rgba(0, 0, 0, 0.05)',
|
|
181
|
+
dotColor: 'rgba(0, 0, 0, 0.5)',
|
|
182
|
+
tick: {
|
|
183
|
+
lineWidth: 1,
|
|
184
|
+
strokeStyle: 'rgba(0, 0, 0, 0.5)',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
legend: {
|
|
188
|
+
label: {
|
|
189
|
+
color: '#333333',
|
|
190
|
+
fontSize: 11,
|
|
191
|
+
fontWeight: 'normal',
|
|
192
|
+
fontFamily: globalFontFamily,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
tooltip: {
|
|
196
|
+
background: 'rgba(85, 85, 85, 0.95)',
|
|
197
|
+
borderColor: 'rgba(255, 255, 255, 0)',
|
|
198
|
+
borderWidth: 0,
|
|
199
|
+
borderRadius: 3,
|
|
200
|
+
borderStyle: 'solid',
|
|
201
|
+
body: {
|
|
202
|
+
fontSize: 12,
|
|
203
|
+
fontFamily: `${globalFontFamily}, sans-serif`,
|
|
204
|
+
fontWeight: 'normal',
|
|
205
|
+
color: '#ffffff',
|
|
206
|
+
},
|
|
207
|
+
header: {
|
|
208
|
+
fontSize: 13,
|
|
209
|
+
fontFamily: `${globalFontFamily}, sans-serif`,
|
|
210
|
+
fontWeight: 'bold',
|
|
211
|
+
color: '#ffffff',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
plot: {
|
|
215
|
+
lineColor: 'rgba(0, 0, 0, 0.05)',
|
|
216
|
+
backgroundColor: 'rgba(255, 255, 255, 0)',
|
|
217
|
+
},
|
|
218
|
+
exportMenu: {
|
|
219
|
+
button: Object.assign(Object.assign({}, makeBorderTheme(5, '#f4f4f4')), { backgroundColor: '#f4f4f4', xIcon: {
|
|
220
|
+
color: '#555555',
|
|
221
|
+
lineWidth: 2,
|
|
222
|
+
}, dotIcon: {
|
|
223
|
+
color: '#555555',
|
|
224
|
+
width: 2,
|
|
225
|
+
height: 2,
|
|
226
|
+
gap: 2,
|
|
227
|
+
} }),
|
|
228
|
+
panel: Object.assign(Object.assign({}, makeBorderTheme(0, '#bab9ba')), { header: Object.assign(Object.assign({}, commonTextTheme), { backgroundColor: '#f4f4f4' }), body: Object.assign(Object.assign({}, commonTextTheme), { backgroundColor: '#ffffff' }) }),
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function makeBorderTheme(borderRadius, borderColor, borderWidth = 1) {
|
|
233
|
+
return { borderWidth, borderRadius, borderColor };
|
|
234
|
+
}
|
|
235
|
+
function makeDefaultTextBubbleTheme(visible = false, borderRadius = 7, paddingX = 5, paddingY = 1, backgroundColor = '#ffffff') {
|
|
236
|
+
return {
|
|
237
|
+
visible,
|
|
238
|
+
paddingX,
|
|
239
|
+
paddingY,
|
|
240
|
+
borderRadius,
|
|
241
|
+
backgroundColor,
|
|
242
|
+
shadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
243
|
+
shadowOffsetY: 2,
|
|
244
|
+
shadowBlur: 4,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function getLineTypeSeriesTheme(globalFontFamily) {
|
|
248
|
+
const defaultDataLabelTheme = makeDefaultDataLabelsTheme(globalFontFamily);
|
|
249
|
+
return {
|
|
250
|
+
lineWidth: defaultSeriesTheme.lineWidth,
|
|
251
|
+
dashSegments: defaultSeriesTheme.dashSegments,
|
|
252
|
+
select: { dot: defaultSeriesTheme.select.dot },
|
|
253
|
+
hover: { dot: defaultSeriesTheme.hover.dot },
|
|
254
|
+
dot: defaultSeriesTheme.dot,
|
|
255
|
+
dataLabels: Object.assign(Object.assign({}, defaultDataLabelTheme), { textBubble: Object.assign(Object.assign({}, makeDefaultTextBubbleTheme()), { arrow: Object.assign({ visible: false, direction: 'bottom' }, DEFAULT_BUBBLE_ARROW) }) }),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function getTreemapHeatmapSeriesTheme(globalFontFamily) {
|
|
259
|
+
const defaultDataLabelTheme = makeDefaultDataLabelsTheme(globalFontFamily);
|
|
260
|
+
return {
|
|
261
|
+
startColor: defaultSeriesTheme.startColor,
|
|
262
|
+
endColor: defaultSeriesTheme.endColor,
|
|
263
|
+
borderWidth: 0,
|
|
264
|
+
borderColor: '#ffffff',
|
|
265
|
+
hover: {
|
|
266
|
+
borderWidth: boxDefault.HOVER_THICKNESS,
|
|
267
|
+
borderColor: '#ffffff',
|
|
268
|
+
},
|
|
269
|
+
select: {
|
|
270
|
+
borderWidth: boxDefault.HOVER_THICKNESS,
|
|
271
|
+
borderColor: '#ffffff',
|
|
272
|
+
},
|
|
273
|
+
dataLabels: Object.assign(Object.assign({}, defaultDataLabelTheme), { color: '#ffffff', textBubble: Object.assign({}, makeDefaultTextBubbleTheme(false, 1, 5, 1, 'rgba(255, 255, 255, 0.5)')) }),
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function getBarColumnSeriesTheme(globalFontFamily) {
|
|
277
|
+
const defaultDataLabelTheme = makeDefaultDataLabelsTheme(globalFontFamily);
|
|
278
|
+
return {
|
|
279
|
+
areaOpacity: 1,
|
|
280
|
+
hover: Object.assign(Object.assign({}, boxDefault.BOX_HOVER), { borderWidth: boxDefault.HOVER_THICKNESS, borderColor: '#ffffff', groupedRect: {
|
|
281
|
+
color: '#000000',
|
|
282
|
+
opacity: 0.05,
|
|
283
|
+
} }),
|
|
284
|
+
select: Object.assign(Object.assign({}, boxDefault.BOX_HOVER), { borderWidth: boxDefault.HOVER_THICKNESS, borderColor: '#ffffff', groupedRect: {
|
|
285
|
+
color: '#000000',
|
|
286
|
+
opacity: 0.2,
|
|
287
|
+
}, restSeries: {
|
|
288
|
+
areaOpacity: 0.2,
|
|
289
|
+
}, areaOpacity: 1 }),
|
|
290
|
+
connector: {
|
|
291
|
+
color: 'rgba(51, 85, 139, 0.3)',
|
|
292
|
+
lineWidth: 1,
|
|
293
|
+
dashSegments: [],
|
|
294
|
+
},
|
|
295
|
+
dataLabels: Object.assign(Object.assign({}, defaultDataLabelTheme), { textBubble: Object.assign(Object.assign({}, makeDefaultTextBubbleTheme(false, 1, 4, 3)), { arrow: Object.assign({ visible: false }, DEFAULT_BUBBLE_ARROW) }), stackTotal: Object.assign(Object.assign({}, defaultDataLabelTheme), { textBubble: Object.assign(Object.assign({}, makeDefaultTextBubbleTheme(true, 1, 4, 3)), { arrow: Object.assign({ visible: true }, DEFAULT_BUBBLE_ARROW) }) }) }),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
const transparentColor = 'rgba(255, 255, 255, 0)';
|
|
299
|
+
const defaultThemeMakers = {
|
|
300
|
+
line: (globalFontFamily) => (Object.assign({}, getLineTypeSeriesTheme(globalFontFamily))),
|
|
301
|
+
area: (globalFontFamily) => {
|
|
302
|
+
const lineTypeSeriesTheme = getLineTypeSeriesTheme(globalFontFamily);
|
|
303
|
+
return Object.assign(Object.assign({}, lineTypeSeriesTheme), { select: Object.assign(Object.assign({}, lineTypeSeriesTheme.select), { areaOpacity: DEFAULT_AREA_SELECTED_SERIES_OPACITY, restSeries: defaultSeriesTheme.select.restSeries }), areaOpacity: DEFAULT_AREA_OPACITY });
|
|
304
|
+
},
|
|
305
|
+
treemap: (globalFontFamily) => getTreemapHeatmapSeriesTheme(globalFontFamily),
|
|
306
|
+
heatmap: (globalFontFamily) => getTreemapHeatmapSeriesTheme(globalFontFamily),
|
|
307
|
+
scatter: () => ({
|
|
308
|
+
size: 12,
|
|
309
|
+
borderWidth: 1.5,
|
|
310
|
+
fillColor: transparentColor,
|
|
311
|
+
select: {
|
|
312
|
+
fillColor: 'rgba(255, 255, 255, 1)',
|
|
313
|
+
borderWidth: 2.5,
|
|
314
|
+
size: 12,
|
|
315
|
+
},
|
|
316
|
+
hover: {
|
|
317
|
+
fillColor: 'rgba(255, 255, 255, 1)',
|
|
318
|
+
borderWidth: 2.5,
|
|
319
|
+
size: 12,
|
|
320
|
+
},
|
|
321
|
+
}),
|
|
322
|
+
bubble: () => ({
|
|
323
|
+
borderWidth: 0,
|
|
324
|
+
borderColor: transparentColor,
|
|
325
|
+
select: {},
|
|
326
|
+
hover: {
|
|
327
|
+
shadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
328
|
+
shadowBlur: 2,
|
|
329
|
+
shadowOffsetY: 2,
|
|
330
|
+
lineWidth: 2,
|
|
331
|
+
},
|
|
332
|
+
}),
|
|
333
|
+
radar: () => ({
|
|
334
|
+
areaOpacity: radarDefault.SELECTED_SERIES_OPACITY,
|
|
335
|
+
hover: {
|
|
336
|
+
dot: {
|
|
337
|
+
radius: radarDefault.HOVER_DOT_RADIUS,
|
|
338
|
+
borderWidth: radarDefault.HOVER_DOT_RADIUS + 1,
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
select: {
|
|
342
|
+
dot: {
|
|
343
|
+
radius: radarDefault.HOVER_DOT_RADIUS,
|
|
344
|
+
borderWidth: radarDefault.HOVER_DOT_RADIUS + 1,
|
|
345
|
+
},
|
|
346
|
+
restSeries: {
|
|
347
|
+
areaOpacity: radarDefault.UNSELECTED_SERIES_OPACITY,
|
|
348
|
+
},
|
|
349
|
+
areaOpacity: radarDefault.SELECTED_SERIES_OPACITY,
|
|
350
|
+
},
|
|
351
|
+
dot: {
|
|
352
|
+
radius: radarDefault.DOT_RADIUS,
|
|
353
|
+
},
|
|
354
|
+
}),
|
|
355
|
+
bar: (globalFontFamily) => (Object.assign({}, getBarColumnSeriesTheme(globalFontFamily))),
|
|
356
|
+
column: (globalFontFamily) => (Object.assign({}, getBarColumnSeriesTheme(globalFontFamily))),
|
|
357
|
+
bullet: (globalFontFamily) => {
|
|
358
|
+
const defaultDataLabelTheme = makeDefaultDataLabelsTheme(globalFontFamily);
|
|
359
|
+
return {
|
|
360
|
+
areaOpacity: 1,
|
|
361
|
+
barWidthRatios: {
|
|
362
|
+
rangeRatio: 1,
|
|
363
|
+
bulletRatio: 0.5,
|
|
364
|
+
markerRatio: 0.8,
|
|
365
|
+
},
|
|
366
|
+
markerLineWidth: 1,
|
|
367
|
+
borderWidth: 0,
|
|
368
|
+
borderColor: 'rgba(255, 255, 255, 0)',
|
|
369
|
+
hover: Object.assign(Object.assign({}, boxDefault.BOX_HOVER), { borderWidth: boxDefault.HOVER_THICKNESS, borderColor: '#ffffff', groupedRect: {
|
|
370
|
+
color: '#000000',
|
|
371
|
+
opacity: 0.05,
|
|
372
|
+
} }),
|
|
373
|
+
select: Object.assign(Object.assign({}, boxDefault.BOX_HOVER), { borderWidth: boxDefault.HOVER_THICKNESS, borderColor: '#ffffff', groupedRect: {
|
|
374
|
+
color: '#000000',
|
|
375
|
+
opacity: 0.2,
|
|
376
|
+
}, restSeries: {
|
|
377
|
+
areaOpacity: 0.2,
|
|
378
|
+
}, areaOpacity: 1 }),
|
|
379
|
+
dataLabels: Object.assign(Object.assign({}, defaultDataLabelTheme), { textBubble: Object.assign(Object.assign({}, makeDefaultTextBubbleTheme()), { arrow: Object.assign({ visible: false }, DEFAULT_BUBBLE_ARROW) }), marker: Object.assign(Object.assign({}, defaultDataLabelTheme), { fontSize: 9, useSeriesColor: true, textBubble: Object.assign(Object.assign({}, makeDefaultTextBubbleTheme(true)), { backgroundColor: 'rgba(255, 255, 255, 0.8)', shadowColor: 'rgba(0, 0, 0, 0.0)', shadowOffsetX: 0, shadowOffsetY: 0, shadowBlur: 0, arrow: Object.assign({ visible: false }, DEFAULT_BUBBLE_ARROW) }) }) }),
|
|
380
|
+
};
|
|
381
|
+
},
|
|
382
|
+
boxPlot: () => ({
|
|
383
|
+
areaOpacity: 1,
|
|
384
|
+
barWidthRatios: {
|
|
385
|
+
barRatio: 1,
|
|
386
|
+
minMaxBarRatio: 0.5,
|
|
387
|
+
},
|
|
388
|
+
markerLineWidth: 1,
|
|
389
|
+
dot: {
|
|
390
|
+
color: '#ffffff',
|
|
391
|
+
radius: boxplotDefault.OUTLIER_RADIUS,
|
|
392
|
+
borderWidth: boxplotDefault.OUTLIER_BORDER_WIDTH,
|
|
393
|
+
useSeriesColor: false,
|
|
394
|
+
},
|
|
395
|
+
rect: { borderWidth: 0 },
|
|
396
|
+
line: Object.assign({}, boxplotDefault.LINE_TYPE),
|
|
397
|
+
hover: Object.assign(Object.assign({}, boxDefault.BOX_HOVER), { rect: { borderWidth: boxDefault.HOVER_THICKNESS, borderColor: '#ffffff' }, dot: {
|
|
398
|
+
radius: boxplotDefault.OUTLIER_RADIUS,
|
|
399
|
+
borderWidth: 0,
|
|
400
|
+
useSeriesColor: true,
|
|
401
|
+
}, line: Object.assign({}, boxplotDefault.LINE_TYPE) }),
|
|
402
|
+
select: Object.assign(Object.assign({}, boxDefault.BOX_HOVER), { rect: { borderWidth: boxDefault.HOVER_THICKNESS, borderColor: '#ffffff' }, dot: {
|
|
403
|
+
radius: boxplotDefault.OUTLIER_RADIUS,
|
|
404
|
+
borderWidth: 0,
|
|
405
|
+
useSeriesColor: true,
|
|
406
|
+
}, line: Object.assign({}, boxplotDefault.LINE_TYPE), restSeries: {
|
|
407
|
+
areaOpacity: 0.2,
|
|
408
|
+
}, areaOpacity: 1 }),
|
|
409
|
+
}),
|
|
410
|
+
pie: (globalFontFamily, { hasOuterAnchor = false, hasOuterAnchorPieSeriesName = false }, isNestedPieChart = false) => {
|
|
411
|
+
const defaultDataLabelTheme = makeDefaultDataLabelsTheme(globalFontFamily);
|
|
412
|
+
return {
|
|
413
|
+
areaOpacity: 1,
|
|
414
|
+
strokeStyle: isNestedPieChart ? '#ffffff' : 'rgba(255, 255, 255, 0)',
|
|
415
|
+
lineWidth: isNestedPieChart ? 1 : 0,
|
|
416
|
+
hover: {
|
|
417
|
+
lineWidth: DEFAULT_PIE_LINE_WIDTH,
|
|
418
|
+
strokeStyle: '#ffffff',
|
|
419
|
+
shadowColor: '#cccccc',
|
|
420
|
+
shadowBlur: 5,
|
|
421
|
+
shadowOffsetX: 0,
|
|
422
|
+
shadowOffsetY: 0,
|
|
423
|
+
},
|
|
424
|
+
select: {
|
|
425
|
+
lineWidth: DEFAULT_PIE_LINE_WIDTH,
|
|
426
|
+
strokeStyle: '#ffffff',
|
|
427
|
+
shadowColor: '#cccccc',
|
|
428
|
+
shadowBlur: 5,
|
|
429
|
+
shadowOffsetX: 0,
|
|
430
|
+
shadowOffsetY: 0,
|
|
431
|
+
restSeries: {
|
|
432
|
+
areaOpacity: 0.3,
|
|
433
|
+
},
|
|
434
|
+
areaOpacity: 1,
|
|
435
|
+
},
|
|
436
|
+
dataLabels: {
|
|
437
|
+
fontFamily: globalFontFamily,
|
|
438
|
+
fontSize: 16,
|
|
439
|
+
fontWeight: 600,
|
|
440
|
+
color: hasOuterAnchor ? '#333333' : '#ffffff',
|
|
441
|
+
useSeriesColor: hasOuterAnchor,
|
|
442
|
+
textBubble: Object.assign({}, makeDefaultTextBubbleTheme(false, 0)),
|
|
443
|
+
callout: {
|
|
444
|
+
lineWidth: 1,
|
|
445
|
+
useSeriesColor: true,
|
|
446
|
+
lineColor: '#e9e9e9',
|
|
447
|
+
},
|
|
448
|
+
pieSeriesName: Object.assign(Object.assign({}, defaultDataLabelTheme), { useSeriesColor: hasOuterAnchorPieSeriesName, color: hasOuterAnchorPieSeriesName ? '#333333' : '#ffffff', textBubble: Object.assign({}, makeDefaultTextBubbleTheme(false, 0)) }),
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
},
|
|
452
|
+
radialBar: (globalFontFamily) => ({
|
|
453
|
+
areaOpacity: 1,
|
|
454
|
+
strokeStyle: 'rgba(255, 255, 255, 0)',
|
|
455
|
+
lineWidth: 0,
|
|
456
|
+
hover: {
|
|
457
|
+
lineWidth: DEFAULT_PIE_LINE_WIDTH,
|
|
458
|
+
strokeStyle: '#fff',
|
|
459
|
+
shadowColor: '#cccccc',
|
|
460
|
+
shadowBlur: 5,
|
|
461
|
+
shadowOffsetX: 0,
|
|
462
|
+
shadowOffsetY: 0,
|
|
463
|
+
groupedSector: {
|
|
464
|
+
color: '#000000',
|
|
465
|
+
opacity: 0.05,
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
select: {
|
|
469
|
+
lineWidth: DEFAULT_PIE_LINE_WIDTH,
|
|
470
|
+
strokeStyle: '#fff',
|
|
471
|
+
shadowColor: '#cccccc',
|
|
472
|
+
shadowBlur: 5,
|
|
473
|
+
shadowOffsetX: 0,
|
|
474
|
+
shadowOffsetY: 0,
|
|
475
|
+
restSeries: {
|
|
476
|
+
areaOpacity: 0.3,
|
|
477
|
+
},
|
|
478
|
+
areaOpacity: 1,
|
|
479
|
+
groupedSector: {
|
|
480
|
+
color: '#000000',
|
|
481
|
+
opacity: 0.2,
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
dataLabels: {
|
|
485
|
+
fontFamily: globalFontFamily,
|
|
486
|
+
fontSize: 11,
|
|
487
|
+
fontWeight: 400,
|
|
488
|
+
color: '#333333',
|
|
489
|
+
useSeriesColor: false,
|
|
490
|
+
textBubble: Object.assign({}, makeDefaultTextBubbleTheme(false, 0)),
|
|
491
|
+
},
|
|
492
|
+
}),
|
|
493
|
+
gauge: (globalFontFamily) => ({
|
|
494
|
+
areaOpacity: 1,
|
|
495
|
+
hover: {
|
|
496
|
+
clockHand: { baseLine: 5 },
|
|
497
|
+
pin: { radius: 5, borderWidth: 5 },
|
|
498
|
+
solid: {
|
|
499
|
+
lineWidth: DEFAULT_PIE_LINE_WIDTH,
|
|
500
|
+
strokeStyle: '#ffffff',
|
|
501
|
+
shadowColor: '#cccccc',
|
|
502
|
+
shadowBlur: 5,
|
|
503
|
+
shadowOffsetX: 0,
|
|
504
|
+
shadowOffsetY: 0,
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
select: {
|
|
508
|
+
clockHand: { baseLine: 5 },
|
|
509
|
+
pin: { radius: 6, borderWidth: 4 },
|
|
510
|
+
solid: {
|
|
511
|
+
lineWidth: DEFAULT_PIE_LINE_WIDTH,
|
|
512
|
+
strokeStyle: '#ffffff',
|
|
513
|
+
shadowColor: '#cccccc',
|
|
514
|
+
shadowBlur: 5,
|
|
515
|
+
shadowOffsetX: 0,
|
|
516
|
+
shadowOffsetY: 0,
|
|
517
|
+
restSeries: {
|
|
518
|
+
areaOpacity: 0.3,
|
|
519
|
+
},
|
|
520
|
+
areaOpacity: 1,
|
|
521
|
+
},
|
|
522
|
+
areaOpacity: 1,
|
|
523
|
+
restSeries: { areaOpacity: 0.3 },
|
|
524
|
+
},
|
|
525
|
+
clockHand: { baseLine: 4 },
|
|
526
|
+
pin: { radius: 5, borderWidth: 5 },
|
|
527
|
+
solid: {
|
|
528
|
+
lineWidth: 0,
|
|
529
|
+
backgroundSolid: { color: 'rgba(0, 0, 0, 0.1)' },
|
|
530
|
+
},
|
|
531
|
+
dataLabels: {
|
|
532
|
+
fontFamily: globalFontFamily,
|
|
533
|
+
fontSize: 11,
|
|
534
|
+
fontWeight: 400,
|
|
535
|
+
color: '#333333',
|
|
536
|
+
useSeriesColor: false,
|
|
537
|
+
textBubble: Object.assign(Object.assign({}, makeDefaultTextBubbleTheme(true, 4, 4, 3)), { shadowColor: 'rgba(0, 0, 0, 0)', shadowOffsetY: 0, shadowBlur: 0, borderColor: '#ccc', borderWidth: 1 }),
|
|
538
|
+
},
|
|
539
|
+
}),
|
|
540
|
+
};
|
|
541
|
+
function getSeriesTheme(globalFontFamily, seriesName, paramForPieSeries, isNestedPieChart = false) {
|
|
542
|
+
if (seriesName === 'pie') {
|
|
543
|
+
return defaultThemeMakers[seriesName](globalFontFamily, paramForPieSeries, isNestedPieChart);
|
|
544
|
+
}
|
|
545
|
+
if (includes(['bubble', 'radar', 'boxPlot'], seriesName)) {
|
|
546
|
+
return defaultThemeMakers[seriesName]();
|
|
547
|
+
}
|
|
548
|
+
return defaultThemeMakers[seriesName](globalFontFamily);
|
|
549
|
+
}
|
|
550
|
+
export function getDefaultTheme(series, pieSeriesOuterAnchors, globalFontFamily = 'Arial', isNestedPieChart = false) {
|
|
551
|
+
const result = Object.keys(series).reduce((acc, seriesName) => (Object.assign(Object.assign({}, acc), { series: Object.assign(Object.assign({}, acc.series), { [seriesName]: getSeriesTheme(globalFontFamily, seriesName, pieSeriesOuterAnchors) }) })), makeDefaultTheme(series, globalFontFamily));
|
|
552
|
+
if (isNestedPieChart) {
|
|
553
|
+
const aliasNames = getNestedPieChartAliasNames(series);
|
|
554
|
+
result.series.pie = aliasNames.reduce((acc, cur) => (Object.assign(Object.assign({}, acc), { [cur]: getSeriesTheme(globalFontFamily, 'pie', pieSeriesOuterAnchors[cur], isNestedPieChart) })), {});
|
|
555
|
+
}
|
|
556
|
+
return result;
|
|
557
|
+
}
|