GUI
Info
Sometimes we already have data in Julia and just want to see the results without exporting it to other software for visualization, which is too troublesome...😢
We assume that your device has at least one modern browser that supports WebGL 2.0
Or you are using the official Julia extension in VSCode
This implementation is achieved through WGLMakie.jl, where users only need to provide the coordinates of the particles, and all other aspects are optional.
MaterialPointVisualizer.vispts Method
vispts(coord, colormap::Symbol=:viridis, colorby::String="-1", attr::Vector=[-1],
psize::Real=1f-2, sample_n::Int=1000000)
Description:
Visualize the particles in a browser/VSCode using WGLMakie.
- coord: The coordinates of the particles. It should be a 2D or 3D array of shape (n, m),
where n is the number of particles and m is the dimension (2 or 3).
colormap [option]: The colormap to use for the visualization. Default is :viridis.
colorby [option]: The attribute to color the particles by. Default is "-1", which means the z-coordinate. If attr is provided, it will be used instead.
attr [option]: The attributes of the particles. It should be a vector of length n.
psize [option]: The size of the particles in the visualization. Default is 1e-2.
sample_n [option]: The number of particles to sample for visualization. Default is 1,000,000. If the number of particles exceeds this value, a random sample will be taken.
Examples:
vispts(rand(10, 3))
vispts(rand(10, 3), colorby="random vals", attr=rand(10), psize=1f0, sample_n=5, colormap=:jet)
Warning
If you are connecting to a remote headless server via SSH, you may encounter issues.