gladly-plot 0.0.9 → 0.0.10
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 +1 -1
- package/src/core/Plot.js +12 -12
package/package.json
CHANGED
package/src/core/Plot.js
CHANGED
|
@@ -222,18 +222,18 @@ export class Plot extends GlBase {
|
|
|
222
222
|
const plotWidth = width - this.margin.left - this.margin.right
|
|
223
223
|
const plotHeight = height - this.margin.top - this.margin.bottom
|
|
224
224
|
|
|
225
|
-
//
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
this.canvas.width = width
|
|
231
|
-
this.canvas.height = height
|
|
232
|
-
|
|
233
|
-
this.width = width
|
|
234
|
-
this.height = height
|
|
235
|
-
this.plotWidth = plotWidth
|
|
236
|
-
this.plotHeight = plotHeight
|
|
225
|
+
// Clamp to at least 1×1 so _initialize() always runs and getConfig() stays
|
|
226
|
+
// accurate even when the container is hidden or too small to fit the margins.
|
|
227
|
+
// The canvas backing store and WebGL context update synchronously; the D3
|
|
228
|
+
// axis pixel ranges will be corrected when the ResizeObserver fires on
|
|
229
|
+
// becoming visible.
|
|
230
|
+
this.canvas.width = Math.max(1, width)
|
|
231
|
+
this.canvas.height = Math.max(1, height)
|
|
232
|
+
|
|
233
|
+
this.width = Math.max(1, width)
|
|
234
|
+
this.height = Math.max(1, height)
|
|
235
|
+
this.plotWidth = Math.max(1, plotWidth)
|
|
236
|
+
this.plotHeight = Math.max(1, plotHeight)
|
|
237
237
|
|
|
238
238
|
this._warnedMissingDomains = false
|
|
239
239
|
await this._initialize()
|