Comments (2)
The problem comes from the way Dash.jl
process the data. Instead of considering matrices as in PlotlyJS.jl
, Dash.jl
needs X,Y,Z
to be defined as Vectors of Vectors.
Here, the plot3D
function must be as follows:
function plot_3D(x, y, z)
nx = length(x)
nv = Int(round(nx./2.))
vl = range(0., 1., nv)
v = repeat(vl, 1, nx)
X = repeat(x', nv, 1)
XX = [c for c in eachcol(X)]
zmin = minimum(z)
traces = GenericTrace[]
Y = y*ones(size(X))
YY = [c for c in eachcol(Y)]
# Line
trace = scatter3d(x = x,
y = Y[1, :],
z = z,
mode = "lines",
line = attr(color = :blue),
showlegend = false)
# Surface
Z = zmin .+ (repeat(z', nv, 1) .- zmin).*v
ZZ = [c for c in eachcol(Z)]
surf = surface(x = XX,
y = YY,
z = ZZ,
showscale = false)
append!(traces, [trace, surf])
# Define the layout
layout = Layout(scene = attr(
xaxis = attr(autorange = "reversed")))
p = plot(traces, layout)
figure = (data = getfield.(p.plot.data, :fields), layout = p.plot.layout.fields)
return figure
end
from dash.jl.
thanks for writing down the workaround @maucejo 👏
from dash.jl.
Related Issues (20)
- Can Plotly Dash animations display buttons and sliders? HOT 6
- ArgumentError: Distributed.var doesn't have a defined StructTypes.StructType HOT 2
- Feature: Type -> Component mapping with weakdeps
- Using python libs in Dash.jl
- Write (python) dash vs Dash.jl feature comparison table HOT 4
- markdown with latex support HOT 1
- Warning during precompilation HOT 1
- Advanced checklist HOT 1
- Support background callbacks HOT 1
- Support figures generated by Plots.jl with a PlotlyBackend HOT 1
- UndefVarError for html components HOT 3
- Try Dash.jl with React 18
- Move `DashBase.to_dash` type-piracy definitions to DashBase repo HOT 2
- Experiment with `PrecompileTools.jl` to speed up TTFX
- Test failing with Julia 1.10.0-beta3 HOT 2
- Circular callbacks with multiple callbacks seem to work HOT 2
- Accept app root path as kwarg to `dash` method? HOT 5
- Why has the DashCoreResources repo been archived? HOT 9
- Editable Tables examples not working HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash.jl.