We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Naming for new coordinate systems
Follow on work from #10202 to finalize naming before releasing. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/models/file/latex_extension.py`
Content:
```
1 """ The LaTex example was derived from: http://matplotlib.org/users/usetex.html
2 """
3 import numpy as np
4 from scipy.special import jv
5 
6 from bokeh.models import Label
7 from bokeh.palettes import Spectral4
8 from bokeh.plotting import figure, output_file, show
9 from bokeh.util.compiler import TypeScript
10 
11 output_file('latex_extension.html')
12 
13 class LatexLabel(Label):
14     """A subclass of `Label` with all of the same class attributes except
15     canvas mode isn't supported and DOM manipulation happens in the TypeScript
16     superclass implementation that requires setting `render_mode='css'`).
17 
18     Only the render method of LabelView is overwritten to perform the
19     text -> latex (via katex) conversion
20     """
21     __javascript__ = ["https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.js"]
22     __css__ = ["https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css"]
23     __implementation__ = TypeScript("""
24 import {Label, LabelView} from "models/annotations/label"
25 
26 declare namespace katex {
27   function render(expression: string, element: HTMLElement, options: {displayMode?: boolean}): void
28 }
29 
30 export class LatexLabelView extends LabelView {
31   model: LatexLabel
32 
33   protected _render(): void {
34     // Here because AngleSpec does units tranform and label doesn't support specs
35     let angle: number
36     switch (this.model.angle_units) {
37       case "rad": {
38         angle = -1 * this.model.angle
39         break
40       }
41       case "deg": {
42         angle = -1 * this.model.angle * Math.PI/180.0
43         break
44       }
45       default:
46         throw new Error("unreachable")
47     }
48 
49     const panel = this.panel || this.plot_view.frame
50 
51     const {x, y} = this.model
52     let sx = this.model.x_units == "data" ? this.scope.x_scale.compute(x) : panel.xview.compute(x)
53     let sy = this.model.y_units == "data" ? this.scope.y_scale.compute(y) : panel.yview.compute(y)
54 
55     sx += this.model.x_offset
56     sy -= this.model.y_offset
57 
58     this._css_text(this.layer.ctx, "", sx, sy, angle)
59     katex.render(this.model.text, this.el!, {displayMode: true})
60   }
61 }
62 
63 export class LatexLabel extends Label {
64   static init_LatexLabel(): void {
65     this.prototype.default_view = LatexLabelView
66 
67     this.override({
68       render_mode: "css",
69     })
70   }
71 }
72 """)
73 
74 p = figure(title="LaTex Extension Demonstration", plot_width=800, plot_height=350,
75            background_fill_color="#fafafa")
76 p.x_range.range_padding = 0
77 
78 x = np.arange(0.0, 20.0, 0.02)
79 
80 for i, n in enumerate([0, 1, 4, 7]):
81     p.line(x, jv(n, x), line_width=3, color=Spectral4[i], alpha=0.8, legend_label="𝜈=%d" % n)
82 
83 
84 text = (r"\text{Bessel Functions of the First Kind: }" +
85         r"J_\nu = \sum_{m=0}^{\infty}\frac{(-1)^m}{m!\ \Gamma(m+\nu+1)}" +
86         r"\left(\frac{x}{2}\right)^{2m+\nu}")
87 latex = LatexLabel(text=text,x=4.5, y=250, x_units='data', y_units='screen',
88                    render_mode='css', text_font_size='11px',
89                    background_fill_color="white", border_line_color="lightgrey")
90 
91 p.add_layout(latex)
92 
93 show(p)
94
```

