Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mermaid 图表渲染自适应 #1574

Closed
Sharang-heng opened this issue Mar 4, 2024 · 3 comments
Closed

mermaid 图表渲染自适应 #1574

Sharang-heng opened this issue Mar 4, 2024 · 3 comments
Assignees
Milestone

Comments

@Sharang-heng
Copy link

Sharang-heng commented Mar 4, 2024

import { useEffect, useState } from "react";
import Vditor from "vditor";
import "vditor/dist/index.css";

const App = () => {
  const [vd, setVd] = useState<Vditor>();
  useEffect(() => {
    const vditor = new Vditor("vditor", {
      after: () => {
        vditor.setValue("`\`\`\`mermaid
gantt
title 开发项目计划
dateFormat  YYYY-MM-DD
section 平台开发
a平台     :active, a1, 2023-01-01, 1d
b平台    :after a1  , 2023-01-01, 3d
c平台    :after a1, 2023-01-04, 3d\`\`\``);        setVd(vditor);
      },
    });
    // Clear the effect
    return () => {
      vd?.destroy();
      setVd(undefined);
    };
  }, []);
  return <div id="vditor" className="vditor" />;
};

export default App;
image

@Vanessa219
Copy link
Owner

这个是由于宽度不够,编辑器宽一点就可以了
image

@Sharang-heng
Copy link
Author

能不能做个自适应优化一下,而且这个时间轴也很奇怪

@Vanessa219 Vanessa219 changed the title 甘特图时间轴重叠 图标渲染自适应 Mar 5, 2024
@Vanessa219 Vanessa219 changed the title 图标渲染自适应 mermaid 图表渲染自适应 Mar 5, 2024
@Vanessa219 Vanessa219 self-assigned this Mar 5, 2024
@Vanessa219 Vanessa219 added this to the 3.9 milestone Mar 5, 2024
@Vanessa219
Copy link
Owner

好的,下个版本改进

Vanessa219 added a commit that referenced this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants