mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-16 20:18:06 +01:00
This commit is contained in:
parent
1732bd84d6
commit
59cecc25c2
2 changed files with 13 additions and 6 deletions
|
|
@ -2302,7 +2302,10 @@ export class Gutter {
|
|||
data: e.outerHTML
|
||||
});
|
||||
if (e.getAttribute("data-subtype") === "echarts") {
|
||||
e.removeAttribute("data-render");
|
||||
const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));
|
||||
if (chartInstance) {
|
||||
chartInstance.resize();
|
||||
}
|
||||
chartRender(e);
|
||||
}
|
||||
});
|
||||
|
|
@ -2343,8 +2346,10 @@ export class Gutter {
|
|||
e.style.width = item;
|
||||
e.style.flex = "none";
|
||||
if (e.getAttribute("data-subtype") === "echarts") {
|
||||
e.removeAttribute("data-render");
|
||||
chartRender(e);
|
||||
const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));
|
||||
if (chartInstance) {
|
||||
chartInstance.resize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -2387,8 +2392,10 @@ export class Gutter {
|
|||
e.style.width = "";
|
||||
e.style.flex = "";
|
||||
if (e.getAttribute("data-subtype") === "echarts") {
|
||||
e.removeAttribute("data-render");
|
||||
chartRender(e);
|
||||
const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));
|
||||
if (chartInstance) {
|
||||
chartInstance.resize();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export const resize = (protyle: IProtyle) => {
|
|||
if (abs.width > MIN_ABS || isNaN(abs.width)) {
|
||||
if (typeof window.echarts !== "undefined") {
|
||||
protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"], [data-subtype="mindmap"]').forEach((chartItem: HTMLElement) => {
|
||||
const chartInstance = window.echarts.getInstanceById(chartItem.firstElementChild.nextElementSibling.getAttribute("_echarts_instance_"));
|
||||
const chartInstance = window.echarts.getInstanceById(chartItem.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));
|
||||
if (chartInstance) {
|
||||
chartInstance.resize();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue