@hpcc-js/common 2.71.11 → 2.71.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/common",
3
- "version": "2.71.11",
3
+ "version": "2.71.13",
4
4
  "description": "hpcc-js - Viz Common",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es6",
@@ -40,26 +40,26 @@
40
40
  "update": "npx --yes npm-check-updates -u -t minor"
41
41
  },
42
42
  "dependencies": {
43
- "@hpcc-js/util": "^2.50.5",
44
- "@types/d3-array": "1.2.9",
45
- "@types/d3-brush": "1.1.5",
46
- "@types/d3-collection": "1.0.10",
47
- "@types/d3-color": "1.4.2",
48
- "@types/d3-dispatch": "1.0.9",
49
- "@types/d3-drag": "1.2.5",
50
- "@types/d3-dsv": "1.2.2",
43
+ "@hpcc-js/util": "^2.50.6",
44
+ "@types/d3-array": "1.2.10",
45
+ "@types/d3-brush": "1.1.6",
46
+ "@types/d3-collection": "1.0.11",
47
+ "@types/d3-color": "1.4.3",
48
+ "@types/d3-dispatch": "1.0.10",
49
+ "@types/d3-drag": "1.2.6",
50
+ "@types/d3-dsv": "1.2.5",
51
51
  "@types/d3-ease": "1.0.11",
52
- "@types/d3-format": "1.4.2",
53
- "@types/d3-interpolate": "1.4.2",
54
- "@types/d3-scale": "1.0.18",
55
- "@types/d3-selection": "1.4.3",
56
- "@types/d3-time-format": "2.3.1",
57
- "@types/d3-transition": "1.3.2",
58
- "@types/d3-zoom": "1.8.4"
52
+ "@types/d3-format": "1.4.3",
53
+ "@types/d3-interpolate": "1.4.3",
54
+ "@types/d3-scale": "1.0.19",
55
+ "@types/d3-selection": "1.4.4",
56
+ "@types/d3-time-format": "2.3.2",
57
+ "@types/d3-transition": "1.3.3",
58
+ "@types/d3-zoom": "1.8.5"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@hpcc-js/bundle": "^2.11.5",
62
- "colorbrewer": "1.5.3",
62
+ "colorbrewer": "1.5.6",
63
63
  "d3-array": "^1",
64
64
  "d3-brush": "^1",
65
65
  "d3-collection": "^1",
@@ -77,7 +77,7 @@
77
77
  "d3-transition": "^1",
78
78
  "d3-zoom": "^1",
79
79
  "font-awesome": "4.7.0",
80
- "tslib": "2.4.1"
80
+ "tslib": "2.6.2"
81
81
  },
82
82
  "repository": {
83
83
  "type": "git",
@@ -90,5 +90,5 @@
90
90
  "url": "https://github.com/hpcc-systems/Visualization/issues"
91
91
  },
92
92
  "homepage": "https://github.com/hpcc-systems/Visualization",
93
- "gitHead": "69e26ec0934dcedd4a35f4639b248851d53d4bb5"
93
+ "gitHead": "3b949c1e18901191ffd0138e84f1713f30621f43"
94
94
  }
package/src/Utility.ts CHANGED
@@ -736,11 +736,17 @@ export function textSize(_text: string | string[], fontName: string = "Verdana",
736
736
  const hash = `${bold}::${fontSize}::${fontName}::${text.join("::")}`;
737
737
  let retVal = g_fontSizeContextCache[hash];
738
738
  if (!retVal) {
739
+ retVal = { width: 0, height: 0 };
739
740
  g_fontSizeContext.font = `${bold ? "bold " : ""}${fontSize}px ${fontName}`;
740
- g_fontSizeContextCache[hash] = retVal = {
741
- width: Math.max(...text.map(t => g_fontSizeContext.measureText("" + t).width)),
742
- height: fontSize * text.length
743
- };
741
+ text.forEach(line => {
742
+ const textMeasurement = g_fontSizeContext.measureText("" + line);
743
+ const width = textMeasurement.width;
744
+ const height = (textMeasurement.fontBoundingBoxDescent + textMeasurement.fontBoundingBoxAscent) * text.length;
745
+ g_fontSizeContextCache[hash] = retVal = {
746
+ width: width > retVal.width ? width : retVal.width,
747
+ height: height > retVal.height ? height : retVal.height
748
+ };
749
+ });
744
750
  }
745
751
  return retVal;
746
752
  }
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/common";
2
- export const PKG_VERSION = "2.71.11";
3
- export const BUILD_VERSION = "2.104.28";
2
+ export const PKG_VERSION = "2.71.13";
3
+ export const BUILD_VERSION = "2.104.32";