JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
422 stars 78 forks source link

Config is ignored #444

Open StepanSushko opened 2 years ago

StepanSushko commented 2 years ago

Describe the bug When I try to prevent modeBar to appear or be static, it is still visible! Also modeBarButtonsToRemove is ignored, I tried examples from here https://plotly.com/julia/configuration-options/

Version info

Please provide the following:

  1. output of julia command versioninfo(): Julia Version 1.7.2 Commit bf53498635 (2022-02-06 15:21 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake) Environment: JULIA_NUM_THREADS = 11 ./julia JULIA_EDITOR = code
  2. Output running the following in Julia 0.7 or greater: using Pkg; pkg"status" (if you are on Julia 0.6 or earlier run Pkg.status()) [336ed68f] CSV v0.10.4 [1b08a953] Dash v1.1.2 [1b08a953] DashBootstrapComponents v1.2.1 [a93c6f00] DataFrames v1.3.5 [31c24e10] Distributions v0.25.70 [5789e2e9] FileIO v1.15.0 [bb4c363b] GridInterpolations v1.1.2 [033835bb] JLD2 v0.4.23 [a40420fb] LocalApproximationValueIteration v0.4.3 [db97f5ab] LocalFunctionApproximation v1.1.0 [08074719] POMDPModelTools v0.3.13 [355abbd5] POMDPModels v0.4.16 [182e52fb] POMDPPolicies v0.4.3 [e0d0a172] POMDPSimulators v0.3.14 [a93abf59] POMDPs v0.9.5 [d96e819e] Parameters v0.12.3 [f0f68f2c] PlotlyJS v0.18.8 [3aa3ecc9] QMDP v0.1.6 [8af83fb2] QuickPOMDPs v0.2.13 [295af30f] Revise v3.4.0 [fdbf4ff8] XLSX v0.8.4 [ade2ca70] Dates [10745b16] Statistics
StepanSushko commented 2 years ago

I've managed to work only the following code: plot( scatter( mode="markers", x=[1, 2, 3], y=[1, 3, 1] ), Layout( modebar_remove=["pan", "zoom", "zoomin", "zoomout", "autoscale", "resetScale", "select", "lasso", "logomark"]) )

StepanSushko commented 2 years ago

If someone is interested in the case of Dash config works: dcc_graph(id = "figure1", figure = figures1, config=Dict( "displayModeBar" => false))

empet commented 2 years ago

With Julia 1.7.3, PlotlyJS 0.18.8 it works, with any settings:

using PlotlyJS
fig= Plot(scatter(x=-1 .+2*rand(10), 
                  y=3*rand(10), mode="markers"), 
          Layout(width=450, height=300);
          config=PlotConfig(displayModeBar=true, 
                            linkText="https://plotly.com/julia/reference",
                            showLink=true))

PlotConfig

See also: http://juliaplots.org/PlotlyJS.jl/dev/api/#PlotlyBase.PlotConfig