I think they're saying that they have two ways to make an SVG:

1. Using matplotlib's built in SVG output support,
2. Their own custom svg creation code, which doesn't use matplotlib at
all, but instead uses their own knowledge of SVG.

It's like using a "word doc --> HTML" convertor versus hand crafted
HTML, and it makes sense that it could be more compact.

William


On Wed, Oct 11, 2023 at 8:18 AM Andrey Novoseltsev <[email protected]> wrote:
>
> That's an interesting observation, do you have any idea why this is the case? 
> I thought that Sage uses matplotlib under the hood for plots ;-)
>
> On Wednesday, 11 October 2023 at 02:07:28 UTC-6 [email protected] wrote:
>>
>> Ah, good point. I can live with the inconvenience of template literals 
>> without dollar signs. I *definitely* wouldn't want to compromise the current 
>> functionality of LaTeX in Sage!
>>
>> Template literals aren't *that* complicated, and are very common in modern 
>> JS. They're much nicer than building up strings by concatenation with +.  
>> (They're still useful even without the dollar sign for templating, since 
>> they permit multi-line strings).
>>
>> FWIW, I mostly do Sage & Python in SageMathCell, but I occasionally do a bit 
>> of HTML / SVG / JS. I don't currently have access to my desktop machine and 
>> it's nice to be able to code on my phone. One of my "hobbies" is creating 
>> geometrical diagrams in SVG using Sage / Python. The resulting SVG files 
>> tend to be much more compact than SVG output created via matplotlib.
>>
>> On Wednesday, 11 October 2023 at 12:29:17 pm UTC+11 [email protected] wrote:
>>>
>>> $ signs are used for LaTeX markup. The collision is unfortunate and it is 
>>> possible to use other delimiters for LaTeX, but there is no reason to break 
>>> existing code now. Why do you want to run complicated HTML/JavaScript 
>>> through SageMathCell at all? I suspect it is better to build your page 
>>> independently and then insert Sage code into it, rather than make the whole 
>>> page part of Sage code.
>>>
>>> Best,
>>> Andrey
>>>
>>> On Monday, 9 October 2023 at 23:30:18 UTC-6 [email protected] wrote:
>>>>
>>>> There appears to be a bug in SageMathCell when running in HTML mode with 
>>>> the handling of JavaScript template literals 
>>>> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
>>>>  . These literals are like Python f-strings. The syntax for string 
>>>> interpolation requires a dollar sign, but that causes some kind of 
>>>> corruption in SageMathCell. Here's a small demo. (I backslash-escaped the 
>>>> dollar to prevent the corruption).
>>>>
>>>> https://sagecell.sagemath.org/?z=eJx9UUtrwzAMvvtXaGXQhEFy2WlNc-kKG-wF66WwQ91arcVcO8RKu1L63yf3MRiDXSz5kz59elRX96-jyfRtDJbXrlbVxaA2YpjYYf3OLfkVkGdsm-A0U_DAGLkqTwmqKs-EeTC7RL_9jyRRVTX1OIUghjUK_iV4I7ChzfmtypNPvukYeNfgsJfyeir4hdV-Jf8sy4f1XgEsgo8MG-1gCGwpFuJ2OPiJGBG-hBrdoueXYLBYUht57HAtwMiSMwMllLKEiUVYBufCNg3hyCNkW2IbpJW5XnxGp6PNYanJxeJISQoFeY_tw-T5SbRm09ABphnR3MHH9V5aOswuAo8MUao5AyvayAJEL2rZRIuxcww6nnqV5D-F-78K9-EmzT1QhzzLe2W6xXFvYtMx0mmOJ_0GTRGgdw==&lang=html
>>>>
>>>> Is this a bug? Is there a workaround?
>>>>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-cell/9ebfb744-dbd1-44a3-9307-7bfc4bb7004fn%40googlegroups.com.



--
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-cell/CACLE5GCvFBhC3m5CXAtJdOYOJDfV3YKTAHFbV6NC2cD4UJNYKg%40mail.gmail.com.

Reply via email to