Path: `sphinx/source/docs/user_guide/examples/extensions_example_latex.py`
Content:
```
1 """ The LaTex example was derived from: http://matplotlib.org/users/usetex.html
2 """
3 
4 import numpy as np
5 
6 from bokeh.models import Label
7 from bokeh.plotting import figure, show
8 from bokeh.util.compiler import TypeScript
9 
10 TS_CODE = """
11 import * as p from "core/properties"
12 import {Label, LabelView} from "models/annotations/label"
13 declare const katex: any
14 
15 export class LatexLabelView extends LabelView {
16   model: LatexLabel
17 
18   render(): void {
19     //--- Start of copied section from ``Label.render`` implementation
20 
21     // Here because AngleSpec does units tranform and label doesn't support specs
22     let angle: number
23     switch (this.model.angle_units) {
24       case "rad": {
25         angle = -this.model.angle
26         break
27       }
28       case "deg": {
29         angle = (-this.model.angle * Math.PI) / 180.0
30         break
31       }
32       default:
33         throw new Error("unreachable code")
34     }
35 
36     const panel = this.panel != null ? this.panel : this.plot_view.frame
37 
38     let sx = this.model.x_units == "data" ? this.scope.x_scale.compute(this.model.x) : panel.xview.compute(this.model.x)
39     let sy = this.model.y_units == "data" ? this.scope.y_scale.compute(this.model.y) : panel.yview.compute(this.model.y)
40 
41     sx += this.model.x_offset
42     sy -= this.model.y_offset
43 
44     //--- End of copied section from ``Label.render`` implementation
45     // Must render as superpositioned div (not on canvas) so that KaTex
46     // css can properly style the text
47     this._css_text(this.layer.ctx, "", sx, sy, angle)
48 
49     // ``katex`` is loaded into the global window at runtime
50     // katex.renderToString returns a html ``span`` element
51     katex.render(this.model.text, this.el, {displayMode: true})
52   }
53 }
54 
55 export namespace LatexLabel {
56   export type Attrs = p.AttrsOf<Props>
57 
58   export type Props = Label.Props
59 }
60 
61 export interface LatexLabel extends LatexLabel.Attrs {}
62 
63 export class LatexLabel extends Label {
64   properties: LatexLabel.Props
65   __view_type__: LatexLabelView
66 
67   constructor(attrs?: Partial<LatexLabel.Attrs>) {
68     super(attrs)
69   }
70 
71   static init_LatexLabel() {
72     this.prototype.default_view = LatexLabelView
73   }
74 }
75 """
76 
77 
78 class LatexLabel(Label):
79     """A subclass of the Bokeh built-in `Label` that supports rendering
80     LaTex using the KaTex typesetting library.
81 
82     Only the render method of LabelView is overloaded to perform the
83     text -> latex (via katex) conversion. Note: ``render_mode="canvas``
84     isn't supported and certain DOM manipulation happens in the Label
85     superclass implementation that requires explicitly setting
86     `render_mode='css'`).
87     """
88     __javascript__ = ["https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js"]
89     __css__ = ["https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css"]
90     __implementation__ = TypeScript(TS_CODE)
91 
92 
93 x = np.arange(0.0, 1.0 + 0.01, 0.01)
94 y = np.cos(2 * 2 * np.pi * x) + 2
95 
96 p = figure(title="LaTex Demonstration", plot_width=500, plot_height=500)
97 p.line(x, y)
98 
99 # Note: must set ``render_mode="css"``
100 latex = LatexLabel(text="f = \sum_{n=1}^\infty\\frac{-e^{i\pi}}{2^n}!",
101                    x=40, y=420, x_units='screen', y_units='screen',
102                    render_mode='css', text_font_size='21px',
103                    background_fill_alpha=0)
104 
105 p.add_layout(latex)
106 
107 show(p)
108
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/examples/models/file/latex_extension.py b/examples/models/file/latex_extension.py
--- a/examples/models/file/latex_extension.py
+++ b/examples/models/file/latex_extension.py
@@ -49,8 +49,8 @@
     const panel = this.panel || this.plot_view.frame
 
     const {x, y} = this.model
-    let sx = this.model.x_units == "data" ? this.scope.x_scale.compute(x) : panel.xview.compute(x)
-    let sy = this.model.y_units == "data" ? this.scope.y_scale.compute(y) : panel.yview.compute(y)
+    let sx = this.model.x_units == "data" ? this.coordinates.x_scale.compute(x) : panel.xview.compute(x)
+    let sy = this.model.y_units == "data" ? this.coordinates.y_scale.compute(y) : panel.yview.compute(y)
 
     sx += this.model.x_offset
     sy -= this.model.y_offset
diff --git a/sphinx/source/docs/user_guide/examples/extensions_example_latex.py b/sphinx/source/docs/user_guide/examples/extensions_example_latex.py
--- a/sphinx/source/docs/user_guide/examples/extensions_example_latex.py
+++ b/sphinx/source/docs/user_guide/examples/extensions_example_latex.py
@@ -35,8 +35,8 @@
 
     const panel = this.panel != null ? this.panel : this.plot_view.frame
 
-    let sx = this.model.x_units == "data" ? this.scope.x_scale.compute(this.model.x) : panel.xview.compute(this.model.x)
-    let sy = this.model.y_units == "data" ? this.scope.y_scale.compute(this.model.y) : panel.yview.compute(this.model.y)
+    let sx = this.model.x_units == "data" ? this.coordinates.x_scale.compute(this.model.x) : panel.xview.compute(this.model.x)
+    let sy = this.model.y_units == "data" ? this.coordinates.y_scale.compute(this.model.y) : panel.yview.compute(this.model.y)
 
     sx += this.model.x_offset
     sy -= this.model.y_offset

{"golden_diff": "diff --git a/examples/models/file/latex_extension.py b/examples/models/file/latex_extension.py\n--- a/examples/models/file/latex_extension.py\n+++ b/examples/models/file/latex_extension.py\n@@ -49,8 +49,8 @@\n     const panel = this.panel || this.plot_view.frame\n \n     const {x, y} = this.model\n-    let sx = this.model.x_units == \"data\" ? this.scope.x_scale.compute(x) : panel.xview.compute(x)\n-    let sy = this.model.y_units == \"data\" ? this.scope.y_scale.compute(y) : panel.yview.compute(y)\n+    let sx = this.model.x_units == \"data\" ? this.coordinates.x_scale.compute(x) : panel.xview.compute(x)\n+    let sy = this.model.y_units == \"data\" ? this.coordinates.y_scale.compute(y) : panel.yview.compute(y)\n \n     sx += this.model.x_offset\n     sy -= this.model.y_offset\ndiff --git a/sphinx/source/docs/user_guide/examples/extensions_example_latex.py b/sphinx/source/docs/user_guide/examples/extensions_example_latex.py\n--- a/sphinx/source/docs/user_guide/examples/extensions_example_latex.py\n+++ b/sphinx/source/docs/user_guide/examples/extensions_example_latex.py\n@@ -35,8 +35,8 @@\n \n     const panel = this.panel != null ? this.panel : this.plot_view.frame\n \n-    let sx = this.model.x_units == \"data\" ? this.scope.x_scale.compute(this.model.x) : panel.xview.compute(this.model.x)\n-    let sy = this.model.y_units == \"data\" ? this.scope.y_scale.compute(this.model.y) : panel.yview.compute(this.model.y)\n+    let sx = this.model.x_units == \"data\" ? this.coordinates.x_scale.compute(this.model.x) : panel.xview.compute(this.model.x)\n+    let sy = this.model.y_units == \"data\" ? this.coordinates.y_scale.compute(this.model.y) : panel.yview.compute(this.model.y)\n \n     sx += this.model.x_offset\n     sy -= this.model.y_offset\n", "issue": "Naming for new coordinate systems\nFollow on work from #10202 to finalize naming before releasing. \n", "before_files": [{"content": "\"\"\" The LaTex example was derived from: http://matplotlib.org/users/usetex.html\n\"\"\"\nimport numpy as np\nfrom scipy.special import jv\n\nfrom bokeh.models import Label\nfrom bokeh.palettes import Spectral4\nfrom bokeh.plotting import figure, output_file, show\nfrom bokeh.util.compiler import TypeScript\n\noutput_file('latex_extension.html')\n\nclass LatexLabel(Label):\n    \"\"\"A subclass of `Label` with all of the same class attributes except\n    canvas mode isn't supported and DOM manipulation happens in the TypeScript\n    superclass implementation that requires setting `render_mode='css'`).\n\n    Only the render method of LabelView is overwritten to perform the\n    text -> latex (via katex) conversion\n    \"\"\"\n    __javascript__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.js\"]\n    __css__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css\"]\n    __implementation__ = TypeScript(\"\"\"\nimport {Label, LabelView} from \"models/annotations/label\"\n\ndeclare namespace katex {\n  function render(expression: string, element: HTMLElement, options: {displayMode?: boolean}): void\n}\n\nexport class LatexLabelView extends LabelView {\n  model: LatexLabel\n\n  protected _render(): void {\n    // Here because AngleSpec does units tranform and label doesn't support specs\n    let angle: number\n    switch (this.model.angle_units) {\n      case \"rad\": {\n        angle = -1 * this.model.angle\n        break\n      }\n      case \"deg\": {\n        angle = -1 * this.model.angle * Math.PI/180.0\n        break\n      }\n      default:\n        throw new Error(\"unreachable\")\n    }\n\n    const panel = this.panel || this.plot_view.frame\n\n    const {x, y} = this.model\n    let sx = this.model.x_units == \"data\" ? this.scope.x_scale.compute(x) : panel.xview.compute(x)\n    let sy = this.model.y_units == \"data\" ? this.scope.y_scale.compute(y) : panel.yview.compute(y)\n\n    sx += this.model.x_offset\n    sy -= this.model.y_offset\n\n    this._css_text(this.layer.ctx, \"\", sx, sy, angle)\n    katex.render(this.model.text, this.el!, {displayMode: true})\n  }\n}\n\nexport class LatexLabel extends Label {\n  static init_LatexLabel(): void {\n    this.prototype.default_view = LatexLabelView\n\n    this.override({\n      render_mode: \"css\",\n    })\n  }\n}\n\"\"\")\n\np = figure(title=\"LaTex Extension Demonstration\", plot_width=800, plot_height=350,\n           background_fill_color=\"#fafafa\")\np.x_range.range_padding = 0\n\nx = np.arange(0.0, 20.0, 0.02)\n\nfor i, n in enumerate([0, 1, 4, 7]):\n    p.line(x, jv(n, x), line_width=3, color=Spectral4[i], alpha=0.8, legend_label=\"\ud835\udf08=%d\" % n)\n\n\ntext = (r\"\\text{Bessel Functions of the First Kind: }\" +\n        r\"J_\\nu = \\sum_{m=0}^{\\infty}\\frac{(-1)^m}{m!\\ \\Gamma(m+\\nu+1)}\" +\n        r\"\\left(\\frac{x}{2}\\right)^{2m+\\nu}\")\nlatex = LatexLabel(text=text,x=4.5, y=250, x_units='data', y_units='screen',\n                   render_mode='css', text_font_size='11px',\n                   background_fill_color=\"white\", border_line_color=\"lightgrey\")\n\np.add_layout(latex)\n\nshow(p)\n", "path": "examples/models/file/latex_extension.py"}, {"content": "\"\"\" The LaTex example was derived from: http://matplotlib.org/users/usetex.html\n\"\"\"\n\nimport numpy as np\n\nfrom bokeh.models import Label\nfrom bokeh.plotting import figure, show\nfrom bokeh.util.compiler import TypeScript\n\nTS_CODE = \"\"\"\nimport * as p from \"core/properties\"\nimport {Label, LabelView} from \"models/annotations/label\"\ndeclare const katex: any\n\nexport class LatexLabelView extends LabelView {\n  model: LatexLabel\n\n  render(): void {\n    //--- Start of copied section from ``Label.render`` implementation\n\n    // Here because AngleSpec does units tranform and label doesn't support specs\n    let angle: number\n    switch (this.model.angle_units) {\n      case \"rad\": {\n        angle = -this.model.angle\n        break\n      }\n      case \"deg\": {\n        angle = (-this.model.angle * Math.PI) / 180.0\n        break\n      }\n      default:\n        throw new Error(\"unreachable code\")\n    }\n\n    const panel = this.panel != null ? this.panel : this.plot_view.frame\n\n    let sx = this.model.x_units == \"data\" ? this.scope.x_scale.compute(this.model.x) : panel.xview.compute(this.model.x)\n    let sy = this.model.y_units == \"data\" ? this.scope.y_scale.compute(this.model.y) : panel.yview.compute(this.model.y)\n\n    sx += this.model.x_offset\n    sy -= this.model.y_offset\n\n    //--- End of copied section from ``Label.render`` implementation\n    // Must render as superpositioned div (not on canvas) so that KaTex\n    // css can properly style the text\n    this._css_text(this.layer.ctx, \"\", sx, sy, angle)\n\n    // ``katex`` is loaded into the global window at runtime\n    // katex.renderToString returns a html ``span`` element\n    katex.render(this.model.text, this.el, {displayMode: true})\n  }\n}\n\nexport namespace LatexLabel {\n  export type Attrs = p.AttrsOf<Props>\n\n  export type Props = Label.Props\n}\n\nexport interface LatexLabel extends LatexLabel.Attrs {}\n\nexport class LatexLabel extends Label {\n  properties: LatexLabel.Props\n  __view_type__: LatexLabelView\n\n  constructor(attrs?: Partial<LatexLabel.Attrs>) {\n    super(attrs)\n  }\n\n  static init_LatexLabel() {\n    this.prototype.default_view = LatexLabelView\n  }\n}\n\"\"\"\n\n\nclass LatexLabel(Label):\n    \"\"\"A subclass of the Bokeh built-in `Label` that supports rendering\n    LaTex using the KaTex typesetting library.\n\n    Only the render method of LabelView is overloaded to perform the\n    text -> latex (via katex) conversion. Note: ``render_mode=\"canvas``\n    isn't supported and certain DOM manipulation happens in the Label\n    superclass implementation that requires explicitly setting\n    `render_mode='css'`).\n    \"\"\"\n    __javascript__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js\"]\n    __css__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css\"]\n    __implementation__ = TypeScript(TS_CODE)\n\n\nx = np.arange(0.0, 1.0 + 0.01, 0.01)\ny = np.cos(2 * 2 * np.pi * x) + 2\n\np = figure(title=\"LaTex Demonstration\", plot_width=500, plot_height=500)\np.line(x, y)\n\n# Note: must set ``render_mode=\"css\"``\nlatex = LatexLabel(text=\"f = \\sum_{n=1}^\\infty\\\\frac{-e^{i\\pi}}{2^n}!\",\n                   x=40, y=420, x_units='screen', y_units='screen',\n                   render_mode='css', text_font_size='21px',\n                   background_fill_alpha=0)\n\np.add_layout(latex)\n\nshow(p)\n", "path": "sphinx/source/docs/user_guide/examples/extensions_example_latex.py"}], "after_files": [{"content": "\"\"\" The LaTex example was derived from: http://matplotlib.org/users/usetex.html\n\"\"\"\nimport numpy as np\nfrom scipy.special import jv\n\nfrom bokeh.models import Label\nfrom bokeh.palettes import Spectral4\nfrom bokeh.plotting import figure, output_file, show\nfrom bokeh.util.compiler import TypeScript\n\noutput_file('latex_extension.html')\n\nclass LatexLabel(Label):\n    \"\"\"A subclass of `Label` with all of the same class attributes except\n    canvas mode isn't supported and DOM manipulation happens in the TypeScript\n    superclass implementation that requires setting `render_mode='css'`).\n\n    Only the render method of LabelView is overwritten to perform the\n    text -> latex (via katex) conversion\n    \"\"\"\n    __javascript__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.js\"]\n    __css__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css\"]\n    __implementation__ = TypeScript(\"\"\"\nimport {Label, LabelView} from \"models/annotations/label\"\n\ndeclare namespace katex {\n  function render(expression: string, element: HTMLElement, options: {displayMode?: boolean}): void\n}\n\nexport class LatexLabelView extends LabelView {\n  model: LatexLabel\n\n  protected _render(): void {\n    // Here because AngleSpec does units tranform and label doesn't support specs\n    let angle: number\n    switch (this.model.angle_units) {\n      case \"rad\": {\n        angle = -1 * this.model.angle\n        break\n      }\n      case \"deg\": {\n        angle = -1 * this.model.angle * Math.PI/180.0\n        break\n      }\n      default:\n        throw new Error(\"unreachable\")\n    }\n\n    const panel = this.panel || this.plot_view.frame\n\n    const {x, y} = this.model\n    let sx = this.model.x_units == \"data\" ? this.coordinates.x_scale.compute(x) : panel.xview.compute(x)\n    let sy = this.model.y_units == \"data\" ? this.coordinates.y_scale.compute(y) : panel.yview.compute(y)\n\n    sx += this.model.x_offset\n    sy -= this.model.y_offset\n\n    this._css_text(this.layer.ctx, \"\", sx, sy, angle)\n    katex.render(this.model.text, this.el!, {displayMode: true})\n  }\n}\n\nexport class LatexLabel extends Label {\n  static init_LatexLabel(): void {\n    this.prototype.default_view = LatexLabelView\n\n    this.override({\n      render_mode: \"css\",\n    })\n  }\n}\n\"\"\")\n\np = figure(title=\"LaTex Extension Demonstration\", plot_width=800, plot_height=350,\n           background_fill_color=\"#fafafa\")\np.x_range.range_padding = 0\n\nx = np.arange(0.0, 20.0, 0.02)\n\nfor i, n in enumerate([0, 1, 4, 7]):\n    p.line(x, jv(n, x), line_width=3, color=Spectral4[i], alpha=0.8, legend_label=\"\ud835\udf08=%d\" % n)\n\n\ntext = (r\"\\text{Bessel Functions of the First Kind: }\" +\n        r\"J_\\nu = \\sum_{m=0}^{\\infty}\\frac{(-1)^m}{m!\\ \\Gamma(m+\\nu+1)}\" +\n        r\"\\left(\\frac{x}{2}\\right)^{2m+\\nu}\")\nlatex = LatexLabel(text=text,x=4.5, y=250, x_units='data', y_units='screen',\n                   render_mode='css', text_font_size='11px',\n                   background_fill_color=\"white\", border_line_color=\"lightgrey\")\n\np.add_layout(latex)\n\nshow(p)\n", "path": "examples/models/file/latex_extension.py"}, {"content": "\"\"\" The LaTex example was derived from: http://matplotlib.org/users/usetex.html\n\"\"\"\n\nimport numpy as np\n\nfrom bokeh.models import Label\nfrom bokeh.plotting import figure, show\nfrom bokeh.util.compiler import TypeScript\n\nTS_CODE = \"\"\"\nimport * as p from \"core/properties\"\nimport {Label, LabelView} from \"models/annotations/label\"\ndeclare const katex: any\n\nexport class LatexLabelView extends LabelView {\n  model: LatexLabel\n\n  render(): void {\n    //--- Start of copied section from ``Label.render`` implementation\n\n    // Here because AngleSpec does units tranform and label doesn't support specs\n    let angle: number\n    switch (this.model.angle_units) {\n      case \"rad\": {\n        angle = -this.model.angle\n        break\n      }\n      case \"deg\": {\n        angle = (-this.model.angle * Math.PI) / 180.0\n        break\n      }\n      default:\n        throw new Error(\"unreachable code\")\n    }\n\n    const panel = this.panel != null ? this.panel : this.plot_view.frame\n\n    let sx = this.model.x_units == \"data\" ? this.coordinates.x_scale.compute(this.model.x) : panel.xview.compute(this.model.x)\n    let sy = this.model.y_units == \"data\" ? this.coordinates.y_scale.compute(this.model.y) : panel.yview.compute(this.model.y)\n\n    sx += this.model.x_offset\n    sy -= this.model.y_offset\n\n    //--- End of copied section from ``Label.render`` implementation\n    // Must render as superpositioned div (not on canvas) so that KaTex\n    // css can properly style the text\n    this._css_text(this.layer.ctx, \"\", sx, sy, angle)\n\n    // ``katex`` is loaded into the global window at runtime\n    // katex.renderToString returns a html ``span`` element\n    katex.render(this.model.text, this.el, {displayMode: true})\n  }\n}\n\nexport namespace LatexLabel {\n  export type Attrs = p.AttrsOf<Props>\n\n  export type Props = Label.Props\n}\n\nexport interface LatexLabel extends LatexLabel.Attrs {}\n\nexport class LatexLabel extends Label {\n  properties: LatexLabel.Props\n  __view_type__: LatexLabelView\n\n  constructor(attrs?: Partial<LatexLabel.Attrs>) {\n    super(attrs)\n  }\n\n  static init_LatexLabel() {\n    this.prototype.default_view = LatexLabelView\n  }\n}\n\"\"\"\n\n\nclass LatexLabel(Label):\n    \"\"\"A subclass of the Bokeh built-in `Label` that supports rendering\n    LaTex using the KaTex typesetting library.\n\n    Only the render method of LabelView is overloaded to perform the\n    text -> latex (via katex) conversion. Note: ``render_mode=\"canvas``\n    isn't supported and certain DOM manipulation happens in the Label\n    superclass implementation that requires explicitly setting\n    `render_mode='css'`).\n    \"\"\"\n    __javascript__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js\"]\n    __css__ = [\"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css\"]\n    __implementation__ = TypeScript(TS_CODE)\n\n\nx = np.arange(0.0, 1.0 + 0.01, 0.01)\ny = np.cos(2 * 2 * np.pi * x) + 2\n\np = figure(title=\"LaTex Demonstration\", plot_width=500, plot_height=500)\np.line(x, y)\n\n# Note: must set ``render_mode=\"css\"``\nlatex = LatexLabel(text=\"f = \\sum_{n=1}^\\infty\\\\frac{-e^{i\\pi}}{2^n}!\",\n                   x=40, y=420, x_units='screen', y_units='screen',\n                   render_mode='css', text_font_size='21px',\n                   background_fill_alpha=0)\n\np.add_layout(latex)\n\nshow(p)\n", "path": "sphinx/source/docs/user_guide/examples/extensions_example_latex.py"}]}