Skip to content

Commit

Permalink
Add radius keyword to bokeh.figure.circle calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Aug 29, 2024
1 parent b4e6aba commit 05b462d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jwql/edb/engineering_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def bokeh_plot_text_data(self, show_plot=False):
dates = abscissa[index].astype(np.datetime64)
y_values = list(np.ones(len(index), dtype=int) * i)
p1.line(dates, y_values, line_width=1, line_color='blue', line_dash='dashed')
p1.circle(dates, y_values, color='blue')
p1.circle(dates, y_values, color='blue', radius=5, radius_dimension='y', radius_units='screen')

p1.yaxis.ticker = list(override_dict.keys())
p1.yaxis.major_label_overrides = override_dict
Expand Down
3 changes: 2 additions & 1 deletion jwql/instrument_monitors/common_monitors/dark_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ def overplot_bad_pix(self, pix_type, coords, values):

# Overplot the bad pixel locations
badpixplots[pix_type] = self.plot.circle(x=f'pixels_x', y=f'pixels_y',
source=sources[pix_type], color=colors[pix_type])
source=sources[pix_type], color=colors[pix_type], radius=0.5,
radius_dimension='y', radius_units='data')

# Add to the legend
if numpix > 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,8 @@ def plot_every_change_data(data, mnem_name, units, show_plot=False, savefig=True
source = ColumnDataSource(data={'x': val_times, 'y': val_data, 'dep': dependency_val})

ldata = fig.line(x='x', y='y', line_width=1, line_color=Turbo256[color], source=source, legend_label=key)
cdata = fig.circle(x='x', y='y', fill_color=Turbo256[color], size=8, source=source, legend_label=key)
cdata = fig.circle(x='x', y='y', fill_color=Turbo256[color], source=source, legend_label=key, radius=4,
radius_dimension='y', radius_units='screen')

hover_tool = HoverTool(tooltips=[('Value', '@dep'),
('Data', '@y{1.11111}'),
Expand Down
2 changes: 1 addition & 1 deletion jwql/website/apps/jwql/bokeh_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def generic_telemetry_plot(times, values, name, nominal_value=None, yellow_limit

fig = figure(width=400, height=400, x_axis_label='Date', y_axis_label='Voltage',
x_axis_type='datetime')
fig.circle(times, values, size=4, color='navy', alpha=0.5)
fig.circle(times, values, color='navy', alpha=0.5, radius=2, radius_dimension='y', radius_units='screen')

if nominal_value is not None:
fig.line(times, np.repeat(nominal_value, len(times)), line_dash='dashed')
Expand Down
8 changes: 4 additions & 4 deletions jwql/website/apps/jwql/bokeh_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def dashboard_disk_usage(self):
y_axis_label='Disk Space (TB)')

plots[data['shortname']].line(x='date', y='available', source=source, legend_label='Available', line_dash='dashed', line_color='#C85108', line_width=3)
plots[data['shortname']].circle(x='date', y='available', source=source,color='#C85108', size=10)
plots[data['shortname']].circle(x='date', y='available', source=source,color='#C85108', radius=5, radius_dimension='y', radius_units='screen')
plots[data['shortname']].line(x='date', y='used', source=source, legend_label='Used', line_dash='dashed', line_color='#355C7D', line_width=3)
plots[data['shortname']].circle(x='date', y='used', source=source, color='#355C7D', size=10)
plots[data['shortname']].circle(x='date', y='used', source=source, color='#355C7D', radius=5, radius_dimension='y', radius_units='screen')

plots[data['shortname']].xaxis.formatter = DatetimeTickFormatter(hours="%H:%M %d %B %Y",
days="%d %B %Y",
Expand Down Expand Up @@ -289,7 +289,7 @@ def dashboard_central_store_data_volume(self):
# Plot the results
source = ColumnDataSource(results)
plot.line(x='date', y='used', source=source, line_color=color, line_dash='dashed', legend_label=area, line_width=3)
plot.circle(x='date', y='used', source=source, color=color, size=10)
plot.circle(x='date', y='used', source=source, color=color, radius=5, radius_dimension='y', radius_units='screen')

hover_tool = HoverTool(tooltips=[('Used:', f'@used TB'),
('Date:', '@date{%d %b %Y}')
Expand Down Expand Up @@ -331,7 +331,7 @@ def dashboard_central_store_data_volume(self):
# Plot the results
legend_str = 'File volume'
cen_store_plot.line(x='date', y='used', source=cen_store_source, legend_label=legend_str, line_dash='dashed', line_color='#355C7D', line_width=3)
cen_store_plot.circle(x='date', y='used', source=cen_store_source, color='#355C7D', size=10)
cen_store_plot.circle(x='date', y='used', source=cen_store_source, color='#355C7D', radius=5, radius_dimension='y', radius_units='screen')
cen_store_plot.xaxis.formatter = DatetimeTickFormatter(hours="%H:%M %d %B %Y",
days="%d %B %Y",
months="%d %B %Y",
Expand Down

0 comments on commit 05b462d

Please sign in to comment.