Skip to content

Commit

Permalink
Fix multiple wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
SarantopoulosKon committed Apr 28, 2023
1 parent ce86c06 commit 103aab0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/core/src/base/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,14 @@ export class TileDBVisualization {

render(): void {
const canvas = document.createElement('canvas');
const wrapperDiv = document.createElement('div');
wrapperDiv.id = 'tdb-viz-wrapper';
wrapperDiv.style.position = 'relative';
wrapperDiv.style.width = '100%';
let wrapperDiv = document.getElementById('tdb-viz-wrapper');

if (!wrapperDiv) {
wrapperDiv = document.createElement('div');
wrapperDiv.id = 'tdb-viz-wrapper';
wrapperDiv.style.position = 'relative';
wrapperDiv.style.width = '100%';
}
canvas.style.width = this.width;
canvas.style.height = this.height;
this.canvas = canvas;
Expand Down

0 comments on commit 103aab0

Please sign in to comment.