mdt-charts 1.28.1 → 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,24 +1,24 @@
|
|
|
1
1
|
export class NewTooltip {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
getEl() {
|
|
3
|
+
return this.elSelection;
|
|
4
|
+
}
|
|
5
|
+
findInWrapper(wrapper) {
|
|
6
|
+
this.elSelection = wrapper.select(`.${NewTooltip.tooltipBlockClass}`);
|
|
7
|
+
return this.elSelection;
|
|
8
|
+
}
|
|
9
|
+
render(wrapper) {
|
|
10
|
+
this.elSelection = wrapper.append("div").attr("class", NewTooltip.tooltipBlockClass);
|
|
11
|
+
return this.elSelection;
|
|
12
|
+
}
|
|
13
|
+
appendContent(content) {
|
|
14
|
+
this.elSelection.node().appendChild(content);
|
|
15
|
+
}
|
|
16
|
+
setCoordinate(coordinate) {
|
|
17
|
+
this.elSelection
|
|
18
|
+
.style("right", coordinate.right)
|
|
19
|
+
.style("bottom", coordinate.bottom)
|
|
20
|
+
.style("left", coordinate.left)
|
|
21
|
+
.style("top", coordinate.top);
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
24
|
NewTooltip.tooltipBlockClass = "mdt-charts-tooltip-block";
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
export interface TooltipPreCoordinate {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
top: number;
|
|
3
|
+
left: number;
|
|
4
4
|
}
|
|
5
5
|
export interface Sizable {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
8
|
}
|
|
9
9
|
export interface ElBounding extends Sizable {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
left: number;
|
|
11
|
+
top: number;
|
|
12
|
+
bottom: number;
|
|
13
13
|
}
|
|
14
14
|
export declare class NewTooltipServiceClass {
|
|
15
|
-
|
|
15
|
+
getTooltipByWindow(
|
|
16
|
+
tooltipBounding: Sizable,
|
|
17
|
+
preCoordinate: TooltipPreCoordinate,
|
|
18
|
+
windowSize: Sizable,
|
|
19
|
+
parentBounding?: ElBounding
|
|
20
|
+
): TooltipPreCoordinate;
|
|
16
21
|
}
|
|
17
22
|
export declare const TooltipService: NewTooltipServiceClass;
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
export class NewTooltipServiceClass {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
getTooltipByWindow(tooltipBounding, preCoordinate, windowSize, parentBounding) {
|
|
3
|
+
const scrollPad = 18;
|
|
4
|
+
const coordinate = {
|
|
5
|
+
top: preCoordinate.top,
|
|
6
|
+
left: preCoordinate.left
|
|
7
|
+
};
|
|
8
|
+
const blockBounding =
|
|
9
|
+
parentBounding !== null && parentBounding !== void 0
|
|
10
|
+
? parentBounding
|
|
11
|
+
: {
|
|
12
|
+
top: 0,
|
|
13
|
+
left: 0,
|
|
14
|
+
height: windowSize.height,
|
|
15
|
+
width: windowSize.width,
|
|
16
|
+
bottom: windowSize.height
|
|
17
|
+
};
|
|
18
|
+
if (preCoordinate.left < 0 && Math.abs(preCoordinate.left) > blockBounding.left)
|
|
19
|
+
coordinate.left = -blockBounding.left;
|
|
20
|
+
if (blockBounding.left + preCoordinate.left + tooltipBounding.width > windowSize.width - scrollPad)
|
|
21
|
+
coordinate.left = windowSize.width - blockBounding.left - tooltipBounding.width - scrollPad;
|
|
22
|
+
if (preCoordinate.top + blockBounding.top < 0 && -preCoordinate.top > blockBounding.top)
|
|
23
|
+
coordinate.top = -blockBounding.top;
|
|
24
|
+
if (blockBounding.top + preCoordinate.top + tooltipBounding.height > windowSize.height)
|
|
25
|
+
coordinate.top = blockBounding.height - tooltipBounding.height - (blockBounding.bottom - windowSize.height);
|
|
26
|
+
return coordinate;
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
export const TooltipService = new NewTooltipServiceClass();
|
|
@@ -4,15 +4,21 @@ import { MdtChartsDataSource } from "../../../config/config";
|
|
|
4
4
|
import { Scales } from "../scale/scale";
|
|
5
5
|
import { TooltipSettings } from "../../../designer/designerConfig";
|
|
6
6
|
export declare class Tooltip {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
static readonly tooltipBlockClass: string;
|
|
8
|
+
static readonly tooltipLineClass = "mdt-charts-tooltip-line";
|
|
9
|
+
static readonly tooltipWrapperClass = "mdt-charts-tooltip-wrapper";
|
|
10
|
+
static readonly tooltipContentClass = "mdt-charts-tooltip-content";
|
|
11
|
+
static readonly tooltipArrowClass = "mdt-charts-tooltip-arrow";
|
|
12
|
+
static render(
|
|
13
|
+
block: Block,
|
|
14
|
+
model: Model<TwoDimensionalOptionsModel | PolarOptionsModel>,
|
|
15
|
+
data: MdtChartsDataSource,
|
|
16
|
+
tooltipOptions: TooltipSettings,
|
|
17
|
+
scales?: Scales
|
|
18
|
+
): void;
|
|
19
|
+
static hide(block: Block): void;
|
|
20
|
+
private static renderTooltipFor2DCharts;
|
|
21
|
+
private static renderTooltipForPolar;
|
|
22
|
+
private static renderLineTooltip;
|
|
23
|
+
private static renderTooltipForDonut;
|
|
18
24
|
}
|
|
@@ -12,148 +12,302 @@ import { DomHelper } from "../../helpers/domHelper";
|
|
|
12
12
|
import { NewTooltip } from "./newTooltip/newTooltip";
|
|
13
13
|
import { MarkDot } from "../../../engine/features/markDots/markDot";
|
|
14
14
|
export class Tooltip {
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
15
|
+
static render(block, model, data, tooltipOptions, scales) {
|
|
16
|
+
TooltipComponentsManager.renderTooltipWrapper(block);
|
|
17
|
+
const withTooltipIndex = model.options.charts.findIndex((chart) => chart.tooltip.show);
|
|
18
|
+
if (withTooltipIndex !== -1) {
|
|
19
|
+
if (model.options.type === "2d") {
|
|
20
|
+
this.renderTooltipFor2DCharts(
|
|
21
|
+
block,
|
|
22
|
+
data,
|
|
23
|
+
model.blockCanvas.size,
|
|
24
|
+
model.chartBlock.margin,
|
|
25
|
+
scales,
|
|
26
|
+
model.options,
|
|
27
|
+
tooltipOptions
|
|
28
|
+
);
|
|
29
|
+
} else if (model.options.type === "polar") {
|
|
30
|
+
this.renderTooltipForPolar(
|
|
31
|
+
block,
|
|
32
|
+
model.options,
|
|
33
|
+
data,
|
|
34
|
+
model.blockCanvas.size,
|
|
35
|
+
model.chartBlock.margin,
|
|
36
|
+
DonutHelper.getThickness(
|
|
37
|
+
model.options.chartCanvas,
|
|
38
|
+
model.blockCanvas.size,
|
|
39
|
+
model.chartBlock.margin
|
|
40
|
+
),
|
|
41
|
+
model.otherComponents.tooltipBlock
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
static hide(block) {
|
|
47
|
+
TooltipComponentsManager.hideComponent(block.getWrapper().select(`.${this.tooltipBlockClass}`));
|
|
48
|
+
TooltipComponentsManager.hideComponent(block.getSvg().select(`.${this.tooltipLineClass}`));
|
|
49
|
+
}
|
|
50
|
+
static renderTooltipFor2DCharts(block, data, blockSize, margin, scales, options, tooltipOptions) {
|
|
51
|
+
if (scales.key.domain().length === 0) return;
|
|
52
|
+
const tooltipParams = {
|
|
53
|
+
type: "2d",
|
|
54
|
+
scales,
|
|
55
|
+
margin,
|
|
56
|
+
blockSize,
|
|
57
|
+
charts: options.charts,
|
|
58
|
+
chartOrientation: options.orient,
|
|
59
|
+
keyAxisOrient: options.axis.key.orient,
|
|
60
|
+
dataOptions: options.data,
|
|
61
|
+
scaleKeyModel: options.scale.key,
|
|
62
|
+
tooltipSettings: tooltipOptions,
|
|
63
|
+
tooltipOptions: options.tooltip
|
|
64
|
+
};
|
|
65
|
+
this.renderLineTooltip(block, data, tooltipParams);
|
|
66
|
+
}
|
|
67
|
+
static renderTooltipForPolar(block, options, data, blockSize, margin, chartThickness, tooltipOptions) {
|
|
68
|
+
const attrTransform = block.getSvg().select(`.${Donut.donutBlockClass}`).attr("transform");
|
|
69
|
+
const translateNums = Helper.getTranslateNumbers(attrTransform);
|
|
70
|
+
const arcItems = Donut.getAllArcGroups(block);
|
|
71
|
+
this.renderTooltipForDonut(
|
|
72
|
+
block,
|
|
73
|
+
arcItems,
|
|
74
|
+
data,
|
|
75
|
+
options.data,
|
|
76
|
+
options.charts[0],
|
|
77
|
+
blockSize,
|
|
78
|
+
margin,
|
|
79
|
+
chartThickness,
|
|
80
|
+
tooltipOptions,
|
|
81
|
+
options.tooltip,
|
|
82
|
+
{ x: translateNums[0], y: translateNums[1] }
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
static renderLineTooltip(block, data, args) {
|
|
86
|
+
const tooltipBlock = TooltipComponentsManager.renderTooltipBlock(block);
|
|
87
|
+
const tooltipContent = TooltipComponentsManager.renderTooltipContentBlock(tooltipBlock);
|
|
88
|
+
const tooltipLine = TooltipComponentsManager.renderTooltipLine(block);
|
|
89
|
+
const tipBox = TipBox.renderOrGet(block, args.margin, args.blockSize);
|
|
90
|
+
let currentKey = null;
|
|
91
|
+
tipBox.on("mousemove", function (e) {
|
|
92
|
+
const keyValue =
|
|
93
|
+
e.detail.keyValue ||
|
|
94
|
+
TipBoxHelper.getKeyValueByPointer(
|
|
95
|
+
pointer(e, this),
|
|
96
|
+
args.chartOrientation,
|
|
97
|
+
args.margin,
|
|
98
|
+
args.blockSize,
|
|
99
|
+
args.scales.key,
|
|
100
|
+
args.scaleKeyModel.type
|
|
101
|
+
);
|
|
102
|
+
if (args.tooltipSettings.position === "followCursor") {
|
|
103
|
+
const tooltipCoordinate = TooltipHelper.getTooltipCursorCoordinate(
|
|
104
|
+
e.detail.pointer || pointer(e, this),
|
|
105
|
+
block.getSvg().node().getBoundingClientRect(),
|
|
106
|
+
tooltipBlock.getEl().node().getBoundingClientRect()
|
|
107
|
+
);
|
|
108
|
+
TooltipComponentsManager.setLineTooltipCoordinate(
|
|
109
|
+
tooltipBlock,
|
|
110
|
+
tooltipCoordinate,
|
|
111
|
+
args.chartOrientation,
|
|
112
|
+
0
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
if (!currentKey || currentKey !== keyValue) {
|
|
116
|
+
TooltipComponentsManager.showComponent(tooltipBlock.getEl());
|
|
117
|
+
if (args.type === "2d")
|
|
118
|
+
TooltipDomHelper.fillForMulti2DCharts(
|
|
119
|
+
tooltipContent,
|
|
120
|
+
args.charts.filter((ch) => ch.tooltip.show),
|
|
121
|
+
data,
|
|
122
|
+
args.dataOptions,
|
|
123
|
+
keyValue,
|
|
124
|
+
args.tooltipOptions
|
|
125
|
+
);
|
|
126
|
+
if (args.tooltipSettings.position === "fixed") {
|
|
127
|
+
const tooltipCoordinate = TooltipHelper.getTooltipFixedCoordinate(
|
|
128
|
+
args.scales.key,
|
|
129
|
+
args.margin,
|
|
130
|
+
keyValue,
|
|
131
|
+
block.getSvg().node().getBoundingClientRect(),
|
|
132
|
+
tooltipContent.node().getBoundingClientRect(),
|
|
133
|
+
args.keyAxisOrient,
|
|
134
|
+
window.innerWidth,
|
|
135
|
+
window.innerHeight
|
|
136
|
+
);
|
|
137
|
+
TooltipComponentsManager.setLineTooltipCoordinate(
|
|
138
|
+
tooltipBlock,
|
|
139
|
+
tooltipCoordinate,
|
|
140
|
+
args.chartOrientation,
|
|
141
|
+
block.transitionManager.durations.tooltipSlide
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
const tooltipLineAttributes = TooltipHelper.getTooltipLineAttributes(
|
|
145
|
+
args.scales.key,
|
|
146
|
+
args.margin,
|
|
147
|
+
keyValue,
|
|
148
|
+
args.chartOrientation,
|
|
149
|
+
args.blockSize
|
|
150
|
+
);
|
|
151
|
+
TooltipComponentsManager.setTooltipLineAttributes(
|
|
152
|
+
tooltipLine,
|
|
153
|
+
tooltipLineAttributes,
|
|
154
|
+
block.transitionManager.durations.tooltipSlide
|
|
155
|
+
);
|
|
156
|
+
TooltipComponentsManager.showComponent(tooltipLine);
|
|
157
|
+
if (args.type === "2d") {
|
|
158
|
+
args.charts.forEach((chart) => {
|
|
159
|
+
const elements = DomHelper.get2DChartElements(block, chart);
|
|
160
|
+
if (!block.filterEventManager.isSelected(currentKey)) {
|
|
161
|
+
const oldElements = DomHelper.getChartElementsByKeys(
|
|
162
|
+
elements,
|
|
163
|
+
chart.isSegmented,
|
|
164
|
+
args.dataOptions.keyField.name,
|
|
165
|
+
[currentKey]
|
|
166
|
+
);
|
|
167
|
+
if (chart.type !== "bar")
|
|
168
|
+
MarkDot.tryMakeMarkDotVisible(oldElements, chart.markersOptions, false);
|
|
169
|
+
ElementHighlighter.toggle2DElements(
|
|
170
|
+
oldElements,
|
|
171
|
+
false,
|
|
172
|
+
chart,
|
|
173
|
+
block.transitionManager.durations.markerHover
|
|
174
|
+
);
|
|
175
|
+
if (block.filterEventManager.getSelectedKeys().length > 0) {
|
|
176
|
+
ElementHighlighter.toggleActivityStyle(oldElements, false);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const selectedElements = DomHelper.getChartElementsByKeys(
|
|
180
|
+
elements,
|
|
181
|
+
chart.isSegmented,
|
|
182
|
+
args.dataOptions.keyField.name,
|
|
183
|
+
[keyValue]
|
|
184
|
+
);
|
|
185
|
+
if (chart.type !== "bar")
|
|
186
|
+
MarkDot.tryMakeMarkDotVisible(selectedElements, chart.markersOptions, true);
|
|
187
|
+
ElementHighlighter.toggleActivityStyle(selectedElements, true);
|
|
188
|
+
if (
|
|
189
|
+
block.filterEventManager.getSelectedKeys().length === 0 ||
|
|
190
|
+
block.filterEventManager.isSelected(keyValue)
|
|
191
|
+
) {
|
|
192
|
+
ElementHighlighter.toggle2DElements(
|
|
193
|
+
selectedElements,
|
|
194
|
+
true,
|
|
195
|
+
chart,
|
|
196
|
+
block.transitionManager.durations.markerHover
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
currentKey = keyValue;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
tipBox.on("mouseleave", function () {
|
|
205
|
+
TooltipComponentsManager.hideComponent(tooltipBlock.getEl());
|
|
206
|
+
TooltipComponentsManager.hideComponent(tooltipLine);
|
|
207
|
+
if (args.type === "2d")
|
|
208
|
+
ElementHighlighter.removeUnselected2DHighlight(
|
|
209
|
+
block,
|
|
210
|
+
args.dataOptions.keyField.name,
|
|
211
|
+
args.charts,
|
|
212
|
+
block.transitionManager.durations.markerHover
|
|
213
|
+
);
|
|
214
|
+
currentKey = null;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
static renderTooltipForDonut(
|
|
218
|
+
block,
|
|
219
|
+
elements,
|
|
220
|
+
data,
|
|
221
|
+
dataOptions,
|
|
222
|
+
chart,
|
|
223
|
+
blockSize,
|
|
224
|
+
margin,
|
|
225
|
+
donutThickness,
|
|
226
|
+
tooltipSettings,
|
|
227
|
+
tooltipOptions,
|
|
228
|
+
translate
|
|
229
|
+
) {
|
|
230
|
+
const tooltipBlock = TooltipComponentsManager.renderTooltipBlock(block);
|
|
231
|
+
const tooltipContent = TooltipComponentsManager.renderTooltipContentBlock(tooltipBlock);
|
|
232
|
+
let tooltipArrow;
|
|
233
|
+
if (tooltipSettings.position === "fixed")
|
|
234
|
+
tooltipArrow = TooltipComponentsManager.renderTooltipArrow(tooltipBlock.getEl());
|
|
235
|
+
if (tooltipSettings.position === "followCursor") {
|
|
236
|
+
elements.on("mousemove", function (e) {
|
|
237
|
+
const pointerCoordinate = !pointer(e, block.getSvg().node())[0]
|
|
238
|
+
? e.detail.pointer
|
|
239
|
+
: pointer(e, block.getSvg().node());
|
|
240
|
+
const tooltipCoordinate = TooltipHelper.getTooltipCursorCoordinate(
|
|
241
|
+
pointerCoordinate,
|
|
242
|
+
block.getSvg().node().getBoundingClientRect(),
|
|
243
|
+
tooltipBlock.getEl().node().getBoundingClientRect()
|
|
244
|
+
);
|
|
245
|
+
tooltipBlock.setCoordinate(tooltipCoordinate);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
elements.on("mouseover", function (e, dataRow) {
|
|
249
|
+
TooltipComponentsManager.showComponent(tooltipBlock.getEl());
|
|
250
|
+
TooltipDomHelper.fillForPolarChart(
|
|
251
|
+
tooltipContent,
|
|
252
|
+
chart,
|
|
253
|
+
data,
|
|
254
|
+
dataOptions,
|
|
255
|
+
dataRow.data[dataOptions.keyField.name],
|
|
256
|
+
select(this).select("path").style("fill"),
|
|
257
|
+
tooltipOptions
|
|
258
|
+
);
|
|
259
|
+
if (tooltipSettings.position === "fixed") {
|
|
260
|
+
const coordinatePointer = TooltipDomHelper.getRecalcedCoordinateByArrow(
|
|
261
|
+
DonutHelper.getArcCentroid(blockSize, margin, dataRow, donutThickness),
|
|
262
|
+
tooltipBlock.getEl(),
|
|
263
|
+
blockSize,
|
|
264
|
+
tooltipArrow,
|
|
265
|
+
translate.x,
|
|
266
|
+
translate.y
|
|
267
|
+
);
|
|
268
|
+
coordinatePointer[0] = coordinatePointer[0] + translate.x;
|
|
269
|
+
coordinatePointer[1] = coordinatePointer[1] + translate.y;
|
|
270
|
+
const tooltipCoordinate = TooltipHelper.getCoordinateByPointer(coordinatePointer);
|
|
271
|
+
tooltipBlock.setCoordinate(tooltipCoordinate);
|
|
272
|
+
}
|
|
273
|
+
ElementHighlighter.toggleActivityStyle(select(this), true);
|
|
274
|
+
const clones = Donut.getAllArcClones(block).filter(
|
|
275
|
+
(d) => d.data[dataOptions.keyField.name] === dataRow.data[dataOptions.keyField.name]
|
|
276
|
+
);
|
|
277
|
+
if (
|
|
278
|
+
clones.nodes().length === 0 &&
|
|
279
|
+
(block.filterEventManager.getSelectedKeys().length === 0 ||
|
|
280
|
+
block.filterEventManager.isSelected(dataRow.data[dataOptions.keyField.name]))
|
|
281
|
+
) {
|
|
282
|
+
ElementHighlighter.renderArcCloneAndHighlight(block, margin, select(this), blockSize, donutThickness);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
elements.on("mouseleave", function (e, dataRow) {
|
|
286
|
+
TooltipComponentsManager.hideComponent(tooltipBlock.getEl());
|
|
287
|
+
if (!block.filterEventManager.isSelected(dataRow.data[dataOptions.keyField.name])) {
|
|
288
|
+
ElementHighlighter.removeCloneForElem(block, dataOptions.keyField.name, select(this));
|
|
289
|
+
ElementHighlighter.removeShadowClone(
|
|
290
|
+
block,
|
|
291
|
+
dataOptions.keyField.name,
|
|
292
|
+
select(this),
|
|
293
|
+
margin,
|
|
294
|
+
blockSize,
|
|
295
|
+
donutThickness
|
|
296
|
+
);
|
|
297
|
+
ElementHighlighter.toggleDonutHighlightState(
|
|
298
|
+
select(this),
|
|
299
|
+
margin,
|
|
300
|
+
blockSize,
|
|
301
|
+
donutThickness,
|
|
302
|
+
block.transitionManager.durations.higlightedScale,
|
|
303
|
+
false
|
|
304
|
+
);
|
|
305
|
+
if (block.filterEventManager.getSelectedKeys().length > 0) {
|
|
306
|
+
ElementHighlighter.toggleActivityStyle(select(this), false);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
157
311
|
}
|
|
158
312
|
Tooltip.tooltipBlockClass = NewTooltip.tooltipBlockClass;
|
|
159
313
|
Tooltip.tooltipLineClass = "mdt-charts-tooltip-line";
|