mdt-charts 1.28.2 → 1.29.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 +164 -165
- package/lib/designer/designerConfig.d.ts +62 -59
- package/lib/engine/block/block.d.ts +22 -16
- package/lib/engine/block/block.js +51 -51
- package/lib/engine/block/blockHelper.d.ts +6 -6
- package/lib/engine/block/blockHelper.js +16 -16
- package/lib/engine/block/blockHtml.d.ts +8 -8
- package/lib/engine/block/blockHtml.js +15 -15
- package/lib/engine/block/blockSvg.d.ts +20 -20
- package/lib/engine/block/blockSvg.js +65 -66
- package/lib/engine/block/defs/LinearGradientDef.d.ts +2 -2
- package/lib/engine/block/defs/LinearGradientDef.js +27 -27
- package/lib/engine/block/defs/hatchPattern.d.ts +4 -4
- package/lib/engine/block/defs/hatchPattern.js +9 -9
- package/lib/engine/colorReader/colorReader.d.ts +5 -5
- package/lib/engine/colorReader/colorReader.js +18 -18
- package/lib/engine/contentManager/contentManager.d.ts +6 -6
- package/lib/engine/contentManager/contentManager.js +15 -15
- package/lib/engine/contentManager/contentManagerFactory.d.ts +6 -6
- package/lib/engine/contentManager/contentManagerFactory.js +12 -12
- package/lib/engine/elementHighlighter/elementHighlighter.d.ts +70 -22
- package/lib/engine/elementHighlighter/elementHighlighter.js +230 -181
- package/lib/engine/elementHighlighter/selectHighlighter.d.ts +29 -4
- package/lib/engine/elementHighlighter/selectHighlighter.js +189 -87
- package/lib/engine/engine.d.ts +16 -16
- package/lib/engine/engine.js +87 -62
- package/lib/engine/features/aggregator/aggregator.d.ts +24 -17
- package/lib/engine/features/aggregator/aggregator.js +113 -102
- package/lib/engine/features/axis/axis.d.ts +22 -9
- package/lib/engine/features/axis/axis.js +159 -150
- package/lib/engine/features/axis/axisDomHelper.d.ts +7 -2
- package/lib/engine/features/axis/axisDomHelper.js +19 -20
- package/lib/engine/features/axis/axisHelper.d.ts +9 -5
- package/lib/engine/features/axis/axisHelper.js +28 -33
- package/lib/engine/features/axis/axisLabelDomHelper.d.ts +26 -11
- package/lib/engine/features/axis/axisLabelDomHelper.js +156 -152
- package/lib/engine/features/axis/axisLabelsEventManager.d.ts +2 -2
- package/lib/engine/features/axis/axisLabelsEventManager.js +32 -32
- package/lib/engine/features/embeddedLabels/embeddedLabels.d.ts +51 -16
- package/lib/engine/features/embeddedLabels/embeddedLabels.js +234 -134
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.d.ts +13 -2
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.js +20 -23
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.d.ts +32 -15
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.js +56 -63
- package/lib/engine/features/gridLine/gidLineHelper.d.ts +13 -7
- package/lib/engine/features/gridLine/gidLineHelper.js +42 -49
- package/lib/engine/features/gridLine/gridLine.d.ts +19 -5
- package/lib/engine/features/gridLine/gridLine.js +35 -36
- package/lib/engine/features/legend/legend.d.ts +38 -29
- package/lib/engine/features/legend/legend.js +117 -92
- package/lib/engine/features/legend/legendDomHelper.d.ts +13 -6
- package/lib/engine/features/legend/legendDomHelper.js +63 -62
- package/lib/engine/features/legend/legendEventsManager.d.ts +13 -8
- package/lib/engine/features/legend/legendEventsManager.js +48 -47
- package/lib/engine/features/legend/legendHelper.d.ts +39 -14
- package/lib/engine/features/legend/legendHelper.js +98 -93
- package/lib/engine/features/legend/legendHelperService.d.ts +13 -6
- package/lib/engine/features/legend/legendHelperService.js +24 -25
- package/lib/engine/features/legend/legendMarkerCreator.d.ts +18 -9
- package/lib/engine/features/legend/legendMarkerCreator.js +79 -76
- package/lib/engine/features/legend/legendWidthCalculator.d.ts +7 -7
- package/lib/engine/features/legend/legendWidthCalculator.js +126 -122
- package/lib/engine/features/markDots/markDot.d.ts +42 -15
- package/lib/engine/features/markDots/markDot.js +101 -70
- package/lib/engine/features/markDots/markDotsHelper.d.ts +8 -1
- package/lib/engine/features/markDots/markDotsHelper.js +13 -12
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.d.ts +17 -17
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.js +42 -47
- package/lib/engine/features/scale/scale.d.ts +17 -12
- package/lib/engine/features/scale/scale.js +76 -69
- package/lib/engine/features/tipBox/tipBox.d.ts +9 -5
- package/lib/engine/features/tipBox/tipBox.js +24 -24
- package/lib/engine/features/tipBox/tipBoxHelper.d.ts +16 -9
- package/lib/engine/features/tipBox/tipBoxHelper.js +60 -45
- package/lib/engine/features/title/title.d.ts +6 -6
- package/lib/engine/features/title/title.js +34 -35
- package/lib/engine/features/tolltip/newTooltip/newTooltip.d.ts +15 -11
- package/lib/engine/features/tolltip/newTooltip/newTooltip.js +21 -21
- package/lib/engine/features/tolltip/newTooltip/newTooltipService.d.ts +13 -8
- package/lib/engine/features/tolltip/newTooltip/newTooltipService.js +26 -23
- package/lib/engine/features/tolltip/tooltip.d.ts +17 -11
- package/lib/engine/features/tolltip/tooltip.js +296 -142
- package/lib/engine/features/tolltip/tooltipComponentsManager.d.ts +21 -10
- package/lib/engine/features/tolltip/tooltipComponentsManager.js +113 -114
- package/lib/engine/features/tolltip/tooltipDomHelper.d.ts +43 -21
- package/lib/engine/features/tolltip/tooltipDomHelper.js +144 -120
- package/lib/engine/features/tolltip/tooltipHelper.d.ts +39 -9
- package/lib/engine/features/tolltip/tooltipHelper.js +114 -91
- package/lib/engine/features/valueLabels/valueLabels.d.ts +58 -38
- package/lib/engine/features/valueLabels/valueLabels.js +205 -169
- package/lib/engine/features/valueLabels/valueLabelsHelper.d.ts +7 -1
- package/lib/engine/features/valueLabels/valueLabelsHelper.js +23 -18
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.d.ts +18 -15
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.js +46 -47
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.d.ts +6 -3
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.js +49 -45
- package/lib/engine/filterManager/filterEventManager.d.ts +37 -26
- package/lib/engine/filterManager/filterEventManager.js +174 -129
- package/lib/engine/helpers/domHelper.d.ts +45 -20
- package/lib/engine/helpers/domHelper.js +62 -61
- package/lib/engine/helpers/fontResizer/fontResizer.d.ts +10 -10
- package/lib/engine/helpers/fontResizer/fontResizer.js +21 -16
- package/lib/engine/helpers/fontResizer/fontResizerService.d.ts +1 -1
- package/lib/engine/helpers/fontResizer/fontResizerService.js +9 -10
- package/lib/engine/helpers/helper.d.ts +27 -27
- package/lib/engine/helpers/helper.js +91 -92
- package/lib/engine/helpers/namesHelper.d.ts +3 -3
- package/lib/engine/helpers/namesHelper.js +6 -6
- package/lib/engine/helpers/pipeline/Pipeline.d.ts +5 -5
- package/lib/engine/helpers/pipeline/Pipeline.js +33 -33
- package/lib/engine/polarNotation/donut/DonutHelper.d.ts +25 -11
- package/lib/engine/polarNotation/donut/DonutHelper.js +71 -70
- package/lib/engine/polarNotation/donut/donut.d.ts +38 -23
- package/lib/engine/polarNotation/donut/donut.js +109 -99
- package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.d.ts +7 -7
- package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.js +36 -36
- package/lib/engine/polarNotation/polarManager.d.ts +5 -5
- package/lib/engine/polarNotation/polarManager.js +66 -52
- package/lib/engine/transitionManager.d.ts +13 -14
- package/lib/engine/transitionManager.js +48 -49
- package/lib/engine/twoDimensionalNotation/area/area.d.ts +44 -28
- package/lib/engine/twoDimensionalNotation/area/area.js +272 -238
- package/lib/engine/twoDimensionalNotation/area/areaGenerator.d.ts +13 -5
- package/lib/engine/twoDimensionalNotation/area/areaGenerator.js +13 -13
- package/lib/engine/twoDimensionalNotation/area/areaHelper.d.ts +4 -4
- package/lib/engine/twoDimensionalNotation/area/areaHelper.js +57 -41
- package/lib/engine/twoDimensionalNotation/bar/bar.d.ts +54 -29
- package/lib/engine/twoDimensionalNotation/bar/bar.js +362 -224
- package/lib/engine/twoDimensionalNotation/bar/barHelper.d.ts +71 -32
- package/lib/engine/twoDimensionalNotation/bar/barHelper.js +162 -126
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.d.ts +6 -6
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.js +24 -24
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStackerService.d.ts +2 -2
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStackerService.js +16 -17
- package/lib/engine/twoDimensionalNotation/dot/dotChart.d.ts +23 -23
- package/lib/engine/twoDimensionalNotation/dot/dotChart.js +135 -114
- package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.d.ts +7 -7
- package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.js +28 -28
- package/lib/engine/twoDimensionalNotation/line/line.d.ts +37 -16
- package/lib/engine/twoDimensionalNotation/line/line.js +162 -132
- package/lib/engine/twoDimensionalNotation/line/lineBuilder.d.ts +14 -11
- package/lib/engine/twoDimensionalNotation/line/lineBuilder.js +47 -48
- package/lib/engine/twoDimensionalNotation/line/lineGenerator.d.ts +4 -4
- package/lib/engine/twoDimensionalNotation/line/lineGenerator.js +8 -8
- package/lib/engine/twoDimensionalNotation/line/lineHelper.d.ts +12 -6
- package/lib/engine/twoDimensionalNotation/line/lineHelper.js +76 -60
- package/lib/engine/twoDimensionalNotation/lineLike/generatorFactory/lineLikeGeneratorFactory.d.ts +6 -6
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.d.ts +5 -5
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.js +16 -17
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.d.ts +11 -10
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.js +9 -7
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorMiddleware.d.ts +3 -1
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +9 -9
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +252 -143
- package/lib/engine/valueFormatter.d.ts +3 -3
- package/lib/engine/valueFormatter.js +6 -6
- package/lib/main.d.ts +82 -75
- package/lib/main.js +79 -84
- package/lib/model/EventEmitter.d.ts +8 -8
- package/lib/model/EventEmitter.js +24 -24
- package/lib/model/chartStyleModel/chartStyleModel.d.ts +5 -5
- package/lib/model/chartStyleModel/chartStyleModel.js +27 -25
- package/lib/model/chartStyleModel/colorRange.d.ts +3 -3
- package/lib/model/chartStyleModel/colorRange.js +19 -24
- package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.d.ts +22 -12
- package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.js +69 -60
- package/lib/model/configsValidator/configValidator.d.ts +1 -1
- package/lib/model/configsValidator/configValidator.js +4 -4
- package/lib/model/dataManagerModel/dataManagerModel.d.ts +36 -26
- package/lib/model/dataManagerModel/dataManagerModel.js +179 -128
- package/lib/model/dataManagerModel/dataManagerModelService.d.ts +2 -2
- package/lib/model/dataManagerModel/dataManagerModelService.js +25 -26
- package/lib/model/featuresModel/axisModel.d.ts +69 -18
- package/lib/model/featuresModel/axisModel.js +224 -169
- package/lib/model/featuresModel/axisModelService.d.ts +10 -6
- package/lib/model/featuresModel/axisModelService.js +27 -27
- package/lib/model/featuresModel/legendModel/legendCanvasModel.d.ts +16 -11
- package/lib/model/featuresModel/legendModel/legendCanvasModel.js +55 -59
- package/lib/model/featuresModel/legendModel/legendModel.d.ts +7 -3
- package/lib/model/featuresModel/legendModel/legendModel.js +59 -41
- package/lib/model/featuresModel/legendModel/polarMarginCalculator.d.ts +8 -3
- package/lib/model/featuresModel/legendModel/polarMarginCalculator.js +18 -20
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.d.ts +8 -4
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.js +40 -27
- package/lib/model/featuresModel/otherComponents.d.ts +7 -4
- package/lib/model/featuresModel/otherComponents.js +9 -9
- package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.d.ts +6 -6
- package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.js +27 -23
- package/lib/model/featuresModel/scaleModel/scaleDomainService.d.ts +19 -5
- package/lib/model/featuresModel/scaleModel/scaleDomainService.js +44 -55
- package/lib/model/featuresModel/scaleModel/scaleModel.d.ts +10 -10
- package/lib/model/featuresModel/scaleModel/scaleModel.js +61 -50
- package/lib/model/featuresModel/scaleModel/scaleModelServices.js +15 -22
- package/lib/model/featuresModel/titleModel.d.ts +1 -1
- package/lib/model/featuresModel/titleModel.js +14 -14
- package/lib/model/featuresModel/tooltipModel.d.ts +1 -1
- package/lib/model/featuresModel/tooltipModel.js +5 -5
- package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.d.ts +23 -11
- package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.js +53 -51
- package/lib/model/helpers/modelHelper.d.ts +7 -7
- package/lib/model/helpers/modelHelper.js +38 -42
- package/lib/model/helpers/twoDimensionalModelHelper.d.ts +37 -9
- package/lib/model/helpers/twoDimensionalModelHelper.js +147 -125
- package/lib/model/helpers/unitsFromConfigReader.js +4 -4
- package/lib/model/helpers/unitsReader.d.ts +2 -2
- package/lib/model/helpers/unitsReader.js +11 -13
- package/lib/model/margin/marginModel.d.ts +7 -7
- package/lib/model/margin/marginModel.js +23 -20
- package/lib/model/margin/twoDim/twoDimMarginModel.d.ts +13 -13
- package/lib/model/margin/twoDim/twoDimMarginModel.js +184 -113
- package/lib/model/model.d.ts +308 -280
- package/lib/model/model.js +4 -4
- package/lib/model/modelBuilder.d.ts +27 -18
- package/lib/model/modelBuilder.js +85 -79
- package/lib/model/modelInstance/canvasModel/canvasModel.d.ts +17 -17
- package/lib/model/modelInstance/canvasModel/canvasModel.js +42 -43
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasMarginModel.d.ts +7 -7
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasSizeModel.d.ts +2 -2
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.d.ts +6 -6
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.js +24 -24
- package/lib/model/modelInstance/canvasModel/legendCanvasModel.d.ts +4 -4
- package/lib/model/modelInstance/canvasModel/legendCanvasModel.js +11 -11
- package/lib/model/modelInstance/canvasModel/titleCanvas.d.ts +4 -4
- package/lib/model/modelInstance/canvasModel/titleCanvas.js +9 -9
- package/lib/model/modelInstance/chartBlockVersion/chartBlockVersion.d.ts +3 -3
- package/lib/model/modelInstance/chartBlockVersion/chartBlockVersion.js +6 -6
- package/lib/model/modelInstance/configReader.d.ts +32 -23
- package/lib/model/modelInstance/configReader.js +125 -94
- package/lib/model/modelInstance/dataModel/dataModel.d.ts +9 -9
- package/lib/model/modelInstance/dataModel/dataModel.js +24 -24
- package/lib/model/modelInstance/dataModel/dataRepository.d.ts +14 -14
- package/lib/model/modelInstance/dataModel/dataRepository.js +42 -42
- package/lib/model/modelInstance/modelInstance.d.ts +11 -6
- package/lib/model/modelInstance/modelInstance.js +16 -16
- package/lib/model/modelInstance/titleConfigReader.d.ts +8 -8
- package/lib/model/modelInstance/titleConfigReader.js +37 -30
- package/lib/model/notations/polar/donut/donutAggregatorService.d.ts +9 -6
- package/lib/model/notations/polar/donut/donutAggregatorService.js +40 -37
- package/lib/model/notations/polar/donut/donutModel.d.ts +9 -5
- package/lib/model/notations/polar/donut/donutModel.js +28 -28
- package/lib/model/notations/polar/donut/donutThicknessService.d.ts +3 -3
- package/lib/model/notations/polar/donut/donutThicknessService.js +13 -15
- package/lib/model/notations/polar/polarModel.d.ts +18 -7
- package/lib/model/notations/polar/polarModel.js +79 -65
- package/lib/model/notations/twoDimensional/styles.d.ts +44 -7
- package/lib/model/notations/twoDimensional/styles.js +234 -125
- package/lib/model/notations/twoDimensionalModel.d.ts +23 -13
- package/lib/model/notations/twoDimensionalModel.js +330 -162
- package/lib/optionsServices/publicOptionsService.d.ts +1 -1
- package/lib/optionsServices/publicOptionsService.js +4 -4
- package/lib/optionsServices/validators/sizeValidator.d.ts +2 -2
- package/lib/optionsServices/validators/sizeValidator.js +10 -11
- package/lib/style/charts-main.css +150 -151
- package/lib/style/charts-main.less +150 -151
- package/package.json +1 -1
|
@@ -1,12 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
ChartOrientation,
|
|
3
|
+
MdtChartsDataRow,
|
|
4
|
+
MdtChartsTwoDimensionalChart,
|
|
5
|
+
MdtChartsTwoDimensionalValueLabels
|
|
6
|
+
} from "../../config/config";
|
|
7
|
+
import {
|
|
8
|
+
GradientDef,
|
|
9
|
+
MarkDotDatumItem,
|
|
10
|
+
Orient,
|
|
11
|
+
TwoDimensionalChartModel,
|
|
12
|
+
TwoDimensionalValueLabels,
|
|
13
|
+
ValueLabelsStyleModel
|
|
14
|
+
} from "../model";
|
|
3
15
|
import { CanvasModel } from "../modelInstance/canvasModel/canvasModel";
|
|
4
16
|
export declare class TwoDimensionalModelHelper {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
static shouldMarkerShow(
|
|
18
|
+
chart: MdtChartsTwoDimensionalChart,
|
|
19
|
+
dataRows: MdtChartsDataRow[],
|
|
20
|
+
valueFieldName: string,
|
|
21
|
+
currentRow: MarkDotDatumItem,
|
|
22
|
+
keyFieldName: string
|
|
23
|
+
): boolean;
|
|
24
|
+
static getGradientDefs(
|
|
25
|
+
charts: TwoDimensionalChartModel[],
|
|
26
|
+
keyAxisOrient: Orient,
|
|
27
|
+
chartOrient: ChartOrientation,
|
|
28
|
+
chartBlockId: number
|
|
29
|
+
): GradientDef[];
|
|
30
|
+
private static getGradientItems;
|
|
31
|
+
private static calculateOpacityItem;
|
|
32
|
+
private static getGradientItemColor;
|
|
33
|
+
static getValueLabels(
|
|
34
|
+
valueLabels: MdtChartsTwoDimensionalValueLabels,
|
|
35
|
+
canvasModel: CanvasModel,
|
|
36
|
+
chartOrientation: ChartOrientation,
|
|
37
|
+
styleModel: ValueLabelsStyleModel
|
|
38
|
+
): TwoDimensionalValueLabels;
|
|
39
|
+
private static getChartBlockSidesOptions;
|
|
12
40
|
}
|
|
@@ -1,128 +1,150 @@
|
|
|
1
1
|
import { getGradientId } from "../../model/notations/twoDimensional/styles";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
hasCollisionBottomSide,
|
|
4
|
+
hasCollisionLeftSide,
|
|
5
|
+
hasCollisionRightSide,
|
|
6
|
+
hasCollisionTopSide,
|
|
7
|
+
shiftCoordinateXLeft,
|
|
8
|
+
shiftCoordinateXRight,
|
|
9
|
+
shiftCoordinateYBottom,
|
|
10
|
+
shiftCoordinateYTop
|
|
11
|
+
} from "../featuresModel/valueLabelsModel/valueLabelsModel";
|
|
3
12
|
export class TwoDimensionalModelHelper {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
13
|
+
static shouldMarkerShow(chart, dataRows, valueFieldName, currentRow, keyFieldName) {
|
|
14
|
+
if (chart.markers.show || dataRows.length === 1) return true;
|
|
15
|
+
const rowIndex = dataRows.findIndex((row) => row[keyFieldName] === currentRow[keyFieldName]);
|
|
16
|
+
if (rowIndex === -1) return false;
|
|
17
|
+
const isFirst = rowIndex === 0;
|
|
18
|
+
const isLast = rowIndex === dataRows.length - 1;
|
|
19
|
+
const previousRow = dataRows[rowIndex - 1];
|
|
20
|
+
const nextRow = dataRows[rowIndex + 1];
|
|
21
|
+
const hasNullNeighborsRows =
|
|
22
|
+
!isFirst &&
|
|
23
|
+
!isLast &&
|
|
24
|
+
(previousRow === null || previousRow === void 0 ? void 0 : previousRow[valueFieldName]) === null &&
|
|
25
|
+
(nextRow === null || nextRow === void 0 ? void 0 : nextRow[valueFieldName]) === null;
|
|
26
|
+
return (
|
|
27
|
+
(isFirst && (nextRow === null || nextRow === void 0 ? void 0 : nextRow[valueFieldName]) === null) ||
|
|
28
|
+
(isLast &&
|
|
29
|
+
(previousRow === null || previousRow === void 0 ? void 0 : previousRow[valueFieldName]) === null) ||
|
|
30
|
+
hasNullNeighborsRows
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
static getGradientDefs(charts, keyAxisOrient, chartOrient, chartBlockId) {
|
|
34
|
+
let gradients = [];
|
|
35
|
+
charts.forEach((chart) => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (chart.type === "area" && chart.areaViewOptions.fill.type === "gradient") {
|
|
38
|
+
(_a = chart.style.elementColors) === null || _a === void 0
|
|
39
|
+
? void 0
|
|
40
|
+
: _a.forEach((elementColor, subIndex) => {
|
|
41
|
+
const gradientId = getGradientId(chart.index, subIndex, chartBlockId);
|
|
42
|
+
gradients.push({
|
|
43
|
+
id: gradientId,
|
|
44
|
+
position: {
|
|
45
|
+
x1: 0,
|
|
46
|
+
y1: 0,
|
|
47
|
+
x2: chartOrient === "horizontal" ? 1 : 0,
|
|
48
|
+
y2: chartOrient === "horizontal" ? 0 : 1
|
|
49
|
+
},
|
|
50
|
+
items: this.getGradientItems(gradientId, elementColor, keyAxisOrient)
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return gradients;
|
|
56
|
+
}
|
|
57
|
+
static getGradientItems(gradientId, elementColor, keyAxisOrient) {
|
|
58
|
+
return [0, 1].map((itemIndex) => ({
|
|
59
|
+
id: gradientId + `-item-${itemIndex}`,
|
|
60
|
+
color: this.getGradientItemColor(itemIndex, keyAxisOrient, elementColor),
|
|
61
|
+
offset: itemIndex,
|
|
62
|
+
opacity: this.calculateOpacityItem(itemIndex, keyAxisOrient)
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
static calculateOpacityItem(itemIndex, orientation) {
|
|
66
|
+
const maxOpacity = 0.3;
|
|
67
|
+
const minOpacity = 0;
|
|
68
|
+
if (orientation === "bottom" || orientation === "right") return itemIndex === 0 ? maxOpacity : minOpacity;
|
|
69
|
+
else return itemIndex === 0 ? minOpacity : maxOpacity;
|
|
70
|
+
}
|
|
71
|
+
static getGradientItemColor(itemIndex, orientation, elementColor) {
|
|
72
|
+
const maxColor = elementColor;
|
|
73
|
+
const minColor = "white";
|
|
74
|
+
if (orientation === "bottom" || orientation === "right") return itemIndex === 0 ? maxColor : minColor;
|
|
75
|
+
else return itemIndex === 0 ? minColor : maxColor;
|
|
76
|
+
}
|
|
77
|
+
static getValueLabels(valueLabels, canvasModel, chartOrientation, styleModel) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
const blockSidesOptions = this.getChartBlockSidesOptions(canvasModel);
|
|
80
|
+
const chartBlockConfig = {
|
|
81
|
+
vertical: {
|
|
82
|
+
left: {
|
|
83
|
+
mode: "shift",
|
|
84
|
+
hasCollision: blockSidesOptions.hasCollisionLeft,
|
|
85
|
+
shiftCoordinate: blockSidesOptions.shiftToRight
|
|
86
|
+
},
|
|
87
|
+
right: {
|
|
88
|
+
mode: "shift",
|
|
89
|
+
hasCollision: blockSidesOptions.hasCollisionRight,
|
|
90
|
+
shiftCoordinate: blockSidesOptions.shiftToLeft
|
|
91
|
+
},
|
|
92
|
+
top: {
|
|
93
|
+
mode: "none"
|
|
94
|
+
},
|
|
95
|
+
bottom: {
|
|
96
|
+
mode: "none"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
horizontal: {
|
|
100
|
+
left: {
|
|
101
|
+
mode: "none"
|
|
102
|
+
},
|
|
103
|
+
right: {
|
|
104
|
+
mode: "none"
|
|
105
|
+
},
|
|
106
|
+
top: {
|
|
107
|
+
mode: "shift",
|
|
108
|
+
hasCollision: blockSidesOptions.hasCollisionTop,
|
|
109
|
+
shiftCoordinate: blockSidesOptions.shiftBottom
|
|
110
|
+
},
|
|
111
|
+
bottom: {
|
|
112
|
+
mode: "shift",
|
|
113
|
+
hasCollision: blockSidesOptions.hasCollisionBottom,
|
|
114
|
+
shiftCoordinate: blockSidesOptions.shiftTop
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
collision: {
|
|
120
|
+
otherValueLables:
|
|
121
|
+
(_b =
|
|
122
|
+
(_a = valueLabels === null || valueLabels === void 0 ? void 0 : valueLabels.collision) ===
|
|
123
|
+
null || _a === void 0
|
|
124
|
+
? void 0
|
|
125
|
+
: _a.otherValueLabels) !== null && _b !== void 0
|
|
126
|
+
? _b
|
|
127
|
+
: {
|
|
128
|
+
mode: "none"
|
|
129
|
+
},
|
|
130
|
+
chartBlock: chartBlockConfig[chartOrientation]
|
|
131
|
+
},
|
|
132
|
+
style: styleModel
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
static getChartBlockSidesOptions(canvasModel) {
|
|
136
|
+
return {
|
|
137
|
+
hasCollisionLeft: (labelClientRect) => hasCollisionLeftSide(labelClientRect, canvasModel.getMargin()),
|
|
138
|
+
shiftToLeft: (labelClientRect) =>
|
|
139
|
+
shiftCoordinateXLeft(labelClientRect, canvasModel.getBlockSize(), canvasModel.getMargin()),
|
|
140
|
+
hasCollisionRight: (labelClientRect) =>
|
|
141
|
+
hasCollisionRightSide(labelClientRect, canvasModel.getBlockSize(), canvasModel.getMargin()),
|
|
142
|
+
shiftToRight: (labelClientRect) => shiftCoordinateXRight(labelClientRect, canvasModel.getMargin()),
|
|
143
|
+
hasCollisionTop: (labelClientRect) => hasCollisionTopSide(labelClientRect, canvasModel.getMargin()),
|
|
144
|
+
shiftTop: (labelClientRect) => shiftCoordinateYTop(labelClientRect),
|
|
145
|
+
hasCollisionBottom: (labelClientRect) =>
|
|
146
|
+
hasCollisionBottomSide(labelClientRect, canvasModel.getBlockSize(), canvasModel.getMargin()),
|
|
147
|
+
shiftBottom: (labelClientRect) => shiftCoordinateYBottom(labelClientRect)
|
|
148
|
+
};
|
|
149
|
+
}
|
|
128
150
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UnitsReader } from "./unitsReader";
|
|
2
2
|
export function getPxPercentUnitByValue(value) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const unitsReader = new UnitsReader();
|
|
4
|
+
const defaultUnit = "px";
|
|
5
|
+
const units = ["%", "px"];
|
|
6
|
+
return unitsReader.getUnitByValue(value, defaultUnit, units);
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnitsFromConfig } from "../model";
|
|
2
2
|
export declare class UnitsReader {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
getUnitByValue<T extends string = UnitsFromConfig>(value: string | number, defaultUnit: T, units: T[]): T;
|
|
4
|
+
private getLastUnitFromString;
|
|
5
5
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
export class UnitsReader {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return resultUnit;
|
|
14
|
-
}
|
|
2
|
+
getUnitByValue(value, defaultUnit, units) {
|
|
3
|
+
if (typeof value !== "string") return defaultUnit;
|
|
4
|
+
return this.getLastUnitFromString(value, units) || defaultUnit;
|
|
5
|
+
}
|
|
6
|
+
getLastUnitFromString(value, units) {
|
|
7
|
+
let resultUnit = null;
|
|
8
|
+
units.forEach((unit) => {
|
|
9
|
+
if (value.endsWith(unit)) resultUnit = unit;
|
|
10
|
+
});
|
|
11
|
+
return resultUnit;
|
|
12
|
+
}
|
|
15
13
|
}
|
|
@@ -3,11 +3,11 @@ import { DesignerConfig } from "../../designer/designerConfig";
|
|
|
3
3
|
import { OtherCommonComponents } from "../model";
|
|
4
4
|
import { ModelInstance } from "../modelInstance/modelInstance";
|
|
5
5
|
export declare class MarginModel {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
private designerConfig;
|
|
7
|
+
private config;
|
|
8
|
+
private twoDimModel;
|
|
9
|
+
constructor(designerConfig: DesignerConfig, config: MdtChartsConfig);
|
|
10
|
+
initMargin(otherComponents: OtherCommonComponents, modelInstance: ModelInstance): void;
|
|
11
|
+
recalcMarginByVerticalAxisLabel(modelInstance: ModelInstance): void;
|
|
12
|
+
private recalcMarginByTitle;
|
|
13
13
|
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { TwoDimMarginModel } from "./twoDim/twoDimMarginModel";
|
|
2
2
|
import { TwoDimConfigReader } from "../modelInstance/configReader";
|
|
3
3
|
export class MarginModel {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
constructor(designerConfig, config) {
|
|
5
|
+
this.designerConfig = designerConfig;
|
|
6
|
+
this.config = config;
|
|
7
|
+
//TODO: ensure
|
|
8
|
+
this.twoDimModel = new TwoDimMarginModel(
|
|
9
|
+
this.designerConfig,
|
|
10
|
+
new TwoDimConfigReader(this.config, this.designerConfig)
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
initMargin(otherComponents, modelInstance) {
|
|
14
|
+
const canvasModel = modelInstance.canvasModel;
|
|
15
|
+
canvasModel.initMargin(Object.assign({}, this.designerConfig.canvas.chartBlockMargin));
|
|
16
|
+
this.recalcMarginByTitle(canvasModel);
|
|
17
|
+
if (this.config.options.type === "2d") {
|
|
18
|
+
this.twoDimModel.recalcMargin(otherComponents, modelInstance);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
recalcMarginByVerticalAxisLabel(modelInstance) {
|
|
22
|
+
this.twoDimModel.recalcMarginByVerticalAxisLabel(modelInstance);
|
|
23
|
+
}
|
|
24
|
+
recalcMarginByTitle(canvasModel) {
|
|
25
|
+
canvasModel.increaseMarginSide("top", canvasModel.titleCanvas.getAllNeededSpace());
|
|
26
|
+
}
|
|
24
27
|
}
|
|
@@ -5,17 +5,17 @@ import { ModelInstance } from "../../modelInstance/modelInstance";
|
|
|
5
5
|
export declare const AXIS_HORIZONTAL_LABEL_PADDING = 12;
|
|
6
6
|
export declare const AXIS_VERTICAL_LABEL_PADDING = 8;
|
|
7
7
|
export declare class TwoDimMarginModel {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
private designerConfig;
|
|
9
|
+
private configReader;
|
|
10
|
+
private twoDimLegendModel;
|
|
11
|
+
constructor(designerConfig: DesignerConfig, configReader: TwoDimConfigReader);
|
|
12
|
+
recalcMargin(otherComponents: OtherCommonComponents, modelInstance: ModelInstance): void;
|
|
13
|
+
recalcMarginByVerticalAxisLabel(modelInstance: ModelInstance): void;
|
|
14
|
+
private getMaxLabelSize;
|
|
15
|
+
private getMaxLabelSizeSecondary;
|
|
16
|
+
private recalcVerticalMarginByAxisLabelHeight;
|
|
17
|
+
private recalcHorizontalMarginByAxisLabelWidth;
|
|
18
|
+
private recalcMarginBySecondaryAxisLabelSize;
|
|
19
|
+
private recalcVerticalMarginWithValueLabelsOn;
|
|
20
|
+
private getValueAxisLabels;
|
|
21
21
|
}
|