HTML5: Drawing Letter with SVG Path - html

I need to create some alphabets (AEGLNRUTSZ) using svg path.
Q. Is there any tool or technique available? I spent all day, playing with code but it seems very complex and don't make any sense. :(
Here's the example snippet, it draws letter D
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M28.2371517,0.75 C32.7510836,1.7 36.0111455,3.55 39.371517,7.05 C42.4309598,10.25 44.3368421,13.9 45.1393189,18 C45.7913313,21.45 45.7913313,58.55 45.1393189,62.05 C43.4340557,71.15 35.6600619,78.25 26.0303406,79.5 C24.0241486,79.75 17.3034056,80 11.1845201,80 L-7.10542736e-15,80 L-7.10542736e-15,1.42108547e-14 L12.4383901,1.42108547e-14 C21.2656347,1.42108547e-14 25.7795666,0.2 28.2371517,0.75 Z M14.5448916,40 L14.5448916,65.6 L19.7108359,65.4 C24.174613,65.25 25.1275542,65.05 27.1337461,63.9 C31.0458204,61.6 31.0959752,61.45 31.0959752,39.7 C31.0959752,18.5 31.0959752,18.5 27.4346749,16.1 C25.6291022,14.9 24.8767802,14.75 19.9616099,14.55 L14.5448916,14.4 L14.5448916,40 Z" fill="

Related

How to make the line which is in skillshare?

How to make these kind of lines?
Skillshare uses one very tall svg file to create this line. Everything else is layered on top of the lines to create this effect. You can find it in the inspector from loh-content/loh-path/svg.
Here you can see how the line goes throughout the page:
<!-- Important: This is directly from skillshare.com, so this is just an example to see how the line works, do not steal other creators work -->
<svg width="2560" height="5709" viewBox="0 0 2560 5709" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M535.771 5.99991L535.771 1.99991L535.771 5.99991ZM1390.77 1627L1390.77 1631L1390.77 1627ZM1056.04 2081.64L1053.52 2078.53L1056.04 2081.64ZM1288.27 2946.5L1287.71 2950.46L1288.27 2946.5ZM1222.27 4823.5L1222.72 4819.52L1222.27 4823.5ZM871.271 4580L867.358 4579.17L871.271 4580ZM1976.27 5703L1976.27 5707L1976.27 5703ZM1283.77 1400.5L1287.53 1399.15L1283.77 1400.5ZM1390.77 1623C1262.14 1623 1152.97 1610.24 1076.09 1575.91C1037.71 1558.77 1007.55 1536.34 986.985 1507.6C966.442 1478.9 955.271 1443.64 955.271 1400.5L947.271 1400.5C947.271 1445.11 958.85 1482.04 980.479 1512.26C1002.08 1542.44 1033.52 1565.66 1072.83 1583.21C1151.32 1618.26 1261.9 1631 1390.77 1631L1390.77 1623ZM535.771 9.99991C686.612 9.99985 898.913 46.0499 1104.33 134.742C1309.74 223.43 1507.94 364.614 1631.09 574.663L1637.99 570.616C1513.73 358.666 1313.94 216.529 1107.5 127.397C901.076 38.2698 687.694 1.99985 535.771 1.99991L535.771 9.99991ZM1631.09 574.663C1754.24 784.72 1783.19 1047.27 1736.53 1257.2C1689.8 1467.41 1567.89 1623 1390.77 1623L1390.77 1631C1573.65 1631 1697.33 1470.41 1744.34 1258.94C1791.4 1047.19 1762.24 782.558 1637.99 570.616L1631.09 574.663ZM1775.28 4158.71C1768.98 4245.32 1713.71 4299.62 1632.18 4336.23C1550.5 4372.91 1443.22 4391.44 1334.54 4406.6C1226.14 4421.72 1116.27 4433.51 1030.41 4456.85C944.858 4480.11 880.89 4515.41 867.358 4579.17L875.184 4580.83C887.652 4522.09 946.958 4487.83 1032.5 4464.57C1117.73 4441.4 1226.78 4429.71 1335.65 4414.52C1444.24 4399.37 1552.6 4380.74 1635.46 4343.53C1718.48 4306.25 1776.66 4249.93 1783.26 4159.29L1775.28 4158.71ZM867.358 4579.17C852.894 4647.32 891.635 4703.94 958.227 4745.95C1024.84 4787.97 1120.22 4816.07 1221.82 4827.47L1222.72 4819.52C1121.83 4808.2 1027.74 4780.34 962.496 4739.18C897.232 4698.01 861.723 4644.25 875.184 4580.83L867.358 4579.17ZM1221.82 4827.47C1345.78 4841.39 1430.52 4858.52 1483.29 4880.15C1509.67 4890.96 1527.71 4902.75 1538.7 4915.52C1549.56 4928.14 1553.66 4941.82 1551.98 4957C1550.29 4972.37 1542.64 4989.56 1529.37 5008.83C1516.13 5028.07 1497.49 5049.09 1474.2 5072.11C1427.62 5118.16 1362.9 5171.74 1286.73 5234.4L1291.81 5240.58C1367.89 5177.99 1432.93 5124.16 1479.83 5077.8C1503.28 5054.62 1522.32 5033.19 1535.96 5013.37C1549.58 4993.58 1558.04 4975.11 1559.93 4957.88C1561.86 4940.44 1557.04 4924.56 1544.76 4910.3C1532.61 4896.18 1513.27 4883.79 1486.33 4872.75C1432.46 4850.67 1346.76 4833.45 1222.72 4819.52L1221.82 4827.47ZM955.271 1400.5C955.271 1357.72 971.384 1325.19 996.388 1303.12C1021.46 1281 1055.74 1269.18 1092.31 1268.46C1165.45 1267.02 1246.92 1309.97 1280.01 1401.86L1287.53 1399.15C1253.19 1303.75 1168.41 1258.96 1092.15 1260.46C1054.03 1261.21 1017.83 1273.54 991.095 1297.13C964.292 1320.78 947.271 1355.53 947.271 1400.5L955.271 1400.5ZM1280.01 1401.86C1311.13 1488.28 1337.41 1590.25 1314.64 1704.06C1291.88 1817.8 1220 1943.99 1053.52 2078.53L1058.55 2084.75C1226.08 1949.36 1299.27 1821.65 1322.48 1705.63C1345.68 1589.68 1318.83 1486.05 1287.53 1399.15L1280.01 1401.86ZM1286.73 5234.4C1210.21 5297.35 1175.46 5358.84 1177.53 5416.05C1179.61 5473.33 1218.52 5524.7 1285.43 5567.55C1419.21 5653.24 1668.03 5707 1976.27 5707L1976.27 5699C1668.52 5699 1421.58 5645.26 1289.74 5560.82C1223.84 5518.61 1187.47 5469.26 1185.53 5415.76C1183.59 5362.21 1216.08 5302.88 1291.81 5240.58L1286.73 5234.4ZM1053.52 2078.53C905.305 2198.31 816.588 2308.6 774.368 2407.89C732.088 2507.33 736.475 2595.68 774.35 2671.02C812.148 2746.2 883.066 2807.97 973.063 2854.95C1063.09 2901.95 1172.49 2934.29 1287.71 2950.46L1288.83 2942.54C1174.31 2926.46 1065.82 2894.35 976.765 2847.86C887.674 2801.35 818.293 2740.61 781.498 2667.42C744.779 2594.39 740.278 2508.51 781.73 2411.02C823.243 2313.4 910.881 2204.09 1058.55 2084.75L1053.52 2078.53ZM1342.51 3448.44C1283.81 3472.78 1246.37 3496.79 1226.28 3521.16C1216.18 3533.42 1210.39 3545.86 1208.58 3558.52C1206.78 3571.18 1209.01 3583.77 1214.47 3596.24C1225.32 3621 1249.05 3645.69 1280.28 3670.75C1311.61 3695.89 1350.96 3721.78 1393.6 3748.81C1479.05 3802.99 1577.79 3861.84 1653.65 3929.29C1729.56 3996.77 1781.59 4072 1775.28 4158.71L1783.26 4159.29C1789.85 4068.75 1735.4 3991.26 1658.96 3923.31C1582.48 3855.31 1483 3796.01 1397.89 3742.05C1355.25 3715.02 1316.23 3689.34 1285.29 3664.52C1254.26 3639.61 1231.83 3615.94 1221.8 3593.03C1216.83 3581.66 1214.95 3570.58 1216.5 3559.65C1218.06 3548.7 1223.1 3537.6 1232.45 3526.25C1251.26 3503.43 1287.21 3480.03 1345.57 3455.83L1342.51 3448.44ZM1287.71 2950.46C1428.88 2970.28 1531.79 2999.58 1599.52 3035.23C1667.32 3070.92 1698.94 3112.42 1699.79 3156.36C1700.65 3200.59 1670.46 3249.23 1609.83 3299.31C1549.36 3349.26 1459.37 3399.99 1342.51 3448.44L1345.57 3455.83C1462.82 3407.22 1553.61 3356.13 1614.93 3305.48C1676.09 3254.95 1708.72 3204.2 1707.79 3156.2C1706.85 3107.93 1672.07 3064.38 1603.24 3028.15C1534.34 2991.88 1430.39 2962.41 1288.83 2942.54L1287.71 2950.46ZM535.771 1.99991C416.807 1.99996 142.392 23.7138 -2.38593 56.5995L-0.61408 64.4008C143.408 31.6865 417.194 9.99996 535.771 9.99991L535.771 1.99991ZM1976.27 5707C2123.6 5707 2263.21 5694.36 2369.23 5680.72C2475.12 5667.09 2547.81 5652.44 2561.18 5648.32L2558.82 5640.68C2546.19 5644.56 2474.13 5659.16 2368.21 5672.78C2262.43 5686.39 2123.17 5699 1976.27 5699L1976.27 5707Z" fill="#00FF84"></path>
</svg>
So to answer vaguely your question you will need to look into these:
How to create svg images
Basic CSS for layering the images (z-index)

