File size: 710 Bytes
4a53b35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from plotly_component import plotly_component

import mesop as me


def on_load(e: me.LoadEvent):
  me.set_theme_mode("system")


@me.page(
  on_load=on_load,
  path="/plotly",
  # CAUTION: this disables an important web security feature and
  # should not be used for most mesop apps.
  #
  # Disabling trusted types because plotly uses DomParser#parseFromString
  # which violates TrustedHTML assignment.
  security_policy=me.SecurityPolicy(
    allowed_iframe_parents=["https://mesop-dev.github.io", "https://huggingface.co"],
    allowed_script_srcs=[
      "https://cdn.jsdelivr.net",
      "https://cdn.plot.ly",
    ],
    dangerously_disable_trusted_types=True,
  ),
)
def page():
  plotly_component()