Comments (15)
The reason is that svg2png depends on PhantomJS and one of core requirements of MathJax-node was to get away from PhantomJS.
AFAIK, there is no pure JS svg2png converter out there. In our experience, Batik performance is better and more stable compared to PhantomJS (but that might be worth re-evaluating).
In any case, we should make it easier to switch converters. I'm not sure how the others feel but simply dropping Batik does not seem ideal to me at this point.
from mathjax-node.
@pkra Thanks for you reply, close this issue.
from mathjax-node.
Let me re-open and rename this. I definitely want us to abstract the PNG conversion; it should be as converter independent as possible. Since svg2png is authord by Domenic it would be a good model to follow for an NPM bridge to Batik.
from mathjax-node.
๐
from mathjax-node.
See also #65 (comment)
from mathjax-node.
๐ svgexport works great
from mathjax-node.
@SamyPesse see my earlier comment regarding our original requirements.
from mathjax-node.
I agree that both solutions java and phantomjs are not ideal.
I think one of svgexports advantages is that no file needs to be written on "disk".
A node only solution would be awesome, but I guess it's a very challanging tasks, which can not be done a few after work sessions.
(ping @gwicke)
from mathjax-node.
Some recent observations
- Over on the Wikimedia fork, there's a PR building on rsvg, wikimedia#16. Biggest immediate question from my end was: is that a bad dependency?
- But I just noticed that jsdom now handles canvas via https://www.npmjs.com/package/canvas. That seem to me to be the most natural approach ("universal JS" etc) despite having similarly bad installation requirements on node.
from mathjax-node.
Note: I haven't actually tested if the canvas solution for jsdom would be sufficient.
from mathjax-node.
Some quick notes from my end:
- We use (a patched version of) rsvg for SVG thumbnailing in production. It is working okay, but lacks support for some features like HTML-in-SVG. There is some RSVG-related discussion on https://phabricator.wikimedia.org/T40010.
- Latest phantomjs (2.0) is based on relatively recent Blink, so likely has similar SVG support as current Chrome. However, binding support for node is mostly still using phantomjs 1.9. We don't currently use phantomjs in production, but might reconsider it for tasks like HTML-to-PDF in the future.
- I can't vouch for the quality or performance of the jsdom canvas solution. The dependencies are manageable (we have a few services using it).
from mathjax-node.
My 2 cents here would be to develop an extension point for MathJax so that people can hook up and test whatever suits them better, while still having a sane default. What is that sane default is arguable, ofc, but the way I see it is that it's sane if it doesn't introduce many (especially binary) external dependencies regardless of the performance penalties or feature set. These could be then mitigated on a case-per-case basis with specialised converters.
from mathjax-node.
Thanks for the feedback, @gwicke @d00rman -- much appreciated!
from mathjax-node.
See #174 for a first attempt.
from mathjax-node.
Closed in favor of #205.
from mathjax-node.
Related Issues (20)
- Config options don't change appearance of SVG output HOT 1
- tex2svg converted image further rendering problem HOT 1
- how to set it to a transparent background? HOT 1
- Do mathjax-node support MathJax@3 HOT 2
- Mathjax- node:Latex Error converting latex to SVG with "\ \ [" HOT 3
- Cannot read property 'childNodes' of null HOT 3
- Rendering problems of latex $$\cong$$ in SVG HOT 5
- '\nolimits is allowed only on operators' which render right in mathjax v3 HOT 2
- width of svg is too small HOT 2
- Unknown node type "mstack" HOT 1
- Cannot get the same result with mathjax-node as with MathJax on the browser HOT 7
- Undefined control sequence even after defining it HOT 2
- "Error: TeX parse error: Missing \end{array}" HOT 2
- MathJax on Linkedom.. HOT 2
- Vercel - Error: Could not load script: "file:///var/task/node_modules/mathjax/unpacked/jax/element/mml/jax.js?V=2.7.9" HOT 5
- Correct mapping for prime symbol HOT 3
- MathJax node does not work with HTML HOT 4
- Cannot read properties of null (reading 'childNodes') HOT 4
- how to fix โmissing open brace on subscriptโ? HOT 6
- use 'tex2svg' cannot generate formula correctly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathjax-node.