mdt-charts 1.12.11 → 1.12.15
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 +2 -2
- package/lib/engine/contentManager/contentManager.d.ts +9 -0
- package/lib/engine/contentManager/contentManager.js +15 -0
- package/lib/engine/contentManager/contentManagerFactory.d.ts +14 -0
- package/lib/engine/contentManager/contentManagerFactory.js +20 -0
- package/lib/engine/engine.js +4 -4
- package/lib/engine/features/axis/axis.js +1 -1
- package/lib/engine/features/axis/axisLabelDomHelper.js +1 -1
- package/lib/engine/features/tolltip/newTooltip/newTooltip.js +1 -1
- package/lib/engine/features/tolltip/tooltip.d.ts +4 -4
- package/lib/engine/features/tolltip/tooltip.js +4 -4
- package/lib/engine/polarNotation/polarManager.d.ts +6 -5
- package/lib/engine/polarNotation/polarManager.js +4 -4
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +7 -6
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +5 -5
- package/lib/model/dataManagerModel/dataManagerModel.d.ts +1 -0
- package/lib/model/dataManagerModel/dataManagerModel.js +7 -0
- package/lib/model/featuresModel/legendModel/legendModel.d.ts +2 -1
- package/lib/model/featuresModel/legendModel/legendModel.js +9 -2
- package/lib/model/featuresModel/legendModel/polarMarginCalculator.js +2 -3
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.js +2 -2
- package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.js +3 -1
- package/lib/model/featuresModel/scaleModel/scaleDomainService.d.ts +6 -0
- package/lib/model/featuresModel/scaleModel/scaleDomainService.js +53 -0
- package/lib/model/featuresModel/scaleModel/scaleModel.d.ts +5 -12
- package/lib/model/featuresModel/scaleModel/scaleModel.js +11 -94
- package/lib/model/featuresModel/scaleModel/scaleModelServices.d.ts +5 -0
- package/lib/model/featuresModel/scaleModel/scaleModelServices.js +22 -0
- package/lib/model/margin/marginModel.d.ts +10 -0
- package/lib/model/margin/marginModel.js +20 -0
- package/lib/model/margin/twoDim/twoDimMarginModel.d.ts +14 -0
- package/lib/model/margin/twoDim/twoDimMarginModel.js +69 -0
- package/lib/model/modelBuilder.d.ts +0 -1
- package/lib/model/modelBuilder.js +8 -12
- package/lib/model/modelInstance/canvasModel/canvasModel.d.ts +4 -3
- package/lib/model/modelInstance/canvasModel/canvasModel.js +1 -1
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasMarginModel.d.ts +11 -0
- package/lib/{engine/features/tolltip/newTooltip/newTooltip.test.d.ts → model/modelInstance/canvasModel/canvasSizesModel/canvasMarginModel.js} +0 -0
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasSizeModel.d.ts +4 -0
- package/lib/{engine/twoDimensionalNotation/bar/stackedData/dataStacker.test.d.ts → model/modelInstance/canvasModel/canvasSizesModel/canvasSizeModel.js} +0 -0
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.d.ts +11 -0
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.js +26 -0
- package/lib/model/modelInstance/canvasModel/titleCanvas.js +1 -1
- package/lib/model/notations/intervalModel.d.ts +3 -3
- package/lib/model/notations/intervalModel.js +8 -9
- package/lib/model/notations/polar/donut/donutAggregatorService.d.ts +1 -0
- package/lib/model/notations/polar/donut/donutAggregatorService.js +19 -4
- package/lib/model/notations/twoDimensionalModel.d.ts +2 -2
- package/lib/model/notations/twoDimensionalModel.js +6 -4
- package/lib/style/charts-main.css +9 -9
- package/lib/style/charts-main.less +9 -9
- package/package.json +1 -1
- package/tsconfig.production.json +2 -1
- package/lib/engine/features/tolltip/newTooltip/newTooltip.test.js +0 -186
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.test.js +0 -199
- package/lib/model/featuresModel/scaleModel.d.ts +0 -19
- package/lib/model/featuresModel/scaleModel.js +0 -115
- package/lib/model/marginModel.d.ts +0 -17
- package/lib/model/marginModel.js +0 -80
- package/lib/model/modelHelper.d.ts +0 -7
- package/lib/model/modelHelper.js +0 -41
- package/lib/model/modelInstance/dataModel.d.ts +0 -11
- package/lib/model/modelInstance/dataModel.js +0 -23
- package/lib/model/notations/polarModel.d.ts +0 -15
- package/lib/model/notations/polarModel.js +0 -59
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DataScope } from "../model";
|
|
2
|
-
export declare const DEFAULT_MAX_RECORDS_AMOUNT = 50;
|
|
3
|
-
export declare class DataModelInstance {
|
|
4
|
-
private maxRecordsAmount;
|
|
5
|
-
private scope;
|
|
6
|
-
initMaxRecordsAmount(amount: number): void;
|
|
7
|
-
getMaxRecordsAmount(): number;
|
|
8
|
-
initScope(scope: DataScope): void;
|
|
9
|
-
getScope(): DataScope;
|
|
10
|
-
getAllowableKeys(): string[];
|
|
11
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_MAX_RECORDS_AMOUNT = 50;
|
|
2
|
-
export class DataModelInstance {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.maxRecordsAmount = DEFAULT_MAX_RECORDS_AMOUNT;
|
|
5
|
-
}
|
|
6
|
-
initMaxRecordsAmount(amount) {
|
|
7
|
-
if (typeof amount === "number" && amount > 0) {
|
|
8
|
-
this.maxRecordsAmount = amount;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
getMaxRecordsAmount() {
|
|
12
|
-
return this.maxRecordsAmount;
|
|
13
|
-
}
|
|
14
|
-
initScope(scope) {
|
|
15
|
-
this.scope = scope;
|
|
16
|
-
}
|
|
17
|
-
getScope() {
|
|
18
|
-
return this.scope;
|
|
19
|
-
}
|
|
20
|
-
getAllowableKeys() {
|
|
21
|
-
return this.getScope().allowableKeys;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MdtChartsDataSource, MdtChartsPolarOptions } from "../../config/config";
|
|
2
|
-
import { DesignerConfig } from "../../designer/designerConfig";
|
|
3
|
-
import { PolarOptionsModel, LegendCoordinate } from "../model";
|
|
4
|
-
import { CanvasModel } from "../modelInstance/canvasModel/canvasModel";
|
|
5
|
-
import { ModelInstance } from "../modelInstance/modelInstance";
|
|
6
|
-
/** If donut block has width less than this const, legend change postion from "right" to "bottom" */
|
|
7
|
-
export declare const MIN_DONUT_BLOCK_SIZE = 120;
|
|
8
|
-
export declare class PolarModel {
|
|
9
|
-
static getOptions(options: MdtChartsPolarOptions, data: MdtChartsDataSource, designerConfig: DesignerConfig, modelInstance: ModelInstance): PolarOptionsModel;
|
|
10
|
-
static getLegendPositionByBlockSize(canvasModel: CanvasModel): "bottom" | "right";
|
|
11
|
-
static doesChartBlockHasEnoughWidthForContainsLegend(chartBlockWidth: number, legendWidth: number, legendCoordinate: LegendCoordinate): boolean;
|
|
12
|
-
static doesChartBlockHasEnoughHeightForContainsLegend(chartBlockHeight: number, legendCoordinate: LegendCoordinate): boolean;
|
|
13
|
-
private static getDonutSettings;
|
|
14
|
-
private static getChartsModel;
|
|
15
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ChartStyleModelService } from "../chartStyleModel/chartStyleModel";
|
|
2
|
-
/** If donut block has width less than this const, legend change postion from "right" to "bottom" */
|
|
3
|
-
export const MIN_DONUT_BLOCK_SIZE = 120;
|
|
4
|
-
export class PolarModel {
|
|
5
|
-
static getOptions(options, data, designerConfig, modelInstance) {
|
|
6
|
-
return {
|
|
7
|
-
type: options.type,
|
|
8
|
-
selectable: !!options.selectable,
|
|
9
|
-
title: options.title,
|
|
10
|
-
data: Object.assign({}, options.data),
|
|
11
|
-
charts: this.getChartsModel(options.chart, data[options.data.dataSource].length, designerConfig.chartStyle),
|
|
12
|
-
legend: modelInstance.canvasModel.legendCanvas.getModel(),
|
|
13
|
-
tooltip: options.tooltip,
|
|
14
|
-
chartCanvas: this.getDonutSettings(designerConfig.canvas.chartOptions.donut, options.chart)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
//TODO: type for returned value
|
|
18
|
-
static getLegendPositionByBlockSize(canvasModel) {
|
|
19
|
-
const widthCoefficientWhenLegendShouldInBottom = 1.5;
|
|
20
|
-
const avgLegendWidth = 100;
|
|
21
|
-
const blockWidth = canvasModel.getBlockSize().width;
|
|
22
|
-
const blockHeight = canvasModel.getBlockSize().height;
|
|
23
|
-
return canvasModel.getChartBlockWidth() < MIN_DONUT_BLOCK_SIZE + avgLegendWidth
|
|
24
|
-
&& blockWidth * widthCoefficientWhenLegendShouldInBottom < blockHeight
|
|
25
|
-
? 'bottom'
|
|
26
|
-
: 'right';
|
|
27
|
-
}
|
|
28
|
-
static doesChartBlockHasEnoughWidthForContainsLegend(chartBlockWidth, legendWidth, legendCoordinate) {
|
|
29
|
-
const rightLegendMargin = legendCoordinate.right.margin;
|
|
30
|
-
return chartBlockWidth - legendWidth - rightLegendMargin.left - rightLegendMargin.right >= MIN_DONUT_BLOCK_SIZE;
|
|
31
|
-
}
|
|
32
|
-
static doesChartBlockHasEnoughHeightForContainsLegend(chartBlockHeight, legendCoordinate) {
|
|
33
|
-
const minHeightForLegend = 30;
|
|
34
|
-
const bottomLegendMargin = legendCoordinate.bottom.margin;
|
|
35
|
-
const heightForLegend = chartBlockHeight - bottomLegendMargin.bottom - bottomLegendMargin.top - MIN_DONUT_BLOCK_SIZE;
|
|
36
|
-
return heightForLegend >= minHeightForLegend;
|
|
37
|
-
}
|
|
38
|
-
static getDonutSettings(settings, chartOptions) {
|
|
39
|
-
return {
|
|
40
|
-
padAngle: settings.padAngle,
|
|
41
|
-
thickness: Object.assign({}, settings.thickness),
|
|
42
|
-
aggregator: {
|
|
43
|
-
margin: settings.aggregatorPad,
|
|
44
|
-
text: chartOptions.aggregator.text
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
static getChartsModel(chart, dataLength, chartStyleConfig) {
|
|
49
|
-
const chartsModel = [];
|
|
50
|
-
chartsModel.push({
|
|
51
|
-
type: chart.type,
|
|
52
|
-
data: Object.assign({}, chart.data),
|
|
53
|
-
tooltip: chart.tooltip,
|
|
54
|
-
cssClasses: ChartStyleModelService.getCssClasses(0),
|
|
55
|
-
style: ChartStyleModelService.getChartStyle(dataLength, chartStyleConfig)
|
|
56
|
-
});
|
|
57
|
-
return chartsModel;
|
|
58
|
-
}
|
|
59
|
-
}
|