前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SVGEdit——SVG编辑器

SVGEdit——SVG编辑器

作者头像
用户1637609
发布2022-09-26 15:23:37
2.7K0
发布2022-09-26 15:23:37
举报
文章被收录于专栏:马洪彪马洪彪

资料

git地址: https://github.com/frangoteam/svgedit 视频搬运: https://www.bilibili.com/video/BV13a411R7q5 demo示例: https://svgedit.netlify.app/editor/index.html

简介

SVGEdit 是一个快速的,基于Web的,JS实现的,SVG画图编辑器,可工作于任何现代浏览器。SVGEdit基于强大的SVG画布库@svgedit/svgcanvas。

当前版本为V7.

本地安装步骤:

  • 从GitHub下载或克隆
  • npm i安装
  • npm run build --workspace @svgedit/svgcanvas,构建svgcanvas依赖
  • npm run start ,执行测试
  • 浏览器访问http://localhost:8000/src/editor/index.html
  • npm run build ,构建项目,然后部署web服务(Nginx)

集成到web应用

使用div集成。

代码语言:javascript
复制
<head>
   <!-- You need to include the CSS for SVGEdit somewhere in your application -->
  <link href="./svgedit.css" rel="stylesheet" media="all"></link>
</head>

<body>
  <!-- svgedit container can be positionned anywhere in the DOM
       but it must have a width and a height -->
  <div id="container" style="width:100%;height:100vh"></div>
</body>
<script type="module">
  /* You need to call the Editor and load it in the <div> */
  import Editor from './Editor.js'
  /* for available options see the file `docs/tutorials/ConfigOptions.md */
  const svgEditor = new Editor(document.getElementById('container'))
  /* initialize the Editor */
  svgEditor.init()
  /* set the configuration */
  svgEditor.setConfig({
          allowInitialUserOverride: true,
          extensions: [],
          noDefaultExtensions: false,
          userExtensions: []
  })
</script>
</html>

二开、扩展

基于React扩展

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-08-28,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 资料
  • 简介
  • 本地安装步骤:
  • 集成到web应用
  • 二开、扩展
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档