|
|
@@ -90,27 +90,12 @@ export class UnitComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
window.requestAnimationFrame(() => {
|
|
|
Object.entries(this.graphViews).forEach(([key, view]) => {
|
|
|
- // Process each pair here
|
|
|
-
|
|
|
- const sensorGroupElement = '#vega_container_' + key;
|
|
|
- const box = document.getElementById('vega_container_' + key);
|
|
|
- const boxWidth = box.getBoundingClientRect().width;
|
|
|
- const boxHeight = box.getBoundingClientRect().height;
|
|
|
-
|
|
|
- console.log('Container Style:', window.getComputedStyle(box).width);
|
|
|
-
|
|
|
if (view) {
|
|
|
- const newWidth = box.getBoundingClientRect().width - 60;
|
|
|
- console.log('Key:', key, 'NewWidth:', newWidth);
|
|
|
-
|
|
|
- view.width(newWidth).runAsync().then(v => {
|
|
|
- console.log('--- Debugging Vega Layout ---');
|
|
|
- console.log('Target Width Signal:', v.signal('width'));
|
|
|
- console.log('Actual View Width:', v.width());
|
|
|
- console.log('Padding:', v.padding());
|
|
|
- // If this returns a different number than 'width',
|
|
|
- // a signal in your JSON is overriding the layout.
|
|
|
- });
|
|
|
+ const box = document.getElementById('vega_container_' + key);
|
|
|
+ const newWidth = box.getBoundingClientRect().width - 50;
|
|
|
+ view.width(newWidth).run();
|
|
|
+ console.log('Requested width : ', newWidth);
|
|
|
+ console.log('Got width: ', view.width());
|
|
|
}
|
|
|
})
|
|
|
});
|