Skip to content

Add conversion of Plots.jl's plotly plots#4

Merged
etpinard merged 5 commits into
plotly:masterfrom
BeastyBlacksmith:master
Aug 3, 2023
Merged

Add conversion of Plots.jl's plotly plots#4
etpinard merged 5 commits into
plotly:masterfrom
BeastyBlacksmith:master

Conversation

@BeastyBlacksmith

@BeastyBlacksmith BeastyBlacksmith commented Jul 28, 2023

Copy link
Copy Markdown
Contributor

Fixes #3
Closes plotly/Dash.jl#214

Comment thread Project.toml Outdated
Comment thread ext/DashBasePlotsExt.jl Outdated
@etpinard

Copy link
Copy Markdown
Contributor

thanks for taking this on @BeastyBlacksmith !!

It would be nice a add a test before merging.

@etpinard

etpinard commented Aug 1, 2023

Copy link
Copy Markdown
Contributor

Related: plotly/Dash.jl#221

Comment thread test/test_ext.jl
Comment on lines +7 to +8
pl = @test_nowarn DashBase.to_dash(plot(1:5))
@test pl isa PlotlyJS.SyncPlot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etpinard do these need to return something readable by JSON3 or is it enough, that they return something that has a to_dash method?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Have you tried it inside a Dash.jl callback?

@etpinard etpinard mentioned this pull request Aug 2, 2023

import DashBase
import PlotlyBase
import PlotlyBase.JSON

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would of course break if PlotlyBase stops importing JSON.

I think this here is fine for now, but we should probably make the switch to using JSON3 exclusively inside DashBase.jl and Dash.jl. We should open an issue once this PR is merged.

Looks like PlotlyBase does define JSON3-compatible StructTypes https://github.com/JuliaPlots/PlotlyBase.jl/blob/master/src/json3.jl, but I haven't tested it

Comment thread ext/DashBasePlotsExt.jl Outdated
@etpinard etpinard added this to the v1 milestone Aug 3, 2023
@etpinard

etpinard commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

Ok. I'm going to go ahead and merge this PR.

The other things I'd like to include in v1 are in https://github.com/plotly/DashBase.jl/milestone/1

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

Successfully merging this pull request may close these issues.

Support figures generated by Plots.jl with a PlotlyBackend Add CI workflow

2 participants