【问题标题】:react-flow-renderer export as imagereact-flow-renderer 导出为图像
【发布时间】:2022-11-15 16:44:33
【问题描述】:

我正在使用“react-flow-renderer”库在我的 React 项目中绘制图表。我必须实现“导出为图像”功能,以便我可以将生成的图表导出为 png/jpeg。库没有实现此功能,我无法通过在画布上绘图来使其工作。

【问题讨论】:

    标签: reactjs canvas


    【解决方案1】:

    我建议使用诸如 use-react-screenshot 之类的第三方库,以 jpg/png 格式保存您的流程图。

    https://codesandbox.io/s/rf55oe?file=/src/App.js

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-26
      • 2020-11-04
      • 1970-01-01
      • 2022-10-23
      • 1970-01-01
      • 2022-10-13
      • 2022-09-29
      • 1970-01-01
      相关资源
      最近更新 更多