Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial fix for dashboard bokeh 0.12.1 integration #220

Merged
merged 1 commit into from
Aug 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions examples/dashboard/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,26 +356,29 @@ def create_layout(self):

# add ui components
controls = []
axes_select = Select.create(name='Axes',
options=self.model.axes)
axes_options = zip(self.model.axes.keys(), self.model.axes.keys())
axes_select = Select.create(name='Axes', options=axes_options)
axes_select.on_change('value', self.on_axes_change)
controls.append(axes_select)

self.field_select = Select.create(name='Field', options=self.model.fields)
fields_options = zip(self.model.fields.keys(), self.model.fields.keys())
self.field_select = Select.create(name='Field', options=fields_options)
self.field_select.on_change('value', self.on_field_change)
controls.append(self.field_select)

self.aggregate_select = Select.create(name='Aggregate',
options=self.model.aggregate_functions)
agg_options = zip(self.model.aggregate_functions.keys(), self.model.aggregate_functions.keys())
self.aggregate_select = Select.create(name='Aggregate', options=agg_options)
self.aggregate_select.on_change('value', self.on_aggregate_change)
controls.append(self.aggregate_select)

transfer_options = zip(self.model.transfer_functions.keys(), self.model.transfer_functions.keys())
transfer_select = Select.create(name='Transfer Function',
options=self.model.transfer_functions)
options=transfer_options)
transfer_select.on_change('value', self.on_transfer_function_change)
controls.append(transfer_select)

color_ramp_select = Select.create(name='Color Ramp', options=self.model.color_ramps)
color_options = zip(self.model.color_ramps.keys(), self.model.color_ramps.keys())
color_ramp_select = Select.create(name='Color Ramp', options=color_options)
color_ramp_select.on_change('value', self.on_color_ramp_change)
controls.append(color_ramp_select)

Expand All @@ -393,8 +396,8 @@ def create_layout(self):
# controls.append(self.model.legend_side_vbox)

# add map components
basemap_select = Select.create(name='Basemap', value='Imagery',
options=self.model.basemaps)
basemap_options = zip(self.model.basemaps.keys(), self.model.basemaps.keys())
basemap_select = Select.create(name='Basemap', value='Imagery', options=basemap_options)
basemap_select.on_change('value', self.on_basemap_change)

image_opacity_slider = Slider(title="Opacity", value=100, start=0,
Expand Down Expand Up @@ -435,12 +438,12 @@ def on_field_change(self, attr, old, new):
self.update_image()

if not self.model.field:
self.aggregate_select.options = [dict(name="No Aggregates Available", value="")]
self.aggregate_select.options = [("No Aggregates Available", "")]
elif self.model.field in self.model.categorical_fields:
self.model.hover_layer.is_categorical = True
self.aggregate_select.options = [dict(name="Categorical", value="count_cat")]
self.aggregate_select.options = [("Categorical", "count_cat")]
else:
opts = [dict(name=k, value=k) for k in self.model.aggregate_functions.keys()]
opts = [(k, k) for k in self.model.aggregate_functions.keys()]
self.aggregate_select.options = opts
self.model.hover_layer.is_categorical = False

Expand Down