0

I am attempting to add additional figures to the datashader dashboard example based on alternative aggregates. For an example, along with the geographic NYC_Taxi lat, lon PU and DO aggregates, I would like to include a second panel that has the trip distance/tip figures within the same dashboard.

I have the second figure set up in the layout and I can mirror the datashader layer from the first image. Dasbboard with two mirrored images

I really think I need a flag sent through the

ds_args = {
'width': fields.Int(missing=800),
'height': fields.Int(missing=600),
'select': fields.Str(missing=""),
'name': fields.Str(missing='fig1'),
}

along with the addition of a name field in the service url for each image.

self.service_url = 'http://{host}:{port}/datashader?'
self.service_url += 'height={HEIGHT}&'
self.service_url += 'width={WIDTH}&'
self.service_url += 'select={XMIN},{YMIN},{XMAX},{YMAX}&'
self.service_url += 'name={NAME}&'
self.service_url += 'cachebust={cachebust}'

with the name field being the flag for creating the proper aggregate. I have come to understand that the service_url contains the appropriate fields for the URL request, but I don't understand how to give a figure a name or a specific tag and pass is back to the class GetDataset() so that I can start picking and choosing from a hypothetical self.models.specific_figure.featurelist for aggregate creation.

Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
  • I wish I could help you! The datashader dashboard example hasn't gotten any love in a long time, because we've always been "just about to" replace it with something more general and understandable, along the lines of our recent [tutorial](https://github.com/ioam/jupytercon2017-holoviews-tutorial). So far, the dashboard in that tutorial isn't as ambitious or nice looking as the current dashboard, but it should be vastly easier to approach, and in particular it should be trivial to have more than one plot in it. Maybe that would be a better starting point? – James A. Bednar Oct 06 '17 at 15:20

1 Answers1

0

A temporary hack I've found is to hard code self.service_url += 'name={NAME}&' to a unique figure name based on a service_url for each desired figure as well as adding the image_renderer.image_source = ImageSource() for each image to udpate_image() as well as inline within the AppView() class after initial figure creation.

The name parameter is successfully passed in based on the addition of 'name': fields.Str(), to ds_args and then it becomes a matter of selecting the proper aggregate methods based on the name and current selections for that figure.