node-tikzjax icon indicating copy to clipboard operation
node-tikzjax copied to clipboard

Failed to render in browser

Open aarnphm opened this issue 1 year ago • 0 comments

Given the following diagram

```tikz
\usepackage{pgfplots}
\usepackage{tikz-3dplot}
\pgfplotsset{compat=1.16}

\begin{document}
\begin{tikzpicture}

\begin{axis}[
    view={25}{30},
    xlabel=$x$,
    ylabel=$y$,
    zlabel=$z$,
    xmin=-80, xmax=80,
    ymin=-80, ymax=80,
    zmin=-4, zmax=0,
    grid=major
]
\addplot3[
    surf,
    domain=-80:80,
    y domain=-80:80,
    samples=40,
    samples y=40,
    faceted color=orange,
    fill opacity=0.7,
    mesh/interior colormap={autumn}{color=(yellow) color=(orange)},
    shader=flat
] {-(cos(x)^2 + cos(y)^2)^2};

\addplot3[
    ->,
    blue,
    quiver={
        u={4*cos(x)*sin(x)*(cos(x)^2 + cos(y)^2)},
        v={4*cos(y)*sin(y)*(cos(x)^2 + cos(y)^2)},
        w=0
    },
    samples=15,
    samples y=15,
    domain=-80:80,
    y domain=-80:80,
] {-4};

\end{axis}
\end{tikzpicture}
\end{document}
```

It seems that obsidian-tikzjax was able to render this, while with node-tikzjax it run into recursion error

Here is the dump from stackblitz:

TikZJax: Rendering input:

\usepackage{pgfplots}
\usepackage{tikz-3dplot}
\pgfplotsset{compat=1.16}

\begin{document}
\begin{tikzpicture}

\begin{axis}[
    view={25}{30},
    xlabel=$x$,
    ylabel=$y$,
    zlabel=$z$,
    xmin=-80, xmax=80,
    ymin=-80, ymax=80,
    zmin=-4, zmax=0,
    grid=major
]
\addplot3[
    surf,
    domain=-80:80,
    y domain=-80:80,
    samples=40,
    samples y=40,
    faceted color=orange,
    fill opacity=0.7,
    mesh/interior colormap={autumn}{color=(yellow) color=(orange)},
    shader=flat
] {-(cos(x)^2 + cos(y)^2)^2};

\addplot3[
    ->,
    blue,
    quiver={
        u={4*cos(x)*sin(x)*(cos(x)^2 + cos(y)^2)},
        v={4*cos(y)*sin(y)*(cos(x)^2 + cos(y)^2)},
        w=0
    },
    samples=15,
    samples y=15,
    domain=-80:80,
    y domain=-80:80,
] {-4};

\end{axis}
\end{tikzpicture}
\end{document}
This is e-TeX, Version 3.14159265-2.6 (preloaded format=latex 2022.5.1)
**entering extended mode
(input.tex
LaTeX2e <2020-02-02> patch level 2
("pgfplots.sty" (pgfplots.revision.tex) (pgfplots.code.tex
(pgfplotscore.code.tex (pgfplotssysgeneric.code.tex)) (pgfplotslibrary.code.tex
) (pgfplotsoldpgfsupp_loader.code.tex (pgflibraryfpu.code.tex))
(pgfplotsutil.code.tex (pgfplotsliststructure.code.tex)
(pgfplotsliststructureext.code.tex) (pgfplotsarray.code.tex)
(pgfplotsmatrix.code.tex) (pgfplotstableshared.code.tex)
(pgfplotsdeque.code.tex) (pgfplotsbinary.code.tex (pgfplotsbinary.data.code.tex
)) (pgfplotsutil.verb.code.tex) (pgflibrarypgfplots.surfshading.code.tex))
(pgfplotscolormap.code.tex (pgfplotscolor.code.tex))
(pgfplotsstackedplots.code.tex) (pgfplotsplothandlers.code.tex
(pgfplotsmeshplothandler.code.tex (pgfplotsmeshplotimage.code.tex)))
(pgfplots.scaling.code.tex) (pgfplotscoordprocessing.code.tex)
(pgfplots.errorbars.code.tex) (pgfplots.markers.code.tex)
(pgfplotsticks.code.tex) (pgfplots.paths.code.tex)
(tikzlibrarydecorations.code.tex (pgfmoduledecorations.code.tex))
(tikzlibrarydecorations.pathmorphing.code.tex
(pgflibrarydecorations.pathmorphing.code.tex))
(tikzlibrarydecorations.pathreplacing.code.tex
(pgflibrarydecorations.pathreplacing.code.tex))) (tikzlibraryplotmarks.code.tex
(pgflibraryplotmarks.code.tex))) ("tikz-3dplot.sty" ("ifthen.sty")
(tikzlibrarycalc.code.tex) (tikzlibrary3d.code.tex) (tikzlibraryarrows.code.tex
(pgflibraryarrows.code.tex)))
No file input.aux.
ABD: EveryShipout initializing macros
Package pgfplots notification 'compat/show suggested version=true': document ha
s been generated with the most recent feature set (\pgfplotsset{compat=1.16}).
[1] [2] (input.aux) )
Output written on input.dvi (2 pages, 590148 bytes).
Transcript written on input.log.
  xxx POST /api/generate 500 30s -

  RangeError: Maximum call stack size exceeded
      at SymbolTree._node (file:///home/projects/node-tikzjax/node_modules/symbol-tree/lib/SymbolTree.js#cjs:49:14)
      at TreeIterator.next (file:///home/projects/node-tikzjax/node_modules/symbol-tree/lib/TreeIterator.js#cjs:34:43)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js#cjs:275:16)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js#cjs:101:11)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js#cjs:277:15)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js#cjs:101:11)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js#cjs:277:15)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js#cjs:101:11)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js#cjs:277:15)
      at SVGElementImpl._detach (file:///home/projects/node-tikzjax/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js#cjs:101:11)

maybe we should ablate jsdom?

aarnphm avatar Nov 27 '24 21:11 aarnphm