|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <title>Plotly.js Devtools - MathJax v3 loaded with chtml output</title> |
| 5 | + <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Droid+Sans|PT+Sans+Narrow|Gravitas+One|Droid+Sans+Mono|Droid+Serif|Raleway|Old+Standard+TT"/> |
| 6 | + <link rel="stylesheet" type="text/css" href="./style.css"> |
| 7 | +</head> |
| 8 | +<body> |
| 9 | + <header> |
| 10 | + <img src=" http://images.plot.ly/logo/[email protected]" onClick=" Tabs.reload();" /> |
| 11 | + <span id="reload-time"></span> |
| 12 | + |
| 13 | + <input id="mocks-search" type="text" placeholder="mocks search" /> |
| 14 | + <input id="css-transform" type="text" placeholder="css transform" /> |
| 15 | + </header> |
| 16 | + |
| 17 | + <section id="mocks-list"></section> |
| 18 | + |
| 19 | + <p>MathJax $V^3$ with $chtml$ output on the page and <b>svg</b> output on the plotly graphs</p> |
| 20 | + <div id="plots"> |
| 21 | + <div id="graph"></div> |
| 22 | + </div> |
| 23 | + <div id="snapshot"></div> |
| 24 | + |
| 25 | + <script> |
| 26 | + window.MathJax = window.MathJax || { |
| 27 | + // see https://github.com/mathjax/MathJax/issues/2705#issuecomment-859742446 |
| 28 | + loader: {load: ['output/svg']}, |
| 29 | + startup: { |
| 30 | + ready() { |
| 31 | + // Get the MathJax modules that we need. |
| 32 | + const {mathjax} = MathJax._.mathjax; |
| 33 | + const {SVG} = MathJax._.output.svg_ts; |
| 34 | + |
| 35 | + // Do the normal setup |
| 36 | + MathJax.startup.defaultReady(); |
| 37 | + |
| 38 | + // Create an SVG output jax and a new MathDocument that uses it. |
| 39 | + const svgOutput = new SVG(MathJax.config.svg); |
| 40 | + const svgDocument = mathjax.document(document, { |
| 41 | + ...MathJax.config.options, |
| 42 | + InputJax: MathJax.startup.input, |
| 43 | + OutputJax: svgOutput |
| 44 | + }); |
| 45 | + |
| 46 | + // Define the SVG-based conversion methods |
| 47 | + MathJax.tex2svg = (math, options = {}) => { |
| 48 | + options.format = svgDocument.inputJax[0].name; |
| 49 | + return svgDocument.convert(math, options); |
| 50 | + }; |
| 51 | + /* |
| 52 | + MathJax.tex2svgPromise = (math, options = {}) => { |
| 53 | + options.format = svgDocument.inputJax[0].name; |
| 54 | + return mathjax.handleRetriesFor(() => svgDocument.convert(math, options)); |
| 55 | + }; |
| 56 | + */ |
| 57 | + MathJax.svgStylesheet = () => svgOutput.styleSheet(svgDocument); |
| 58 | + } |
| 59 | + } |
| 60 | + }; |
| 61 | + </script> |
| 62 | + <script src="../../node_modules/mathjax-v3/es5/tex-chtml.js"></script> |
| 63 | + |
| 64 | + <script charset="utf-8" id="source" src="../../build/plotly.js" type="module"></script> |
| 65 | + <script charset="utf-8" src="../../build/test_dashboard-bundle.js"></script> |
| 66 | +</body> |
| 67 | +</html> |
0 commit comments