mdt-charts 1.15.6 → 1.15.7

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.
@@ -25,12 +25,13 @@ export class ModelHelper {
25
25
  return uniqueValues;
26
26
  }
27
27
  static getStringScore(word) {
28
- // lower case letter width ~ 0.74 from upper case width.
28
+ // lower case letter width ~ 0.8 from upper case width.
29
29
  // Number width == lower case letter width
30
30
  let score = 0;
31
31
  const upperLetterScore = 1;
32
32
  const lowerLetterScore = 0.8;
33
- const digitAndSymbolScore = 0.67;
33
+ const digitScore = 0.75;
34
+ const otherSymbolScore = 0.52;
34
35
  const specialSmallSymbols = [",", ".", " "];
35
36
  for (let i = 0; i < word.length; i++) {
36
37
  if (parseFloat(word[i]).toString() !== word[i] && !specialSmallSymbols.includes(word[i]) && word[i].trim().length > 0) {
@@ -39,8 +40,10 @@ export class ModelHelper {
39
40
  else
40
41
  score += lowerLetterScore;
41
42
  }
43
+ else if (word[i] == parseInt(word[i]).toString())
44
+ score += digitScore;
42
45
  else
43
- score += digitAndSymbolScore;
46
+ score += otherSymbolScore;
44
47
  }
45
48
  return score;
46
49
  }
@@ -44,7 +44,7 @@ export class TwoDimMarginModel {
44
44
  }
45
45
  else {
46
46
  labelsTexts = modelInstance.dataModel.repository.getBiggestValueAndDecremented(this.configReader.getFieldsBySegments())
47
- .map(v => this.configReader.getAxisLabelFormatter()(v));
47
+ .map(v => this.configReader.getAxisLabelFormatter()(v).toString());
48
48
  }
49
49
  return AxisModel.getLabelSize(this.designerConfig.canvas.axisLabel.maxSize.main, labelsTexts);
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdt-charts",
3
- "version": "1.15.6",
3
+ "version": "1.15.7",
4
4
  "description": "",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {