How change font text to SVG path - go

I have JSON input.
{
"text": "Change me to svg path",
"font": "Lato-Bold"
}
Expected output looks like this: https://jsfiddle.net/q2rupnc3/
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" height="400" width="800">
<path d="M41.54 58.79L41.54 58.79Q42.34 58.79 42.95 59.40L42.95 59.40L46.76 63.54Q43.60 67.46 38.97 69.55Q34.34 71.64 27.86 71.64L27.86 71.64Q22.07 71.64 17.44 69.66Q12.82 67.68 9.54 64.15Q6.26 60.62 4.52 55.73Q2.77 50.83 2.77 45.04L2.77 45.04Q2.77 39.17 4.64 34.29Q6.52 29.41 9.92 25.88Q13.32 22.36 18.04 20.39Q22.75 18.43 28.48 18.43L28.48 18.43Q34.16 18.43 38.57 20.30Q42.98 22.18 46.08 25.20L46.08 25.20L42.84 29.70Q42.55 30.13 42.10 30.46Q41.65 30.78 40.86 30.78L40.86 30.78Q40.32 30.78 39.74 30.47Q39.17 30.17 38.48 29.72Q37.80 29.27 36.90 28.73Q36.00 28.19 34.81 27.74Q33.62 27.29 32.06 26.98Q30.49 26.68 28.44 26.68L28.44 26.68Q24.95 26.68 22.05 27.92Q19.15 29.16 17.06 31.52Q14.98 33.88 13.82 37.28Q12.67 40.68 12.67 45.04L12.67 45.04Q12.67 49.43 13.91 52.85Q15.16 56.27 17.28 58.61Q19.40 60.95 22.28 62.19Q25.16 63.43 28.48 63.43L28.48 63.43Q30.46 63.43 32.06 63.22Q33.66 63.00 35.01 62.53Q36.36 62.06 37.57 61.33Q38.77 60.59 39.96 59.51L39.96 59.51Q40.32 59.18 40.72 58.99Q41.11 58.79 41.54 58.79ZM60.91 17.57L60.91 38.09Q63.07 36.07 65.66 34.81Q68.26 33.55 71.75 33.55L71.75 33.55Q74.77 33.55 77.11 34.58Q79.45 35.60 81.02 37.46Q82.58 39.31 83.39 41.89Q84.20 44.46 84.20 47.56L84.20 47.56L84.20 71.06L75.31 71.06L75.31 47.56Q75.31 44.17 73.76 42.32Q72.22 40.46 69.05 40.46L69.05 40.46Q66.74 40.46 64.73 41.51Q62.71 42.55 60.91 44.35L60.91 44.35L60.91 71.06L52.02 71.06L52.02 17.57L60.91 17.57ZM112.14 61.52L112.14 55.30Q108.29 55.48 105.66 55.96Q103.03 56.45 101.45 57.20Q99.86 57.96 99.18 58.97Q98.50 59.98 98.50 61.16L98.50 61.16Q98.50 63.50 99.88 64.51Q101.27 65.52 103.50 65.52L103.50 65.52Q106.24 65.52 108.23 64.53Q110.23 63.54 112.14 61.52L112.14 61.52ZM93.35 42.12L91.76 39.28Q98.14 33.44 107.10 33.44L107.10 33.44Q110.34 33.44 112.90 34.51Q115.45 35.57 117.22 37.46Q118.98 39.35 119.90 41.98Q120.82 44.60 120.82 47.74L120.82 47.74L120.82 71.06L116.78 71.06Q115.52 71.06 114.84 70.69Q114.16 70.31 113.76 69.16L113.76 69.16L112.97 66.49Q111.56 67.75 110.23 68.71Q108.90 69.66 107.46 70.31Q106.02 70.96 104.38 71.30Q102.74 71.64 100.76 71.64L100.76 71.64Q98.42 71.64 96.44 71.01Q94.46 70.38 93.02 69.12Q91.58 67.86 90.79 65.99Q90.00 64.12 90.00 61.63L90.00 61.63Q90.00 60.23 90.47 58.84Q90.94 57.46 92.00 56.20Q93.06 54.94 94.75 53.82Q96.44 52.70 98.91 51.88Q101.38 51.05 104.65 50.53Q107.93 50.00 112.14 49.90L112.14 49.90L112.14 47.74Q112.14 44.03 110.56 42.25Q108.97 40.46 105.98 40.46L105.98 40.46Q103.82 40.46 102.40 40.97Q100.98 41.47 99.90 42.10Q98.82 42.73 97.94 43.24Q97.06 43.74 95.98 43.74L95.98 43.74Q95.04 43.74 94.39 43.25Q93.74 42.77 93.35 42.12L93.35 42.12ZM136.87 35.75L137.48 38.66Q138.60 37.55 139.84 36.59Q141.08 35.64 142.47 34.97Q143.86 34.31 145.44 33.93Q147.02 33.55 148.90 33.55L148.90 33.55Q151.92 33.55 154.26 34.58Q156.60 35.60 158.17 37.46Q159.73 39.31 160.54 41.89Q161.35 44.46 161.35 47.56L161.35 47.56L161.35 71.06L152.46 71.06L152.46 47.56Q152.46 44.17 150.91 42.32Q149.36 40.46 146.20 40.46L146.20 40.46Q143.89 40.46 141.88 41.51Q139.86 42.55 138.06 44.35L138.06 44.35L138.06 71.06L129.17 71.06L129.17 34.13L134.60 34.13Q136.33 34.13 136.87 35.75L136.87 35.75ZM183.28 51.70L183.28 51.70Q184.93 51.70 186.16 51.25Q187.38 50.80 188.19 50.00Q189.00 49.21 189.41 48.10Q189.83 46.98 189.83 45.65L189.83 45.65Q189.83 42.91 188.19 41.31Q186.55 39.71 183.28 39.71L183.28 39.71Q180.00 39.71 178.36 41.31Q176.72 42.91 176.72 45.65L176.72 45.65Q176.72 46.94 177.14 48.06Q177.55 49.18 178.36 49.99Q179.17 50.80 180.41 51.25Q181.66 51.70 183.28 51.70ZM193.32 72.72L193.32 72.72Q193.32 71.64 192.67 70.96Q192.02 70.27 190.91 69.89Q189.79 69.52 188.30 69.34Q186.80 69.16 185.13 69.07Q183.46 68.98 181.67 68.90Q179.89 68.83 178.20 68.62L178.20 68.62Q176.72 69.44 175.81 70.56Q174.89 71.68 174.89 73.15L174.89 73.15Q174.89 74.12 175.37 74.97Q175.86 75.82 176.92 76.43Q177.98 77.04 179.68 77.38Q181.37 77.72 183.82 77.72L183.82 77.72Q186.30 77.72 188.10 77.35Q189.90 76.97 191.07 76.30Q192.24 75.64 192.78 74.72Q193.32 73.80 193.32 72.72ZM191.56 35.39L202.18 35.39L202.18 38.70Q202.18 40.28 200.27 40.64L200.27 40.64L196.96 41.26Q197.71 43.16 197.71 45.43L197.71 45.43Q197.71 48.17 196.61 50.38Q195.52 52.60 193.57 54.14Q191.63 55.69 188.98 56.54Q186.34 57.38 183.28 57.38L183.28 57.38Q182.20 57.38 181.19 57.28Q180.18 57.17 179.21 56.99L179.21 56.99Q177.48 58.03 177.48 59.33L177.48 59.33Q177.48 60.44 178.51 60.97Q179.53 61.49 181.22 61.70Q182.92 61.92 185.08 61.97Q187.24 62.03 189.50 62.21Q191.77 62.39 193.93 62.84Q196.09 63.29 197.78 64.26Q199.48 65.23 200.50 66.91Q201.53 68.58 201.53 71.21L201.53 71.21Q201.53 73.66 200.32 75.96Q199.12 78.26 196.83 80.06Q194.54 81.86 191.21 82.96Q187.88 84.06 183.64 84.06L183.64 84.06Q179.46 84.06 176.36 83.25Q173.27 82.44 171.22 81.09Q169.16 79.74 168.16 77.98Q167.15 76.21 167.15 74.30L167.15 74.30Q167.15 71.71 168.71 69.97Q170.28 68.22 173.02 67.18L173.02 67.18Q171.54 66.42 170.68 65.16Q169.81 63.90 169.81 61.85L169.81 61.85Q169.81 61.02 170.12 60.14Q170.42 59.26 171.02 58.39Q171.61 57.53 172.51 56.75Q173.41 55.98 174.64 55.37L174.64 55.37Q171.83 53.86 170.23 51.34Q168.62 48.82 168.62 45.43L168.62 45.43Q168.62 42.70 169.72 40.48Q170.82 38.27 172.78 36.70Q174.74 35.14 177.43 34.31Q180.11 33.48 183.28 33.48L183.28 33.48Q185.65 33.48 187.74 33.97Q189.83 34.45 191.56 35.39L191.56 35.39ZM214.81 48.35L231.59 48.35Q231.59 46.62 231.10 45.09Q230.62 43.56 229.64 42.41Q228.67 41.26 227.18 40.59Q225.68 39.92 223.70 39.92L223.70 39.92Q219.85 39.92 217.64 42.12Q215.42 44.32 214.81 48.35L214.81 48.35ZM237.49 53.71L214.63 53.71Q214.85 56.56 215.64 58.63Q216.43 60.70 217.73 62.05Q219.02 63.40 220.81 64.06Q222.59 64.73 224.75 64.73L224.75 64.73Q226.91 64.73 228.47 64.22Q230.04 63.72 231.21 63.11Q232.38 62.50 233.26 61.99Q234.14 61.49 234.97 61.49L234.97 61.49Q236.09 61.49 236.63 62.32L236.63 62.32L239.18 65.56Q237.71 67.28 235.87 68.45Q234.04 69.62 232.04 70.33Q230.04 71.03 227.97 71.32Q225.90 71.60 223.96 71.60L223.96 71.60Q220.10 71.60 216.79 70.33Q213.48 69.05 211.03 66.55Q208.58 64.04 207.18 60.35Q205.78 56.66 205.78 51.80L205.78 51.80Q205.78 48.02 207.00 44.69Q208.22 41.36 210.51 38.90Q212.80 36.43 216.09 34.99Q219.38 33.55 223.52 33.55L223.52 33.55Q227.02 33.55 229.97 34.67Q232.92 35.78 235.04 37.93Q237.17 40.07 238.37 43.18Q239.58 46.30 239.58 50.29L239.58 50.29Q239.58 52.31 239.15 53.01Q238.72 53.71 237.49 53.71L237.49 53.71ZM272.63 71.06L263.74 71.06L263.74 34.13L269.17 34.13Q270.90 34.13 271.44 35.75L271.44 35.75L272.02 38.48Q272.99 37.40 274.05 36.50Q275.11 35.60 276.32 34.96Q277.52 34.31 278.91 33.93Q280.30 33.55 281.95 33.55L281.95 33.55Q285.44 33.55 287.69 35.44Q289.94 37.33 291.06 40.46L291.06 40.46Q291.92 38.63 293.22 37.31Q294.52 36 296.06 35.17Q297.61 34.34 299.36 33.95Q301.10 33.55 302.87 33.55L302.87 33.55Q305.93 33.55 308.30 34.49Q310.68 35.42 312.30 37.22Q313.92 39.02 314.77 41.62Q315.61 44.21 315.61 47.56L315.61 47.56L315.61 71.06L306.72 71.06L306.72 47.56Q306.72 44.03 305.17 42.25Q303.62 40.46 300.64 40.46L300.64 40.46Q299.27 40.46 298.10 40.93Q296.93 41.40 296.05 42.28Q295.16 43.16 294.66 44.50Q294.16 45.83 294.16 47.56L294.16 47.56L294.16 71.06L285.23 71.06L285.23 47.56Q285.23 43.85 283.73 42.16Q282.24 40.46 279.36 40.46L279.36 40.46Q277.42 40.46 275.74 41.42Q274.07 42.37 272.63 44.03L272.63 44.03L272.63 71.06ZM331.06 48.35L347.83 48.35Q347.83 46.62 347.35 45.09Q346.86 43.56 345.89 42.41Q344.92 41.26 343.42 40.59Q341.93 39.92 339.95 39.92L339.95 39.92Q336.10 39.92 333.88 42.12Q331.67 44.32 331.06 48.35L331.06 48.35ZM353.74 53.71L330.88 53.71Q331.09 56.56 331.88 58.63Q332.68 60.70 333.97 62.05Q335.27 63.40 337.05 64.06Q338.83 64.73 340.99 64.73L340.99 64.73Q343.15 64.73 344.72 64.22Q346.28 63.72 347.45 63.11Q348.62 62.50 349.51 61.99Q350.39 61.49 351.22 61.49L351.22 61.49Q352.33 61.49 352.87 62.32L352.87 62.32L355.43 65.56Q353.95 67.28 352.12 68.45Q350.28 69.62 348.28 70.33Q346.28 71.03 344.21 71.32Q342.14 71.60 340.20 71.60L340.20 71.60Q336.35 71.60 333.04 70.33Q329.72 69.05 327.28 66.55Q324.83 64.04 323.42 60.35Q322.02 56.66 322.02 51.80L322.02 51.80Q322.02 48.02 323.24 44.69Q324.47 41.36 326.75 38.90Q329.04 36.43 332.33 34.99Q335.63 33.55 339.77 33.55L339.77 33.55Q343.26 33.55 346.21 34.67Q349.16 35.78 351.29 37.93Q353.41 40.07 354.62 43.18Q355.82 46.30 355.82 50.29L355.82 50.29Q355.82 52.31 355.39 53.01Q354.96 53.71 353.74 53.71L353.74 53.71ZM392.29 71.64L392.29 71.64Q387.47 71.64 384.89 68.92Q382.32 66.20 382.32 61.42L382.32 61.42L382.32 40.79L378.54 40.79Q377.82 40.79 377.32 40.32Q376.81 39.85 376.81 38.92L376.81 38.92L376.81 35.39L382.75 34.42L384.62 24.34Q384.80 23.62 385.31 23.22Q385.81 22.82 386.60 22.82L386.60 22.82L391.21 22.82L391.21 34.45L401.08 34.45L401.08 40.79L391.21 40.79L391.21 60.80Q391.21 62.53 392.06 63.50Q392.90 64.48 394.38 64.48L394.38 64.48Q395.21 64.48 395.77 64.28Q396.32 64.08 396.74 63.86Q397.15 63.65 397.48 63.45Q397.80 63.25 398.12 63.25L398.12 63.25Q398.52 63.25 398.77 63.45Q399.02 63.65 399.31 64.04L399.31 64.04L401.98 68.36Q400.03 69.98 397.51 70.81Q394.99 71.64 392.29 71.64ZM423.11 33.55L423.11 33.55Q427.21 33.55 430.58 34.88Q433.94 36.22 436.34 38.66Q438.73 41.11 440.03 44.64Q441.32 48.17 441.32 52.52L441.32 52.52Q441.32 56.92 440.03 60.44Q438.73 63.97 436.34 66.46Q433.94 68.94 430.58 70.27Q427.21 71.60 423.11 71.60L423.11 71.60Q418.97 71.60 415.58 70.27Q412.20 68.94 409.81 66.46Q407.41 63.97 406.10 60.44Q404.78 56.92 404.78 52.52L404.78 52.52Q404.78 48.17 406.10 44.64Q407.41 41.11 409.81 38.66Q412.20 36.22 415.58 34.88Q418.97 33.55 423.11 33.55ZM423.11 64.76L423.11 64.76Q427.72 64.76 429.93 61.67Q432.14 58.57 432.14 52.60L432.14 52.60Q432.14 46.62 429.93 43.49Q427.72 40.36 423.11 40.36L423.11 40.36Q418.43 40.36 416.18 43.51Q413.93 46.66 413.93 52.60L413.93 52.60Q413.93 58.54 416.18 61.65Q418.43 64.76 423.11 64.76ZM490.18 38.12L488.16 41.33Q487.80 41.90 487.40 42.14Q487.01 42.37 486.40 42.37L486.40 42.37Q485.75 42.37 485.01 42.01Q484.27 41.65 483.30 41.20Q482.33 40.75 481.09 40.39Q479.84 40.03 478.15 40.03L478.15 40.03Q475.52 40.03 474.03 41.15Q472.54 42.26 472.54 44.06L472.54 44.06Q472.54 45.25 473.31 46.06Q474.08 46.87 475.36 47.48Q476.64 48.10 478.26 48.58Q479.88 49.07 481.55 49.64Q483.23 50.22 484.85 50.96Q486.47 51.70 487.75 52.83Q489.02 53.96 489.80 55.55Q490.57 57.13 490.57 59.36L490.57 59.36Q490.57 62.03 489.62 64.28Q488.66 66.53 486.79 68.17Q484.92 69.80 482.17 70.72Q479.41 71.64 475.81 71.64L475.81 71.64Q473.90 71.64 472.09 71.30Q470.27 70.96 468.59 70.34Q466.92 69.73 465.50 68.90Q464.08 68.08 463.00 67.10L463.00 67.10L465.05 63.72Q465.44 63.11 465.98 62.78Q466.52 62.46 467.35 62.46L467.35 62.46Q468.18 62.46 468.92 62.93Q469.66 63.40 470.63 63.94Q471.60 64.48 472.91 64.94Q474.23 65.41 476.24 65.41L476.24 65.41Q477.83 65.41 478.96 65.03Q480.10 64.66 480.83 64.04Q481.57 63.43 481.91 62.62Q482.26 61.81 482.26 60.95L482.26 60.95Q482.26 59.65 481.48 58.82Q480.71 58.00 479.43 57.38Q478.15 56.77 476.51 56.29Q474.88 55.80 473.17 55.22Q471.46 54.65 469.82 53.87Q468.18 53.10 466.90 51.91Q465.62 50.72 464.85 49.00Q464.08 47.27 464.08 44.82L464.08 44.82Q464.08 42.55 464.98 40.50Q465.88 38.45 467.62 36.92Q469.37 35.39 471.98 34.47Q474.59 33.55 478.01 33.55L478.01 33.55Q481.82 33.55 484.96 34.81Q488.09 36.07 490.18 38.12L490.18 38.12ZM523.55 34.13L530.57 34.13L515.92 71.06L507.85 71.06L493.20 34.13L500.54 34.13Q501.55 34.13 502.22 34.60Q502.88 35.06 503.10 35.78L503.10 35.78L510.23 55.51Q510.80 57.24 511.24 58.90Q511.67 60.55 511.99 62.21L511.99 62.21Q512.35 60.55 512.78 58.90Q513.22 57.24 513.83 55.51L513.83 55.51L521.10 35.78Q521.35 35.06 522.00 34.60Q522.65 34.13 523.55 34.13L523.55 34.13ZM548.78 51.70L548.78 51.70Q550.44 51.70 551.66 51.25Q552.89 50.80 553.70 50.00Q554.51 49.21 554.92 48.10Q555.34 46.98 555.34 45.65L555.34 45.65Q555.34 42.91 553.70 41.31Q552.06 39.71 548.78 39.71L548.78 39.71Q545.51 39.71 543.87 41.31Q542.23 42.91 542.23 45.65L542.23 45.65Q542.23 46.94 542.65 48.06Q543.06 49.18 543.87 49.99Q544.68 50.80 545.92 51.25Q547.16 51.70 548.78 51.70ZM558.83 72.72L558.83 72.72Q558.83 71.64 558.18 70.96Q557.53 70.27 556.42 69.89Q555.30 69.52 553.81 69.34Q552.31 69.16 550.64 69.07Q548.96 68.98 547.18 68.90Q545.40 68.83 543.71 68.62L543.71 68.62Q542.23 69.44 541.31 70.56Q540.40 71.68 540.40 73.15L540.40 73.15Q540.40 74.12 540.88 74.97Q541.37 75.82 542.43 76.43Q543.49 77.04 545.18 77.38Q546.88 77.72 549.32 77.72L549.32 77.72Q551.81 77.72 553.61 77.35Q555.41 76.97 556.58 76.30Q557.75 75.64 558.29 74.72Q558.83 73.80 558.83 72.72ZM557.06 35.39L567.68 35.39L567.68 38.70Q567.68 40.28 565.78 40.64L565.78 40.64L562.46 41.26Q563.22 43.16 563.22 45.43L563.22 45.43Q563.22 48.17 562.12 50.38Q561.02 52.60 559.08 54.14Q557.14 55.69 554.49 56.54Q551.84 57.38 548.78 57.38L548.78 57.38Q547.70 57.38 546.70 57.28Q545.69 57.17 544.72 56.99L544.72 56.99Q542.99 58.03 542.99 59.33L542.99 59.33Q542.99 60.44 544.01 60.97Q545.04 61.49 546.73 61.70Q548.42 61.92 550.58 61.97Q552.74 62.03 555.01 62.21Q557.28 62.39 559.44 62.84Q561.60 63.29 563.29 64.26Q564.98 65.23 566.01 66.91Q567.04 68.58 567.04 71.21L567.04 71.21Q567.04 73.66 565.83 75.96Q564.62 78.26 562.34 80.06Q560.05 81.86 556.72 82.96Q553.39 84.06 549.14 84.06L549.14 84.06Q544.97 84.06 541.87 83.25Q538.78 82.44 536.72 81.09Q534.67 79.74 533.66 77.98Q532.66 76.21 532.66 74.30L532.66 74.30Q532.66 71.71 534.22 69.97Q535.79 68.22 538.52 67.18L538.52 67.18Q537.05 66.42 536.18 65.16Q535.32 63.90 535.32 61.85L535.32 61.85Q535.32 61.02 535.63 60.14Q535.93 59.26 536.53 58.39Q537.12 57.53 538.02 56.75Q538.92 55.98 540.14 55.37L540.14 55.37Q537.34 53.86 535.73 51.34Q534.13 48.82 534.13 45.43L534.13 45.43Q534.13 42.70 535.23 40.48Q536.33 38.27 538.29 36.70Q540.25 35.14 542.93 34.31Q545.62 33.48 548.78 33.48L548.78 33.48Q551.16 33.48 553.25 33.97Q555.34 34.45 557.06 35.39L557.06 35.39ZM599.69 44.93L599.69 61.49Q601.20 63.32 602.98 64.08Q604.76 64.84 606.85 64.84L606.85 64.84Q608.87 64.84 610.49 64.08Q612.11 63.32 613.24 61.78Q614.38 60.23 614.99 57.87Q615.60 55.51 615.60 52.31L615.60 52.31Q615.60 49.07 615.08 46.82Q614.56 44.57 613.58 43.16Q612.61 41.76 611.23 41.11Q609.84 40.46 608.08 40.46L608.08 40.46Q605.30 40.46 603.36 41.63Q601.42 42.80 599.69 44.93L599.69 44.93ZM598.50 35.75L599.22 39.17Q601.49 36.61 604.37 35.03Q607.25 33.44 611.14 33.44L611.14 33.44Q614.16 33.44 616.66 34.70Q619.16 35.96 620.98 38.36Q622.80 40.75 623.79 44.26Q624.78 47.77 624.78 52.31L624.78 52.31Q624.78 56.45 623.66 59.98Q622.55 63.50 620.48 66.10Q618.41 68.69 615.47 70.15Q612.54 71.60 608.90 71.60L608.90 71.60Q605.81 71.60 603.61 70.65Q601.42 69.70 599.69 68.00L599.69 68.00L599.69 83.12L590.80 83.12L590.80 34.13L596.23 34.13Q597.96 34.13 598.50 35.75L598.50 35.75ZM651.20 61.52L651.20 55.30Q647.35 55.48 644.72 55.96Q642.10 56.45 640.51 57.20Q638.93 57.96 638.24 58.97Q637.56 59.98 637.56 61.16L637.56 61.16Q637.56 63.50 638.95 64.51Q640.33 65.52 642.56 65.52L642.56 65.52Q645.30 65.52 647.30 64.53Q649.30 63.54 651.20 61.52L651.20 61.52ZM632.41 42.12L630.83 39.28Q637.20 33.44 646.16 33.44L646.16 33.44Q649.40 33.44 651.96 34.51Q654.52 35.57 656.28 37.46Q658.04 39.35 658.96 41.98Q659.88 44.60 659.88 47.74L659.88 47.74L659.88 71.06L655.85 71.06Q654.59 71.06 653.90 70.69Q653.22 70.31 652.82 69.16L652.82 69.16L652.03 66.49Q650.63 67.75 649.30 68.71Q647.96 69.66 646.52 70.31Q645.08 70.96 643.45 71.30Q641.81 71.64 639.83 71.64L639.83 71.64Q637.49 71.64 635.51 71.01Q633.53 70.38 632.09 69.12Q630.65 67.86 629.86 65.99Q629.06 64.12 629.06 61.63L629.06 61.63Q629.06 60.23 629.53 58.84Q630 57.46 631.06 56.20Q632.12 54.94 633.82 53.82Q635.51 52.70 637.97 51.88Q640.44 51.05 643.72 50.53Q646.99 50.00 651.20 49.90L651.20 49.90L651.20 47.74Q651.20 44.03 649.62 42.25Q648.04 40.46 645.05 40.46L645.05 40.46Q642.89 40.46 641.47 40.97Q640.04 41.47 638.96 42.10Q637.88 42.73 637.00 43.24Q636.12 43.74 635.04 43.74L635.04 43.74Q634.10 43.74 633.46 43.25Q632.81 42.77 632.41 42.12L632.41 42.12ZM680.54 71.64L680.54 71.64Q675.72 71.64 673.15 68.92Q670.57 66.20 670.57 61.42L670.57 61.42L670.57 40.79L666.79 40.79Q666.07 40.79 665.57 40.32Q665.06 39.85 665.06 38.92L665.06 38.92L665.06 35.39L671.00 34.42L672.88 24.34Q673.06 23.62 673.56 23.22Q674.06 22.82 674.86 22.82L674.86 22.82L679.46 22.82L679.46 34.45L689.33 34.45L689.33 40.79L679.46 40.79L679.46 60.80Q679.46 62.53 680.31 63.50Q681.16 64.48 682.63 64.48L682.63 64.48Q683.46 64.48 684.02 64.28Q684.58 64.08 684.99 63.86Q685.40 63.65 685.73 63.45Q686.05 63.25 686.38 63.25L686.38 63.25Q686.77 63.25 687.02 63.45Q687.28 63.65 687.56 64.04L687.56 64.04L690.23 68.36Q688.28 69.98 685.76 70.81Q683.24 71.64 680.54 71.64ZM703.91 17.57L703.91 38.09Q706.07 36.07 708.66 34.81Q711.25 33.55 714.74 33.55L714.74 33.55Q717.77 33.55 720.11 34.58Q722.45 35.60 724.01 37.46Q725.58 39.31 726.39 41.89Q727.20 44.46 727.20 47.56L727.20 47.56L727.20 71.06L718.31 71.06L718.31 47.56Q718.31 44.17 716.76 42.32Q715.21 40.46 712.04 40.46L712.04 40.46Q709.74 40.46 707.72 41.51Q705.71 42.55 703.91 44.35L703.91 44.35L703.91 71.06L695.02 71.06L695.02 17.57L703.91 17.57Z" />
</svg>
I have Lato-Bold.ttf file on my device so if it will be needed I can use it. I can not use text svg tag because the svg reader only understands path. How can this be achieved with it with Go?

