mdt-charts 1.9.7 → 1.9.11
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 +190 -190
- package/dist/index.html +363 -48
- package/dist/listeners.89e1e272264c0e680de8.js +278 -0
- package/dist/main.f8b6bc6fee33cef1116c.js +228 -0
- package/dist/src_engine_engine_ts.ccee2a280374e0083541.js +759 -0
- package/dist/vendors-node_modules_chroma-js_chroma_js-node_modules_d3-array_src_max_js-node_modules_d3-arr-c3fc24.b32acc465b8557229277.js +1869 -0
- package/package.json +57 -57
- package/dist/bundle.js +0 -2
- package/dist/bundle.js.LICENSE.txt +0 -56
- package/lib/config/config.d.ts +0 -146
- package/lib/config/config.js +0 -1
- package/lib/designer/designerConfig.d.ts +0 -71
- package/lib/designer/designerConfig.js +0 -1
- package/lib/engine/block/block.d.ts +0 -35
- package/lib/engine/block/block.js +0 -110
- package/lib/engine/block/blockHelper.d.ts +0 -12
- package/lib/engine/block/blockHelper.js +0 -19
- package/lib/engine/contentManager.d.ts +0 -9
- package/lib/engine/contentManager.js +0 -29
- package/lib/engine/elementHighlighter/elementHighlighter.d.ts +0 -30
- package/lib/engine/elementHighlighter/elementHighlighter.js +0 -197
- package/lib/engine/elementHighlighter/selectHighlighter.d.ts +0 -11
- package/lib/engine/elementHighlighter/selectHighlighter.js +0 -95
- package/lib/engine/engine.d.ts +0 -20
- package/lib/engine/engine.js +0 -64
- package/lib/engine/features/aggregator/aggregator.d.ts +0 -22
- package/lib/engine/features/aggregator/aggregator.js +0 -95
- package/lib/engine/features/axis/axis.d.ts +0 -12
- package/lib/engine/features/axis/axis.js +0 -118
- package/lib/engine/features/axis/axisDomHelper.d.ts +0 -7
- package/lib/engine/features/axis/axisDomHelper.js +0 -24
- package/lib/engine/features/axis/axisHelper.d.ts +0 -9
- package/lib/engine/features/axis/axisHelper.js +0 -53
- package/lib/engine/features/axis/axisLabelDomHelper.d.ts +0 -17
- package/lib/engine/features/axis/axisLabelDomHelper.js +0 -143
- package/lib/engine/features/axis/axisLabelsEventManager.d.ts +0 -6
- package/lib/engine/features/axis/axisLabelsEventManager.js +0 -36
- package/lib/engine/features/embeddedLabels/embeddedLabels.d.ts +0 -23
- package/lib/engine/features/embeddedLabels/embeddedLabels.js +0 -147
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.d.ts +0 -8
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.js +0 -30
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.d.ts +0 -27
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.js +0 -65
- package/lib/engine/features/gridLine/gidLineHelper.d.ts +0 -13
- package/lib/engine/features/gridLine/gidLineHelper.js +0 -30
- package/lib/engine/features/gridLine/gridLine.d.ts +0 -11
- package/lib/engine/features/gridLine/gridLine.js +0 -67
- package/lib/engine/features/legend/legend.d.ts +0 -22
- package/lib/engine/features/legend/legend.js +0 -109
- package/lib/engine/features/legend/legendDomHelper.d.ts +0 -8
- package/lib/engine/features/legend/legendDomHelper.js +0 -48
- package/lib/engine/features/legend/legendEventsManager.d.ts +0 -12
- package/lib/engine/features/legend/legendEventsManager.js +0 -47
- package/lib/engine/features/legend/legendHelper.d.ts +0 -21
- package/lib/engine/features/legend/legendHelper.js +0 -97
- package/lib/engine/features/markDots/markDot.d.ts +0 -20
- package/lib/engine/features/markDots/markDot.js +0 -68
- package/lib/engine/features/markDots/markDotsHelper.d.ts +0 -6
- package/lib/engine/features/markDots/markDotsHelper.js +0 -16
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlert.d.ts +0 -14
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlert.js +0 -97
- package/lib/engine/features/scale/scale.d.ts +0 -16
- package/lib/engine/features/scale/scale.js +0 -74
- package/lib/engine/features/tipBox/tipBox.d.ts +0 -11
- package/lib/engine/features/tipBox/tipBox.js +0 -32
- package/lib/engine/features/tipBox/tipBoxHelper.d.ts +0 -16
- package/lib/engine/features/tipBox/tipBoxHelper.js +0 -48
- package/lib/engine/features/title/title.d.ts +0 -9
- package/lib/engine/features/title/title.js +0 -35
- package/lib/engine/features/tolltip/tooltip.d.ts +0 -19
- package/lib/engine/features/tolltip/tooltip.js +0 -180
- package/lib/engine/features/tolltip/tooltipComponentsManager.d.ts +0 -17
- package/lib/engine/features/tolltip/tooltipComponentsManager.js +0 -127
- package/lib/engine/features/tolltip/tooltipDomHelper.d.ts +0 -36
- package/lib/engine/features/tolltip/tooltipDomHelper.js +0 -114
- package/lib/engine/features/tolltip/tooltipHelper.d.ts +0 -16
- package/lib/engine/features/tolltip/tooltipHelper.js +0 -99
- package/lib/engine/filterManager/filterEventManager.d.ts +0 -33
- package/lib/engine/filterManager/filterEventManager.js +0 -127
- package/lib/engine/helpers/domHelper.d.ts +0 -30
- package/lib/engine/helpers/domHelper.js +0 -68
- package/lib/engine/helpers/helper.d.ts +0 -30
- package/lib/engine/helpers/helper.js +0 -89
- package/lib/engine/helpers/namesHelper.d.ts +0 -5
- package/lib/engine/helpers/namesHelper.js +0 -9
- package/lib/engine/intervalNotation/gantt.d.ts +0 -10
- package/lib/engine/intervalNotation/gantt.js +0 -62
- package/lib/engine/intervalNotation/intervalManager.d.ts +0 -7
- package/lib/engine/intervalNotation/intervalManager.js +0 -30
- package/lib/engine/polarNotation/donut/DonutHelper.d.ts +0 -15
- package/lib/engine/polarNotation/donut/DonutHelper.js +0 -58
- package/lib/engine/polarNotation/donut/donut.d.ts +0 -32
- package/lib/engine/polarNotation/donut/donut.js +0 -124
- package/lib/engine/polarNotation/polarManager.d.ts +0 -10
- package/lib/engine/polarNotation/polarManager.js +0 -55
- package/lib/engine/transitionManager.d.ts +0 -19
- package/lib/engine/transitionManager.js +0 -64
- package/lib/engine/twoDimensionalNotation/area/area.d.ts +0 -17
- package/lib/engine/twoDimensionalNotation/area/area.js +0 -131
- package/lib/engine/twoDimensionalNotation/area/areaHelper.d.ts +0 -9
- package/lib/engine/twoDimensionalNotation/area/areaHelper.js +0 -40
- package/lib/engine/twoDimensionalNotation/bar/bar.d.ts +0 -34
- package/lib/engine/twoDimensionalNotation/bar/bar.js +0 -216
- package/lib/engine/twoDimensionalNotation/bar/barHelper.d.ts +0 -24
- package/lib/engine/twoDimensionalNotation/bar/barHelper.js +0 -103
- package/lib/engine/twoDimensionalNotation/line/line.d.ts +0 -17
- package/lib/engine/twoDimensionalNotation/line/line.js +0 -132
- package/lib/engine/twoDimensionalNotation/line/lineHelper.d.ts +0 -8
- package/lib/engine/twoDimensionalNotation/line/lineHelper.js +0 -28
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +0 -11
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +0 -101
- package/lib/engine/valueFormatter.d.ts +0 -6
- package/lib/engine/valueFormatter.js +0 -8
- package/lib/main.d.ts +0 -79
- package/lib/main.js +0 -85
- package/lib/model/chartStyleModel.d.ts +0 -16
- package/lib/model/chartStyleModel.js +0 -67
- package/lib/model/dataManagerModel.d.ts +0 -22
- package/lib/model/dataManagerModel.js +0 -137
- package/lib/model/featuresModel/axisModel.d.ts +0 -18
- package/lib/model/featuresModel/axisModel.js +0 -111
- package/lib/model/featuresModel/legendModel/legendCanvasModel.d.ts +0 -7
- package/lib/model/featuresModel/legendModel/legendCanvasModel.js +0 -86
- package/lib/model/featuresModel/legendModel/legendModel.d.ts +0 -13
- package/lib/model/featuresModel/legendModel/legendModel.js +0 -78
- package/lib/model/featuresModel/otherComponents.d.ts +0 -6
- package/lib/model/featuresModel/otherComponents.js +0 -12
- package/lib/model/featuresModel/scaleModel.d.ts +0 -17
- package/lib/model/featuresModel/scaleModel.js +0 -100
- package/lib/model/featuresModel/titleModel.d.ts +0 -4
- package/lib/model/featuresModel/titleModel.js +0 -14
- package/lib/model/featuresModel/tooltipModel.d.ts +0 -4
- package/lib/model/featuresModel/tooltipModel.js +0 -7
- package/lib/model/marginModel.d.ts +0 -19
- package/lib/model/marginModel.js +0 -126
- package/lib/model/model.d.ts +0 -220
- package/lib/model/model.js +0 -1
- package/lib/model/modelBuilder.d.ts +0 -16
- package/lib/model/modelBuilder.js +0 -128
- package/lib/model/modelHelper.d.ts +0 -7
- package/lib/model/modelHelper.js +0 -41
- package/lib/model/notations/intervalModel.d.ts +0 -8
- package/lib/model/notations/intervalModel.js +0 -93
- package/lib/model/notations/polarModel.d.ts +0 -7
- package/lib/model/notations/polarModel.js +0 -27
- package/lib/model/notations/twoDimensionalModel.d.ts +0 -19
- package/lib/model/notations/twoDimensionalModel.js +0 -85
- package/lib/style/charts-main.css +0 -240
- package/lib/style/charts-main.less +0 -240
- package/test.html +0 -196
package/lib/model/marginModel.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { AxisModel } from "./featuresModel/axisModel";
|
|
2
|
-
import { DataManagerModel } from "./dataManagerModel";
|
|
3
|
-
import { LegendModel, MIN_DONUT_BLOCK_SIZE } from "./featuresModel/legendModel/legendModel";
|
|
4
|
-
import { AxisType } from "./modelBuilder";
|
|
5
|
-
import { TwoDimensionalModel } from "./notations/twoDimensionalModel";
|
|
6
|
-
export const AXIS_HORIZONTAL_LABEL_PADDING = 15;
|
|
7
|
-
export const AXIS_VERTICAL_LABEL_PADDING = 10;
|
|
8
|
-
export class MarginModel {
|
|
9
|
-
static getMargin(designerConfig, config, otherComponents, data) {
|
|
10
|
-
const margin = Object.assign({}, designerConfig.canvas.chartBlockMargin);
|
|
11
|
-
this.recalcMarginWithLegend(margin, config, designerConfig.canvas.legendBlock.maxWidth, otherComponents.legendBlock, data);
|
|
12
|
-
this.recalcMarginByTitle(margin, otherComponents.titleBlock);
|
|
13
|
-
if (config.options.type === '2d' || config.options.type === 'interval') {
|
|
14
|
-
const labelSize = this.getHorizontalMarginByAxisLabels(designerConfig.canvas.axisLabel.maxSize.main, config.options.axis, data, config.options);
|
|
15
|
-
this.recalcVerticalMarginByAxisLabelHeight(labelSize, margin, config.options.orientation, config.options.axis);
|
|
16
|
-
// Если встроенный лейбл показывает ключи, то лейблы оси ключей не показываются
|
|
17
|
-
// При этом все графики должны иметь: embeddedLabels = 'key'
|
|
18
|
-
// И все графики должны быть типа bar.
|
|
19
|
-
const showingFlag = config.options.type === '2d'
|
|
20
|
-
? !TwoDimensionalModel.getChartsEmbeddedLabelsFlag(config.options.charts, config.options.orientation)
|
|
21
|
-
: true;
|
|
22
|
-
this.recalcHorizontalMarginByAxisLabelWidth(labelSize, margin, config.options.orientation, config.options.axis, showingFlag);
|
|
23
|
-
}
|
|
24
|
-
return margin;
|
|
25
|
-
}
|
|
26
|
-
static recalcPolarMarginWithScopedData(margin, blockSize, designerConfig, config, legendBlockModel, dataScope, options) {
|
|
27
|
-
let position = LegendModel.getLegendModel(config.options.type, config.options.legend.show, config.canvas.size, margin).position;
|
|
28
|
-
if (position !== 'off') {
|
|
29
|
-
if (position === 'right' && blockSize.width - margin.left - margin.right < MIN_DONUT_BLOCK_SIZE)
|
|
30
|
-
position = 'bottom';
|
|
31
|
-
this.clearMarginByLegendBlockPosition(margin, legendBlockModel);
|
|
32
|
-
let allowableKeys = [...dataScope.allowableKeys];
|
|
33
|
-
if (dataScope.hidedRecordsAmount !== 0 && position === 'bottom')
|
|
34
|
-
allowableKeys.push('1'); // Если есть спрятанные записи, то в массив добавляется объект, чтобы выделить место в легенде для индикатора переполнения
|
|
35
|
-
const legendSize = LegendModel.getLegendSize(config.options.type, position, allowableKeys, designerConfig.canvas.legendBlock.maxWidth, config.canvas.size, legendBlockModel);
|
|
36
|
-
margin[position] += legendSize + legendBlockModel.coordinate[position].margin[position];
|
|
37
|
-
legendBlockModel.coordinate[position].size = legendSize;
|
|
38
|
-
options.legend.position = position;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
static recalcMarginByVerticalAxisLabel(margin, config, designerConfig, dataScope) {
|
|
42
|
-
if ((config.options.type === '2d' || config.options.type === 'interval') && config.options.orientation === 'vertical') {
|
|
43
|
-
const axisLabelSize = AxisModel.getLabelSize(designerConfig.canvas.axisLabel.maxSize.main, dataScope.allowableKeys);
|
|
44
|
-
const axisConfig = AxisModel.getKeyAxisLabelPosition(margin, config.canvas.size, dataScope.allowableKeys.length);
|
|
45
|
-
const marginOrient = config.options.axis.key.position === 'end' ? 'bottom' : 'top';
|
|
46
|
-
if (axisConfig === 'rotated')
|
|
47
|
-
margin[marginOrient] += (axisLabelSize.width - axisLabelSize.height);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
static getHorizontalMarginByAxisLabels(labelsMaxWidth, axis, data, options) {
|
|
51
|
-
const keyAxisOrient = AxisModel.getAxisOrient(AxisType.Key, options.orientation, axis.key.position);
|
|
52
|
-
let labelsTexts;
|
|
53
|
-
if (keyAxisOrient === 'left' || keyAxisOrient === 'right') {
|
|
54
|
-
labelsTexts = DataManagerModel.getDataValuesByKeyField(data, options.data.dataSource, options.data.keyField.name);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
labelsTexts = ['0000'];
|
|
58
|
-
}
|
|
59
|
-
return AxisModel.getLabelSize(labelsMaxWidth, labelsTexts);
|
|
60
|
-
}
|
|
61
|
-
static recalcVerticalMarginByAxisLabelHeight(labelSize, margin, orientation, axis) {
|
|
62
|
-
const keyAxisOrient = AxisModel.getAxisOrient(AxisType.Key, orientation, axis.key.position);
|
|
63
|
-
const valueAxisOrient = AxisModel.getAxisOrient(AxisType.Value, orientation, axis.value.position);
|
|
64
|
-
if ((keyAxisOrient === 'bottom' || keyAxisOrient === 'top')) {
|
|
65
|
-
if (axis.key.visibility)
|
|
66
|
-
margin[keyAxisOrient] += labelSize.height + AXIS_HORIZONTAL_LABEL_PADDING;
|
|
67
|
-
}
|
|
68
|
-
else if (axis.value.visibility) {
|
|
69
|
-
margin[valueAxisOrient] += labelSize.height + AXIS_HORIZONTAL_LABEL_PADDING;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
static recalcHorizontalMarginByAxisLabelWidth(labelSize, margin, orientation, axis, isShow) {
|
|
73
|
-
const keyAxisOrient = AxisModel.getAxisOrient(AxisType.Key, orientation, axis.key.position);
|
|
74
|
-
const valueAxisOrient = AxisModel.getAxisOrient(AxisType.Value, orientation, axis.value.position);
|
|
75
|
-
if ((keyAxisOrient === 'left' || keyAxisOrient === 'right') && isShow && axis.key.visibility) {
|
|
76
|
-
margin[keyAxisOrient] += labelSize.width + AXIS_VERTICAL_LABEL_PADDING;
|
|
77
|
-
}
|
|
78
|
-
else if ((valueAxisOrient === 'left' || valueAxisOrient === 'right') && axis.value.visibility) {
|
|
79
|
-
margin[valueAxisOrient] += labelSize.width + AXIS_VERTICAL_LABEL_PADDING;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
static recalcMarginWithLegend(margin, config, legendMaxWidth, legendBlockModel, data) {
|
|
83
|
-
const legendPosition = LegendModel.getLegendModel(config.options.type, config.options.legend.show, config.canvas.size, margin).position;
|
|
84
|
-
if (legendPosition !== 'off') {
|
|
85
|
-
const legendItemsContent = this.getLegendItemsContent(config.options, data);
|
|
86
|
-
const legendSize = LegendModel.getLegendSize(config.options.type, legendPosition, legendItemsContent, legendMaxWidth, config.canvas.size, legendBlockModel);
|
|
87
|
-
margin[legendPosition] += legendSize;
|
|
88
|
-
if (legendSize !== 0)
|
|
89
|
-
this.appendToGlobalMarginValuesLegendMargin(margin, legendPosition, legendBlockModel);
|
|
90
|
-
legendBlockModel.coordinate[legendPosition].size = legendSize;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
static getLegendItemsContent(options, data) {
|
|
94
|
-
if (options.type === '2d') {
|
|
95
|
-
let texts = [];
|
|
96
|
-
options.charts.forEach(chart => {
|
|
97
|
-
texts = texts.concat(chart.data.valueFields.map(field => field.title));
|
|
98
|
-
});
|
|
99
|
-
return texts;
|
|
100
|
-
}
|
|
101
|
-
else if (options.type === 'polar') {
|
|
102
|
-
return DataManagerModel.getDataValuesByKeyField(data, options.data.dataSource, options.data.keyField.name);
|
|
103
|
-
}
|
|
104
|
-
else if (options.type === 'interval') {
|
|
105
|
-
return [options.chart.data.valueField1.name];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
static appendToGlobalMarginValuesLegendMargin(margin, position, legendBlockModel) {
|
|
109
|
-
const legendCoordinate = legendBlockModel.coordinate;
|
|
110
|
-
if (position === 'left' || position === 'right')
|
|
111
|
-
margin[position] += legendCoordinate[position].margin.left + legendCoordinate[position].margin.right;
|
|
112
|
-
else
|
|
113
|
-
margin[position] += legendCoordinate[position].margin.top + legendCoordinate[position].margin.bottom;
|
|
114
|
-
}
|
|
115
|
-
static clearMarginByLegendBlockPosition(margin, legendBlockModel) {
|
|
116
|
-
const legendCoordinate = legendBlockModel.coordinate;
|
|
117
|
-
['left', 'right', 'top', 'bottom'].forEach((position) => {
|
|
118
|
-
margin[position] -= legendCoordinate[position].size === 0
|
|
119
|
-
? 0
|
|
120
|
-
: legendCoordinate[position].size + legendCoordinate[position].margin[position];
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
static recalcMarginByTitle(margin, titleBlockModel) {
|
|
124
|
-
margin.top += titleBlockModel.margin.top + titleBlockModel.size;
|
|
125
|
-
}
|
|
126
|
-
}
|
package/lib/model/model.d.ts
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { ChartOrientation, IntervalChartType, PolarChartType, Size, TooltipOptions, TwoDimensionalChartType } from "../config/config";
|
|
2
|
-
import { DataType, DonutOptionsCanvas, Formatter, TooltipSettings, Transitions } from "../designer/designerConfig";
|
|
3
|
-
declare type AxisType = "key" | "value";
|
|
4
|
-
export declare type Orient = "top" | "bottom" | "left" | "right";
|
|
5
|
-
export declare type ScaleKeyType = "band" | "point";
|
|
6
|
-
export declare type ScaleValueType = "linear" | "datetime";
|
|
7
|
-
export declare type AxisLabelPosition = "straight" | "rotated";
|
|
8
|
-
export declare type LegendPosition = "off" | "top" | "bottom" | "left" | "right";
|
|
9
|
-
export declare type EmbeddedLabelTypeModel = "none" | "key" | "value";
|
|
10
|
-
export declare type DataOptions = {
|
|
11
|
-
[option: string]: any;
|
|
12
|
-
};
|
|
13
|
-
export interface Model {
|
|
14
|
-
blockCanvas: BlockCanvas;
|
|
15
|
-
chartBlock: ChartBlock;
|
|
16
|
-
options: TwoDimensionalOptionsModel | PolarOptionsModel | IntervalOptionsModel;
|
|
17
|
-
otherComponents: OtherComponents;
|
|
18
|
-
dataSettings: DataSettings;
|
|
19
|
-
chartSettings: ChartElementsSettings;
|
|
20
|
-
transitions?: Transitions;
|
|
21
|
-
}
|
|
22
|
-
export interface BlockCanvas {
|
|
23
|
-
size: Size;
|
|
24
|
-
cssClass: string;
|
|
25
|
-
}
|
|
26
|
-
export interface ChartBlock {
|
|
27
|
-
margin: BlockMargin;
|
|
28
|
-
}
|
|
29
|
-
export interface BlockMargin {
|
|
30
|
-
top: number;
|
|
31
|
-
bottom: number;
|
|
32
|
-
left: number;
|
|
33
|
-
right: number;
|
|
34
|
-
}
|
|
35
|
-
interface OptionsModel {
|
|
36
|
-
legend: ILegendModel;
|
|
37
|
-
data: OptionsModelData;
|
|
38
|
-
title: string;
|
|
39
|
-
selectable: boolean;
|
|
40
|
-
tooltip: TooltipOptions;
|
|
41
|
-
}
|
|
42
|
-
export interface TwoDimensionalOptionsModel extends OptionsModel {
|
|
43
|
-
type: "2d";
|
|
44
|
-
scale: IScaleModel;
|
|
45
|
-
axis: IAxisModel;
|
|
46
|
-
charts: TwoDimensionalChartModel[];
|
|
47
|
-
additionalElements: AdditionalElementsOptions;
|
|
48
|
-
orient: ChartOrientation;
|
|
49
|
-
}
|
|
50
|
-
export interface PolarOptionsModel extends OptionsModel {
|
|
51
|
-
type: "polar";
|
|
52
|
-
charts: PolarChartModel[];
|
|
53
|
-
}
|
|
54
|
-
export interface IntervalOptionsModel extends OptionsModel {
|
|
55
|
-
type: "interval";
|
|
56
|
-
scale: IScaleModel;
|
|
57
|
-
axis: IAxisModel;
|
|
58
|
-
charts: IntervalChartModel[];
|
|
59
|
-
additionalElements: AdditionalElementsOptions;
|
|
60
|
-
orient: ChartOrientation;
|
|
61
|
-
}
|
|
62
|
-
export interface ILegendModel {
|
|
63
|
-
position: LegendPosition;
|
|
64
|
-
}
|
|
65
|
-
export interface OptionsModelData {
|
|
66
|
-
dataSource: string;
|
|
67
|
-
keyField: Field;
|
|
68
|
-
}
|
|
69
|
-
export interface Field {
|
|
70
|
-
name: string;
|
|
71
|
-
format: DataType;
|
|
72
|
-
}
|
|
73
|
-
export interface IScaleModel {
|
|
74
|
-
key: ScaleKeyModel;
|
|
75
|
-
value: ScaleValueModel;
|
|
76
|
-
}
|
|
77
|
-
export interface ScaleKeyModel {
|
|
78
|
-
domain: any[];
|
|
79
|
-
range: RangeModel;
|
|
80
|
-
type: ScaleKeyType;
|
|
81
|
-
elementsAmount: number;
|
|
82
|
-
}
|
|
83
|
-
export interface ScaleValueModel {
|
|
84
|
-
domain: any[];
|
|
85
|
-
range: RangeModel;
|
|
86
|
-
type: ScaleValueType;
|
|
87
|
-
}
|
|
88
|
-
export interface RangeModel {
|
|
89
|
-
start: number;
|
|
90
|
-
end: number;
|
|
91
|
-
}
|
|
92
|
-
export interface IAxisModel {
|
|
93
|
-
key: AxisModelOptions;
|
|
94
|
-
value: AxisModelOptions;
|
|
95
|
-
}
|
|
96
|
-
export interface AxisModelOptions {
|
|
97
|
-
visibility: boolean;
|
|
98
|
-
type: AxisType;
|
|
99
|
-
orient: Orient;
|
|
100
|
-
translate: TranslateModel;
|
|
101
|
-
cssClass: string;
|
|
102
|
-
ticks: AxisTicksModel;
|
|
103
|
-
labels: AxisLabelModel;
|
|
104
|
-
}
|
|
105
|
-
export interface TranslateModel {
|
|
106
|
-
translateX: number;
|
|
107
|
-
translateY: number;
|
|
108
|
-
}
|
|
109
|
-
interface AxisTicksModel {
|
|
110
|
-
flag: boolean;
|
|
111
|
-
}
|
|
112
|
-
export interface AxisLabelModel {
|
|
113
|
-
maxSize: number;
|
|
114
|
-
position: AxisLabelPosition;
|
|
115
|
-
visible: boolean;
|
|
116
|
-
defaultTooltip: boolean;
|
|
117
|
-
}
|
|
118
|
-
export interface AdditionalElementsOptions {
|
|
119
|
-
gridLine: GridLineOptions;
|
|
120
|
-
}
|
|
121
|
-
export interface GridLineOptions {
|
|
122
|
-
flag: GridLineFlag;
|
|
123
|
-
}
|
|
124
|
-
export interface GridLineFlag {
|
|
125
|
-
key: boolean;
|
|
126
|
-
value: boolean;
|
|
127
|
-
}
|
|
128
|
-
interface ChartModel {
|
|
129
|
-
tooltip: TooltipModel;
|
|
130
|
-
cssClasses: string[];
|
|
131
|
-
style: ChartStyle;
|
|
132
|
-
}
|
|
133
|
-
interface TooltipModel {
|
|
134
|
-
show: boolean;
|
|
135
|
-
}
|
|
136
|
-
export interface ChartStyle {
|
|
137
|
-
elementColors: string[];
|
|
138
|
-
opacity: number;
|
|
139
|
-
}
|
|
140
|
-
export interface TwoDimensionalChartModel extends ChartModel {
|
|
141
|
-
type: TwoDimensionalChartType;
|
|
142
|
-
data: TwoDimensionalChartDataModel;
|
|
143
|
-
index: number;
|
|
144
|
-
embeddedLabels: EmbeddedLabelTypeModel;
|
|
145
|
-
isSegmented: boolean;
|
|
146
|
-
markersOptions: MarkersOptions;
|
|
147
|
-
}
|
|
148
|
-
export interface IntervalChartModel extends ChartModel {
|
|
149
|
-
type: IntervalChartType;
|
|
150
|
-
data: IntervalChartDataModel;
|
|
151
|
-
}
|
|
152
|
-
export interface PolarChartModel extends ChartModel {
|
|
153
|
-
type: PolarChartType;
|
|
154
|
-
data: PolarChartDataModel;
|
|
155
|
-
}
|
|
156
|
-
export interface TwoDimensionalChartDataModel {
|
|
157
|
-
valueFields: ValueField[];
|
|
158
|
-
}
|
|
159
|
-
export interface ValueField extends Field {
|
|
160
|
-
title: string;
|
|
161
|
-
}
|
|
162
|
-
export interface MarkersOptions {
|
|
163
|
-
show: boolean;
|
|
164
|
-
}
|
|
165
|
-
interface IntervalChartDataModel {
|
|
166
|
-
valueField1: ValueField;
|
|
167
|
-
valueField2: ValueField;
|
|
168
|
-
}
|
|
169
|
-
interface PolarChartDataModel {
|
|
170
|
-
valueField: ValueField;
|
|
171
|
-
}
|
|
172
|
-
export interface DataSettings {
|
|
173
|
-
scope: DataScope;
|
|
174
|
-
format: DataFormat;
|
|
175
|
-
}
|
|
176
|
-
export interface DataScope {
|
|
177
|
-
hidedRecordsAmount: number;
|
|
178
|
-
allowableKeys: string[];
|
|
179
|
-
}
|
|
180
|
-
export interface DataFormat {
|
|
181
|
-
formatters: Formatter;
|
|
182
|
-
}
|
|
183
|
-
export interface ChartElementsSettings {
|
|
184
|
-
bar: BarChartSettings;
|
|
185
|
-
donut: DonutChartSettings;
|
|
186
|
-
}
|
|
187
|
-
export interface BarChartSettings {
|
|
188
|
-
groupMaxDistance: number;
|
|
189
|
-
groupMinDistance: number;
|
|
190
|
-
barDistance: number;
|
|
191
|
-
maxBarWidth: number;
|
|
192
|
-
minBarWidth: number;
|
|
193
|
-
}
|
|
194
|
-
export interface DonutChartSettings extends DonutOptionsCanvas {
|
|
195
|
-
}
|
|
196
|
-
export interface OtherComponents {
|
|
197
|
-
legendBlock: LegendBlockModel;
|
|
198
|
-
titleBlock: TitleBlockModel;
|
|
199
|
-
tooltipBlock: TooltipSettings;
|
|
200
|
-
}
|
|
201
|
-
interface ComponentBlockModel {
|
|
202
|
-
margin: BlockMargin;
|
|
203
|
-
size: number;
|
|
204
|
-
pad: number;
|
|
205
|
-
}
|
|
206
|
-
export interface LegendBlockModel {
|
|
207
|
-
coordinate: LegendCoordinate;
|
|
208
|
-
standartTooltip: boolean;
|
|
209
|
-
}
|
|
210
|
-
export interface LegendCoordinate {
|
|
211
|
-
top: LegendCanvasCoordinate;
|
|
212
|
-
bottom: LegendCanvasCoordinate;
|
|
213
|
-
left: LegendCanvasCoordinate;
|
|
214
|
-
right: LegendCanvasCoordinate;
|
|
215
|
-
}
|
|
216
|
-
export interface TitleBlockModel extends ComponentBlockModel {
|
|
217
|
-
}
|
|
218
|
-
interface LegendCanvasCoordinate extends ComponentBlockModel {
|
|
219
|
-
}
|
|
220
|
-
export {};
|
package/lib/model/model.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { MdtChartsConfig, MdtChartsDataSource } from '../config/config';
|
|
2
|
-
import { Model } from './model';
|
|
3
|
-
import { DesignerConfig } from '../designer/designerConfig';
|
|
4
|
-
export declare enum AxisType {
|
|
5
|
-
Key = 0,
|
|
6
|
-
Value = 1
|
|
7
|
-
}
|
|
8
|
-
export declare const CLASSES: {
|
|
9
|
-
dataLabel: string;
|
|
10
|
-
legendLabel: string;
|
|
11
|
-
legendColor: string;
|
|
12
|
-
legendItem: string;
|
|
13
|
-
};
|
|
14
|
-
export declare function assembleModel(config: MdtChartsConfig, data: MdtChartsDataSource, designerConfig: DesignerConfig): Model;
|
|
15
|
-
export declare function getPreparedData(model: Model, data: MdtChartsDataSource, config: MdtChartsConfig): MdtChartsDataSource;
|
|
16
|
-
export declare function getUpdatedModel(config: MdtChartsConfig, data: MdtChartsDataSource, designerConfig: DesignerConfig): Model;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { MarginModel } from './marginModel';
|
|
2
|
-
import { TwoDimensionalModel } from './notations/twoDimensionalModel';
|
|
3
|
-
import { PolarModel } from './notations/polarModel';
|
|
4
|
-
import { DataManagerModel } from './dataManagerModel';
|
|
5
|
-
import { IntervalModel } from './notations/intervalModel';
|
|
6
|
-
import { OtherComponentsModel } from './featuresModel/otherComponents';
|
|
7
|
-
export var AxisType;
|
|
8
|
-
(function (AxisType) {
|
|
9
|
-
AxisType[AxisType["Key"] = 0] = "Key";
|
|
10
|
-
AxisType[AxisType["Value"] = 1] = "Value";
|
|
11
|
-
})(AxisType || (AxisType = {}));
|
|
12
|
-
export const CLASSES = {
|
|
13
|
-
dataLabel: 'data-label',
|
|
14
|
-
legendLabel: 'legend-label',
|
|
15
|
-
legendColor: 'legend-circle',
|
|
16
|
-
legendItem: 'legend-item',
|
|
17
|
-
};
|
|
18
|
-
function getBlockCanvas(config) {
|
|
19
|
-
return {
|
|
20
|
-
size: {
|
|
21
|
-
width: config.canvas.size.width,
|
|
22
|
-
height: config.canvas.size.height
|
|
23
|
-
},
|
|
24
|
-
cssClass: config.canvas.class
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function getChartBlock(margin) {
|
|
28
|
-
return {
|
|
29
|
-
margin
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function getOptions(config, designerConfig, margin, dataScope, data) {
|
|
33
|
-
if (config.options.type === '2d') {
|
|
34
|
-
return TwoDimensionalModel.getOptions(config, designerConfig, margin, dataScope, data);
|
|
35
|
-
}
|
|
36
|
-
else if (config.options.type === 'polar') {
|
|
37
|
-
return PolarModel.getOptions(config, data, margin, designerConfig);
|
|
38
|
-
}
|
|
39
|
-
else if (config.options.type === 'interval') {
|
|
40
|
-
return IntervalModel.getOptions(config, designerConfig, margin, dataScope, data);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function getDataSettings(dataScope, designerConfig) {
|
|
44
|
-
return {
|
|
45
|
-
scope: dataScope,
|
|
46
|
-
format: getDataFormat(designerConfig)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function getChartSettings(barSettings, donutSettings) {
|
|
50
|
-
return {
|
|
51
|
-
bar: Object.assign({}, barSettings),
|
|
52
|
-
donut: Object.assign({}, donutSettings)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function getDataFormat(designerConfig) {
|
|
56
|
-
return {
|
|
57
|
-
formatters: designerConfig.dataFormat.formatters
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function getTransitions(designerConfig) {
|
|
61
|
-
return designerConfig.transitions;
|
|
62
|
-
}
|
|
63
|
-
function roundMargin(margin) {
|
|
64
|
-
margin.top = Math.ceil(margin.top);
|
|
65
|
-
margin.bottom = Math.ceil(margin.bottom);
|
|
66
|
-
margin.left = Math.ceil(margin.left);
|
|
67
|
-
margin.right = Math.ceil(margin.right);
|
|
68
|
-
}
|
|
69
|
-
export function assembleModel(config, data, designerConfig) {
|
|
70
|
-
if (!data || Object.keys(data).length === 0)
|
|
71
|
-
return {
|
|
72
|
-
blockCanvas: getBlockCanvas(config),
|
|
73
|
-
chartBlock: null,
|
|
74
|
-
otherComponents: null,
|
|
75
|
-
options: null,
|
|
76
|
-
dataSettings: null,
|
|
77
|
-
chartSettings: null
|
|
78
|
-
};
|
|
79
|
-
resetFalsyValues(data, config.options.data.keyField.name);
|
|
80
|
-
const otherComponents = OtherComponentsModel.getOtherComponentsModel(designerConfig.elementsOptions, config.options.type);
|
|
81
|
-
const margin = MarginModel.getMargin(designerConfig, config, otherComponents, data);
|
|
82
|
-
const dataScope = DataManagerModel.getDataScope(config, margin, data, designerConfig, otherComponents.legendBlock);
|
|
83
|
-
const preparedData = DataManagerModel.getPreparedData(data, dataScope.allowableKeys, config);
|
|
84
|
-
if (config.options.type === '2d' && config.options.axis.key.visibility)
|
|
85
|
-
MarginModel.recalcMarginByVerticalAxisLabel(margin, config, designerConfig, dataScope);
|
|
86
|
-
const blockCanvas = getBlockCanvas(config);
|
|
87
|
-
const chartBlock = getChartBlock(margin);
|
|
88
|
-
const options = getOptions(config, designerConfig, margin, dataScope, preparedData);
|
|
89
|
-
const dataSettings = getDataSettings(dataScope, designerConfig);
|
|
90
|
-
const chartSettings = getChartSettings(designerConfig.canvas.chartOptions.bar, designerConfig.canvas.chartOptions.donut);
|
|
91
|
-
const transitions = getTransitions(designerConfig);
|
|
92
|
-
if (options.type === 'polar')
|
|
93
|
-
MarginModel.recalcPolarMarginWithScopedData(margin, config.canvas.size, designerConfig, config, otherComponents.legendBlock, dataScope, options);
|
|
94
|
-
roundMargin(margin);
|
|
95
|
-
return {
|
|
96
|
-
blockCanvas,
|
|
97
|
-
chartBlock,
|
|
98
|
-
otherComponents,
|
|
99
|
-
options,
|
|
100
|
-
dataSettings,
|
|
101
|
-
chartSettings,
|
|
102
|
-
transitions
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function resetFalsyValues(data, keyFieldName) {
|
|
106
|
-
for (let setName in data) {
|
|
107
|
-
data[setName].forEach(dataRow => {
|
|
108
|
-
for (let fieldName in dataRow) {
|
|
109
|
-
if (fieldName === keyFieldName && !dataRow[fieldName]) {
|
|
110
|
-
dataRow[fieldName] = '';
|
|
111
|
-
}
|
|
112
|
-
else if (dataRow[fieldName] !== 0 && !dataRow[fieldName]) {
|
|
113
|
-
dataRow[fieldName] = 0;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
export function getPreparedData(model, data, config) {
|
|
120
|
-
resetFalsyValues(data, config.options.data.keyField.name);
|
|
121
|
-
if (!model || Object.keys(model).length === 0 || !data || Object.keys(data).length === 0)
|
|
122
|
-
return null;
|
|
123
|
-
const preparedData = DataManagerModel.getPreparedData(data, model.dataSettings.scope.allowableKeys, config);
|
|
124
|
-
return preparedData;
|
|
125
|
-
}
|
|
126
|
-
export function getUpdatedModel(config, data, designerConfig) {
|
|
127
|
-
return assembleModel(config, data, designerConfig);
|
|
128
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MdtChartsDataSource, IntervalChart } from "../config/config";
|
|
2
|
-
export declare class ModelHelper {
|
|
3
|
-
static getSum(items: number[]): number;
|
|
4
|
-
static getMinAndMaxOfIntervalData(data: MdtChartsDataSource, dataSource: string, chart: IntervalChart): [Date, Date];
|
|
5
|
-
static getUniqueValues(values: string[]): string[];
|
|
6
|
-
static getStringScore(word: string): number;
|
|
7
|
-
}
|
package/lib/model/modelHelper.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export class ModelHelper {
|
|
2
|
-
static getSum(items) {
|
|
3
|
-
return items.reduce((acc, item) => acc + item, 0);
|
|
4
|
-
}
|
|
5
|
-
static getMinAndMaxOfIntervalData(data, dataSource, chart) {
|
|
6
|
-
let min = data[dataSource][0][chart.data.valueField1.name];
|
|
7
|
-
let max = data[dataSource][0][chart.data.valueField1.name];
|
|
8
|
-
const chartData = data[dataSource];
|
|
9
|
-
const valueField1 = chart.data.valueField1.name;
|
|
10
|
-
const valueField2 = chart.data.valueField2.name;
|
|
11
|
-
chartData.forEach(dataRow => {
|
|
12
|
-
if (dataRow[valueField1] > max)
|
|
13
|
-
max = dataRow[valueField1];
|
|
14
|
-
if (dataRow[valueField1] < min)
|
|
15
|
-
min = dataRow[valueField1];
|
|
16
|
-
if (dataRow[valueField2] > max)
|
|
17
|
-
max = dataRow[valueField2];
|
|
18
|
-
if (dataRow[valueField2] < min)
|
|
19
|
-
min = dataRow[valueField2];
|
|
20
|
-
});
|
|
21
|
-
return [min, max];
|
|
22
|
-
}
|
|
23
|
-
static getUniqueValues(values) {
|
|
24
|
-
const uniqueValues = values.filter((keyValue, index, self) => self.indexOf(keyValue) === index);
|
|
25
|
-
return uniqueValues;
|
|
26
|
-
}
|
|
27
|
-
static getStringScore(word) {
|
|
28
|
-
// lower case letter width ~ 0.74 from upper case width.
|
|
29
|
-
// Number width == lower case letter width
|
|
30
|
-
let score = 0;
|
|
31
|
-
const upperLetterScore = 1;
|
|
32
|
-
const lowerLetterScore = 0.74;
|
|
33
|
-
for (let i = 0; i < word.length; i++) {
|
|
34
|
-
if (word[i].toUpperCase() === word[i] && parseFloat(word[i]).toString() !== word[i])
|
|
35
|
-
score += upperLetterScore;
|
|
36
|
-
else
|
|
37
|
-
score += lowerLetterScore;
|
|
38
|
-
}
|
|
39
|
-
return score;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MdtChartsConfig, MdtChartsDataSource, IntervalOptions } from "../../config/config";
|
|
2
|
-
import { DesignerConfig } from "../../designer/designerConfig";
|
|
3
|
-
import { AdditionalElementsOptions, BlockMargin, DataScope, IntervalOptionsModel } from "../model";
|
|
4
|
-
export declare class IntervalModel {
|
|
5
|
-
static getOptions(config: MdtChartsConfig, designerConfig: DesignerConfig, margin: BlockMargin, dataScope: DataScope, data: MdtChartsDataSource): IntervalOptionsModel;
|
|
6
|
-
static getAdditionalElements(options: IntervalOptions): AdditionalElementsOptions;
|
|
7
|
-
private static getChartsModel;
|
|
8
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { AxisModel } from "../featuresModel/axisModel";
|
|
2
|
-
import { ChartStyleModel } from "../chartStyleModel";
|
|
3
|
-
import { DataManagerModel } from "../dataManagerModel";
|
|
4
|
-
import { LegendModel } from "../featuresModel/legendModel/legendModel";
|
|
5
|
-
import { AxisType } from "../modelBuilder";
|
|
6
|
-
import { ScaleModel, ScaleType } from "../featuresModel/scaleModel";
|
|
7
|
-
export class IntervalModel {
|
|
8
|
-
static getOptions(config, designerConfig, margin, dataScope, data) {
|
|
9
|
-
const options = config.options;
|
|
10
|
-
return {
|
|
11
|
-
legend: LegendModel.getLegendModel(config.options.type, config.options.legend.show, config.canvas.size, margin),
|
|
12
|
-
title: options.title,
|
|
13
|
-
selectable: !!options.selectable,
|
|
14
|
-
orient: options.orientation,
|
|
15
|
-
scale: {
|
|
16
|
-
key: {
|
|
17
|
-
domain: dataScope.allowableKeys,
|
|
18
|
-
range: {
|
|
19
|
-
start: 0,
|
|
20
|
-
end: ScaleModel.getRangePeek(ScaleType.Key, options.orientation, margin, config.canvas.size)
|
|
21
|
-
},
|
|
22
|
-
type: 'band',
|
|
23
|
-
elementsAmount: 1
|
|
24
|
-
},
|
|
25
|
-
value: {
|
|
26
|
-
domain: ScaleModel.getDateValueDomain(data, options.chart, options.axis.key.position, options.data.dataSource),
|
|
27
|
-
range: {
|
|
28
|
-
start: 0,
|
|
29
|
-
end: ScaleModel.getRangePeek(ScaleType.Value, options.orientation, margin, config.canvas.size)
|
|
30
|
-
},
|
|
31
|
-
type: 'datetime'
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
axis: {
|
|
35
|
-
key: {
|
|
36
|
-
type: 'key',
|
|
37
|
-
orient: AxisModel.getAxisOrient(AxisType.Key, options.orientation, options.axis.key.position),
|
|
38
|
-
translate: {
|
|
39
|
-
translateX: AxisModel.getAxisTranslateX(AxisType.Key, options.orientation, options.axis.key.position, margin, config.canvas.size.width),
|
|
40
|
-
translateY: AxisModel.getAxisTranslateY(AxisType.Key, options.orientation, options.axis.key.position, margin, config.canvas.size.height)
|
|
41
|
-
},
|
|
42
|
-
cssClass: 'key-axis',
|
|
43
|
-
ticks: options.axis.key.ticks,
|
|
44
|
-
labels: {
|
|
45
|
-
maxSize: AxisModel.getLabelSize(designerConfig.canvas.axisLabel.maxSize.main, data[options.data.dataSource].map(d => d[options.data.keyField.name])).width,
|
|
46
|
-
position: AxisModel.getKeyAxisLabelPosition(margin, config.canvas.size, DataManagerModel.getDataValuesByKeyField(data, options.data.dataSource, options.data.keyField.name).length),
|
|
47
|
-
visible: true,
|
|
48
|
-
defaultTooltip: designerConfig.elementsOptions.tooltip.position === 'fixed'
|
|
49
|
-
},
|
|
50
|
-
visibility: options.axis.key.visibility
|
|
51
|
-
},
|
|
52
|
-
value: {
|
|
53
|
-
type: 'value',
|
|
54
|
-
orient: AxisModel.getAxisOrient(AxisType.Value, options.orientation, options.axis.value.position),
|
|
55
|
-
translate: {
|
|
56
|
-
translateX: AxisModel.getAxisTranslateX(AxisType.Value, options.orientation, options.axis.value.position, margin, config.canvas.size.width),
|
|
57
|
-
translateY: AxisModel.getAxisTranslateY(AxisType.Value, options.orientation, options.axis.value.position, margin, config.canvas.size.height)
|
|
58
|
-
},
|
|
59
|
-
cssClass: 'value-axis',
|
|
60
|
-
ticks: options.axis.value.ticks,
|
|
61
|
-
labels: {
|
|
62
|
-
maxSize: designerConfig.canvas.axisLabel.maxSize.main,
|
|
63
|
-
position: 'straight',
|
|
64
|
-
visible: true,
|
|
65
|
-
defaultTooltip: true
|
|
66
|
-
},
|
|
67
|
-
visibility: options.axis.value.visibility
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
data: Object.assign({}, options.data),
|
|
71
|
-
type: options.type,
|
|
72
|
-
charts: this.getChartsModel(options.chart, designerConfig.chartStyle),
|
|
73
|
-
additionalElements: this.getAdditionalElements(options),
|
|
74
|
-
tooltip: options.tooltip
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
static getAdditionalElements(options) {
|
|
78
|
-
return {
|
|
79
|
-
gridLine: options.additionalElements.gridLine
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
static getChartsModel(chart, chartStyleConfig) {
|
|
83
|
-
const chartsModel = [];
|
|
84
|
-
chartsModel.push({
|
|
85
|
-
type: chart.type,
|
|
86
|
-
data: Object.assign({}, chart.data),
|
|
87
|
-
tooltip: chart.tooltip,
|
|
88
|
-
cssClasses: ChartStyleModel.getCssClasses(0),
|
|
89
|
-
style: ChartStyleModel.getChartStyle(1, chartStyleConfig)
|
|
90
|
-
});
|
|
91
|
-
return chartsModel;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MdtChartsConfig, MdtChartsDataSource } from "../../config/config";
|
|
2
|
-
import { DesignerConfig } from "../../designer/designerConfig";
|
|
3
|
-
import { BlockMargin, PolarOptionsModel } from "../model";
|
|
4
|
-
export declare class PolarModel {
|
|
5
|
-
static getOptions(config: MdtChartsConfig, data: MdtChartsDataSource, margin: BlockMargin, designerConfig: DesignerConfig): PolarOptionsModel;
|
|
6
|
-
private static getChartsModel;
|
|
7
|
-
}
|