Update dynamic map options parameters (colorbar limits) for server application

I am trying to create a plot which is a layout of two heatmap plots. Each has its own data that gets updated dynamically via a Pipe() stream. Each plot has its own colorbar and I would like the colorbar to update when sending new data via the pipe. When I don’t define any clim parameter for the plots, they do update, but their colorbars become linked and reflect the maximum ‘z’ value from either plot. To get around that, I have tried to define a clim parameter for each plot. That works fine to get the colorbars defined based on the initial data, but then is not able to update when sending new data. I have seen examples in Responding to Events > Using Parameterized classes as a stream as a potential way to do this but have not been able to get that to work. I have been able to redraw a plot with an updated color bar using plot.apply.opts(clim=(0,max)), but that does not update the server version of the plot. The pipe for the data itself is working fine to update the server plots, but can’t seem to figure out how to update the range on their colorbars as I do so. I am trying to include here an example of my efforts from a notebook. I seem to be a new user and it is not allowing me to upload the notebook example.

As a new user I don’t appear to be able to directly upload from jupyter notebook, but am trying to cut and paste the example code here.

The data here is a made up example where the x axis data is common between the two data sets. That wants to be considered a shared axes between the plots so when the user zooms or pans it happens to both plots. I have tried to follow an example to define a Paramerterized class to update the plot options.

That plots are each a heat map representing the data. The data is nominally updated by a running python application which sends updates to the plot via the defined Pipe.

This creates the plots as desired.

This demonstrates dynamically updating the plot data via the Pipe. That works fine.

This demonstrates the ability to update plot options to change the color map and color bar limits. In the notebook, this creates a new plot while what I really was trying to do is update the existing plot that got created above. At this point the Pipe is able to update both versions of the plot with new data, but what I am further trying to accomplish is to update the clim value that goes with the new data and have the original plots colorbar get updated along with the heatmap colorization to go with the new data.

This next step was intended to demonstrate the pass/fail heat map getting updated with new data, but it actually seems to get updated in the step above when the options get applied.

This demonstrates the ability to create a server version of the plots. It is here where I am trying to understand how to define a stream that will update the server version of the plot with an updated clim value to go with the data.

The next couple of cells demonstrate the “data” pipe to the individual server plots works fine, but also want to update the clim value there.