Missing font on a SVG logo

I have an SVG logo that has been designed with the Nunito Sans font.
The font is showing correctly on the website only if the font is installed on the computer.
Please find below the code from the SVG image
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 501.58 501.58"><defs><style>.cls-1{fill:#243d62;stroke:#1d1d1b;stroke-miterlimit:10;}.cls-2{font-size:99.93px;fill:#fff;font-family:Nunito Sans;font-weight:700;}.cls-3{letter-spacing:-1px;}</style></defs><title>Logo512x512</title><circle class="cls-1" cx="250.79" cy="250.79" r="250.29"/><text class="cls-2" transform="translate(25.25 279.94)"><tspan class="cls-3">P</tspan><tspan x="64.66" y="0">acAnGO</tspan></text></svg>
I tried to save the fonts on the website but it never worked.
As the Nunito Sans belong to Google, is there a way to assign it though a web link?
If not what will be the correct code to link the font to the SVG logo?
Thanks
There are two solutions for this:
Before exporting in your logo in SVG make sure to convert your text to outlines. Normally you can do this in Sketch or Illustrator quite easily by pressing right mouse on the selected text. I converted it to curves with a program (Affinity Designer) and below is the result. This can be accomplished with any editor. If you the code you should see the logo as it is intended.
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 2090 2090" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-miterlimit:10;"><circle cx="1044.96" cy="1044.96" r="1042.88" style="fill:#243d62;stroke:#1d1d1b;stroke-width:4.17px;"/><g><path d="M136.853,872.872l128.243,0c31.367,0 55.795,7.842 73.282,23.525c17.488,15.684 26.232,37.682 26.232,65.996c-0,28.313 -8.744,50.381 -26.232,66.204c-17.487,15.822 -41.915,23.733 -73.282,23.733l-74.531,-0l0,114.087l-53.712,-0l-0,-293.545Zm121.581,138.237c36.919,-0 55.378,-16.1 55.378,-48.3c0,-16.377 -4.58,-28.521 -13.74,-36.433c-9.16,-7.911 -23.04,-11.866 -41.638,-11.866l-67.869,-0l0,96.599l67.869,-0Z" style="fill:#fff;fill-rule:nonzero;"/><g><path d="M489.128,957.813c28.591,-0 49.826,6.939 63.705,20.819c13.88,13.879 20.819,35.253 20.819,64.121l0,123.664l-49.548,-0l-0,-31.228c-4.719,10.825 -12.145,19.292 -22.276,25.398c-10.132,6.107 -21.86,9.161 -35.184,9.161c-13.602,-0 -25.954,-2.776 -37.057,-8.328c-11.104,-5.551 -19.848,-13.185 -26.232,-22.9c-6.385,-9.716 -9.577,-20.542 -9.577,-32.478c0,-14.989 3.817,-26.786 11.451,-35.392c7.633,-8.605 20.055,-14.85 37.265,-18.736c17.21,-3.887 40.944,-5.83 71.2,-5.83l10.41,0l-0,-9.576c-0,-13.879 -2.984,-23.872 -8.952,-29.979c-5.968,-6.107 -15.892,-9.161 -29.771,-9.161c-10.826,0 -22.138,1.874 -33.935,5.621c-11.797,3.748 -23.386,8.953 -34.767,15.615l-14.573,-35.809c11.381,-7.217 25.121,-13.185 41.221,-17.904c16.1,-4.719 31.367,-7.078 45.801,-7.078Zm-12.075,174.461c13.879,-0 25.191,-4.65 33.935,-13.949c8.744,-9.299 13.116,-21.304 13.116,-36.016l-0,-8.744l-7.495,0c-18.598,0 -33.033,0.833 -43.303,2.498c-10.271,1.666 -17.627,4.58 -22.068,8.744c-4.441,4.164 -6.662,9.854 -6.662,17.072c0,8.882 3.053,16.169 9.16,21.859c6.107,5.691 13.879,8.536 23.317,8.536Z" style="fill:#fff;fill-rule:nonzero;"/><path d="M719.384,1169.75c-21.374,-0 -39.903,-4.303 -55.587,-12.908c-15.683,-8.605 -27.688,-20.819 -36.016,-36.641c-8.327,-15.822 -12.491,-34.282 -12.491,-55.378c-0,-21.096 4.372,-39.764 13.116,-56.002c8.743,-16.239 21.165,-28.8 37.265,-37.682c16.1,-8.883 34.698,-13.324 55.794,-13.324c14.435,-0 28.522,2.29 42.262,6.87c13.741,4.58 24.775,10.756 33.102,18.529l-14.989,36.641c-8.605,-6.94 -17.696,-12.214 -27.273,-15.823c-9.576,-3.608 -19.084,-5.412 -28.521,-5.412c-18.043,-0 -32.061,5.621 -42.054,16.863c-9.993,11.242 -14.99,27.411 -14.99,48.507c0,20.819 4.997,36.85 14.99,48.092c9.993,11.242 24.011,16.863 42.053,16.863c9.438,-0 18.946,-1.804 28.522,-5.413c9.577,-3.609 18.668,-8.883 27.273,-15.822l14.989,36.224c-8.882,8.05 -20.263,14.365 -34.143,18.945c-13.879,4.581 -28.313,6.871 -43.303,6.871Z" style="fill:#fff;fill-rule:nonzero;"/><path d="M1058.73,1166.42l-29.562,-68.702l-142.817,-0l-29.563,68.702l-54.129,-0l132.824,-293.545l43.719,0l132.824,293.545l-53.296,-0Zm-154.891,-110.34l107.424,0l-53.712,-124.912l-53.712,124.912Z" style="fill:#fff;fill-rule:nonzero;"/><path d="M1256.92,957.813c24.427,-0 42.609,6.939 54.545,20.819c11.936,13.879 17.904,34.836 17.904,62.872l-0,124.913l-52.047,-0l0,-121.998c0,-15.822 -2.984,-27.342 -8.952,-34.559c-5.968,-7.217 -15.337,-10.826 -28.105,-10.826c-14.99,-0 -26.995,4.719 -36.017,14.157c-9.021,9.438 -13.532,22.068 -13.532,37.89l0,115.336l-52.047,-0l0,-203.608l50.798,0l-0,30.396c6.939,-11.381 16.239,-20.125 27.897,-26.232c11.659,-6.107 24.844,-9.16 39.556,-9.16Z" style="fill:#fff;fill-rule:nonzero;"/><path d="M1631.66,1007.78l0,140.735c-13.324,6.662 -29.493,11.936 -48.508,15.822c-19.014,3.886 -38.375,5.829 -58.084,5.829c-30.256,0 -56.488,-6.037 -78.695,-18.112c-22.206,-12.075 -39.208,-29.424 -51.006,-52.047c-11.797,-22.623 -17.696,-49.479 -17.696,-80.569c0,-30.811 5.899,-57.529 17.696,-80.152c11.798,-22.623 28.591,-39.972 50.382,-52.047c21.79,-12.075 47.397,-18.112 76.821,-18.112c20.541,-0 39.833,2.984 57.876,8.952c18.043,5.968 33.032,14.504 44.969,25.607l-17.905,38.723c-13.601,-10.548 -26.995,-18.112 -40.18,-22.693c-13.185,-4.58 -27.689,-6.87 -43.511,-6.87c-30.257,0 -53.088,8.952 -68.494,26.856c-15.406,17.905 -23.109,44.483 -23.109,79.736c0,72.172 31.645,108.258 94.934,108.258c18.876,-0 37.751,-2.637 56.627,-7.911l0,-73.699l-63.289,0l0,-38.306l111.172,-0Z" style="fill:#fff;fill-rule:nonzero;"/><path d="M1822.78,1170.16c-28.591,0 -53.365,-6.107 -74.323,-18.32c-20.957,-12.214 -37.126,-29.702 -48.507,-52.464c-11.381,-22.762 -17.072,-49.41 -17.072,-79.944c0,-30.534 5.621,-57.112 16.863,-79.736c11.243,-22.623 27.412,-40.041 48.508,-52.255c21.096,-12.213 45.94,-18.32 74.531,-18.32c28.591,-0 53.366,6.107 74.323,18.32c20.958,12.214 37.058,29.632 48.3,52.255c11.242,22.624 16.863,49.202 16.863,79.736c-0,30.534 -5.691,57.182 -17.072,79.944c-11.38,22.762 -27.55,40.25 -48.507,52.464c-20.958,12.213 -45.593,18.32 -73.907,18.32Zm0,-42.887c26.926,0 47.953,-9.299 63.081,-27.897c15.128,-18.598 22.692,-45.246 22.692,-79.944c0,-34.698 -7.564,-61.276 -22.692,-79.736c-15.128,-18.459 -36.155,-27.688 -63.081,-27.688c-27.203,-0 -48.369,9.229 -63.497,27.688c-15.128,18.46 -22.692,45.038 -22.692,79.736c-0,34.698 7.564,61.346 22.692,79.944c15.128,18.598 36.294,27.897 63.497,27.897Z" style="fill:#fff;fill-rule:nonzero;"/></g></g></svg>
Include nunito sans through google fonts in your tag in your document. You can select styles here. Then for embed, choose link (for html) or #import (if you want to include through CSS) and copy paste that link to your html or css file. You'll need the html provided by google.

