Skip to main content

We had a designer create an icon set - I specifically requested that they be SVG so that I could use them to create a custom library in LucidChart. 



Unfortunately once imported many of the SVGs are mangled or distorted in some way. 



Looking at the source code it seems that the "problematic" SVGs have some sort of fancy element in them - like a <rect> or <clipPath>. (Those aren't really "fancy." Those are very standard.)



I can't ask our designer to start using LucidChart as a vector design tool - because it simply isn't one and asking that would be unfair.



 



I can however perhaps ask for some sort of SVG standardization or conversion that will make them compatible with LucidChart.



I have searched the knowledge base on this but does LucidChart have a guide to their SVG requirements?



 



As an example here is an icon before and after import:





Here is the "before" SVG:



<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M16 34L24 42L32 34" stroke="#202124" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
<path d="M24 24V42" stroke="#202124" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
<path d="M41.76 36.18C43.4988 34.9573 44.8027 33.2123 45.4826 31.1983C46.1624 29.1843 46.1828 27.006 45.5408 24.9797C44.8988 22.9533 43.6277 21.1842 41.9121 19.9291C40.1965 18.6741 38.1256 17.9983 36 18H33.48C32.8785 15.6557 31.753 13.4785 30.1882 11.6322C28.6235 9.78583 26.6603 8.31852 24.4464 7.34071C22.2325 6.36289 19.8257 5.90005 17.407 5.98703C14.9884 6.07401 12.621 6.70854 10.4831 7.84285C8.34517 8.97716 6.49244 10.5817 5.06436 12.5357C3.63629 14.4896 2.67009 16.7421 2.23851 19.1235C1.80693 21.5049 1.92121 23.9532 2.57275 26.284C3.22429 28.6149 4.39611 30.7676 5.99999 32.58" stroke="#202124" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
</g>
<defs>
<clipPath id="clip0">
<rect width="48" height="48" fill="white" />
</clipPath>
</defs>
</svg>


 



And here is after it is processed by LucidChart:



<svg xmlns="http://www.w3.org/2000/svg" xmlns:lucid="lucid" width="94" height="94">
<g lucid:page-tab-id="0_0" stroke="#202124" stroke-width="4" fill-opacity="0">
<path d="M72 56.02l-8 8-8.02-8z" />
<path d="M46 54.58l-.22-.25-1.36-1.84-1.06-2.03-.8-2.16-.25-1.14-.3-2.02v-1.98l.22-2 .13-.66.62-2.1.92-2 1.18-1.85 1.2-1.47 1.96-1.77 2.25-1.43.87-.43 1.93-.76 2.02-.46L57.4 28h1.1l2 .18 2.03.47 1.9.72 1.97 1 2.03 1.48 1.76 1.8.25.33 1.27 1.87 1.02 2.02.74 2.16h2.5l2.03.18 2.03.66 1.9 1.08 1 .86 1.55 1.9L85.53 47l.1.22.34 2-.04 2.03-.44 1.98-.5 1.16-1.36 2.13-1.9 1.68z" />
</g>
</svg>


 



Is the answer simply to covert anything and everything to a path first?

Hi Caitlin thanks for posting! We don't have a standard requirements guide for SVG imports but we would be happy to take a look at your specific case and pass any feedback on to our development team for future improvements to the SVG import process. Would mind reaching out directly using this form attaching the original copies of your SVG files so we can take a closer look? 


In the meantime I would recommend trying to converting these files to a single path- we often find that resolves SVG file rendering issues. Alternatively you could export these icons as JPEGs or PNGs and upload them as images in your document. Once uploaded you can add those images to a custom shape library which you will be able to reuse in other documents. To do this simply right click on the uploaded icon image and select "Add to Custom Shape Library" from the drop-down menu. 


I'm with Caitlin! ;-)


As a brand new (potential) user I'm baffled that the SVG-import is seemingly not prioritised at all? Seems a lot of work has gone into the product - but from my little corner in the world I have very hard to see it being used for anything other than totally standard flowcharts without a working shape import. The results from my first attempts from Corel Draw X8 are fairly pathetic:



...looks like this imported in LucidChart:


I've seen circles work in other symbols and some lines/outlines scales fine. And I have strangely (!) not been able to find ANY guidelines (other than Emma D's comment about "single path" (although I'm not sure what's meant by this yet)) for what to avoid etc. Not that I think Corel Draw is easily "hacked" - but at least the SVG output is readable "code" that might be altered by hand. But even that is impossible if no one has any idea of the limitations/errors in the LucidChart import and the people behind it refuse to communicate it?!?


