mirror of
https://gitee.com/antv/g6.git
synced 2024-12-05 21:28:33 +08:00
0b89bf7f86
* refactor: remove unused demos * refactor: adjust onresize handle * refactor: update 3d data resource * docs: update demos imports * refactor: handle resize uniformly and import module name * fix: fix issue that demo cannot get container * refactor: remove unused demos of algorithm and case
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]);
|
|
};
|
|
}
|