SVG Polligon points to CSS clip-path

So I have this svg:
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 995.26 1112.58"><defs><style>.cls-1{fill:#fff;}</style></defs>
<title>Artboard 7</title><polygon class="cls-1" points="995.21 335.92 995.21
335.92 798.61 0 111.04 0 0 189.25 540.15 1112.58 540.19 1112.58 995 336.47
995 336.46 995.26 336.01 995.21 335.92"/></svg>
and I would like to use that shape as a CSS clip-path with percentages but I have no clue on how to convert those points so it works on CSS. Any tool or tricks available to achieve this would be great.
Found the solution, I just needed to scale the svg viewbox to (0 0 100 100) and then re calculate the points with that new view bow. eg: the first point would be (995.21 * 100)/995.26

Issue with fine position for a SVG file into HTML page (SVG made by Inkscape command line)

From this link, I generate a SVG file from a Postscript (itself made by latex) :
inkscape example.ps --export-plain-svg example.svg
example.ps comes from example.tex below :
\begin{document}
\begin{pspicture}(-4,-2.5)(6,2.5)
\rput(-4,1.5){light\,(1\,:\,yes,\,0\,:\,no)}
\rput(-4,-0.5){noise\,(1\,:\,yes,\,0\,:\,no)}
\rput(5,1.5){eyes\,(0\,:\,closed,\,1\,:\,opened)}
\rput(5,-0.5){voice\,(00\,:\,snore,\,01\,:\,laugh,\,10:\,growl,\,11:\,cry)}
\rput(0,0){Robot toy module}
\psframe(-1.5,-2)(1.5,2)
\psline{->}(-1.5,1)(-4,1)
\psline{->}(-1.5,-1)(-4,-1)
\psline{->}(1.5,1)(4,1)
\psline{->}(1.5,-1)(4,-1)
\psline{-}(2.5,-1.2)(2.9,-0.8)
\rput(2.7,-1.4){2}
\psline{-}(-0.2,-2)(0,-1.7)
\psline{-}(0.2,-2)(0,-1.7)
\psline{-}(0,-2)(0,-2.4)
\rput(0,-2.6){H}
\end{pspicture}
\end{document}
Now I would like to include into a HTML page with a fine position, i.e at the top of parent container.
Unfortunately, I have troubles to adjust the parameters of position from the SVG file into HTML ; for example, I put into HTML page :
<object data="example.svg" width="700 " height="400 " type="image/svg+xml">
and "example.svg" (just created vith inkscape) contains :
viewBox="0 0 743.75 1052.5"
height="1052.5"
width="743.75"
But the result (visible on this link) is not good, since SVG is too small.
The SVG file is located on the following link.
I took width="700 " height="400 for <object> because it would be, like for a standard image into <img> tag, a fine size (and so position) for the SVG into HTML page.
Maybe this problem comes from width and height offsets for SVG "example.svg" file (seen when I visualize it directly in browser : check here )
I tried to set 700 and 400 in viewBox and also for height width :
viewBox="0 0 700 400"
height="400"
width="700"
The result is visible here. For width, it may be acceptable but I have still this large vertical offset (I mean blank space) with the top "title" ("Coding > Robot module").
Is there a general rule to apply for positioning a SVG file without offset. (or at least with a small offset like with an image).
PS: I would like to keep the <object> tag to include the SVG into HTML.
The problem is that the SVG generated by LaTeX is for the whole page, and the viewBox it sets represents the page.
To get the diagram in the middle of the page to scale and fit whatever size you want it to, you need to update the viewBox so that it reflexts the bounding box of (just) your diagram.
So it turns out that the appropriate viewBox to use is approximately:
viewBox="134 174 489 168"
If you set it to that (and update your width and height) you will end up with an SVG that behaves as you want.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="134 174 489 168"
height="168"
width="489"
xml:space="preserve"
version="1.1"
id="svg2"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs6" /><g
transform="matrix(1.25,0,0,-1.25,0,1052.5)"
id="g10"><g
transform="scale(0.1,0.1)"
id="g12"><g
transform="scale(10,10)"
id="g14"><text
id="text16"
style="font-variant:normal;font-weight:normal;font-size:9.96263981px;font-family:CMR10;-inkscape-font-specification:CMR10;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
transform="matrix(1,0,0,-1,108.974,686.3)"><tspan
id="tspan18"
y="0"
x="0 2.7596512 5.5193024 10.559301 15.839153 21.359074 25.199078 31.798918 36.238419 41.278271 45.718269 49.678268 53.997841 60.597839 65.037338 70.557343 75.597343">light(1:yes,0:no)</tspan><tspan
id="tspan20"
y="56.6926"
x="-0.96015602 4.559844 9.599843 12.359494 16.319492 22.319571 26.159575 32.759415 37.198917 42.238766 46.678768 50.638767 54.958336 61.678257 66.11776 71.637756 76.677757">noise(1:yes,0:no)</tspan><tspan
id="tspan22"
y="0"
x="239.63785 244.07784 249.11792 253.55791 259.07809 262.91806 269.51791 273.9574 278.3974 281.15704 286.19702 290.15704 294.59705 300.11703 304.43674 311.15668 315.47626 320.51627 326.27628 330.71631 336.23633 340.67636 346.19638">eyes(0:closed,1:opened)</tspan><tspan
id="tspan24"
y="56.6926"
x="200.39804 205.43788 210.47787 213.23752 217.67751 223.67735 227.51735 232.55736 239.15742 243.59691 247.55693 253.07692 258.11691 262.07693 266.51691 270.8364 275.8764 282.35632 286.79581 289.55545 294.59546 300.11545 305.15546 310.67545 315.11502 320.15503 325.19504 329.51471 334.55472 338.51471 343.31473 350.51474 353.27438 357.47418 362.51419 367.5542 371.87387 376.31387 380.27386 385.55386">voice(00:snore,01:laugh,10:growl,11:cry)</tspan><tspan
id="tspan26"
y="42.5196"
x="113.50584 120.82584 125.86586 131.62576 136.66576 143.74568 147.58568 152.38553 160.90544 169.18546 174.46559 179.98558 185.50557 188.26523">Robottoymodule</tspan></text>
</g><path
id="path28"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 2199.59,6461.8 0,562.94 842.42,0 0,-1125.88 -842.42,0 0,562.94 z" /><path
id="path30"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 1530.18,6760.71 -43.24,-15.44 43.24,-15.45 -17.29,15.45" /><path
id="path32"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 2195.6,6745.27 -682.71,0" /><path
id="path34"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 1530.18,6193.78 -43.24,-15.44 43.24,-15.45 -17.29,15.45" /><path
id="path36"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 2195.6,6178.34 -682.71,0" /><path
id="path38"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 3711.42,6729.82 43.24,15.45 -43.24,15.44 17.29,-15.44" /><path
id="path40"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 3046,6745.27 682.71,0" /><path
id="path42"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="m 3711.42,6162.89 43.24,15.45 -43.24,15.44 17.29,-15.44" /><path
id="path44"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 3046,6178.34 682.71,0" /><path
id="path46"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 3329.46,6121.64 113.38,113.39" /><g
transform="scale(10,10)"
id="g48"><text
id="text50"
style="font-variant:normal;font-weight:normal;font-size:9.96263981px;font-family:CMR10;-inkscape-font-specification:CMR10;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
transform="matrix(1,0,0,-1,336.095,603.375)"><tspan
id="tspan52"
y="0"
x="0">2</tspan></text>
</g><path
id="path54"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 2564.11,5894.87 56.69,85.04" /><path
id="path56"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 2677.49,5894.87 -56.69,85.04" /><path
id="path58"
style="fill:none;stroke:#000000;stroke-width:7.97010994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
d="m 2620.8,5894.87 0,-113.38" /><g
transform="scale(10,10)"
id="g60"><text
id="text62"
style="font-variant:normal;font-weight:normal;font-size:9.96263981px;font-family:CMR10;-inkscape-font-specification:CMR10;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
transform="matrix(1,0,0,-1,258.36,569.119)"><tspan
id="tspan64"
y="0"
x="0">H</tspan><tspan
id="tspan66"
y="429.819"
x="44.7598">1</tspan></text>
</g></g></g></svg>
If you need your diagram to scale and fit its parent container. Set both width and height to "100%".

How do I Morph one SVG to another?

I've looked around for about an hour only to resort to SO; I found https://css-tricks.com/svg-shape-morphing-works/ . This tutorial says "create two svg's with same amount of points" and then randomly jumps to:
<svg viewBox="0 0 194.6 185.1">
<polygon fill="#FFD41D" points=" ... shape 1 points ... ">
</polygon>
</svg>
There are no references to either of the SVG images after creation. The tutorial doesn't explain whats going on... or what to do with the images I created - I'm assuming these "points" are some sort of co-ordinate system that plot out the image, and the value for the viewbox attribute seem random - .
I looked at other solutions such as GreenSocks svgmorphing tool but for the task of morphing two 40px images together it seemed over-complicated having to go through learning all the syntax ect.
( The two images are located at:
http://tobi.freetzi.com/arr.svg and
http://tobi.freetzi.com/add.svg
)
The two paths that you are morphing between have to have the same number and type of path commands. Path commands are the single letters that appear in your path definition d="". You can read more about them in the SVG spec.
In your first SVG (arr.svg) there are X commands:
arr.svg add.svg
-------------- --------------
M12.222,13.293 M29.000,22.000
L7.000,13.000 L22.000,22.000
L17.172,23.899 L22.000,29.000
L17.172,23.899 L18.000,33.000
L20.000,26.728 L18.000,22.000
L20.000,26.728 L7.000,22.000
L20.000,26.728 L10.000,18.000
L22.828,23.899 L18.000,18.000
L22.828,23.899 L18.000,10.000
L33.000,13.000 L22.000,7.000
L27.778,13.293 L22.000,18.000
L20.000,21.071 L32.000,18.000
L14.343,15.414 L29.000,22.000
Z
Your two SVGs almost match. If you add a 'Z' to the first one, you should be able to animate them.
<svg viewBox="0 0 121.5 60.834">
<path d="">
<animate attributeName="d" dur="2s" repeatCount="indefinite"
keyTimes="0;0.5;1"
values="M12.222,13.293 L7.000,13.000 L17.172,23.899 L17.172,23.899 L20.000,26.728 L20.000,26.728 L20.000,26.728 L22.828,23.899 L22.828,23.899 L33.000,13.000 L27.778,13.293 L20.000,21.071 L14.343,15.414 Z;
M29.000,22.000 L22.000,22.000 L22.000,29.000 L18.000,33.000 L18.000,22.000 L7.000,22.000 L10.000,18.000 L18.000,18.000 L18.000,10.000 L22.000,7.000 L22.000,18.000 L32.000,18.000 L29.000,22.000 Z;
M12.222,13.293 L7.000,13.000 L17.172,23.899 L17.172,23.899 L20.000,26.728 L20.000,26.728 L20.000,26.728 L22.828,23.899 L22.828,23.899 L33.000,13.000 L27.778,13.293 L20.000,21.071 L14.343,15.414 Z"/>
</path>
</svg>