在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:
更多推荐
Illustrator / SVG到JavaScript工作流程? (模板库?)
发布评论