Yes this is possible with https://github.com/tdewolff/canvas (I'm the principal author). You can see an example at https://github.com/tdewolff/canvas/blob/master/examples/preview/main.go#L89 (result at https://github.com/tdewolff/canvas/blob/master/examples/preview/out.png) where I load a font and convert a piece of text to a vector path.
The following should work in your case (not tested) using tdewolff/canvas:
fontFamily := canvas.NewFontFamily("Lato")
if err := fontFamily.LoadFontFile("Lato-Bold.ttf", canvas.FontBold); err != nil {
panic(err)
}
face := fontFamily.Face(14.0, canvas.Black, canvas.FontBold, canvas.FontNormal)
path, err := face.ToPath("Change me to svg path")
if err != nil {
panic(err)
}
tpl := `<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" height="400" width="800">
<path d="%s" />
</svg>`
fmt.Printf(tpl, path.ToSVG())

Related

Cannot filter an array of hashes because a key hasn't got an attribute

I have this hash
question["options"]
=> [{"id"=>10217, "title"=>{"English"=>"Da A a E"}, "value"=>"Da A a E", "properties"=>{"disabled"=>false}},
{"id"=>10218, "title"=>{"English"=>"Profondo"}, "value"=>"Profondo", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10219, "title"=>{"English"=>"La macchina da caffè a capsule"}, "value"=>"La macchina da caffè a capsule", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10234, "title"=>{"English"=>"Extender Wifi"}, "value"=>"Extender Wifi", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10246, "title"=>{"English"=>"Da A a F"}, "value"=>"Da A a F", "properties"=>{"disabled"=>false}},
{"id"=>10247, "title"=>{"English"=>"Sistematico"}, "value"=>"Sistematico", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10250, "title"=>{"English"=>"4"}, "value"=>"4", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10252, "title"=>{"English"=>"Ruote"}, "value"=>"Ruote", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10268, "title"=>{"English"=>"Sub 8 GHz"}, "value"=>"Sub 8 GHz", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10273, "title"=>{"English"=>"La copertura sul territorio"}, "value"=>"La copertura sul territorio", "properties"=>{"disabled"=>true, "piping_exclude"=>"false", "show_rules"=>nil, "show_rules_logic_map"=>nil}},
{"id"=>10280, "title"=>{"English"=>"Da A a G"}, "value"=>"Da A a G", "properties"=>nil}]
I need to filter this array removing every value where ["property"]["disabled"] is true
I'm using this
question["options"].filter{ |o|
unless o["properties"].dig("disabled")
{
"value": o["value"],
"id": o["id"],
"text": {
"it": o["title"]["English"]
}
}
end
}
but on the last value "properties"=>nil and of course
undefined method `dig' for nil:NilClass
I try also with try method but is doesn't work...
If you just need to remove elements where ["properties"]["disabled"] is true you just need use Array#reject with such condition
question["options"].reject { |o| o.dig("properties", "disabled") }
# => [{"id"=>10217, "title"=>{"English"=>"Da A a E"}, "value"=>"Da A a E", "properties"=>{"disabled"=>false}},
# {"id"=>10246, "title"=>{"English"=>"Da A a F"}, "value"=>"Da A a F", "properties"=>{"disabled"=>false}},
# {"id"=>10280, "title"=>{"English"=>"Da A a G"}, "value"=>"Da A a G", "properties"=>nil}]
But as I see in the question, you also try to map filtered data (with symbol keys), in this case you can use Enumerable#filter_map
question["options"].filter_map do |o|
unless o.dig("properties", "disabled")
{
value: o["value"],
id: o["id"],
text: { it: o["title"]["English"] }
}
end
end
# => [{:value=>"Da A a E", :id=>10217, :text=>{:it=>"Da A a E"}},
# {:value=>"Da A a F", :id=>10246, :text=>{:it=>"Da A a F"}},
# {:value=>"Da A a G", :id=>10280, :text=>{:it=>"Da A a G"}}]

Find sum of column, divide column value, and print to new column using awk

So my data looks like this:
file Gibbs kcal rel pop pop2
RR2.out -1752.142111 -1099486.696073 0.000000 -0.0000 1.0000
RR1.out -1752.141887 -1099486.555511 0.140562 -0.2374 0.7891
RR4.out -1752.140564 -1099485.725315 0.970758 -1.6398 0.1947
RR3.out -1752.140319 -1099485.571575 1.124498 -1.8995 0.1502
RR5.out -1752.138532 -1099484.450215 2.245858 -3.7937 0.0227
RR6.out -1752.138493 -1099484.425742 2.270331 -3.8351 0.0218
And I want to find the sum of column 6 then divide each value in column 6 by that sum and print these values in a new column titled "weighted"
Using
echo "weighted" >> allRE7
awk 'NR==FNR{sum+= $6; next}{printf("%0.4f\n", $6/sum)}' input input >> out
paste input out >> final
Gives me
file Gibbs kcal rel pop pop2 weighted
RR2.out -1752.142111 -1099486.696073 0.000000 -0.0000 1.0000 0.0000
RR1.out -1752.141887 -1099486.555511 0.140562 -0.2374 0.7891 0.4590
RR4.out -1752.140564 -1099485.725315 0.970758 -1.6398 0.1947 0.3622
RR3.out -1752.140319 -1099485.571575 1.124498 -1.8995 0.1502 0.0894
RR5.out -1752.138532 -1099484.450215 2.245858 -3.7937 0.0227 0.0689
RR6.out -1752.138493 -1099484.425742 2.270331 -3.8351 0.0218 0.0104
0.0100
I don't know where the 0.0100 value comes from.
The problem was that the awk code was printed a weighted result for the header line. To eliminate that, replace:
awk 'NR==FNR{sum+= $6; next}{printf("%0.4f\n", $6/sum)}' input input >> out
with:
awk 'NR==FNR{sum+= $6; next} FNR>1{printf("%0.4f\n", $6/sum)}' input input >> out
The FNR>1 condition assures that $6/sum is only printed for the data lines.
Improvement
The echo and paste commands are not necessary. Try:
$ awk 'NR==FNR{sum+= $6; next} FNR==1{print $0,"weighted"; next} {printf("%s %0.4f\n",$0,$6/sum)}' input input
file Gibbs kcal rel pop pop2 weighted
RR2.out -1752.142111 -1099486.696073 0.000000 -0.0000 1.0000 0.4590
RR1.out -1752.141887 -1099486.555511 0.140562 -0.2374 0.7891 0.3622
RR4.out -1752.140564 -1099485.725315 0.970758 -1.6398 0.1947 0.0894
RR3.out -1752.140319 -1099485.571575 1.124498 -1.8995 0.1502 0.0689
RR5.out -1752.138532 -1099484.450215 2.245858 -3.7937 0.0227 0.0104
RR6.out -1752.138493 -1099484.425742 2.270331 -3.8351 0.0218 0.0100
A variation on the above uses a ternary operator (hat tip: Ed Morton),:
$ awk 'NR==FNR{sum+= $6; next} {print $0, (FNR>1 ? sprintf("%0.4f",$6/sum) : "weighted")}' input input
file Gibbs kcal rel pop pop2 weighted
RR2.out -1752.142111 -1099486.696073 0.000000 -0.0000 1.0000 0.4590
RR1.out -1752.141887 -1099486.555511 0.140562 -0.2374 0.7891 0.3622
RR4.out -1752.140564 -1099485.725315 0.970758 -1.6398 0.1947 0.0894
RR3.out -1752.140319 -1099485.571575 1.124498 -1.8995 0.1502 0.0689
RR5.out -1752.138532 -1099484.450215 2.245858 -3.7937 0.0227 0.0104
RR6.out -1752.138493 -1099484.425742 2.270331 -3.8351 0.0218 0.0100
You are computing the average to the heading line as well.
To omit the heading line your awk script should be:
awk 'FNR==1{next}NR==FNR{sum+= $6; next}{printf("%0.4f\n", $6/sum)}' input input >> out
paste input out >> final
A cleaner awk script including the paste command is:
awk 'FNR==1{next}NR==FNR{sum+= $6; next}{printf("%s %0.4f\n", $0, $6/sum)}' input input

Creating a variable thickness line in d3.js

full source code is at: http://codepen.io/geewhizbang/full/XKLdLE/
I'd like to have the stroke-width vary along the the length of the snake. Just before the end of the snake, the stroke-width should taper to zero.
but if I write a function to do this, it doesn't know about "(d)"
gameBoard.append('path')
.attr("id", snakeId)
.attr("d", interpolator(data))
.attr('stroke-width', snakeStroke + 2)
.attr('fill', 'none')
.attr('stroke', config.snakeOutlineColor);
gameBoard.append('path')
.attr("d", interpolator(data))
.attr('stroke-width', snakeStroke)
.attr('fill', 'none')
.attr('stroke', config.snakeColor);
You can use markers at the start and the end to make your head and tail, and it's possible to hack a variable width stroke using a carefully designed combination of stroke-dasharray and a filter - here's an example.
(But as Robert says above - it's easier to just draw a path and fill it!)
<svg width="800px" height="600px" color-interpolation-filters="sRGB" viewBox="0 0 1500 1000">
<defs>
<filter id="var-width">
<feGaussianBlur in="SourceGraphic" stdDeviation="6" result="blur-source"/>
<feComponentTransfer result="clipper">
<feFuncA type="table" tableValues="0 1 1 1 1"/>
</feComponentTransfer>
<feComponentTransfer result="clipper2">
<feFuncA type="table" tableValues="0 1 1 1 1"/>
</feComponentTransfer>
</filter>
</defs>
<g filter="url(#var-width)">
<path fill="none" stroke="red" stroke-width="10" stroke-dasharray="40,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
d="m 1258.5,638.2714 c -7.5386,-1.87182 -33.9939,-11.02201 -39.8682,-13.78935 -11.8775,-5.59544 -20.9684,-11.05227 -23.0439,-13.8322 -1.8443,-2.47024 -1.8682,-2.8389 -0.3852,-5.94882 1.0032,-2.10363 4.2273,-5.10701 8.8214,-8.21732 11.269,-7.62954 15.6404,-12.9223 17.3957,-21.06234 0.3651,-1.69325 -0.03,-25.31825 -0.8777,-52.5 -2.9735,-95.33422 -3.586,-124.03659 -4.2229,-197.87915 l -0.6421,-74.45779 -4.4256,4.95779 c -2.4341,2.72678 -10.6977,12.60778 -18.3636,21.95778 -7.6659,9.35 -15.6811,18.8 -17.8115,21 -3.7423,3.86447 -5.8767,7.72575 -7.7291,13.98218 -0.5779,1.95206 -1.8586,3.3253 -3.7074,3.9755 -2.3893,0.84027 -3.7801,0.48275 -9.0266,-2.32045 -8.9188,-4.76521 -22.7502,-15.29413 -32.8795,-25.02886 -10.012,-9.622 -13.0072,-13.87833 -12.5523,-17.83719 0.318,-2.76657 0.3347,-2.77224 10.0705,-3.40751 5.7327,-0.37406 10.6786,-1.2287 12,-2.07356 20.5761,-13.15527 52.0465,-32.92983 65.9619,-41.44744 l 17.7139,-10.84267 0.4224,-92 c 0.2504,-54.531463 0.043,-94.036334 -0.5086,-97 -0.5121,-2.75 -1.1944,-6.287354 -1.5161,-7.860787 -0.3838,-1.876808 -0.1104,-3.161369 0.7947,-3.734687 4.1441,-2.624742 27.1746,0.346621 56.2384,7.255796 18.3348,4.35864 20.3214,7.159946 11.9848,16.899447 -5.1909,6.064358 -8.5251,12.824946 -10.2015,20.685129 -2.7521,12.903832 -3.6418,68.318932 -3.6248,225.755102 0.016,151.69554 0.5864,197.15726 3.6505,291.17828 1.3097,40.18569 0.6939,51.75256 -3.1568,59.30055 -2.463,4.82796 -4.6906,5.73771 -10.5108,4.29257 z M 532.94465,619.5607 c -4.15545,-2.42174 -15.1636,-10.04526 -24.46257,-16.94116 -25.33227,-18.78581 -38.63045,-24.60698 -51.43828,-22.5167 -3.04909,0.49762 -15.4438,2.0654 -27.5438,3.48397 -38.21518,4.48022 -68.73764,11.51345 -79.36797,18.2886 -3.46987,2.21149 -11.54542,1.96514 -14.1972,-0.4331 -2.39051,-2.16195 -5.31837,-7.55542 -6.28168,-11.5716 -0.34686,-1.4461 -2.37798,-5.50543 -4.51359,-9.02072 C 319.2275,571.11854 307.71914,547.86135 302.45162,535 290.2059,505.10051 280.70789,474.83194 271.4532,436.21324 c -2.46647,-10.29228 -5.60245,-22.18503 -6.96885,-26.42833 -3.05313,-9.48144 -3.07894,-11.03333 -0.23435,-14.09542 1.6445,-1.77024 4.13376,-2.74576 9.25,-3.625 3.85,-0.66163 12.48987,-2.98822 19.19971,-5.1702 20.65457,-6.71668 52.31498,-13.02081 102.30029,-20.36975 9.625,-1.41509 26.73197,-4.11437 38.01548,-5.99841 64.6974,-10.8027 110.88469,-13.04319 132.66359,-6.43538 15.29655,4.64104 27.54679,9.41596 40.82093,15.91123 20.81828,10.18676 30.41695,19.72863 30.47804,30.29768 0.0254,4.40096 -0.82411,6.17957 -8.45451,17.70034 -6.5974,9.9611 -15.99703,28.94651 -20.299,41 -1.66854,4.675 -6.49294,19.3 -10.7209,32.5 -12.29635,38.39015 -32.82397,92.80004 -43.39456,115.02032 -4.65253,9.78003 -10.1609,17.49788 -12.46266,17.46162 -0.63053,-0.01 -4.54632,-1.99949 -8.70176,-4.42124 z M 507.6904,564.56385 c 3.36684,-1.56758 6.3121,-3.93564 8.38311,-6.74023 14.27335,-19.3292 33.07756,-85.5587 36.86017,-129.82362 1.05006,-12.2881 0.28669,-22.17788 -2.16272,-28.01867 -2.9387,-7.00755 -12.30976,-11.92715 -26.73793,-14.03683 -9.55212,-1.3967 -34.74526,-0.82738 -50.23629,1.13526 l -9.70326,1.22936 -1.6437,4.09544 c -2.19389,5.4663 -3.38973,18.68898 -3.42268,37.84544 L 459,446 l 3.01585,0 c 1.65872,0 9.19622,-1.62912 16.75,-3.62027 10.0126,-2.63928 16.59405,-3.75578 24.28843,-4.12038 10.11135,-0.47914 10.67373,-0.39737 13.40081,1.94837 l 2.84654,2.44848 -1.42172,10.33843 c -0.81276,5.91022 -1.15552,12.94414 -0.80023,16.4219 0.73892,7.233 -0.1094,9.28011 -4.62805,11.16813 -4.10035,1.71323 -9.91944,1.78683 -21.71115,0.27461 -8.5037,-1.09056 -15.69315,-0.65103 -29.59766,1.80945 l -3.35717,0.59407 0.48672,25.61861 c 0.26769,14.09023 0.91941,26.9686 1.44826,28.6186 l 0.96154,3 8.40891,-0.45591 c 18.09353,-0.981 19.98363,-0.80409 22.13904,2.07209 1.25506,1.67476 2.2596,5.27322 2.79158,10 0.98163,8.72206 2.2089,12.3393 4.67286,13.7727 2.54423,1.48009 3.16849,1.38814 8.99584,-1.32503 z M 371,556.98657 c 14.51804,-2.22981 34.99616,-7.39833 35.45257,-8.94796 0.77825,-2.64242 2.47372,-23.86076 3.17935,-39.78861 0.59209,-13.36514 0.48502,-15.25 -0.8663,-15.25 -1.70191,0 -17.52785,4.39734 -22.26562,6.18664 -1.65,0.62315 -4.37197,2.13994 -6.04883,3.37063 -9.86604,7.24099 -19.23389,3.83236 -26.39563,-9.60445 -8.38482,-15.73153 -9.83765,-28.90854 -3.50542,-31.7937 1.39919,-0.63752 6.68531,-1.18318 11.74693,-1.21258 5.28594,-0.0307 17.71547,-1.42209 29.20295,-3.26901 l 20,-3.21555 -0.19841,-13.11095 c -0.22114,-14.61265 -2.4427,-29.58932 -5.37538,-36.23819 l -1.93509,-4.38716 -5.33458,0.62698 c -8.19745,0.96345 -28.46102,6.31301 -37.78468,9.97511 -10.27121,4.03428 -21.46384,10.4748 -25.65705,14.76372 -4.21885,4.31514 -4.72008,7.99356 -4.68856,34.40851 0.0286,23.99296 1.17779,34.00167 6.42471,55.95682 3.66388,15.33106 10.78116,37.4891 12.76385,39.73731 2.47655,2.80822 10.35298,3.4715 21.28519,1.79244 z m -192.5,52.07042 c -2.75,-0.44007 -8.825,-1.83696 -13.5,-3.1042 -9.01886,-2.4447 -14,-5.94484 -14,-9.83748 0,-1.1212 2.09783,-4.19332 4.66185,-6.82693 9.14276,-9.39091 8.36954,-1.04132 10.08162,-108.86508 0.83197,-52.39661 1.21232,-96.4633 0.84521,-97.92598 -0.62116,-2.47491 -1.62289,-1.45695 -14.43843,14.67242 -12.24875,15.41601 -25.51283,30.49588 -42.22916,48.01011 -15.805655,16.5601 -38.698015,35.15284 -50.133135,40.71718 -9.454661,4.60066 -16.734211,6.10878 -29.248054,6.05942 -12.737694,-0.0503 -19.055188,-1.04317 -21.3708673,-3.35884 -2.3606342,-2.36064 -0.9444684,-4.077 9.2420843,-11.20123 C 51.256014,454.42545 85.848748,418.65441 125.17101,367 c 26.5994,-34.94142 43.9835,-62.67912 48.2165,-76.93316 2.07833,-6.99849 2.03097,-8.64836 -0.3156,-10.99493 -1.81047,-1.81047 -2.29576,-1.84231 -7.95512,-0.52207 -21.9096,5.11116 -76.799404,29.84746 -80.537391,36.29448 -5.770496,9.95256 -13.808146,7.56946 -20.732148,-6.14691 C 60.069722,301.21416 50.62515,276.20122 48.542824,268.16526 46.702614,261.06366 46.527228,251.87277 48.2,250.2 c 1.526426,-1.52643 5.465848,-1.46571 9.234478,0.14231 5.426073,2.31524 16.836196,0.18446 50.065522,-9.34949 34.99184,-10.03965 58.31512,-18.74398 89,-33.21513 36.94053,-17.42135 45.89748,-20.67483 50.39879,-18.30663 3.09785,1.62982 8.23103,6.99681 17.72175,18.52894 14.36976,17.46065 15.72533,19.63344 16.18124,25.93641 0.59762,8.26204 -1.1902,11.10767 -9.83151,15.64855 -4.99501,2.62481 -9.10156,5.90525 -14.15358,11.30634 -14.39406,15.38863 -26.02202,30.26181 -34.32841,43.90905 l -3.83471,6.30035 6.92322,7.03788 c 6.55184,6.66036 22.97302,19.1946 32.78171,25.02219 6.78157,4.02911 8.1501,6.78447 8.09447,16.29719 -0.064,10.95168 -3.21715,20.21714 -8.89751,26.1455 -6.18163,6.45151 -10.99073,5.79539 -22.51411,-3.07164 -6.45238,-4.96499 -19.01988,-12.95428 -25.87279,-16.44759 l -4.33145,-2.20798 0.66415,117.31188 c 0.66237,116.99729 0.65868,117.32048 -1.37932,120.52153 -3.9413,6.19055 -14.29582,9.1598 -25.62194,7.34733 z m 596.16667,-57.72366 c -1.34025,-1.34024 -0.61395,-5.58572 1.39865,-8.1756 1.13592,-1.46175 15.21885,-15.93273 31.29539,-32.15773 40.01132,-40.38079 51.96635,-54.89172 62.44398,-75.79403 15.15418,-30.23176 24.95936,-64.15459 31.13172,-107.70597 3.7631,-26.55187 7.17596,-72.08033 5.35063,-71.37872 -2.26256,0.86966 -22.11335,20.27797 -32.60553,31.87872 -18.93188,20.93217 -29.60984,36.06663 -37.43322,53.05615 -7.1,15.41861 -12.50642,16.63894 -23.35792,5.27231 -6.62653,-6.94111 -10.5885,-13.23476 -15.89612,-25.25126 -6.37249,-14.42735 -9.18104,-23.26 -8.80783,-27.69988 0.30658,-3.64731 0.43784,-3.75865 5.88222,-4.98957 3.06275,-0.69245 14.53775,-5.76821 25.5,-11.27946 24.40142,-12.26776 50.51042,-24.10844 71.39675,-32.37912 L 906.6962,238.5 l 0.6519,-8.90362 c 1.03833,-14.18152 0.75507,-97.01461 -0.43434,-127.01103 -0.82278,-20.75009 -0.80325,-27.923313 0.0805,-29.574607 1.82869,-3.41693 7.03768,-5.01455 16.22363,-4.975855 16.21944,0.06832 33.67143,4.610617 40.64347,10.578425 3.65346,3.127231 4.13865,4.043611 4.13865,7.816727 0,2.965264 -0.75778,5.314761 -2.47447,7.672077 -1.36096,1.868836 -2.9683,4.522883 -3.57187,5.897883 -3.7292,8.49552 -6.23899,39.9317 -7.94385,99.5 -1.78581,62.39657 -5.48825,101.86347 -13.06562,139.27555 -5.2089,25.71813 -9.68489,39.9514 -21.45479,68.22445 -12.63846,30.35946 -17.21086,46.57302 -18.4717,65.5 -1.07664,16.16175 -2.79502,22.05084 -7.91855,27.13776 -2.13951,2.12423 -11.35103,8.52406 -20.47003,14.22183 -28.39954,17.74473 -53.04423,29.16439 -75.9241,35.18108 -10.51012,2.76384 -20.52529,3.80572 -22.03835,2.29266 z m 280.71453,-51.86666 c -5.0153,-0.81428 -10.8653,-2.0897 -13,-2.83429 -3.5223,-1.22859 -3.8702,-1.66723 -3.7621,-4.74308 0.066,-1.86412 0.8742,-5.36952 1.797,-7.7898 4.6838,-12.28466 6.6006,-56.55419 6.5328,-150.87754 -0.033,-45.50464 -0.3845,-68.07075 -1.0547,-67.65655 -1.6271,1.00557 -15.2248,18.38911 -20.2779,25.92359 -4.9381,7.36301 -10.1998,17.75499 -13.1701,26.011 -2.2827,6.34478 -6.3268,10.5 -10.2192,10.5 -5.65359,0 -16.67035,-10.33666 -21.58636,-20.25374 -6.69563,-13.5071 -11.98579,-27.42541 -12.06164,-31.73395 -0.079,-4.48626 -0.0777,-4.48787 3.921,-5.08656 2.2,-0.32938 10.975,-4.04715 19.5,-8.2617 8.525,-4.21456 24.275,-11.61337 35,-16.4418 l 19.5,-8.77897 0.1152,-65.76366 0.1151,-65.76367 2.2819,-2.42895 c 3.4733,-3.69712 8.2453,-4.839319 17.415,-4.168334 15.0375,1.100364 38.0875,8.710164 41.8502,13.816574 2.1822,2.96161 2.0984,3.21797 -4.0676,12.44251 -3.7185,5.56288 -5.7292,11.72572 -7.1524,21.92225 -4.8668,34.86857 -9.6988,164.76827 -8.723,234.5 0.7041,50.31166 2.1688,68.28316 7.1976,88.31329 4.157,16.55746 4.4629,23.4185 1.2129,27.19687 -2.2127,2.57238 -2.5371,2.62935 -17.25,3.02935 -10.2785,0.27944 -17.8631,-0.058 -24.1137,-1.07284 z M 373.20218,340.75817 C 368.9436,338.70753 348.23012,308.25683 334.93367,284.5 326.6507,269.70077 317.75024,251.23688 313.2402,239.49716 c -1.69095,-4.40156 -4.23674,-10.31691 -5.65732,-13.14522 -5.66012,-11.26905 -3.18327,-14.56887 12.2142,-16.27258 10.49408,-1.16115 40.32289,-8.29021 88.20292,-21.08041 38.06271,-10.16769 53.52235,-12.9486 72.16203,-12.98063 12.34687,-0.0212 21.00728,1.45859 38.08012,6.50677 26.55738,7.85261 42.37024,15.73243 47.32646,23.58359 4.35799,6.90351 2.99259,11.17418 -6.96667,21.79024 -22.16311,23.62473 -35.89136,49.53278 -41.64942,78.60108 -1.55481,7.84908 -4.48559,13.96403 -7.70312,16.07225 -2.47646,1.62263 -2.92663,1.58198 -10.39371,-0.93857 C 475.81529,313.8563 443.7669,315.93243 406,327.649 c -13.7844,4.27638 -16.22813,5.45563 -21.72766,10.48487 -4.35542,3.98297 -6.96425,4.60142 -11.07016,2.6243 z M 398,284.95799 c 17.80245,-2.03609 42.47792,-6.08994 52.93506,-8.69651 12.22121,-3.04629 16.06415,-5.84129 21.52774,-15.6573 6.96724,-12.51751 10.4397,-24.22223 10.50207,-35.39963 0.0459,-8.23156 -1.78098,-10.12634 -12.57068,-13.03772 -18.18113,-4.90579 -43.40549,-1.87163 -73.88974,8.88797 -18.70405,6.60171 -23.24983,9.76661 -25.46044,17.72625 -1.33797,4.81755 -1.32367,21.90204 0.0253,30.21669 1.86382,11.48819 7.89746,18.59727 14.82735,17.47019 1.43185,-0.23288 6.87836,-0.91235 12.10336,-1.50994 z M 337.0964,160.74822 c -4.03254,-2.09414 -5.99957,-5.8658 -7.65747,-14.68271 -1.95213,-10.3817 -7.58234,-29.16217 -11.50854,-38.38862 -3.63337,-8.538295 -3.70601,-11.599548 -0.35004,-14.752576 2.52009,-2.367691 3.09816,-2.439833 24.75,-3.088745 24.71972,-0.740857 54.26648,-3.683061 74.66965,-7.435446 14.04913,-2.583801 17.11268,-3.299263 46,-10.74284 21.54148,-5.55073 44.18838,-10.137428 57.71096,-11.688261 13.33155,-1.528923 16.32668,-0.309645 20.77904,8.45889 2.83858,5.590314 3.01,6.595803 3.01,17.655461 0,17.681597 1.68629,16.262197 -38.57482,32.469727 -17.83385,7.17921 -39.38019,16.12169 -47.88076,19.87219 -19.74549,8.71183 -26.49289,11.23266 -36.46688,13.62402 -10.25709,2.45925 -18.10915,2.4301 -27.57754,-0.10238 -10.69039,-2.85932 -20.42746,-1.49287 -39.5,5.54321 -11.50683,4.245 -14.44424,4.7949 -17.4036,3.25808 z M 198.08099,147.92077 c -7.38045,-1.56358 -17.85589,-3.50154 -23.27876,-4.30657 -14.34891,-2.13011 -15.59982,-3.08445 -19.59617,-14.95025 -6.99243,-20.76162 -9.21734,-42.521914 -5.72043,-55.947465 3.35123,-12.866247 14.10669,-29.385827 21.68323,-33.303806 3.63646,-1.880487 10.23427,-1.789746 14.42392,0.198374 6.50545,3.087037 12.31161,12.244475 20.85282,32.888947 3.47653,8.402937 9.64416,18.27782 15.65064,25.057999 C 227.79769,103.99385 244,128.3106 244,130.43159 c 0,5.50999 -7.89654,15.6953 -14.5,18.70275 -5.65933,2.57745 -15.27834,2.20591 -31.41901,-1.21357 z" />
</g>
</svg>

Speeding up ''ismember'' in Matlab

I'm using the Matlab build in command ''ismember'' to see whether a certain data set is within a larger dataset. The purpose of the piece of code is to remove any multiples of the [0 0] row from the larger data set shown below:
To do achieve this, I am using the following piece of code:
[Lia,locB] = ismember([0 0; 0 0],AFdata,'rows');
if sum(Lia) > 1
AFdata(locB(1):locB(end-1),:) = [];
end
AFdata = [
1.0000 -0.0114
0.9975 -0.0098
0.9951 -0.0084
0.9928 -0.0074
0.9903 -0.0066
0.9804 -0.0042
0.9705 -0.0018
0.9606 0.0004
0.9507 0.0025
0.9408 0.0045
0.9309 0.0063
0.9210 0.0082
0.9111 0.0100
0.9012 0.0118
0.8913 0.0135
0.8814 0.0152
0.8715 0.0167
0.8616 0.0183
0.8517 0.0199
0.8418 0.0214
0.8318 0.0229
0.8219 0.0243
0.8120 0.0256
0.8021 0.0269
0.7922 0.0282
0.7823 0.0294
0.7724 0.0306
0.7625 0.0318
0.7526 0.0329
0.7427 0.0340
0.7328 0.0350
0.7229 0.0359
0.7130 0.0368
0.7031 0.0377
0.6932 0.0385
0.6833 0.0393
0.6734 0.0401
0.6635 0.0408
0.6536 0.0415
0.6437 0.0422
0.6338 0.0428
0.6239 0.0434
0.6140 0.0439
0.6041 0.0444
0.5942 0.0449
0.5843 0.0454
0.5744 0.0458
0.5645 0.0461
0.5546 0.0465
0.5447 0.0469
0.5348 0.0472
0.5249 0.0475
0.5150 0.0478
0.5051 0.0481
0.4951 0.0483
0.4852 0.0485
0.4753 0.0487
0.4654 0.0489
0.4555 0.0491
0.4456 0.0492
0.4357 0.0493
0.4258 0.0494
0.4159 0.0495
0.4060 0.0495
0.3961 0.0495
0.3862 0.0495
0.3763 0.0495
0.3664 0.0494
0.3565 0.0493
0.3466 0.0492
0.3367 0.0491
0.3268 0.0490
0.3169 0.0488
0.3070 0.0486
0.2971 0.0484
0.2872 0.0482
0.2773 0.0479
0.2674 0.0476
0.2575 0.0473
0.2476 0.0469
0.2377 0.0465
0.2278 0.0461
0.2179 0.0457
0.2080 0.0452
0.1981 0.0447
0.1882 0.0441
0.1783 0.0435
0.1684 0.0428
0.1584 0.0421
0.1485 0.0413
0.1386 0.0404
0.1287 0.0395
0.1188 0.0385
0.1089 0.0374
0.0990 0.0363
0.0891 0.0352
0.0792 0.0338
0.0693 0.0323
0.0594 0.0306
0.0495 0.0287
0.0396 0.0265
0.0297 0.0239
0.0198 0.0204
0.0099 0.0153
0.0050 0.0115
0.0020 0.0075
0 0
0 0
0.0020 -0.0075
0.0050 -0.0115
0.0099 -0.0153
0.0198 -0.0204
0.0297 -0.0239
0.0396 -0.0265
0.0495 -0.0287
0.0594 -0.0306
0.0693 -0.0323
0.0792 -0.0338
0.0891 -0.0352
0.0990 -0.0363
0.1089 -0.0375
0.1188 -0.0386
0.1287 -0.0396
0.1386 -0.0405
0.1485 -0.0414
0.1584 -0.0422
0.1684 -0.0429
0.1783 -0.0436
0.1882 -0.0442
0.1981 -0.0448
0.2080 -0.0454
0.2179 -0.0459
0.2278 -0.0463
0.2377 -0.0467
0.2476 -0.0471
0.2575 -0.0475
0.2674 -0.0478
0.2773 -0.0481
0.2872 -0.0484
0.2971 -0.0486
0.3070 -0.0488
0.3169 -0.0490
0.3268 -0.0491
0.3367 -0.0492
0.3466 -0.0493
0.3565 -0.0493
0.3664 -0.0493
0.3763 -0.0493
0.3862 -0.0492
0.3961 -0.0491
0.4060 -0.0490
0.4159 -0.0488
0.4258 -0.0486
0.4357 -0.0484
0.4456 -0.0481
0.4555 -0.0478
0.4654 -0.0474
0.4753 -0.0470
0.4852 -0.0465
0.4951 -0.0460
0.5051 -0.0455
0.5150 -0.0449
0.5249 -0.0442
0.5348 -0.0435
0.5447 -0.0427
0.5546 -0.0418
0.5645 -0.0408
0.5744 -0.0397
0.5843 -0.0386
0.5942 -0.0374
0.6041 -0.0362
0.6140 -0.0350
0.6239 -0.0337
0.6338 -0.0324
0.6437 -0.0310
0.6536 -0.0296
0.6635 -0.0281
0.6734 -0.0266
0.6833 -0.0252
0.6932 -0.0236
0.7031 -0.0220
0.7130 -0.0204
0.7229 -0.0188
0.7328 -0.0172
0.7427 -0.0156
0.7526 -0.0141
0.7625 -0.0125
0.7724 -0.0110
0.7823 -0.0095
0.7922 -0.0080
0.8021 -0.0067
0.8120 -0.0055
0.8219 -0.0045
0.8318 -0.0035
0.8418 -0.0026
0.8517 -0.0018
0.8616 -0.0012
0.8715 -0.0007
0.8814 -0.0004
0.8913 -0.0003
0.9012 -0.0004
0.9111 -0.0007
0.9210 -0.0012
0.9309 -0.0020
0.9408 -0.0030
0.9507 -0.0042
0.9606 -0.0055
0.9705 -0.0072
0.9804 -0.0092
0.9903 -0.0115
0.9928 -0.0119
0.9951 -0.0121
0.9975 -0.0119
1.0000 -0.0114]
However, this piece of code is executed for multiple datasets and numerous iterations which makes this a slows piece of code.
Is there any alternative to using ''ismember''? Or a quicker way to do this. Unfortunately I am not good with programing.
If you use logical indexing it will be faster.
%create index
index = sum(AFdata' == 0)==2;
%clean AFdata
AFdata(index,:) = [];
This is a minor improvement of obchardon's answer. There is no need to transpose the data set, instead use the dimension argument for sum or all. find is unnecessary, use logical indexing instead. Using all instead of sum makes the comparison unnecessary.
index =all(AFdata==0,2);
AFdata(index,:) = [];

SVG shape animation - reverse the animation

iam currently testing around with native shape animations in a .svg file.
I have now set up my animiation, but using repeatCount = "indefinite" is causing a jump between the two transitions. Is there a way to change the shape and then rewing that transformation before it starts again?
here is my current animation, the keyspline tag is just for testing:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="128px" height="128px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<path d="M105.458,86.9005L106.907,89.0485L69.5305,108.142L68.7175,105.944C68.7175,105.944 67.1175,101.87 63.4175,99.5755C60.2075,97.4055 26.3605,73.8965 26.3725,63.8795C26.4455,58.7045 24.4185,55.3095 22.9445,52.8415C21.6675,50.8415 20.5625,48.9895 21.3645,46.9885C21.8875,45.4935 23.2425,44.4175 25.2845,43.9335C28.1085,43.2275 32.9545,43.8155 36.4125,47.0975C39.3425,49.7745 41.4705,54.4535 43.5855,58.9725C43.9665,59.7505 44.7165,61.1445 45.4035,61.7375C49.5855,66.0935 52.4095,65.3865 55.0445,62.2715C57.8255,58.9835 55.8715,40.2365 51.8785,38.2885C48.8905,36.9085 45.3925,37.1835 40.8265,36.0885C36.1015,35.0065 30.9125,34.1215 30.7885,28.4775C31.0635,25.8715 31.5985,24.5365 34.8365,22.9895C42.0825,19.5125 58.2515,17.5945 66.1585,24.5655C68.2185,26.3425 69.8845,27.1805 71.0025,29.1925C72.0655,28.4625 74.5205,27.1385 76.2695,27.0015C82.3125,26.5265 101.287,52.1735 101.459,52.3215C104.014,56.3205 102.56,72.4275 101.985,77.3195C101.773,80.7285 105.458,86.9005 105.458,86.9005M71.6205,102.162L100.529,87.2885C99.2145,84.8065 97.2835,80.5965 97.7875,76.8415C98.8175,67.5525 99.0725,56.5475 97.9665,54.6965C94.8725,49.9315 80.0505,32.3585 76.6105,31.3365C75.3385,31.4365 74.5945,32.1405 74.1425,32.4995C74.9295,34.3765 75.3995,36.2775 76.0025,37.8455C76.6565,40.0555 77.2855,41.9455 78.0475,43.5005C78.6125,44.5865 78.2365,45.9085 77.1615,46.4785C76.0865,47.0475 74.7765,46.6655 74.2105,45.5795C73.0925,43.5675 72.4395,41.3565 71.7725,38.9865C71.1445,37.0965 70.6625,35.0345 69.7155,33.1705C69.7155,33.1705 69.7025,33.0105 69.5435,33.0225C68.3875,30.5285 66.0105,28.7775 63.5945,26.5445C57.2445,21.0665 42.8255,22.8465 36.9725,25.7295C34.5035,26.8925 34.4585,28.3505 34.4835,28.6715C34.4635,30.4505 36.2755,31.1155 41.3315,32.3335C46.5455,33.5385 53.8345,32.6425 57.1765,38.5185C57.7295,39.4445 59.0625,44.1855 59.1885,45.7915C60.8725,59.0665 60.2335,63.1555 54.0175,67.5215C49.2395,69.8355 42.4555,66.9765 39.3805,60.4335C37.4625,56.3845 35.5195,52.0135 33.2755,49.9285C31.2035,47.9915 28.4495,47.5615 26.8595,47.6865C26.0645,47.7495 25.5995,47.9475 25.4535,48.1205C25.6505,48.5895 26.2035,49.5155 26.5845,50.2935C28.2425,53.0705 30.6505,57.2435 30.6655,63.5425C30.6105,70.9775 57.2035,89.7255 65.6465,95.3615C68.7105,97.7055 71.6205,102.162 71.6205,102.162" style="fill:black;fill-rule:nonzero;">
<animate attributeName = "d" begin = "0s" dur = "2s" calcMode = "spline" keySplines = "0 0.75 0.25 1" repeatCount = "indefinite"
from = "M105.458,86.9005L106.907,89.0485L69.5305,108.142L68.7175,105.944C68.7175,105.944 67.1175,101.87 63.4175,99.5755C60.2075,97.4055 26.3605,73.8965 26.3725,63.8795C26.4455,58.7045 24.4185,55.3095 22.9445,52.8415C21.6675,50.8415 20.5625,48.9895 21.3645,46.9885C21.8875,45.4935 23.2425,44.4175 25.2845,43.9335C28.1085,43.2275 32.9545,43.8155 36.4125,47.0975C39.3425,49.7745 41.4705,54.4535 43.5855,58.9725C43.9665,59.7505 44.7165,61.1445 45.4035,61.7375C49.5855,66.0935 52.4095,65.3865 55.0445,62.2715C57.8255,58.9835 55.8715,40.2365 51.8785,38.2885C48.8905,36.9085 45.3925,37.1835 40.8265,36.0885C36.1015,35.0065 30.9125,34.1215 30.7885,28.4775C31.0635,25.8715 31.5985,24.5365 34.8365,22.9895C42.0825,19.5125 58.2515,17.5945 66.1585,24.5655C68.2185,26.3425 69.8845,27.1805 71.0025,29.1925C72.0655,28.4625 74.5205,27.1385 76.2695,27.0015C82.3125,26.5265 101.287,52.1735 101.459,52.3215C104.014,56.3205 102.56,72.4275 101.985,77.3195C101.773,80.7285 105.458,86.9005 105.458,86.9005M71.6205,102.162L100.529,87.2885C99.2145,84.8065 97.2835,80.5965 97.7875,76.8415C98.8175,67.5525 99.0725,56.5475 97.9665,54.6965C94.8725,49.9315 80.0505,32.3585 76.6105,31.3365C75.3385,31.4365 74.5945,32.1405 74.1425,32.4995C74.9295,34.3765 75.3995,36.2775 76.0025,37.8455C76.6565,40.0555 77.2855,41.9455 78.0475,43.5005C78.6125,44.5865 78.2365,45.9085 77.1615,46.4785C76.0865,47.0475 74.7765,46.6655 74.2105,45.5795C73.0925,43.5675 72.4395,41.3565 71.7725,38.9865C71.1445,37.0965 70.6625,35.0345 69.7155,33.1705C69.7155,33.1705 69.7025,33.0105 69.5435,33.0225C68.3875,30.5285 66.0105,28.7775 63.5945,26.5445C57.2445,21.0665 42.8255,22.8465 36.9725,25.7295C34.5035,26.8925 34.4585,28.3505 34.4835,28.6715C34.4635,30.4505 36.2755,31.1155 41.3315,32.3335C46.5455,33.5385 53.8345,32.6425 57.1765,38.5185C57.7295,39.4445 59.0625,44.1855 59.1885,45.7915C60.8725,59.0665 60.2335,63.1555 54.0175,67.5215C49.2395,69.8355 42.4555,66.9765 39.3805,60.4335C37.4625,56.3845 35.5195,52.0135 33.2755,49.9285C31.2035,47.9915 28.4495,47.5615 26.8595,47.6865C26.0645,47.7495 25.5995,47.9475 25.4535,48.1205C25.6505,48.5895 26.2035,49.5155 26.5845,50.2935C28.2425,53.0705 30.6505,57.2435 30.6655,63.5425C30.6105,70.9775 57.2035,89.7255 65.6465,95.3615C68.7105,97.7055 71.6205,102.162 71.6205,102.162"
to = "M105.458,86.9005L106.907,89.0485L69.5305,108.142L68.7175,105.944C68.7175,105.944 67.1175,101.87 63.4175,99.5755C60.2075,97.4055 30.2115,77.2595 26.0385,68.1535C23.9425,63.4205 20.6835,61.1835 18.3125,59.5555C16.3175,58.2725 14.5395,57.0525 14.4325,54.8985C14.2825,53.3215 15.0645,51.7785 16.7175,50.4855C18.9885,48.6635 23.6375,47.1745 28.1495,48.7115C31.9305,49.9205 35.4985,52.9545 39.6335,56.2995C40.3045,56.8475 41.5705,57.5735 42.3385,58.2185C47.5465,61.3635 50.8705,64.5945 53.5055,61.4795C55.6495,57.0295 54.3325,36.5505 54.5245,31.4245C54.3265,26.6135 54.5475,16.3405 54.5505,11.6455C54.5055,6.79852 54.1595,1.54552 59.6205,0.113523C62.2195,-0.224477 64.4325,0.168523 66.6895,2.95852C69.2325,6.82052 72.3155,21.9045 72.9825,33.0295C73.1945,35.6185 70.5725,26.4335 71.6905,28.4455C72.7535,27.7165 74.5205,27.1385 76.2695,27.0015C82.3125,26.5265 101.287,52.1735 101.459,52.3215C104.013,56.3205 102.56,72.4275 101.985,77.3195C101.773,80.7285 105.458,86.9005 105.458,86.9005M71.6205,102.162L100.529,87.2885C99.2145,84.8065 97.2835,80.5965 97.7875,76.8415C98.8175,67.5525 99.0725,56.5475 97.9665,54.6965C94.8725,49.9315 80.0505,32.3585 76.6105,31.3365C75.3385,31.4365 74.5945,32.1405 74.1425,32.4995C74.9295,34.3765 75.3995,36.2775 76.0025,37.8455C76.6565,40.0555 77.2855,41.9455 78.0475,43.5005C78.6125,44.5865 78.2365,45.9085 77.1615,46.4785C76.0865,47.0475 74.7765,46.6655 74.2105,45.5795C73.0925,43.5675 72.4395,41.3565 71.7725,38.9865C71.1445,37.0965 70.6625,35.0345 69.7155,33.1705C69.7155,33.1705 70.3795,34.6835 69.4925,32.6435C68.3365,30.1495 69.5395,27.5035 69.1255,31.5725C66.8055,24.0815 65.8995,10.3625 63.7305,5.48952C62.0255,3.35852 60.5975,3.65352 60.2905,3.75252C58.5565,4.14652 58.3305,6.06352 58.3205,11.2635C58.3605,16.6155 58.8765,26.6195 59.1495,33.6745C59.2835,34.7445 59.4685,44.6965 59.5245,45.7375C59.2035,58.5935 61.3995,63.4245 53.8365,67.2375C48.3995,68.1745 41.9445,64.2495 36.4175,59.5885C32.9835,56.7105 29.3925,53.5515 26.4825,52.5945C23.7905,51.7005 21.1085,52.4605 19.7165,53.2375C19.0205,53.6265 18.6815,54.0005 18.6205,54.2195C18.9955,54.5635 19.8845,55.1735 20.5555,55.7205C23.2225,57.5515 27.1525,60.3365 29.7985,66.0535C32.8535,72.8315 57.2035,89.7255 65.6455,95.3615C68.7105,97.7055 71.6205,102.162 71.6205,102.162"/>
</path>
</svg>
any hint or tipp is appreciated :)
Instead of using from and to, use the values and keyTimes attributes. For each of these you specify a series of values representing the keyframes for the animation.
So for values, I have put "[path1]; [path2]; [path1]", so the animation goes to path2 and back to path1 again.
The keyTimes attribute specifies the timing of the three keyframes. The values represent fractions of the duration (dur) from "0" to "1".
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="128px" height="128px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<path style="fill:black;fill-rule:nonzero;">
<animate attributeName="d" begin="0s" dur="2s" repeatCount="indefinite" keyTimes="0; 0.5; 1"
values = "M105.458,86.9005L106.907,89.0485L69.5305,108.142L68.7175,105.944C68.7175,105.944 67.1175,101.87 63.4175,99.5755C60.2075,97.4055 26.3605,73.8965 26.3725,63.8795C26.4455,58.7045 24.4185,55.3095 22.9445,52.8415C21.6675,50.8415 20.5625,48.9895 21.3645,46.9885C21.8875,45.4935 23.2425,44.4175 25.2845,43.9335C28.1085,43.2275 32.9545,43.8155 36.4125,47.0975C39.3425,49.7745 41.4705,54.4535 43.5855,58.9725C43.9665,59.7505 44.7165,61.1445 45.4035,61.7375C49.5855,66.0935 52.4095,65.3865 55.0445,62.2715C57.8255,58.9835 55.8715,40.2365 51.8785,38.2885C48.8905,36.9085 45.3925,37.1835 40.8265,36.0885C36.1015,35.0065 30.9125,34.1215 30.7885,28.4775C31.0635,25.8715 31.5985,24.5365 34.8365,22.9895C42.0825,19.5125 58.2515,17.5945 66.1585,24.5655C68.2185,26.3425 69.8845,27.1805 71.0025,29.1925C72.0655,28.4625 74.5205,27.1385 76.2695,27.0015C82.3125,26.5265 101.287,52.1735 101.459,52.3215C104.014,56.3205 102.56,72.4275 101.985,77.3195C101.773,80.7285 105.458,86.9005 105.458,86.9005M71.6205,102.162L100.529,87.2885C99.2145,84.8065 97.2835,80.5965 97.7875,76.8415C98.8175,67.5525 99.0725,56.5475 97.9665,54.6965C94.8725,49.9315 80.0505,32.3585 76.6105,31.3365C75.3385,31.4365 74.5945,32.1405 74.1425,32.4995C74.9295,34.3765 75.3995,36.2775 76.0025,37.8455C76.6565,40.0555 77.2855,41.9455 78.0475,43.5005C78.6125,44.5865 78.2365,45.9085 77.1615,46.4785C76.0865,47.0475 74.7765,46.6655 74.2105,45.5795C73.0925,43.5675 72.4395,41.3565 71.7725,38.9865C71.1445,37.0965 70.6625,35.0345 69.7155,33.1705C69.7155,33.1705 69.7025,33.0105 69.5435,33.0225C68.3875,30.5285 66.0105,28.7775 63.5945,26.5445C57.2445,21.0665 42.8255,22.8465 36.9725,25.7295C34.5035,26.8925 34.4585,28.3505 34.4835,28.6715C34.4635,30.4505 36.2755,31.1155 41.3315,32.3335C46.5455,33.5385 53.8345,32.6425 57.1765,38.5185C57.7295,39.4445 59.0625,44.1855 59.1885,45.7915C60.8725,59.0665 60.2335,63.1555 54.0175,67.5215C49.2395,69.8355 42.4555,66.9765 39.3805,60.4335C37.4625,56.3845 35.5195,52.0135 33.2755,49.9285C31.2035,47.9915 28.4495,47.5615 26.8595,47.6865C26.0645,47.7495 25.5995,47.9475 25.4535,48.1205C25.6505,48.5895 26.2035,49.5155 26.5845,50.2935C28.2425,53.0705 30.6505,57.2435 30.6655,63.5425C30.6105,70.9775 57.2035,89.7255 65.6465,95.3615C68.7105,97.7055 71.6205,102.162 71.6205,102.162;
M105.458,86.9005L106.907,89.0485L69.5305,108.142L68.7175,105.944C68.7175,105.944 67.1175,101.87 63.4175,99.5755C60.2075,97.4055 30.2115,77.2595 26.0385,68.1535C23.9425,63.4205 20.6835,61.1835 18.3125,59.5555C16.3175,58.2725 14.5395,57.0525 14.4325,54.8985C14.2825,53.3215 15.0645,51.7785 16.7175,50.4855C18.9885,48.6635 23.6375,47.1745 28.1495,48.7115C31.9305,49.9205 35.4985,52.9545 39.6335,56.2995C40.3045,56.8475 41.5705,57.5735 42.3385,58.2185C47.5465,61.3635 50.8705,64.5945 53.5055,61.4795C55.6495,57.0295 54.3325,36.5505 54.5245,31.4245C54.3265,26.6135 54.5475,16.3405 54.5505,11.6455C54.5055,6.79852 54.1595,1.54552 59.6205,0.113523C62.2195,-0.224477 64.4325,0.168523 66.6895,2.95852C69.2325,6.82052 72.3155,21.9045 72.9825,33.0295C73.1945,35.6185 70.5725,26.4335 71.6905,28.4455C72.7535,27.7165 74.5205,27.1385 76.2695,27.0015C82.3125,26.5265 101.287,52.1735 101.459,52.3215C104.013,56.3205 102.56,72.4275 101.985,77.3195C101.773,80.7285 105.458,86.9005 105.458,86.9005M71.6205,102.162L100.529,87.2885C99.2145,84.8065 97.2835,80.5965 97.7875,76.8415C98.8175,67.5525 99.0725,56.5475 97.9665,54.6965C94.8725,49.9315 80.0505,32.3585 76.6105,31.3365C75.3385,31.4365 74.5945,32.1405 74.1425,32.4995C74.9295,34.3765 75.3995,36.2775 76.0025,37.8455C76.6565,40.0555 77.2855,41.9455 78.0475,43.5005C78.6125,44.5865 78.2365,45.9085 77.1615,46.4785C76.0865,47.0475 74.7765,46.6655 74.2105,45.5795C73.0925,43.5675 72.4395,41.3565 71.7725,38.9865C71.1445,37.0965 70.6625,35.0345 69.7155,33.1705C69.7155,33.1705 70.3795,34.6835 69.4925,32.6435C68.3365,30.1495 69.5395,27.5035 69.1255,31.5725C66.8055,24.0815 65.8995,10.3625 63.7305,5.48952C62.0255,3.35852 60.5975,3.65352 60.2905,3.75252C58.5565,4.14652 58.3305,6.06352 58.3205,11.2635C58.3605,16.6155 58.8765,26.6195 59.1495,33.6745C59.2835,34.7445 59.4685,44.6965 59.5245,45.7375C59.2035,58.5935 61.3995,63.4245 53.8365,67.2375C48.3995,68.1745 41.9445,64.2495 36.4175,59.5885C32.9835,56.7105 29.3925,53.5515 26.4825,52.5945C23.7905,51.7005 21.1085,52.4605 19.7165,53.2375C19.0205,53.6265 18.6815,54.0005 18.6205,54.2195C18.9955,54.5635 19.8845,55.1735 20.5555,55.7205C23.2225,57.5515 27.1525,60.3365 29.7985,66.0535C32.8535,72.8315 57.2035,89.7255 65.6455,95.3615C68.7105,97.7055 71.6205,102.162 71.6205,102.162;
M105.458,86.9005L106.907,89.0485L69.5305,108.142L68.7175,105.944C68.7175,105.944 67.1175,101.87 63.4175,99.5755C60.2075,97.4055 26.3605,73.8965 26.3725,63.8795C26.4455,58.7045 24.4185,55.3095 22.9445,52.8415C21.6675,50.8415 20.5625,48.9895 21.3645,46.9885C21.8875,45.4935 23.2425,44.4175 25.2845,43.9335C28.1085,43.2275 32.9545,43.8155 36.4125,47.0975C39.3425,49.7745 41.4705,54.4535 43.5855,58.9725C43.9665,59.7505 44.7165,61.1445 45.4035,61.7375C49.5855,66.0935 52.4095,65.3865 55.0445,62.2715C57.8255,58.9835 55.8715,40.2365 51.8785,38.2885C48.8905,36.9085 45.3925,37.1835 40.8265,36.0885C36.1015,35.0065 30.9125,34.1215 30.7885,28.4775C31.0635,25.8715 31.5985,24.5365 34.8365,22.9895C42.0825,19.5125 58.2515,17.5945 66.1585,24.5655C68.2185,26.3425 69.8845,27.1805 71.0025,29.1925C72.0655,28.4625 74.5205,27.1385 76.2695,27.0015C82.3125,26.5265 101.287,52.1735 101.459,52.3215C104.014,56.3205 102.56,72.4275 101.985,77.3195C101.773,80.7285 105.458,86.9005 105.458,86.9005M71.6205,102.162L100.529,87.2885C99.2145,84.8065 97.2835,80.5965 97.7875,76.8415C98.8175,67.5525 99.0725,56.5475 97.9665,54.6965C94.8725,49.9315 80.0505,32.3585 76.6105,31.3365C75.3385,31.4365 74.5945,32.1405 74.1425,32.4995C74.9295,34.3765 75.3995,36.2775 76.0025,37.8455C76.6565,40.0555 77.2855,41.9455 78.0475,43.5005C78.6125,44.5865 78.2365,45.9085 77.1615,46.4785C76.0865,47.0475 74.7765,46.6655 74.2105,45.5795C73.0925,43.5675 72.4395,41.3565 71.7725,38.9865C71.1445,37.0965 70.6625,35.0345 69.7155,33.1705C69.7155,33.1705 69.7025,33.0105 69.5435,33.0225C68.3875,30.5285 66.0105,28.7775 63.5945,26.5445C57.2445,21.0665 42.8255,22.8465 36.9725,25.7295C34.5035,26.8925 34.4585,28.3505 34.4835,28.6715C34.4635,30.4505 36.2755,31.1155 41.3315,32.3335C46.5455,33.5385 53.8345,32.6425 57.1765,38.5185C57.7295,39.4445 59.0625,44.1855 59.1885,45.7915C60.8725,59.0665 60.2335,63.1555 54.0175,67.5215C49.2395,69.8355 42.4555,66.9765 39.3805,60.4335C37.4625,56.3845 35.5195,52.0135 33.2755,49.9285C31.2035,47.9915 28.4495,47.5615 26.8595,47.6865C26.0645,47.7495 25.5995,47.9475 25.4535,48.1205C25.6505,48.5895 26.2035,49.5155 26.5845,50.2935C28.2425,53.0705 30.6505,57.2435 30.6655,63.5425C30.6105,70.9775 57.2035,89.7255 65.6465,95.3615C68.7105,97.7055 71.6205,102.162 71.6205,102.162"/>
</path>
</svg>

Resources