Internals
PlutoVista.backend!
— Methodbackend!(p::PlutoVistaPlot; datadim=1, backend=:default, clear=false)
Overwrite backend if clear is true.
PlutoVista.command!
— Methodcommand!(p, cmd)
Enter new command named cmd
.
The idea is to pass one single Dict with all plot data to javascript using AbstractPlutoDingetjes.Display.published_to_js
.
For this purpose we need a some "language" hidden in behind the dict.
Plot elements are described by commands executed one after another. For this purpose, we use integers converted to strings as dict keys and pass the command name as the corresponding entry.
The entry cmdcount
keeps track of the number of commands. So we can parse all commands from 1 to jsdict[:cmdcount] in javascript in the same sequence as they have been entered.
Parameters are named and entered into the dictionary with the command number as prefix.
E.g. for a polyline as command number 5, we create the entries
"5" => "polyline"
"5x" => Vector of x coordinates in canvas coordinate system
"5y" => Vector of y coordinates in canvas coordinate system
PlutoVista.parameter!
— Methodparameter!(p, name, value)
After command!
, create a parameter entry
PlutoVista.reset!
— Methodreset!(p)
Reset command list
PlutoVista.triang
— Methodtriang(X, Y)
Create triangulation data from X and Y coordinate vectors
Base.show
— MethodBase.show(io::IO,::MIME"text/html",p::PlutoVTKPlot)
Show plot in html. This creates a vtk.js based renderer along with a canvas for handling the colorbar.
PlutoVista.outline!
— Methodoutline!(p::PlutoVTKPlot,pts,faces,facemarkers,facecolormap,nbregions,xyzmin,xyzmax;alpha=0.1)
Plot transparent outline of grid boundaries.
PlutoVista.vtkpolys
— Method vtkpolys(tris; offset=0)
Set up polygon (triangle) data for vtk. Coding is [3, i11, i12, i13, 3 , i21, i22 ,i23, ...] Careful: js indexing counts from zero.
Base.show
— Methodshow(
io::IO,
m::Union{MIME{Symbol("text/html")}, MIME{Symbol("juliavscode/html")}},
p::PlutoPlotlyPlot
) -> Any
Show plotly plot.