diff --git a/package.json b/package.json index 5ee53b5..59a9427 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ ], "types": "dist/index.d.ts", "scripts": { + "start": "rollup -c -w", "prebuild": "rimraf dist", "build": "rollup -c", "prepub": "npm run build", diff --git a/src/tracks/canvas-track.ts b/src/tracks/canvas-track.ts index 89290e6..a9d5672 100644 --- a/src/tracks/canvas-track.ts +++ b/src/tracks/canvas-track.ts @@ -28,15 +28,17 @@ export default class CanvasTrack extends Track extends Tr */ onUpdate(trackEvent: OnUpdateEvent) : void { super.onUpdate(trackEvent); + + const boundingClient = this.elm.getBoundingClientRect(); + setStyles(this.plotGroup, { height: `${this.elm.clientHeight}px`, - width: `${this.elm.clientWidth}px`, + width: `${boundingClient.width}px`, }); } }