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

displayModeBar = false #185

Closed
akubisch opened this issue Apr 7, 2018 · 7 comments
Closed

displayModeBar = false #185

akubisch opened this issue Apr 7, 2018 · 7 comments

Comments

@akubisch
Copy link

akubisch commented Apr 7, 2018

Hi,
I am happily using this great package! Yet, I was just wondering, how it is possible to hide the mode bar using plotlyJS.jl!? I know it is possible (see here). But what is the correct position for this argument?

Thanks a lot in advance!

@sglyon
Copy link
Member

sglyon commented Apr 7, 2018

Hi @akubisch thanks for reaching out -- glad you are liking the package!

I actually haven't hooked this up yet, but would be very happy to accept a pull request that implements this.

I could provide some pointers on where/how to get started. Would you be interested in contributing a pull request with this feature?

See also #108

@akubisch
Copy link
Author

akubisch commented Apr 7, 2018

Hi @sglyon,

Thanks for the swift response! I would surely be interested in contributing a pull request, it just depends a bit on the potential load of work associated with it ;-) If you could give me some hints I could have a look at it.

Also - before opening a new issue: is there an easy way to change the locale of date axes?

@sglyon
Copy link
Member

sglyon commented Apr 7, 2018

For locale, I think you can set xaxis_tickformat using this mini language: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format


I think one way we could implement this in a few steps:

1

Add an additional field on the SyncPlot type so that it looks like this:

struct SyncPlot{TD<:AbstractPlotlyDisplay}
    plot::Plot
    view::TD
    config::PlotlyBase.PlotlyAttribute
end

2

Have the plot method look like this:

function plot(args...; config::PlotlyBase.PlotlyAttribute=attr(showLink=false), kwargs...)
    SyncPlot(Plot(args...; kwargs...), config)
end

3

Have the SyncPlot method look like this:

function SyncPlot(p::Plot, config::PlotlyBase.PlotlyAttribute=attr())
    SyncPlot(p, DEFAULT_DISPLAY[](p), config)
end

4

Find all places where we call the javascript function Plotly.newPlot and make sure to pass the config settings from the SyncPlot

This includes

  1. script_content here -- note we might need to add a config argument here because this takes in a Plot instead of a SyncPlot
  2. display_blink here -- note ElectronPlot is just a sync plot that has an ElectronDisplay, so the new config field we created in step 1 will be available. Also, there are 2 usages of Plotly.newPlot in that function
  3. html_body here

When we are doing step 4 from above, I think we might want to make sure that showLink is set to false whenever it isn't explicitly passed in config so that the new feature is backwards compatible.

Hopefully that makes some sense. If not, please tell me!

@akubisch
Copy link
Author

akubisch commented Apr 7, 2018

It very much does and I think I should be able to handle that :-) I will try to take care of it over the weekend, but cannot promise it'll work out.

@sglyon
Copy link
Member

sglyon commented Apr 7, 2018

No rush! Whenever you can get it to will be great

@sglyon
Copy link
Member

sglyon commented Aug 27, 2018

included in #208

@sglyon
Copy link
Member

sglyon commented Aug 31, 2018

For now, please use the master branch

] # enter pkg mode
(v1.0) pkg> checkout PlotlyJS

If you want save figures you can do

] # enter package mode
(v1.0) pkg> add https://github.com/sglyon/ORCA.jl.git#master

If this doesn't resolve your issue here, please reopen the issue and leave a comment describing what went wrong

@sglyon sglyon closed this as completed Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants