HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/panel/dist/lib/models/mathjax.js
import { Markup } from "@bokehjs/models/widgets/markup";
import { PanelMarkupView } from "./layout";
export class MathJaxView extends PanelMarkupView {
    static __name__ = "MathJaxView";
    connect_signals() {
        super.connect_signals();
        const { text } = this.model.properties;
        this.on_change(text, () => this.render());
    }
    render() {
        super.render();
        const text = this.model.text;
        const tex_parts = this.provider.MathJax.find_tex(text);
        const processed_text = [];
        let last_index = 0;
        for (const part of tex_parts) {
            processed_text.push(text.slice(last_index, part.start.n));
            processed_text.push(this.provider.MathJax.tex2svg(part.math, { display: part.display }).outerHTML);
            last_index = part.end.n;
        }
        if (last_index < text.length) {
            processed_text.push(text.slice(last_index));
        }
        this.container.innerHTML = processed_text.join("");
    }
}
export class MathJax extends Markup {
    static __name__ = "MathJax";
    constructor(attrs) {
        super(attrs);
    }
    static __module__ = "panel.models.mathjax";
    static {
        this.prototype.default_view = MathJaxView;
    }
}
//# sourceMappingURL=mathjax.js.map