mirror of
https://gitee.com/antv/g6.git
synced 2024-12-14 09:30:48 +08:00
10 lines
377 B
TypeScript
10 lines
377 B
TypeScript
|
if (typeof window !== 'undefined') {
|
||
|
window.onresize = () => {
|
||
|
const { graph, container, widthOffset = 0, heightOffset = 0 } = window as any;
|
||
|
|
||
|
if (!graph || graph.destroyed) return;
|
||
|
if (!container || !container.scrollWidth || !container.scrollHeight) return;
|
||
|
graph.setSize([container.scrollWidth + widthOffset, container.scrollHeight + heightOffset]);
|
||
|
};
|
||
|
}
|