Illustrator / SVG到JavaScript工作流程? (模板库?)

编程入门 行业动态 更新时间:2024-10-25 08:26:34
本文介绍了Illustrator / SVG到JavaScript工作流程? (模板库?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Illustrator中保存为SVG时,这是典型的结果:

When "Saving as SVG" in Illustrator, this is the typical result:

<?xml version="1.0" encoding="iso-8859-1"?> <!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "www.w3/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="www.w3/2000/svg" xmlns:xlink="www.w3/1999/xlink" x="0px" y="0px" width="841.89px" height="595.28px" viewBox="0 0 841.89 595.28" style="enable-background:new 0 0 841.89 595.28;" xml:space="preserve"> <g id="symbol1" ... > <path ... /> <path ... /> <path ... /> </g> </svg>

我想知道是否有任何类型的模板库(如小胡子,把手等)。 )这将允许我以与HTML类似的方式使用SVG? 这将允许我保存一堆SVG元素模板并动态设置其样式属性和内容......

I'd like to know if there's any kind of JavaScript templating library (like mustache, handlebars etc.) that would allow me to use SVG in a similar fashion as HTML? That would allow me to save a bunch of SVG element templates and set their style attributes and content dynamically ...

推荐答案

根据 groups.google/forum/#!topic/d3-js/qVZ7hacBGrE 您可以使用下划线模板。

According to groups.google/forum/#!topic/d3-js/qVZ7hacBGrE you can use underscore templates.

该论坛还讨论了另一种选择:

The forum also discusses an alternative:

  • 创建一个svgdefs
  • 使用use插入svg对象
  • 使用 d3.js
  • 让它可见
  • create an svg "defs"
  • insert svg object with "use"
  • modify it using d3.js
  • make it visible
  • 更多推荐

    Illustrator / SVG到JavaScript工作流程? (模板库?)

    本文发布于:2023-11-28 10:20:40,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1642008.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:工作流程   模板   Illustrator   SVG   JavaScript

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!