@hpcc-js/common 3.8.1 → 3.8.2

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": "3.8.1",
3
+ "version": "3.8.2",
4
4
  "description": "hpcc-js - Viz Common",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
@@ -41,7 +41,7 @@
41
41
  "update-major": "npx --yes npm-check-updates -u"
42
42
  },
43
43
  "dependencies": {
44
- "@hpcc-js/util": "^3.6.1",
44
+ "@hpcc-js/util": "^3.6.2",
45
45
  "@types/d3-array": "1.2.12",
46
46
  "@types/d3-brush": "1.1.8",
47
47
  "@types/d3-collection": "1.0.13",
@@ -59,7 +59,7 @@
59
59
  "@types/d3-zoom": "1.8.7"
60
60
  },
61
61
  "devDependencies": {
62
- "@hpcc-js/esbuild-plugins": "^1.9.1",
62
+ "@hpcc-js/esbuild-plugins": "^1.9.2",
63
63
  "colorbrewer": "1.7.0",
64
64
  "d3-array": "^1",
65
65
  "d3-brush": "^1",
@@ -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": "0cfcae9b4ccbd0b3c9f21381f4581bf121392585"
93
+ "gitHead": "9d31241482c78decca86e3bf624244ce5b40f3d6"
94
94
  }
package/src/HTMLWidget.ts CHANGED
@@ -145,8 +145,16 @@ export class HTMLWidget extends Widget {
145
145
  } else if (this._target) { // HTMLElement
146
146
  this._placeholderElement = d3Select(this._target);
147
147
  if (!this._size.width && !this._size.height) {
148
- const width = parseFloat(this._placeholderElement.style("width"));
149
- const height = parseFloat(this._placeholderElement.style("height"));
148
+ const width = parseFloat(this._placeholderElement.style("width"))
149
+ - (parseFloat(this._placeholderElement.style("margin-left")) + parseFloat(this._placeholderElement.style("margin-right")))
150
+ - (parseFloat(this._placeholderElement.style("border-left")) + parseFloat(this._placeholderElement.style("border-right")))
151
+ - (parseFloat(this._placeholderElement.style("padding-left")) + parseFloat(this._placeholderElement.style("padding-right")))
152
+ ;
153
+ const height = parseFloat(this._placeholderElement.style("height"))
154
+ - (parseFloat(this._placeholderElement.style("margin-top")) + parseFloat(this._placeholderElement.style("margin-bottom")))
155
+ - (parseFloat(this._placeholderElement.style("border-top")) + parseFloat(this._placeholderElement.style("border-bottom")))
156
+ - (parseFloat(this._placeholderElement.style("padding-top")) + parseFloat(this._placeholderElement.style("padding-bottom")))
157
+ ;
150
158
  this.size({
151
159
  width,
152
160
  height