Better HN
topnewbestaskshowjobs
Log inSign up

kushalkolar

40 karma · joined Jan 26, 2025 (1y ago) · 35 submissions

Submissions

comment 1y ago · link · parent

I just commented above, see this: https://github.com/vispy/jupyter_rfb/issues/95#issuecomment-...

comment 1y ago · link · parent

I just remembered, I think there is something weird with Google's servers or the network because performance was very poor even with a custom Google Cloud instance running jupyterlab, see this: https://github.com/vispy/jupyter_rfb/issues/95#issuecomment-...

comment 1y ago · link · parent

OK now try to do this in 3D with arbitrary projections and interactivity! And guess what, you'd create a rendering engine :)

My earlier reply has a link to how GPUs actually push pixels to the screen.

There are also some excellent blog posts on how line rendering is done:

https://almarklein.org/triangletricks.html

https://almarklein.org/line_rendering.html

comment 1y ago · link · parent

Setting the value of a pixel in an image is very different from drawing objects like lines, this is a good introduction: https://graphicscompendium.com/intro/01-graphics-pipeline

comment 1y ago · link · parent

In the meantime you can use the rendering engine pygfx to create them directly :)

comment 1y ago · link · parent

Take a look at the examples gallery, it differs greatly from matplotlib. But I guess that will be subjective

comment 1y ago · link · parent

Fastplotlib is very different from bokeh and holoviz, and has different use cases.

Bokeh and holoviz send data to a JS front end that draws (to the best of my knowledge), whereas fastplotlib does everything on the python side and uses jupyter_rfb to send a compressed frame buffer when used in jupyter. Fastplotlib also works as a native desktop application in Qt and glfw, which is very different from bokeh/holoviz. Fastplotlib also has higher raw render speed, you can scroll though a 4k video at 60Hz with thousands of extra objects on your desktop which I haven't ever been able to accomplish with bokeh (I haven't tried it in years, not sure if things have changed)

The events system is also very different, we try to keep the API to simple function callbacks in fastplotlib.

At the end of the day use the best tool for your use case :)

comment 1y ago · link · parent

I don't think it's ready yet and I think it might be private at the moment, Cyrille can comment more on it.

But if I understand correctly it's a protocol for serializing graphical objects, pretty neat idea.

comment 1y ago · link · parent

non-jupyter notebook implementations have their quirks, eventually we hope to make a more universal jupyter-rfb kind of library, perhaps using anywidget. Anywidget is awesome: https://github.com/manzt/anywidget

People have used fastplotlib and jupyter-rfb in vscode, but it can be troublesome and we don't currently have the resources to figure out exactly why.

comment 1y ago · link · parent

> the data is available on a machine in a cluster rather than on the local machine of a user

jupyter-rfb lets you do remote rendering for this, render to a remote frame buffer and send over a jpeg byte stream. We and a number of our scientific users use it like this. https://fastplotlib.org/ver/dev/user_guide/faq.html#what-fra...

> defining a protocol for transferring plot points

This sounds more like GSP, which Cyrille Rossant (who's made some posts here) works on, it has a slightly different kind of use case.

comment 1y ago · link · parent

I do not know ruby but sometimes that's an opportunity to try and make one which others will also find useful :)

comment 1y ago · link · parent

Thanks, and the purpose was to show what's possible on modest hardware that most people have. We have created gigabytes of graphics that live on the gpu for more complex use cases and they remain performant, but you need a gaming gpu.

comment 1y ago · link · parent

This is exactly why we use jupyter-rfb, I often have large datasets on a remote cluster computer and we perform remote rendering.

see: https://fastplotlib.org/ver/dev/user_guide/faq.html#what-fra...

comment 1y ago · link · parent

Hi! I've seen some of your work on wgpu-py! Definitely let us know if you need help or have ideas, if you're on the main branch we recently merged a PR that allows events to be bidirectional.

comment 1y ago · link · parent

Rendering frames and saving them to disk can be done with rendercanvas but we haven't exposed this in fastplotlib yet: https://github.com/pygfx/rendercanvas/issues/49

comment 1y ago · link · parent

Yea the security issue is why I'm pretty sure you can't do it on WGPU, but Vulkan and cupy can fully run locally so it doesn't have the same security concern.

comment 1y ago · link · parent

Thanks! Yup our focus is not publication figures, matplotlib and seaborn cover that space pretty well.

comment 1y ago · link · parent

This looks cools thanks! Makes me wonder if there's any way to do that with WGPU if WGPU is interfacing with Vulkan, probably not easy if possible I"m guessing.

WGPU has security protections since it's designed for the browser so I'm guessing it's impossible.

comment 1y ago · link · parent

We offer a lot of ways to slice colors, set cmaps and cmap transforms, they are really useful in neuroscience:

https://fastplotlib.org/ver/dev/_gallery/line/line_colorslic...

https://fastplotlib.org/ver/dev/_gallery/line/line_cmap_more...

https://fastplotlib.org/ver/dev/_gallery/line/line_cmap.html...

And with collections if you want to go crazy: https://fastplotlib.org/ver/dev/_gallery/line_collection/lin...

comment 1y ago · link · parent

Thanks! That is a great question and one that I've we've been battling with as well. As far as we know, this is not possible due to the way different contexts are set up on the GPU https://github.com/pygfx/pygfx/issues/510

tinygrad which I haven't used seems torch-like and has a WGPU backend: https://github.com/tinygrad/tinygrad

comment 1y ago · link · parent

Exactly that's a good example!

comment 1y ago · link · parent

The example from the article with the subtitle "Large-scale calcium imaging dataset with corresponding behavior and down-stream analysis" is a good example. We have brain imaging video that is acquired simultaneously with behavioral video data. It is absolutely essential to view the raw video at 30-60Hz.

comment 1y ago · link · parent

Almar made blog posts about the line shader he wrote!

https://almarklein.org/triangletricks.html

https://almarklein.org/line_rendering.html

A big shader refactor was done in this PR: https://github.com/pygfx/pygfx/pull/628

comment 1y ago · link · parent

ok, different libraries have different use cases, the type of data we work with absolutely necessitates dynamic visualization. You wouldn't view a video with imshow would you?

comment 1y ago · link · parent

Thanks! I used pyqtgraph for many years and love what can be done by it, we started off wanting to build something like it but based on WGPU and not bound to Qt.

comment 1y ago · link · parent

Thanks Ivo!

Just to add on, colab is weird and not performant, this PR outlines our attempts to get jupyter-rfb working on colab: https://github.com/vispy/jupyter_rfb/pull/77

comment 1y ago · link · parent

Different use cases :) Plotly doesn't give the performance and interactive tools required for many neuroscience visualizations. We also focus more on the primitive graphics and, at least not yet, on the more complex "composite" graphics built with primitives like histograms.

comment 1y ago · link · parent

In fastplotlib at the end of the day everything is wgpu under the hood, and as the other poster correctly pointed out about numpy being fortran and C wrappers.

comment 1y ago · link · parent

We love imgui! Big thanks to the imgui devs, and Pascal Thomet who maintains the python bindings for imgui-bundle, and https://github.com/panxinmiao who made an Imgui Renderer for wgpu-py!

comment 1y ago · link · parent

In the browser only jupyter for now, you can use voila to make a server based application using jupyter: https://github.com/voila-dashboards/voila

As Caitlin pointed out below pyodide is a future goal.

12