SVG Animation for MathJax Tex
npm install mjx-svghtml
`
Full Example
`js
// initialize instance with options
const m = new MJXSVG(null, {
transition: 'all 0.5s ease', // transition property
createDelay: 200, // milliseconds delay of new symbols creation
removeDelay: 200, // milliseconds delay of symbol removing
scale: 1 // scaling factor
})
// render to DOM
document.body.append(m.svg)
// example
const sleep = ms => new Promise(r => setTimeout(r, ms))
async function show () {
m.update('dy = d(e^{x^2})')
await sleep(2000)
m.update('dy = e^{x^2}d(x^2)')
await sleep(2000)
m.update('dy = e^{x^2}2xdx')
await sleep(2000)
m.update('\\frac{dy}{dx} = 2xe^{x^2}')
}
show()
``