You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpanelaspnpn.extension("echarts")
# Create ECharts 3D surface figure.# can be done either from pyecharts or with JSON directly:importmathfrompyecharts.chartsimportSurface3Dfrompyechartsimportoptionsasoptsdeffloat_range(start, end, step, round_number=2):
"""Generates a range for the 3d surface"""temp= []
whileTrue:
ifstart<end:
temp.append(round(start, round_number))
start+=stepelse:
breakreturntempdefsurface3d_data():
"""Generates data for the plot"""fort0infloat_range(-3, 3, 0.05):
y=t0fort1infloat_range(-3, 3, 0.05):
x=t1z=math.sin(x**2+y**2) *x/3.14yield [x, y, z]
_data=list(surface3d_data())
surface3d=Surface3D(init_opts=opts.InitOpts(height="600px",
width="800px"))
surface3d.add(
series_name="",
shading="color",
data=list(surface3d_data()),
xaxis3d_opts=opts.Axis3DOpts(type_="value"),
yaxis3d_opts=opts.Axis3DOpts(type_="value"),
grid3d_opts=opts.Grid3DOpts(width=100, height=40, depth=100),
)
surface3d.set_global_opts(title_opts=opts.TitleOpts(title="Scatter-VisualMap(Color)"),
visualmap_opts=opts.VisualMapOpts(dimension=2,
max_=1,
min_=-1,
range_color=["#313695",
"#4575b4",
"#74add1",
"#abd9e9",
"#e0f3f8",
"#ffffbf",
"#fee090",
"#fdae61",
"#f46d43",
"#d73027",
"#a50026"],
)
)
# We can pass to pn.pane.ECharts either a JSON or a pyecharts object.# For the JSON object, we can just create it from the pyecharts figure# created above:importjsonsurface3d_json=json.loads(surface3d.dump_options())
echarts_pane=pn.pane.ECharts(surface3d) # could also be pn.pane.ECharts(surface3d_json)# It looks like ECharts pane is broken in Jupyter notebook. However,# we can create a Bokeh Server from the notebook directly:bokeh_server=echarts_pane.show()
# A new tab will be opened, but the chart will not appear...
So, the JS error in the web console is the following:
Quick example, which can be ran in the notebook:
So, the JS error in the web console is the following:
And that's it. Thank you so much for the current ECharts integration in Panel!
The text was updated successfully, but these errors were encountered: