juliapluto / plutoplotly.jl Goto Github PK
View Code? Open in Web Editor NEWLicense: The Unlicense
License: The Unlicense
Inspired by https://discourse.julialang.org/t/reactive-plot-in-pluto-or-jupyter/77654
PlutoPlotly could publish plot coordinates (as tuple) when clicking on a plot so that they can be bound using @bind
.
Modifying existing plots from different cells and from the JS side is useful many times, especially if the plot is outputting some variable that is bound on julia using @bind
.
Modifying the plot via JS does not trigger a @bind
reset and so is preferable.
Main idea to do this is to add a flag to the PlutoPlot object (default to true
) that enforces probably via the plot id in JS that this plot is only rendered once. This way one can pass the julia plot object to a julia function and be sure that not more than one plot exists for that specific julia object.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
There is no wrapper function to save an html version of a plot object. The current workaround is as follows:
let
open("$(homedir())/tmp/text.html"; write=true) do io
PlotlyBase.to_html(io, p.Plot)
end
end
As discussed last week, I think I am loading plotly as the JavaScript notebook example say one should load ES6 modules:
PlutoPlotly.jl/notebooks/wrapper.jl
Lines 311 to 313 in 0a1a78b
but the Plotly object is anyway attached to the window and can not be accessed from plotly
in JS.
Tagging @fonsp as mentioned last week
Current color types from Colors.jl are going through the standard json processing but that errors when rendered inside PlutoPlots.
They should be converted to string representations during _preprocessing
all the methods that directly modify a PlotlyBase.Plot object should be overloaded to also support the PlutoPlot object directly.
Additionally, make_subplots
from PlotlyJS should also be added as seen on discourse
When backing PlutoPlotly into a custom sysimage that contains Pluto and PlutoPlotly, I get the following warning upon starting Pluto
┌ Warning: You loaded this package outside of Pluto, this is not the intended behavior and you should use either PlotlyBase or PlotlyJS directly
└ @ PlutoPlotly ~/.julia/packages/PlutoPlotly/8WjBh/src/PlutoPlotly.jl:12
Does is_inside_pluto()
not work as intended in this case?
Steps to reproduce on julia 1.7.3
using Pkg
Pkg.activate(temp = true)
Pkg.develop("PrecompilePlutoCourse")
cd(joinpath(Pkg.devdir(), "PrecompilePlutoCourse", "Demo"))
Pkg.activate(".")
using Demo
Demo.create_sysimage()
Demo.start()
hey! did you consider using float32 by default for plot data? to make large plots faster
The plots resize nicely when directly rendered inside a flex div, they do not do so when wrapped around a bond with @bind
or when used inside PlutoUI.ExperimentalLayout.hbox
.
See #1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.