-
-
Notifications
You must be signed in to change notification settings - Fork 42
[Question] Can we display surface? #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
related to #60 ? |
@terasakisatoshi I'm not sure, I am looking for a reliable way to make it happened. |
I think that you may want to use |
@jackparmer Thanks, I'll give it a try |
@jackparmer I've tried something like this: using Dash
using DashHtmlComponents
using DashCoreComponents
using PlotlyJS
function get_surface()
data = surface(
z=[
[8.83, 8.89, 8.81, 8.87, 8.9, 8.87],
[8.89, 8.94, 8.85, 8.94, 8.96, 8.92],
[8.84, 8.9, 8.82, 8.92, 8.93, 8.91],
[8.79, 8.85, 8.79, 8.9, 8.94, 8.92],
[8.79, 8.88, 8.81, 8.9, 8.95, 8.92],
[8.8, 8.82, 8.78, 8.91, 8.94, 8.92],
[8.75, 8.78, 8.77, 8.91, 8.95, 8.92],
[8.8, 8.8, 8.77, 8.91, 8.95, 8.94],
[8.74, 8.81, 8.76, 8.93, 8.98, 8.99],
[8.89, 8.99, 8.92, 9.1, 9.13, 9.11],
[8.97, 8.97, 8.91, 9.09, 9.11, 9.11],
[9.04, 9.08, 9.05, 9.25, 9.28, 9.27],
[9, 9.01, 9, 9.2, 9.23, 9.2],
[8.99, 8.99, 8.98, 9.18, 9.2, 9.19],
[8.93, 8.97, 8.97, 9.18, 9.2, 9.18]
],
colorscale="Viridis"
)
layout = Layout(width=800, height=550)
return data, layout
end
function gen_app()
d, l = get_surface()
app = dash(external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"])
app.layout = html_div() do
html_h1("Hello Dash"),
html_div("Dash.jl: Julia interface for Dash"),
dcc_graph(
id = "example-graph",
figure = (data=d, layout=l)
)
end
return app
end
Base.run(app::Dash.DashApp) = run_server(app, "0.0.0.0", 8080) But this doesn't seem to work, I got the same empty graph shown in the first comment. I've tried define function gen_app()
app = dash(external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"])
app.layout = html_div() do
html_h1("Hello Dash"),
html_div("Dash.jl: Julia interface for Dash"),
dcc_graph(
id = "example-graph",
figure = (
data = [(
z=[
[8.83, 8.89, 8.81, 8.87, 8.9, 8.87],
[8.89, 8.94, 8.85, 8.94, 8.96, 8.92],
[8.84, 8.9, 8.82, 8.92, 8.93, 8.91],
[8.79, 8.85, 8.79, 8.9, 8.94, 8.92],
[8.79, 8.88, 8.81, 8.9, 8.95, 8.92],
[8.8, 8.82, 8.78, 8.91, 8.94, 8.92],
[8.75, 8.78, 8.77, 8.91, 8.95, 8.92],
[8.8, 8.8, 8.77, 8.91, 8.95, 8.94],
[8.74, 8.81, 8.76, 8.93, 8.98, 8.99],
[8.89, 8.99, 8.92, 9.1, 9.13, 9.11],
[8.97, 8.97, 8.91, 9.09, 9.11, 9.11],
[9.04, 9.08, 9.05, 9.25, 9.28, 9.27],
[9, 9.01, 9, 9.2, 9.23, 9.2],
[8.99, 8.99, 8.98, 9.18, 9.2, 9.19],
[8.93, 8.97, 8.97, 9.18, 9.2, 9.18]
],
type="surface"
)],
layout = (
title = "Dash Data Visualization",
)
)
)
end
return app
end
Base.run(app::Dash.DashApp) = run_server(app, "0.0.0.0", 8080) And it works~~~ 💯 |
Hi @foldfelis you should be able to use PlotlyJS.jl now to create figures. You can use the
When I run this, I get the following: Thanks for the question! |
That is awesome 😎, Thanks |
I'am looking for a solution to integrate Plots.jl and Dash.jl. Here's how I generate a plotly plot:
The figure looks like this:
I've tried to transfer the plot to plotly series and set to the
dcc_graph
But I get a web page with an empty graph
Is there any way to plot a surface in Dash.jl?
The text was updated successfully, but these errors were encountered: