Support for Point-Spread Functions with Polygon Glyphs

There are various use-cases where plotting different glyphs dynamically (or apply a point spread function) for each data point based on each point’s parameters. An example is below.

Use-case
Imagine I want to make a plot of germ density on a petri dish over many trials. Each germ colony could be represented as a gaussian blur around a central point (x,y) with column parameters such as std_xx, std_xy, std_yx, std_yy, and max_density. I would like to plot the overall density of all these germ colonies (thousands or millions) across many dishes and experiments. To be clear, I do not have a series of points that make up each colony, but instead I have a single point representing the colony.

Currently, I do not know how to attempt this visualization datashaders.

Feature Discussion
A feature I would like to add would be:

  • A glyph that can take in a point spread function
  • A point spread function is passed the current pixel location (x,y) and various columns.
  • Suggest using the polygon glyph as a boundary
  • For each pixel in the glyph, add an intensity based on data-value * scalar
  • Scalar is output of the point spread function(pixel_x, pixel_y, columns)

This is my first open-source discussion. I am looking for forward to any feedback for approaches to the above problem and I would like to help contribute to solve this issue

What you’re describing was something in the original plan for Datashader, where each “point” could conceivably represent an entire distribution, originally to reflect a confidence interval but in your case to reflect an estimated population. Alas, we never implemented this approach due to not having a specific use case in mind. Nowadays we don’t have many people on the team working on the internals of Datashader and so it would be relatively difficult for us to add this even though you’ve now identified a use case, but if you have funding behind this application, please reach out to me privately and I’ll brainstorm about whether we could make it happen.

If not, it’s not too hard to write some Numba code by hand that would do this, but it wouldn’t be fun!