-
-
Notifications
You must be signed in to change notification settings - Fork 42
[Question] Can we display heatmap ? #60
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
Hi, @terasakisatoshi !
Behavior of other JSON packages:
Only JSON behaves adequately with the matrix, but I would not like to switch to it for a number of reasons. I still don't really understand what to do with this - apparently I will need to do PR in JSON2 (or do piracy inside Dash and overload the method for the matrix) As a temporary not very beautiful solution I can offer:
|
Thank you @waralex . using Dash
using DashHtmlComponents
using DashCoreComponents
using Plots
plotly()
using Images
using TestImages
p = plot(imresize(testimage("mandrill"), 100,100))
data = Plots.plotly_series(p)
layout = Plots.plotly_layout(p)
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, layout)
)
end
run_server(app, "127.0.0.1", 8080, debug=true) Since Plots.jl uses On the other hand, due to Dash uses |
It seems your temporary solution works to display an image (It is not cool though 😅 ) Code using Dash
using DashHtmlComponents
using DashCoreComponents
using Plots
plotly()
using Images
using TestImages
p = plot(imresize(testimage("mandrill"), 100,100))
data = Plots.plotly_series(p)
data[1][:z] = [c for c in eachcol(data[1][:z])] # <-- As a temporary
layout = Plots.plotly_layout(p)
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, layout)
)
end
run_server(app, "127.0.0.1", 8080, debug=true) Result |
Rather than the |
Can we just use PlotlyJS jl for figure? I mean, something like: p = plot(traces, layout)
dcc_graph(; figure = p) Because PlotlyJS plot have the same structure as the figure tuple. |
@jackparmer and @ndgnuh you are on to something!! Here is a working version of this example that uses the new
A few notes:
Good luck, please feel free to reopen (or comment!) if you have additional questions |
Also see the new image docs!! https://plotly.com/julia/images/ |
I would like to draw heatmap using Dash.jl like
http://juliaplots.org/PlotlyJS.jl/stable/examples/heatmaps/
The following code only displays diagonal elements
Here is my code to reproduce this issue
The text was updated successfully, but these errors were encountered: