Skip to content

Commit

Permalink
feat(plot): parameterize height
Browse files Browse the repository at this point in the history
  • Loading branch information
nritsche committed Nov 27, 2020
1 parent ba4a31e commit 9ac8d65
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bondia/plot/delayspectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self, data, config, **params):
# set default values
self.transpose = True
self.logarithmic_colorscale = True
self.height = 400

@param.depends(
"lsd",
Expand All @@ -48,6 +49,7 @@ def __init__(self, data, config, **params):
"serverside_rendering",
"colormap_range",
"helper_lines",
"height",
)
def view(self):
if self.lsd is None:
Expand Down Expand Up @@ -173,7 +175,7 @@ def view(self):
)
img.opts(
# Fix height, but make width responsive
height=500,
height=self.height,
responsive=True,
shared_axes=False,
)
Expand Down
5 changes: 4 additions & 1 deletion bondia/plot/plot.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from panel import Row, Param
import param


class BondiaPlot:
class BondiaPlot(param.Parameterized):
def __init__(self, name: str, activated: bool = True):
self._name = name
self._id = name.lower().replace(" ", "_")
self._panel_row_active = activated
self._panel_row = None

height = param.Integer(500, bounds=(0, 10000))

@property
def id(self):
return self._id
Expand Down
5 changes: 4 additions & 1 deletion bondia/plot/ringmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def __init__(self, data, config, **params):
# transpose by default
self.transpose = True

self.height = 800

self.read_config(config)

def _finalise_config(self):
Expand Down Expand Up @@ -194,6 +196,7 @@ def param_control(self):
"weight_mask_threshold",
"flag_mask",
"flags",
"height",
)
def view(self):
if self.lsd is None:
Expand Down Expand Up @@ -423,7 +426,7 @@ def view(self):

img.opts(
# Fix height, but make width responsive
height=500,
height=self.height,
responsive=True,
shared_axes=True,
)
Expand Down
4 changes: 3 additions & 1 deletion bondia/plot/sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(self, data, config, **params):
self.selections = None

HeatMapPlot.__init__(self, "Sensitivity", activated=True, **params)
self.height = 600
self.read_config(config)
self.logarithmic_colorscale = True

Expand Down Expand Up @@ -83,6 +84,7 @@ def update_pol(self):
"polarization",
"mark_day_time",
"mask_rfi",
"height",
)
def view(self):
if self.lsd is None:
Expand Down Expand Up @@ -214,7 +216,7 @@ def view(self):

img.opts(
# Fix height, but make width responsive
height=500,
height=self.height,
responsive=True,
bgcolor="lightgray",
shared_axes=True,
Expand Down

0 comments on commit 9ac8d65

Please sign in to comment.