Skip to content
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

ticklabeloverflow does not work for PlotLayoutAxis #45

Open
jochenkrattenmacher opened this issue Jul 20, 2022 · 2 comments
Open

ticklabeloverflow does not work for PlotLayoutAxis #45

jochenkrattenmacher opened this issue Jul 20, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jochenkrattenmacher
Copy link

jochenkrattenmacher commented Jul 20, 2022

Hello,

there are actually 2 issues, and I suppose the second might be related to plotly rather than StipplePlotly:

Issue 1:
Even though it says so in the docstring, PlotLayoutAxis does not have a field named "ticklabeloverflow". Consequently, there is an error if one tries to assign a value to it.

Issue 2:
I tried to fix the issue by adding the following line to the struct definition of PlotLayoutAxis in Layouts.jl (copied from the definition of ColorBar):

ticklabeloverflow::Union{String,Nothing} = nothing # "allow" | "hide past div" | "hide past domain"

I also added :ticklabeloverflow to the list given to optionals!

Unfortunately, changing this field value then doesn't seem to have any effect on the flow of my tick labels. I am not sure whether my "fix" was executed incorrectly or whether this is a plotly issue.

Both issues don't really affect me though, because I can just as well use automargin = true

Cheers

@AbhimanyuAryan AbhimanyuAryan added the bug Something isn't working label Jul 21, 2022
@AbhimanyuAryan AbhimanyuAryan self-assigned this Jul 21, 2022
@AbhimanyuAryan
Copy link
Member

Thanks for reporting can you also provide an MWE of what you tried? Also if possible please push the changes you made in PlotLayoutAxis so I can verify the approach

@jochenkrattenmacher
Copy link
Author

Heyo

I am not sure where you meant me to push to, so I just pushed to a forked repo:
jochenkrattenmacher@0254149

Here's the MWE:

using Genie.Router
using Stipple, StipplePlotly

@reactive! mutable struct Presentation <: ReactiveModel
    plotlayout::R{PlotLayout} = PlotLayout(font = Font("Helvetica, sans-serif", 40, "rgb(31, 31, 31)"),
        xaxis = [PlotLayoutAxis(tickvals = [1], ticktext = ["a<br>c<br>d<br>"], ticklabeloverflow = "allow")],
    )
    plotdata::R{Vector{PlotData}} = [PlotData(x = [1], y = [1])]
    plotconfig::R{PlotConfig} = PlotConfig()
end

function init_presentation()
    presentation = Stipple.init(Presentation)
    on(presentation.isready) do ready
        ready || return
        push!(presentation)        
    end
    presentation
end

function ui(presentation)
    page(presentation, "",
    [
        plot(:plotdata, layout = :plotlayout, config = :plotconfig)
    ]
    )
end

route("/") do
  init_presentation() |> ui |> html
end

up(8080, open_browser = true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants