Comments (6)
Yep, I know exactly what the problem is. When you try to set paper_bgcolor=x
the PlotlyJS.jl underscore magic is applied and this gets applied and this is translated to Dict(:paper => Dict(:bgcolor => x))
instead of Dict(:paper_bgcolor => x)
I'll take a look at the backend code in Plots.jl and see if I can fix this.
from plotlyjs.jl.
Looks like you managed to hit on one of just a few trace attributes that have underscores:
julia> using JSON
julia> d = JSON.parsefile(Pkg.dir("PlotlyJS", "deps", "plotschema.json"));
julia> get_keys(x) = [];
julia> get_keys(d::Associative) = vcat(collect(keys(d)), map(get_keys, values(d))...);
julia> get_keys(d["schema"]["layout"]) |> unique |> length
180
julia> get_keys(d["schema"]["traces"]) |> unique |> length
249
julia> unique(filter(x->contains(x, "_") && !(x[1] == '_'), get_keys(d["schema"]["traces"])))
5-element Array{Any,1}:
"error_y"
"error_x"
"copy_ystyle"
"copy_zstyle"
"error_z"
julia> unique(filter(x->contains(x, "_") && !(x[1] == '_'), get_keys(d["schema"]["layout"])))
2-element Array{Any,1}:
"plot_bgcolor"
"paper_bgcolor"
I'm not really sure what the best way around this is. I noticed that you set the layout attributes using the relayout!
methods, which is great. The problem with those is that they end up calling setindex!
, which is where the underscore magic gets applied.
Any suggestions on an elegant way to deal with this? I think you should still use relayout!
, but I should maybe add a kwarg to that function that describes if we should do the underscore replacing or just operate directly with the keys that were handed to us?
from plotlyjs.jl.
Here's an idea...
What if arguments that are passed to relayout!
s second argument in the dict are merge
d with the underlying layout dict without any processing. But, we continue to do _
processing for all attributes set via keyword arguments?
from plotlyjs.jl.
Good catch!
What if arguments that are passed to relayout!s second argument in the dict are merged with the underlying layout dict without any processing
This is the best option, if it doesn't break anything.
The other option is to keep a list valid_keys
and only split if it's not in the list.
from plotlyjs.jl.
OK fixed on my sl/ijulia-comm
branch.
Will leave open here until we merge into master
from plotlyjs.jl.
Done!
from plotlyjs.jl.
Related Issues (20)
- Plotting fails after a couple of plot calls HOT 1
- PlotlyJs.savefig() doesn't save static image - Kaleido is not avaiable HOT 11
- Heatmap with customdata and hovertemplate doesn't display the right info, when size(customdata)=size(z)
- PlotlyJS breaks when Julia is started with multiple threads
- Bump PLOTLYJS_VERSION
- Blank Plot when plotting in browser with VSCode setting "Julia: Use Plot Pane" unchecked
- cannot create subplots of pie HOT 2
- Add `image` Type of Trace HOT 8
- PlotlyJS.image incorrectly serializes to json the z array of size (d, rows, cols) , d=3, 4
- Not all documentation source files available in repo
- Kaleido process in package initialisation hangs HOT 26
- Time series plot with period data type HOT 1
- style not defined HOT 6
- The "using PlotlyJS" execution does not finish HOT 2
- Pre-compilation does not finish with version 0.18.11 HOT 7
- Setting PlotlyJS as default backend for Plots HOT 1
- Kaleido not available on windows 11 with julia 1.10 HOT 6
- Windows error for PlotlyKaleido breaks precompilation HOT 8
- "Kaleido startup failed" in docker container HOT 1
- densitymapbox doesn't generate a valid visualization HOT 14
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 plotlyjs.jl.