mdt-charts 1.10.0 → 1.11.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/lib/config/config.d.ts +9 -2
- package/lib/designer/designerConfig.d.ts +8 -2
- package/lib/engine/features/aggregator/aggregator.d.ts +4 -3
- package/lib/engine/features/aggregator/aggregator.js +14 -11
- package/lib/engine/features/title/title.js +2 -0
- package/lib/engine/features/tolltip/tooltip.js +1 -1
- package/lib/engine/filterManager/filterEventManager.d.ts +3 -3
- package/lib/engine/filterManager/filterEventManager.js +4 -4
- package/lib/engine/intervalNotation/intervalManager.js +2 -2
- package/lib/engine/polarNotation/donut/DonutHelper.d.ts +2 -0
- package/lib/engine/polarNotation/donut/DonutHelper.js +20 -3
- package/lib/engine/polarNotation/donut/donut.js +1 -1
- package/lib/engine/polarNotation/polarManager.js +6 -7
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +4 -4
- package/lib/model/chartStyleModel/TwoDimensionalChartStyleModel.d.ts +19 -0
- package/lib/model/chartStyleModel/TwoDimensionalChartStyleModel.js +61 -0
- package/lib/model/chartStyleModel/chartStyleModel.d.ts +9 -0
- package/lib/model/chartStyleModel/chartStyleModel.js +27 -0
- package/lib/model/dataManagerModel.d.ts +3 -2
- package/lib/model/dataManagerModel.js +12 -10
- package/lib/model/featuresModel/axisModel.d.ts +9 -8
- package/lib/model/featuresModel/axisModel.js +20 -20
- package/lib/model/featuresModel/legendModel/legendModel.d.ts +4 -3
- package/lib/model/featuresModel/legendModel/legendModel.js +5 -7
- package/lib/model/featuresModel/otherComponents.d.ts +9 -2
- package/lib/model/featuresModel/otherComponents.js +6 -4
- package/lib/model/featuresModel/scaleModel.d.ts +6 -5
- package/lib/model/featuresModel/scaleModel.js +9 -9
- package/lib/model/featuresModel/titleModel.d.ts +1 -1
- package/lib/model/featuresModel/titleModel.js +7 -5
- package/lib/model/marginModel.d.ts +5 -5
- package/lib/model/marginModel.js +37 -35
- package/lib/model/model.d.ts +24 -18
- package/lib/model/modelBuilder.js +23 -34
- package/lib/model/modelInstance/canvasModel/canvasModel.d.ts +22 -0
- package/lib/model/modelInstance/canvasModel/canvasModel.js +42 -0
- package/lib/model/modelInstance/canvasModel/titleCanvas.d.ts +9 -0
- package/lib/model/modelInstance/canvasModel/titleCanvas.js +11 -0
- package/lib/model/modelInstance/modelInstance.d.ts +7 -0
- package/lib/model/modelInstance/modelInstance.js +11 -0
- package/lib/model/notations/intervalModel.d.ts +2 -1
- package/lib/model/notations/intervalModel.js +16 -13
- package/lib/model/notations/polarModel.d.ts +5 -3
- package/lib/model/notations/polarModel.js +17 -7
- package/lib/model/notations/twoDimensionalModel.d.ts +7 -5
- package/lib/model/notations/twoDimensionalModel.js +19 -11
- package/lib/style/charts-main.css +2 -0
- package/lib/style/charts-main.less +2 -0
- package/package.json +3 -2
- package/.vscode/settings.json +0 -7
- package/dist/index.html +0 -363
- package/dist/listeners.93c655365f908a888f8a.js +0 -278
- package/dist/main.f8b6bc6fee33cef1116c.js +0 -228
- package/dist/src_engine_engine_ts.f6ee215f42079564fff5.js +0 -770
- package/dist/vendors-node_modules_chroma-js_chroma_js-node_modules_d3-array_src_max_js-node_modules_d3-arr-c3fc24.2f05591b407b8b60f1c4.js +0 -1891
- package/lib/model/chartStyleModel.d.ts +0 -16
- package/lib/model/chartStyleModel.js +0 -67
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TwoDimensionalChartType } from "../config/config";
|
|
2
|
-
import { ChartStyleConfig } from "../designer/designerConfig";
|
|
3
|
-
import { ChartStyle } from "./model";
|
|
4
|
-
export declare class ChartStyleModel {
|
|
5
|
-
private static safeColorsAmount;
|
|
6
|
-
private static standartColors;
|
|
7
|
-
static getCssClasses(chartIndex: number): string[];
|
|
8
|
-
static get2DChartStyle(chartsAmount: number, chartType: TwoDimensionalChartType, chartsFieldsAmounts: number[], chartIndex: number, isSegmented: boolean, styleConfig: ChartStyleConfig): ChartStyle;
|
|
9
|
-
static getChartStyle(elementsAmount: number, styleConfig: ChartStyleConfig): ChartStyle;
|
|
10
|
-
private static getChartColors;
|
|
11
|
-
private static getChartOpacity;
|
|
12
|
-
private static getColorSet;
|
|
13
|
-
private static checkAndGet;
|
|
14
|
-
private static getStartIndex;
|
|
15
|
-
private static resetColor;
|
|
16
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as chroma from "chroma-js";
|
|
2
|
-
import { ModelHelper } from "./modelHelper";
|
|
3
|
-
export class ChartStyleModel {
|
|
4
|
-
static getCssClasses(chartIndex) {
|
|
5
|
-
const cssClasses = [`chart-${chartIndex}`];
|
|
6
|
-
return cssClasses;
|
|
7
|
-
}
|
|
8
|
-
static get2DChartStyle(chartsAmount, chartType, chartsFieldsAmounts, chartIndex, isSegmented, styleConfig) {
|
|
9
|
-
const startIndex = this.getStartIndex(chartIndex, chartsFieldsAmounts);
|
|
10
|
-
const baseColors = this.checkAndGet(styleConfig.baseColors);
|
|
11
|
-
const palette = this.getColorSet(baseColors, ModelHelper.getSum(chartsFieldsAmounts));
|
|
12
|
-
return {
|
|
13
|
-
elementColors: this.getChartColors(palette, chartsFieldsAmounts[chartIndex], startIndex, chartType),
|
|
14
|
-
opacity: this.getChartOpacity(chartsAmount, chartType, chartsFieldsAmounts[chartIndex], isSegmented)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
static getChartStyle(elementsAmount, styleConfig) {
|
|
18
|
-
const baseColors = this.checkAndGet(styleConfig.baseColors);
|
|
19
|
-
return {
|
|
20
|
-
elementColors: this.getColorSet(baseColors, elementsAmount),
|
|
21
|
-
opacity: 1
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
static getChartColors(palette, elementsAmount, startIndex, chartType) {
|
|
25
|
-
const selectedColors = palette.slice(startIndex, startIndex + elementsAmount);
|
|
26
|
-
if (chartType !== 'line')
|
|
27
|
-
return selectedColors;
|
|
28
|
-
for (let i = 0; i < selectedColors.length; i++) {
|
|
29
|
-
selectedColors[i] = chroma.mix(selectedColors[i], 'white', 0.2).saturate(3).hex();
|
|
30
|
-
}
|
|
31
|
-
return selectedColors;
|
|
32
|
-
}
|
|
33
|
-
static getChartOpacity(chartsLength, chartType, chartsValueFieldAmount, isSegmented) {
|
|
34
|
-
if (chartType === 'area' && (chartsLength > 1 || chartsValueFieldAmount > 1) && !isSegmented)
|
|
35
|
-
return 0.5; // combined area with other charts has 0.5 opacity
|
|
36
|
-
return 1;
|
|
37
|
-
}
|
|
38
|
-
static getColorSet(baseColors, elementsAmount) {
|
|
39
|
-
return chroma.scale(baseColors)
|
|
40
|
-
.mode('rgb')
|
|
41
|
-
.domain([0, 0.55, 0.75, 1])
|
|
42
|
-
.colors(elementsAmount <= 1 ? 2 : elementsAmount);
|
|
43
|
-
}
|
|
44
|
-
static checkAndGet(baseColors) {
|
|
45
|
-
if (baseColors.length === 0 || baseColors.filter(color => color === 'rgba(0, 0, 0, 0)' || !color).length > 0) {
|
|
46
|
-
return this.standartColors;
|
|
47
|
-
}
|
|
48
|
-
return baseColors;
|
|
49
|
-
}
|
|
50
|
-
static getStartIndex(chartIndex, chartsFieldsAmounts) {
|
|
51
|
-
let startIndex = 0;
|
|
52
|
-
for (let i = 0; i < chartIndex; i++) {
|
|
53
|
-
startIndex += chartsFieldsAmounts[i];
|
|
54
|
-
}
|
|
55
|
-
return startIndex;
|
|
56
|
-
}
|
|
57
|
-
static resetColor(index, baseColor) {
|
|
58
|
-
let color = chroma(baseColor)
|
|
59
|
-
.luminance(0.5)
|
|
60
|
-
.saturate(1.5 + Math.floor(index / this.safeColorsAmount) * 0.5);
|
|
61
|
-
color = chroma(color)
|
|
62
|
-
.set('hsv.h', chroma(color).get('hsv.h') + Math.floor(index / this.safeColorsAmount) * 4);
|
|
63
|
-
return color.hex();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
ChartStyleModel.safeColorsAmount = 8;
|
|
67
|
-
ChartStyleModel.standartColors = ["#209DE3", "#FF3131", "#FFBA00", "#20B078"];
|