# SVG String Bug

**URL:** <https://talk.observablehq.com/t/svg-string-bug/3277>\
**Category:** Help\
**Created:** [May 12, 2020, 10:40pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277 "2020-05-12T22:40:03Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 12, 2020, 10:40pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/1 "2020-05-12T22:40:03Z")

</div>

> **[SVG STRING BUG: Wolfram Cloud Free Form 2D Regions / CCN/CDN/LOG / Observable](https://observablehq.com/@ccnlog/svg-string-bug-wolfram-cloud-free-form-2d-regions)**
>
> The magic notebook for visualization.

I am pretty sure this is a Mathematica ExportString [, “SVG”] bug.

x^2+y^2\<1 fails

x^2+y^2\>1 works!

The graphic code is from Bostok, pretty sure that is working, maybe needs a bit alteration for Mathematica?

There is a nagging Syntax error, which I do not have the expertise to track.

If someone could figure out the bug then I can send to techsupprot @ wolfram.

Dara

---

<div class="post-metadata">

**Author:** ![mcmcclur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mcmcclur/32/2364_2.png) [@mcmcclur](https://talk.observablehq.com/u/mcmcclur)\
**Post date:** [May 12, 2020, 11:01pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/2 "2020-05-12T23:01:28Z")

</div>

> [@dara](#):
>
> x^2+y^2\<1 fails
> 
> x^2+y^2\>1 works!

Both seem to work fine for me. Are you perhaps referring to the red error message that says  
“SyntaxError: Unterminated template literal”  
??

That’s just a separate cell that can be deleted.

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 12, 2020, 11:09pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/3 "2020-05-12T23:09:00Z")

</div>

\<1 fails for me in Observable Notebook, works in Mathematica

---

<div class="post-metadata">

**Author:** ![j-f1](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/j-f1/32/368_2.png) [@j-f1](https://talk.observablehq.com/u/j-f1)\
**Post date:** [May 12, 2020, 11:32pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/4 "2020-05-12T23:32:03Z")

</div>

It looks like the string being returned is too long and it’s getting cut off.

---

<div class="post-metadata">

**Author:** ![mcmcclur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mcmcclur/32/2364_2.png) [@mcmcclur](https://talk.observablehq.com/u/mcmcclur)\
**Post date:** [May 12, 2020, 11:46pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/5 "2020-05-12T23:46:13Z")

</div>

> [@dara](#):
>
> \<1 fails for me in Observable Notebook, works in Mathematica

It failed on my iPhone but works on my Macbook Pro - here’s what it looks like there:

 ![Screen Shot 2020-05-12 at 7.40.49 PM](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/7/72f6e6cde980b1f236000dd72e364a572f16cd84.jpeg)

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 12, 2020, 11:51pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/6 "2020-05-12T23:51:29Z")

</div>

It fails on FireFox and Safari on my iMac!

This is bizarre!

D

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 12, 2020, 11:52pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/7 "2020-05-12T23:52:16Z")

</div>

Thanx, could you tell me in which part of the code what quota I need to increase?

Appreciate the help

D

---

<div class="post-metadata">

**Author:** ![j-f1](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/j-f1/32/368_2.png) [@j-f1](https://talk.observablehq.com/u/j-f1)\
**Post date:** [May 12, 2020, 11:53pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/8 "2020-05-12T23:53:23Z")

</div>

I think you’d need to change the output limit for the Wolfram Cloud function.

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 12, 2020, 11:54pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/9 "2020-05-12T23:54:07Z")

</div>

Thanx, I will suggest that to their engineering and see what they say and will report back

D

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 12, 2020, 11:57pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/10 "2020-05-12T23:57:57Z")

</div>

I am getting this Observable error

text = SyntaxError: JSON.parse: unterminated string at line 1 column 7077889 of the JSON data

from  
text = (await fetch(url1)).json()

Why it works on your machine and not on my mine?

Dara

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 13, 2020, 12:51am UTC](https://talk.observablehq.com/t/svg-string-bug/3277/11 "2020-05-13T00:51:31Z")

</div>

Also to inform you all that Dashed boundaries with different Colors did not work with Mathematica’s ExportString [] and I am sure there is a way to solve that, and I am going to write to techsupport about.

Seemingly if I Export from the grammar and then APIFunction on the Wolfram Cloud there are differences to the output String than if directly Export from my desktop into a file.

This we have seen many times and always found a workaround.

It is a flaw which Wolfram over the years has done a good job addressing but still some leftovers here and there.

Dara

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 13, 2020, 4:58am UTC](https://talk.observablehq.com/t/svg-string-bug/3277/12 "2020-05-13T04:58:24Z")

</div>

Dear Mark

Several of our programmers test this notebook on their machines in USA and some were working and some failed.

There is a discrepancy between Observable notebooks perhaps? Wolfram Cloud spews the same for all of them.

Possibly our friend j-F1 mentioned that some String is too long and truncated.

I cannot call the techsupport at wolfram for a ticket, I cannot establish Mathematica as the culprit.

Dara

---

<div class="post-metadata">

**Author:** ![mcmcclur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mcmcclur/32/2364_2.png) [@mcmcclur](https://talk.observablehq.com/u/mcmcclur)\
**Post date:** [May 13, 2020, 8:38am UTC](https://talk.observablehq.com/t/svg-string-bug/3277/13 "2020-05-13T08:38:10Z")

</div>

> [@dara](#):
>
> I cannot call the techsupport at wolfram for a ticket, I cannot establish Mathematica as the culprit.

Well, you can take Observable out of the picture easily enough by just opening the URL in a web browser. If the resulting string is not a complete SVG, then you’ve got your culprit.

---

<div class="post-metadata">

**Author:** ![dara](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/dara/32/3057_2.png) [@dara](https://talk.observablehq.com/u/dara)\
**Post date:** [May 13, 2020, 12:59pm UTC](https://talk.observablehq.com/t/svg-string-bug/3277/14 "2020-05-13T12:59:32Z")

</div>

Damn that was easy.

I will post a ticket at Wolfram techsupport an report back
