mdt-charts 1.29.0 → 1.29.1
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 +167 -177
- package/lib/designer/designerConfig.d.ts +59 -62
- package/lib/engine/block/block.d.ts +16 -22
- 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 +66 -65
- 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 +7 -6
- package/lib/engine/contentManager/contentManager.js +15 -15
- package/lib/engine/contentManager/contentManagerFactory.d.ts +7 -7
- package/lib/engine/contentManager/contentManagerFactory.js +12 -12
- package/lib/engine/elementHighlighter/elementHighlighter.d.ts +22 -70
- package/lib/engine/elementHighlighter/elementHighlighter.js +181 -230
- package/lib/engine/elementHighlighter/selectHighlighter.d.ts +4 -29
- package/lib/engine/elementHighlighter/selectHighlighter.js +87 -189
- package/lib/engine/engine.d.ts +17 -17
- package/lib/engine/engine.js +62 -87
- package/lib/engine/features/aggregator/aggregator.d.ts +17 -24
- package/lib/engine/features/aggregator/aggregator.js +102 -113
- package/lib/engine/features/axis/axis.d.ts +9 -22
- package/lib/engine/features/axis/axis.js +150 -159
- package/lib/engine/features/axis/axisDomHelper.d.ts +2 -7
- package/lib/engine/features/axis/axisDomHelper.js +20 -19
- package/lib/engine/features/axis/axisHelper.d.ts +5 -9
- package/lib/engine/features/axis/axisHelper.js +33 -28
- package/lib/engine/features/axis/axisLabelDomHelper.d.ts +11 -26
- package/lib/engine/features/axis/axisLabelDomHelper.js +152 -156
- 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 +16 -51
- package/lib/engine/features/embeddedLabels/embeddedLabels.js +134 -234
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.d.ts +2 -13
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.js +23 -20
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.d.ts +15 -32
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.js +63 -56
- package/lib/engine/features/gridLine/gidLineHelper.d.ts +7 -13
- package/lib/engine/features/gridLine/gidLineHelper.js +49 -42
- package/lib/engine/features/gridLine/gridLine.d.ts +5 -19
- package/lib/engine/features/gridLine/gridLine.js +36 -35
- package/lib/engine/features/legend/legend.d.ts +28 -38
- package/lib/engine/features/legend/legend.js +92 -118
- package/lib/engine/features/legend/legendDomHelper.d.ts +6 -13
- package/lib/engine/features/legend/legendDomHelper.js +62 -63
- package/lib/engine/features/legend/legendEventsManager.d.ts +8 -13
- package/lib/engine/features/legend/legendEventsManager.js +47 -48
- package/lib/engine/features/legend/legendHelper.d.ts +14 -39
- package/lib/engine/features/legend/legendHelper.js +92 -98
- package/lib/engine/features/legend/legendHelperService.d.ts +6 -13
- package/lib/engine/features/legend/legendHelperService.js +25 -24
- package/lib/engine/features/legend/legendMarkerCreator.d.ts +9 -18
- package/lib/engine/features/legend/legendMarkerCreator.js +76 -79
- package/lib/engine/features/legend/legendWidthCalculator.d.ts +7 -7
- package/lib/engine/features/legend/legendWidthCalculator.js +122 -126
- package/lib/engine/features/markDots/markDot.d.ts +15 -42
- package/lib/engine/features/markDots/markDot.js +70 -101
- package/lib/engine/features/markDots/markDotsHelper.d.ts +1 -8
- package/lib/engine/features/markDots/markDotsHelper.js +12 -13
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.d.ts +5 -23
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.js +34 -42
- package/lib/engine/features/scale/scale.d.ts +12 -17
- package/lib/engine/features/scale/scale.js +69 -76
- package/lib/engine/features/tipBox/tipBox.d.ts +5 -9
- package/lib/engine/features/tipBox/tipBox.js +24 -24
- package/lib/engine/features/tipBox/tipBoxHelper.d.ts +9 -16
- package/lib/engine/features/tipBox/tipBoxHelper.js +45 -60
- package/lib/engine/features/title/title.d.ts +6 -6
- package/lib/engine/features/title/title.js +35 -34
- package/lib/engine/features/tolltip/newTooltip/newTooltip.d.ts +11 -15
- package/lib/engine/features/tolltip/newTooltip/newTooltip.js +21 -21
- package/lib/engine/features/tolltip/newTooltip/newTooltipService.d.ts +8 -13
- package/lib/engine/features/tolltip/newTooltip/newTooltipService.js +23 -26
- package/lib/engine/features/tolltip/tooltip.d.ts +11 -17
- package/lib/engine/features/tolltip/tooltip.js +142 -296
- package/lib/engine/features/tolltip/tooltipComponentsManager.d.ts +10 -21
- package/lib/engine/features/tolltip/tooltipComponentsManager.js +114 -113
- package/lib/engine/features/tolltip/tooltipDomHelper.d.ts +21 -43
- package/lib/engine/features/tolltip/tooltipDomHelper.js +120 -144
- package/lib/engine/features/tolltip/tooltipHelper.d.ts +9 -39
- package/lib/engine/features/tolltip/tooltipHelper.js +91 -114
- package/lib/engine/features/valueLabels/valueLabels.d.ts +38 -58
- package/lib/engine/features/valueLabels/valueLabels.js +169 -205
- package/lib/engine/features/valueLabels/valueLabelsHelper.d.ts +1 -7
- package/lib/engine/features/valueLabels/valueLabelsHelper.js +18 -23
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.d.ts +15 -18
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.js +47 -46
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.d.ts +3 -6
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.js +45 -49
- package/lib/engine/filterManager/filterEventManager.d.ts +30 -37
- package/lib/engine/filterManager/filterEventManager.js +131 -174
- package/lib/engine/helpers/domHelper.d.ts +20 -45
- package/lib/engine/helpers/domHelper.js +61 -62
- package/lib/engine/helpers/fontResizer/fontResizer.d.ts +10 -10
- package/lib/engine/helpers/fontResizer/fontResizer.js +16 -21
- package/lib/engine/helpers/fontResizer/fontResizerService.d.ts +1 -1
- package/lib/engine/helpers/fontResizer/fontResizerService.js +10 -9
- package/lib/engine/helpers/helper.d.ts +27 -27
- package/lib/engine/helpers/helper.js +92 -91
- 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 +11 -25
- package/lib/engine/polarNotation/donut/DonutHelper.js +70 -71
- package/lib/engine/polarNotation/donut/donut.d.ts +23 -38
- package/lib/engine/polarNotation/donut/donut.js +99 -109
- package/lib/engine/polarNotation/polarManager.d.ts +6 -6
- package/lib/engine/polarNotation/polarManager.js +47 -67
- package/lib/engine/transitionManager.d.ts +14 -13
- package/lib/engine/transitionManager.js +49 -48
- package/lib/engine/twoDimensionalNotation/area/area.d.ts +28 -44
- package/lib/engine/twoDimensionalNotation/area/area.js +238 -272
- package/lib/engine/twoDimensionalNotation/area/areaGenerator.d.ts +5 -13
- 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 +41 -57
- package/lib/engine/twoDimensionalNotation/bar/bar.d.ts +29 -54
- package/lib/engine/twoDimensionalNotation/bar/bar.js +224 -362
- package/lib/engine/twoDimensionalNotation/bar/barHelper.d.ts +32 -71
- package/lib/engine/twoDimensionalNotation/bar/barHelper.js +126 -162
- 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 +17 -16
- package/lib/engine/twoDimensionalNotation/dot/dotChart.d.ts +23 -23
- package/lib/engine/twoDimensionalNotation/dot/dotChart.js +114 -135
- package/lib/engine/twoDimensionalNotation/line/line.d.ts +16 -37
- package/lib/engine/twoDimensionalNotation/line/line.js +132 -162
- package/lib/engine/twoDimensionalNotation/line/lineBuilder.d.ts +11 -14
- package/lib/engine/twoDimensionalNotation/line/lineBuilder.js +48 -47
- 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 +6 -12
- package/lib/engine/twoDimensionalNotation/line/lineHelper.js +60 -76
- 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 +17 -16
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.d.ts +10 -11
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.js +7 -9
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorMiddleware.d.ts +1 -3
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +10 -10
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +138 -253
- package/lib/engine/valueFormatter.d.ts +3 -3
- package/lib/engine/valueFormatter.js +6 -6
- package/lib/main.d.ts +79 -82
- package/lib/main.js +84 -79
- 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 +25 -27
- package/lib/model/chartStyleModel/colorRange.d.ts +3 -3
- package/lib/model/chartStyleModel/colorRange.js +24 -19
- package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.d.ts +12 -22
- package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.js +60 -69
- package/lib/model/configsValidator/configValidator.d.ts +1 -1
- package/lib/model/configsValidator/configValidator.js +4 -4
- package/lib/model/dataManagerModel/dataManagerModel.d.ts +26 -36
- package/lib/model/dataManagerModel/dataManagerModel.js +128 -179
- package/lib/model/dataManagerModel/dataManagerModelService.d.ts +2 -2
- package/lib/model/dataManagerModel/dataManagerModelService.js +26 -25
- package/lib/model/featuresModel/axisModel.d.ts +18 -69
- package/lib/model/featuresModel/axisModel.js +169 -224
- package/lib/model/featuresModel/axisModelService.d.ts +6 -10
- package/lib/model/featuresModel/axisModelService.js +27 -27
- package/lib/model/featuresModel/legendModel/legendCanvasModel.d.ts +11 -16
- package/lib/model/featuresModel/legendModel/legendCanvasModel.js +59 -55
- package/lib/model/featuresModel/legendModel/legendModel.d.ts +3 -7
- package/lib/model/featuresModel/legendModel/legendModel.js +41 -59
- package/lib/model/featuresModel/legendModel/polarMarginCalculator.d.ts +3 -8
- package/lib/model/featuresModel/legendModel/polarMarginCalculator.js +20 -18
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.d.ts +4 -8
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.js +27 -40
- package/lib/model/featuresModel/otherComponents.d.ts +4 -7
- package/lib/model/featuresModel/otherComponents.js +9 -9
- package/lib/model/featuresModel/recordOverflowModel/recordOverflowModel.d.ts +4 -0
- package/lib/model/featuresModel/recordOverflowModel/recordOverflowModel.js +33 -0
- package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.d.ts +6 -6
- package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.js +23 -27
- package/lib/model/featuresModel/scaleModel/scaleDomainService.d.ts +5 -19
- package/lib/model/featuresModel/scaleModel/scaleDomainService.js +55 -44
- package/lib/model/featuresModel/scaleModel/scaleModel.d.ts +10 -10
- package/lib/model/featuresModel/scaleModel/scaleModel.js +50 -61
- package/lib/model/featuresModel/scaleModel/scaleModelServices.js +22 -15
- 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 +11 -23
- package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.js +51 -53
- package/lib/model/helpers/modelHelper.d.ts +7 -7
- package/lib/model/helpers/modelHelper.js +42 -38
- package/lib/model/helpers/twoDimensionalModelHelper.d.ts +9 -37
- package/lib/model/helpers/twoDimensionalModelHelper.js +125 -147
- package/lib/model/helpers/unitsFromConfigReader.js +4 -4
- package/lib/model/helpers/unitsReader.d.ts +2 -2
- package/lib/model/helpers/unitsReader.js +13 -11
- package/lib/model/margin/marginModel.d.ts +7 -7
- package/lib/model/margin/marginModel.js +20 -23
- package/lib/model/margin/twoDim/twoDimMarginModel.d.ts +13 -13
- package/lib/model/margin/twoDim/twoDimMarginModel.js +113 -184
- package/lib/model/model.d.ts +284 -315
- package/lib/model/model.js +4 -4
- package/lib/model/modelBuilder.d.ts +18 -27
- package/lib/model/modelBuilder.js +79 -85
- package/lib/model/modelInstance/canvasModel/canvasModel.d.ts +17 -17
- package/lib/model/modelInstance/canvasModel/canvasModel.js +43 -42
- 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 +23 -32
- package/lib/model/modelInstance/configReader.js +94 -125
- package/lib/model/modelInstance/dataModel/dataModel.d.ts +10 -10
- package/lib/model/modelInstance/dataModel/dataModel.js +25 -25
- 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 +6 -11
- package/lib/model/modelInstance/modelInstance.js +16 -16
- package/lib/model/modelInstance/titleConfigReader.d.ts +8 -8
- package/lib/model/modelInstance/titleConfigReader.js +30 -37
- package/lib/model/notations/polar/donut/donutAggregatorService.d.ts +6 -9
- package/lib/model/notations/polar/donut/donutAggregatorService.js +37 -40
- package/lib/model/notations/polar/donut/donutModel.d.ts +5 -9
- 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 +15 -13
- package/lib/model/notations/polar/polarModel.d.ts +7 -18
- package/lib/model/notations/polar/polarModel.js +72 -79
- package/lib/model/notations/twoDimensional/styles.d.ts +7 -44
- package/lib/model/notations/twoDimensional/styles.js +125 -234
- package/lib/model/notations/twoDimensionalModel.d.ts +13 -23
- package/lib/model/notations/twoDimensionalModel.js +170 -330
- 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 +11 -10
- package/lib/style/charts-main.css +151 -150
- package/lib/style/charts-main.less +151 -150
- package/package.json +1 -1
- package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.d.ts +0 -15
- package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.js +0 -40
- package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.d.ts +0 -15
- package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.js +0 -32
|
@@ -1,50 +1,61 @@
|
|
|
1
1
|
export function getResolvedDomain(domain, dataRows) {
|
|
2
|
-
|
|
2
|
+
return typeof domain === "function" ? domain({ data: dataRows }) : domain;
|
|
3
3
|
}
|
|
4
4
|
export function getScaleLinearDomain(configDomain, dataRows, configOptions, valueGroup = "main") {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
const calculator = new ScaleDomainCalculator();
|
|
6
|
+
let domainPeekMin;
|
|
7
|
+
let domainPeekMax;
|
|
8
|
+
const resolvedConfigDomain = getResolvedDomain(configDomain, dataRows);
|
|
9
|
+
const charts = configOptions.charts.filter((chart) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return ((_a = chart.data.valueGroup) !== null && _a !== void 0 ? _a : "main") === valueGroup;
|
|
12
|
+
});
|
|
13
|
+
if (resolvedConfigDomain.start === -1)
|
|
14
|
+
domainPeekMin = calculator.getScaleMinValue(configOptions.charts, dataRows);
|
|
15
|
+
else
|
|
16
|
+
domainPeekMin = resolvedConfigDomain.start;
|
|
17
|
+
if (resolvedConfigDomain.end === -1)
|
|
18
|
+
domainPeekMax = calculator.getScaleMaxValue(charts, dataRows);
|
|
19
|
+
else
|
|
20
|
+
domainPeekMax = resolvedConfigDomain.end;
|
|
21
|
+
if (configOptions.axis.key.position === "start")
|
|
22
|
+
return [domainPeekMin, domainPeekMax];
|
|
23
|
+
return [domainPeekMax, domainPeekMin];
|
|
19
24
|
}
|
|
20
25
|
export class ScaleDomainCalculator {
|
|
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
|
-
|
|
26
|
+
getScaleMinValue(charts, dataRows) {
|
|
27
|
+
let min = 0;
|
|
28
|
+
charts.forEach((chart) => {
|
|
29
|
+
dataRows.forEach((dataRow) => {
|
|
30
|
+
let sumInRow = 0;
|
|
31
|
+
chart.data.valueFields.forEach((field) => {
|
|
32
|
+
if (chart.isSegmented && dataRow[field.name] < 0) {
|
|
33
|
+
sumInRow += dataRow[field.name];
|
|
34
|
+
}
|
|
35
|
+
else if (dataRow[field.name] < sumInRow)
|
|
36
|
+
sumInRow = dataRow[field.name];
|
|
37
|
+
});
|
|
38
|
+
if (min > sumInRow)
|
|
39
|
+
min = sumInRow;
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
return min;
|
|
43
|
+
}
|
|
44
|
+
getScaleMaxValue(charts, dataRows) {
|
|
45
|
+
let max = 0;
|
|
46
|
+
charts.forEach((chart) => {
|
|
47
|
+
dataRows.forEach((dataRow) => {
|
|
48
|
+
let sumInRow = 0;
|
|
49
|
+
chart.data.valueFields.forEach((field) => {
|
|
50
|
+
if (chart.isSegmented && dataRow[field.name] > 0)
|
|
51
|
+
sumInRow += dataRow[field.name];
|
|
52
|
+
else if (dataRow[field.name] > sumInRow)
|
|
53
|
+
sumInRow = dataRow[field.name];
|
|
54
|
+
});
|
|
55
|
+
if (max < sumInRow)
|
|
56
|
+
max = sumInRow;
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
return max;
|
|
60
|
+
}
|
|
50
61
|
}
|
|
@@ -3,16 +3,16 @@ import { MdtChartsTwoDimensionalOptions, MdtChartsDataRow } from "../../../confi
|
|
|
3
3
|
import { CanvasModel } from "../../modelInstance/canvasModel/canvasModel";
|
|
4
4
|
import { TwoDimConfigReader } from "../../modelInstance/configReader";
|
|
5
5
|
export declare enum ScaleType {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Key = 0,
|
|
7
|
+
Value = 1
|
|
8
8
|
}
|
|
9
9
|
export declare class ScaleModel {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
private readonly options;
|
|
11
|
+
private readonly canvasModel;
|
|
12
|
+
constructor(options: MdtChartsTwoDimensionalOptions, canvasModel: CanvasModel);
|
|
13
|
+
getScaleKey(allowableKeys: string[]): ScaleKeyModel;
|
|
14
|
+
getScaleLinear(dataRows: MdtChartsDataRow[], configReader?: TwoDimConfigReader): ScaleValueModel;
|
|
15
|
+
getScaleSecondaryLinear(dataRows: MdtChartsDataRow[], configReader?: TwoDimConfigReader): ScaleValueModel;
|
|
16
|
+
private getChartsByTypes;
|
|
17
|
+
private getScaleKeyType;
|
|
18
18
|
}
|
|
@@ -2,67 +2,56 @@ import { getElementsAmountForScale, getScaleKeyRangePeek, getScaleValueRangePeek
|
|
|
2
2
|
import { getScaleLinearDomain } from "./scaleDomainService";
|
|
3
3
|
export var ScaleType;
|
|
4
4
|
(function (ScaleType) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
ScaleType[ScaleType["Key"] = 0] = "Key";
|
|
6
|
+
ScaleType[ScaleType["Value"] = 1] = "Value";
|
|
7
7
|
})(ScaleType || (ScaleType = {}));
|
|
8
8
|
export class ScaleModel {
|
|
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
|
-
? _a
|
|
58
|
-
: null
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
getChartsByTypes(charts, types) {
|
|
62
|
-
return charts.filter((chart) => types.includes(chart.type));
|
|
63
|
-
}
|
|
64
|
-
getScaleKeyType(charts) {
|
|
65
|
-
if (charts.some((chart) => chart.type === "bar" || chart.type === "dot")) return "band";
|
|
66
|
-
return "point";
|
|
67
|
-
}
|
|
9
|
+
constructor(options, canvasModel) {
|
|
10
|
+
this.options = options;
|
|
11
|
+
this.canvasModel = canvasModel;
|
|
12
|
+
}
|
|
13
|
+
getScaleKey(allowableKeys) {
|
|
14
|
+
const bandLikeCharts = this.getChartsByTypes(this.options.charts, ["bar", "dot"]);
|
|
15
|
+
return {
|
|
16
|
+
domain: allowableKeys,
|
|
17
|
+
range: {
|
|
18
|
+
start: 0,
|
|
19
|
+
end: getScaleKeyRangePeek(this.options.orientation, this.canvasModel)
|
|
20
|
+
},
|
|
21
|
+
type: this.getScaleKeyType(this.options.charts),
|
|
22
|
+
elementsAmount: getElementsAmountForScale(bandLikeCharts)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
getScaleLinear(dataRows, configReader) {
|
|
26
|
+
var _a;
|
|
27
|
+
return {
|
|
28
|
+
domain: getScaleLinearDomain(this.options.axis.value.domain, dataRows, this.options),
|
|
29
|
+
range: {
|
|
30
|
+
start: 0,
|
|
31
|
+
end: getScaleValueRangePeek(this.options.orientation, this.canvasModel)
|
|
32
|
+
},
|
|
33
|
+
type: "linear",
|
|
34
|
+
formatter: (_a = configReader === null || configReader === void 0 ? void 0 : configReader.getAxisLabelFormatter()) !== null && _a !== void 0 ? _a : null
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
getScaleSecondaryLinear(dataRows, configReader) {
|
|
38
|
+
var _a;
|
|
39
|
+
return {
|
|
40
|
+
domain: getScaleLinearDomain(this.options.axis.valueSecondary.domain, dataRows, this.options, "secondary"),
|
|
41
|
+
range: {
|
|
42
|
+
start: 0,
|
|
43
|
+
end: getScaleValueRangePeek(this.options.orientation, this.canvasModel)
|
|
44
|
+
},
|
|
45
|
+
type: "linear",
|
|
46
|
+
formatter: (_a = configReader === null || configReader === void 0 ? void 0 : configReader.getSecondaryAxisLabelFormatter()) !== null && _a !== void 0 ? _a : null
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
getChartsByTypes(charts, types) {
|
|
50
|
+
return charts.filter((chart) => types.includes(chart.type));
|
|
51
|
+
}
|
|
52
|
+
getScaleKeyType(charts) {
|
|
53
|
+
if (charts.some((chart) => chart.type === "bar" || chart.type === "dot"))
|
|
54
|
+
return "band";
|
|
55
|
+
return "point";
|
|
56
|
+
}
|
|
68
57
|
}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
export function getScaleKeyRangePeek(chartOrientation, canvasModel) {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
if (chartOrientation === "vertical")
|
|
3
|
+
return canvasModel.getChartBlockWidth();
|
|
4
|
+
return canvasModel.getChartBlockHeight();
|
|
4
5
|
}
|
|
5
6
|
export function getScaleValueRangePeek(chartOrientation, canvasModel) {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
if (chartOrientation === "vertical")
|
|
8
|
+
return canvasModel.getChartBlockHeight();
|
|
9
|
+
return canvasModel.getChartBlockWidth();
|
|
8
10
|
}
|
|
9
11
|
export function getElementsAmountForScale(bandLikeCharts) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
if (bandLikeCharts.length === 0)
|
|
13
|
+
return 1;
|
|
14
|
+
let barAmounts = {};
|
|
15
|
+
bandLikeCharts.forEach((chart) => {
|
|
16
|
+
if (!barAmounts[chart.type])
|
|
17
|
+
barAmounts[chart.type] = 0;
|
|
18
|
+
if (chart.type === "dot")
|
|
19
|
+
barAmounts[chart.type] = 1;
|
|
20
|
+
if (chart.type === "bar") {
|
|
21
|
+
if (chart.isSegmented)
|
|
22
|
+
barAmounts[chart.type] += 1;
|
|
23
|
+
else
|
|
24
|
+
barAmounts[chart.type] += chart.data.valueFields.length;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return Math.max(...Object.values(barAmounts));
|
|
21
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TitleBlockModel } from "../model";
|
|
2
2
|
import { TitleConfigReader } from "../modelInstance/titleConfigReader";
|
|
3
3
|
export declare class TitleModel {
|
|
4
|
-
|
|
4
|
+
static getTitleModel(titleConfig: TitleConfigReader): TitleBlockModel;
|
|
5
5
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export class TitleModel {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
static getTitleModel(titleConfig) {
|
|
3
|
+
const defaultPads = titleConfig.getFontSize();
|
|
4
|
+
const pad = titleConfig.getTextContent() ? defaultPads : 0;
|
|
5
|
+
return {
|
|
6
|
+
margin: {
|
|
7
|
+
bottom: 5,
|
|
8
|
+
left: 0,
|
|
9
|
+
right: 0,
|
|
10
|
+
top: 0
|
|
11
|
+
},
|
|
12
|
+
size: pad,
|
|
13
|
+
pad: 0
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export class TooltipModel {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
static getTooltipModel(options) {
|
|
3
|
+
return {
|
|
4
|
+
position: (options === null || options === void 0 ? void 0 : options.position) || "followCursor"
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
7
|
}
|
|
@@ -2,36 +2,24 @@ import { BlockMargin, Orient, ValueLabelAnchor, ValueLabelDominantBaseline } fro
|
|
|
2
2
|
import { BoundingRect } from "../../../engine/features/valueLabelsCollision/valueLabelsCollision";
|
|
3
3
|
import { Size, ValueLabelsPositionMode, ValueLabelsRotationOptions } from "../../../config/config";
|
|
4
4
|
interface ValueLabelAlignment {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
dominantBaseline: ValueLabelDominantBaseline;
|
|
6
|
+
textAnchor: ValueLabelAnchor;
|
|
7
7
|
}
|
|
8
8
|
export declare const OFFSET_SIZE_PX = 10;
|
|
9
9
|
export declare const BORDER_OFFSET_SIZE_PX = 2;
|
|
10
10
|
export declare class ValueLabelCoordinateCalculator {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
private readonly keyAxisOrient;
|
|
12
|
+
private readonly margin;
|
|
13
|
+
private readonly offsetSizePx;
|
|
14
|
+
constructor(positionMode: ValueLabelsPositionMode | undefined, keyAxisOrient: Orient, margin: BlockMargin);
|
|
15
|
+
getValueLabelY(scaledValue: number): number;
|
|
16
|
+
getValueLabelX(scaledValue: number): number;
|
|
17
17
|
}
|
|
18
|
-
export declare function calculateValueLabelAlignment(
|
|
19
|
-
keyAxisOrient: Orient,
|
|
20
|
-
positionMode?: ValueLabelsPositionMode,
|
|
21
|
-
rotation?: ValueLabelsRotationOptions
|
|
22
|
-
): ValueLabelAlignment;
|
|
18
|
+
export declare function calculateValueLabelAlignment(keyAxisOrient: Orient, positionMode?: ValueLabelsPositionMode, rotation?: ValueLabelsRotationOptions): ValueLabelAlignment;
|
|
23
19
|
export declare function hasCollisionLeftSide(labelClientRect: BoundingRect, margin: BlockMargin): boolean;
|
|
24
|
-
export declare function hasCollisionRightSide(
|
|
25
|
-
labelClientRect: BoundingRect,
|
|
26
|
-
blockSize: Size,
|
|
27
|
-
margin: BlockMargin
|
|
28
|
-
): boolean;
|
|
20
|
+
export declare function hasCollisionRightSide(labelClientRect: BoundingRect, blockSize: Size, margin: BlockMargin): boolean;
|
|
29
21
|
export declare function hasCollisionTopSide(labelClientRect: BoundingRect, margin: BlockMargin): boolean;
|
|
30
|
-
export declare function hasCollisionBottomSide(
|
|
31
|
-
labelClientRect: BoundingRect,
|
|
32
|
-
blockSize: Size,
|
|
33
|
-
margin: BlockMargin
|
|
34
|
-
): boolean;
|
|
22
|
+
export declare function hasCollisionBottomSide(labelClientRect: BoundingRect, blockSize: Size, margin: BlockMargin): boolean;
|
|
35
23
|
export declare function shiftCoordinateXLeft(labelClientRect: BoundingRect, blockSize: Size, margin: BlockMargin): void;
|
|
36
24
|
export declare function shiftCoordinateXRight(labelClientRect: BoundingRect, margin: BlockMargin): void;
|
|
37
25
|
export declare function shiftCoordinateYTop(labelClientRect: BoundingRect): void;
|
|
@@ -1,75 +1,73 @@
|
|
|
1
1
|
export const OFFSET_SIZE_PX = 10;
|
|
2
2
|
export const BORDER_OFFSET_SIZE_PX = 2;
|
|
3
3
|
export class ValueLabelCoordinateCalculator {
|
|
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
|
-
|
|
4
|
+
constructor(positionMode, keyAxisOrient, margin) {
|
|
5
|
+
this.keyAxisOrient = keyAxisOrient;
|
|
6
|
+
this.margin = margin;
|
|
7
|
+
this.offsetSizePx = positionMode === "center" ? 0 : OFFSET_SIZE_PX;
|
|
8
|
+
}
|
|
9
|
+
getValueLabelY(scaledValue) {
|
|
10
|
+
switch (this.keyAxisOrient) {
|
|
11
|
+
case "bottom":
|
|
12
|
+
return scaledValue - this.offsetSizePx + this.margin.top;
|
|
13
|
+
case "top":
|
|
14
|
+
return scaledValue + this.offsetSizePx + this.margin.top;
|
|
15
|
+
default:
|
|
16
|
+
return scaledValue + this.margin.top;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
getValueLabelX(scaledValue) {
|
|
20
|
+
switch (this.keyAxisOrient) {
|
|
21
|
+
case "right":
|
|
22
|
+
return scaledValue - this.offsetSizePx + this.margin.left;
|
|
23
|
+
case "left":
|
|
24
|
+
return scaledValue + this.offsetSizePx + this.margin.left;
|
|
25
|
+
default:
|
|
26
|
+
return scaledValue + this.margin.left;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
export function calculateValueLabelAlignment(keyAxisOrient, positionMode, rotation) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return { dominantBaseline: "middle", textAnchor: "middle" };
|
|
47
|
-
}
|
|
31
|
+
if ((positionMode !== null && positionMode !== void 0 ? positionMode : "after") === "after" && !(rotation === null || rotation === void 0 ? void 0 : rotation.angle)) {
|
|
32
|
+
switch (keyAxisOrient) {
|
|
33
|
+
case "top":
|
|
34
|
+
return { dominantBaseline: "hanging", textAnchor: "middle" };
|
|
35
|
+
case "bottom":
|
|
36
|
+
return { dominantBaseline: "auto", textAnchor: "middle" };
|
|
37
|
+
case "left":
|
|
38
|
+
return { dominantBaseline: "middle", textAnchor: "start" };
|
|
39
|
+
case "right":
|
|
40
|
+
return { dominantBaseline: "middle", textAnchor: "end" };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return { dominantBaseline: "middle", textAnchor: "middle" };
|
|
45
|
+
}
|
|
48
46
|
}
|
|
49
47
|
export function hasCollisionLeftSide(labelClientRect, margin) {
|
|
50
|
-
|
|
48
|
+
return labelClientRect.x - labelClientRect.width / 2 <= margin.left;
|
|
51
49
|
}
|
|
52
50
|
export function hasCollisionRightSide(labelClientRect, blockSize, margin) {
|
|
53
|
-
|
|
51
|
+
return labelClientRect.x + labelClientRect.width / 2 >= blockSize.width - margin.right;
|
|
54
52
|
}
|
|
55
53
|
export function hasCollisionTopSide(labelClientRect, margin) {
|
|
56
|
-
|
|
54
|
+
return labelClientRect.y - labelClientRect.height / 2 <= margin.top;
|
|
57
55
|
}
|
|
58
56
|
export function hasCollisionBottomSide(labelClientRect, blockSize, margin) {
|
|
59
|
-
|
|
57
|
+
return labelClientRect.y + labelClientRect.height / 2 >= blockSize.height - margin.bottom;
|
|
60
58
|
}
|
|
61
59
|
export function shiftCoordinateXLeft(labelClientRect, blockSize, margin) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
const blockRightSide = blockSize.width - margin.right;
|
|
61
|
+
const labelRightSide = labelClientRect.x + labelClientRect.width / 2;
|
|
62
|
+
labelClientRect.x -= labelRightSide - blockRightSide + BORDER_OFFSET_SIZE_PX;
|
|
65
63
|
}
|
|
66
64
|
export function shiftCoordinateXRight(labelClientRect, margin) {
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
const labelLeftSide = labelClientRect.x - labelClientRect.width / 2;
|
|
66
|
+
labelClientRect.x += margin.left - labelLeftSide + BORDER_OFFSET_SIZE_PX;
|
|
69
67
|
}
|
|
70
68
|
export function shiftCoordinateYTop(labelClientRect) {
|
|
71
|
-
|
|
69
|
+
labelClientRect.y -= labelClientRect.height / 2 + BORDER_OFFSET_SIZE_PX;
|
|
72
70
|
}
|
|
73
71
|
export function shiftCoordinateYBottom(labelClientRect) {
|
|
74
|
-
|
|
72
|
+
labelClientRect.y += labelClientRect.height / 2 + BORDER_OFFSET_SIZE_PX;
|
|
75
73
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare class ModelHelper {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
private static readonly defaultBaseFontSize;
|
|
3
|
+
private static baseFontSize;
|
|
4
|
+
private static getBaseFontSize;
|
|
5
|
+
static getFontSizeCssValue(propertyName: string, defaultValue: number): number;
|
|
6
|
+
static getSum(items: number[]): number;
|
|
7
|
+
static getUniqueValues(values: string[]): string[];
|
|
8
|
+
static getStringScore(word: string): number;
|
|
9
9
|
}
|
|
@@ -1,42 +1,46 @@
|
|
|
1
1
|
import { DomHelper } from "../../engine/helpers/domHelper";
|
|
2
2
|
export class ModelHelper {
|
|
3
|
-
|
|
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
|
-
|
|
3
|
+
static getBaseFontSize(propertyName) {
|
|
4
|
+
if (!this.baseFontSize)
|
|
5
|
+
this.baseFontSize = this.getFontSizeCssValue(propertyName, this.defaultBaseFontSize);
|
|
6
|
+
return this.baseFontSize;
|
|
7
|
+
}
|
|
8
|
+
static getFontSizeCssValue(propertyName, defaultValue) {
|
|
9
|
+
const value = parseInt(DomHelper.getCssPropertyValue(document.documentElement, propertyName));
|
|
10
|
+
return isNaN(value) ? defaultValue : value;
|
|
11
|
+
}
|
|
12
|
+
static getSum(items) {
|
|
13
|
+
return items.reduce((acc, item) => acc + item, 0);
|
|
14
|
+
}
|
|
15
|
+
static getUniqueValues(values) {
|
|
16
|
+
const uniqueValues = values.filter((keyValue, index, self) => self.indexOf(keyValue) === index);
|
|
17
|
+
return uniqueValues;
|
|
18
|
+
}
|
|
19
|
+
static getStringScore(word) {
|
|
20
|
+
// lower case letter width ~ 0.8 from upper case width.
|
|
21
|
+
// Number width == lower case letter width
|
|
22
|
+
const fontSize = this.getBaseFontSize("--chart-base-font-size");
|
|
23
|
+
let score = 0;
|
|
24
|
+
const upperLetterScore = fontSize / 9;
|
|
25
|
+
const lowerLetterScore = fontSize / 13;
|
|
26
|
+
const digitScore = fontSize / 15;
|
|
27
|
+
const otherSymbolScore = fontSize / 23;
|
|
28
|
+
const specialSmallSymbols = [",", ".", " "];
|
|
29
|
+
for (let i = 0; i < word.length; i++) {
|
|
30
|
+
if (parseFloat(word[i]).toString() !== word[i] &&
|
|
31
|
+
!specialSmallSymbols.includes(word[i]) &&
|
|
32
|
+
word[i].trim().length > 0) {
|
|
33
|
+
if (word[i].toUpperCase() === word[i])
|
|
34
|
+
score += upperLetterScore;
|
|
35
|
+
else
|
|
36
|
+
score += lowerLetterScore;
|
|
37
|
+
}
|
|
38
|
+
else if (word[i] == parseInt(word[i]).toString())
|
|
39
|
+
score += digitScore;
|
|
40
|
+
else
|
|
41
|
+
score += otherSymbolScore;
|
|
42
|
+
}
|
|
43
|
+
return score;
|
|
44
|
+
}
|
|
41
45
|
}
|
|
42
46
|
ModelHelper.defaultBaseFontSize = 13;
|