In any case I'm a bit sceptical about the general usefulness of LucidChart if the import function is broken (and I for one perceive it as such currently)... But hopefully someone out there has some solid hints for the frustrated users?


Thanks and best regards


 Anders


 


 


SVG-code for the above symbol:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW X8 -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="16.3798mm" height="11.5067mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 169 119"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<style type="text/css">
<![CDATA[
.str0 {stroke:black;stroke-width:5.15677}
.fil0 {fill:none}
]]>
</style>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<g id="_2726513021040">
<polygon class="fil0 str0" points="33 1313 16626 16693 131116 3116 "/>
<g>
<rect class="fil0 str0" transform="matrix(0.448201 -0.448201 0.448201 0.448201 94.5555 59.3377)" width="60.7086" height="60.7086"/>
<polygon class="fil0 str0" points="11439 12232 12939 12979 12287 11479 "/>
</g>
<g>
<path class="fil0 str0" d="M42 14l0 16m4 14l18 35"/>
<line class="fil0 str0" x1="42" y1="104" x2="42" y2= "89" />
</g>
<circle class="fil0 str0" transform="matrix(2.64845E-14 1 -1 2.64845E-14 42.1783 37.3742)" r="7"/>
<circle class="fil0 str0" transform="matrix(2.64845E-14 1 -1 2.64845E-14 42.1783 81.3006)" r="7"/>
</g>
</g>
</svg>


 


Update:


After some trial-n-error I found the following for Corel Draw X8 (might be helpful for other users):



  1. Sometimes circle etc. are fine - if not convert them to curves

  2. Text placement is a pain. Convert the text to curves (and live with the bad scalability of outline width). This also makes it appear in the preview in the LucidChart library

  3. Grouped objects are more likely to export badly

  4. Avoid arrowheads - they seemingly make the whole or parts of the symbol unable to have outline width changed in LucidChart

  5. Outline widths are not transferred 1:1. Currently I'm just changing them in LucidChart after placing symbols


Cheers


Anders (that is still hoping for LucidChart developers to make a proper import function! ;-)


Thanks for the tips Anders!


I also have some SVG tips I've learned through trial and error. I have been working with the Feather icon library. 



  • Arcs in paths are hit or miss. Sometimes Lucid will flip them horizontally (example: "At-Sign" and "Anchor" in the Feather library) or drop a section of the path (example:  "Umbrella" SVGs from the Feather icon library)



  • If you need a circle use an actual circle element and not a rectangle with rounded corners. Not sure how common this is but I was working with another set of icons that used rounded rectangles as circles. Upon import they became rounded rectangle blobs. 



  • LucidChart does not recognize "stroke-linecap" so don't bother including it in your designs. Unfortunately for me Feather uses these quite a lot and when you drop the linecap styling the icon can change drastically.



  • If an SVG has JUST line elements you will want to convert them to a path. The SVG will initially import correctly but once imported you cannot click and drag it with your mouse (at least not in Chrome). Example: the "Sliders" SVG from the Feather icon library


  • In some cases it can help to use absolute paths instead of relative. For example the "Eye" SVG from the Feather icon library. 


This imports weird:


<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>

But this is ok:


<path d="M112S54124S23122312S19201220S112112Z"></path>

 


Reply