def __init__(self, input_csv, team_list_json): self.display_data = DisplayData(input_csv, team_list_json) self.control_box = ControlBox( get_display_names(self.display_data.team_list), self.display_data.get_time_interval()) self.main_plot = MainPlot(self.display_data.source) self.set_up_callbacks()
def __init__(self, win, x, y): ControlBox.__init__(self, win, x, y, 'silver', (250, 60, 60)) self.centerx, self.centery = self.x + 4, self.y + 4 self.backdrop = ['/-------+-------\\', '|...|...|PSYCHIC|', '|...|...|-------/', '|...|...|', '|---+---|', '|...|...|', '|...|...|', '|...|...|', '\-------/'] self.x_axis = 'LEFT-X' self.y_axis = 'LEFT-Y'
def __init__(self, win, x, y): ControlBox.__init__(self, win, x, y, 'aqua', 'navy') self.centerx, self.centery = self.x + 12, self.y + 4 self.backdrop = ['/-------\\', '|...|...|', '|...|...|', '|...|...|', '|---+---|', '|...|...|', '/-------|...|...|', '| NERVE |...|...|', '\---------------/'] self.x_axis = 'RIGHT-X' self.y_axis = 'RIGHT-Y'
class Scorigami(object): def __init__(self, input_csv, team_list_json): self.display_data = DisplayData(input_csv, team_list_json) self.control_box = ControlBox( get_display_names(self.display_data.team_list), self.display_data.get_time_interval()) self.main_plot = MainPlot(self.display_data.source) self.set_up_callbacks() def set_up_callbacks(self): self.control_box.team.on_change('value', lambda attr, old, new: self.update()) self.control_box.dp1.on_change('value', lambda attr, old, new: self.update()) self.control_box.dp2.on_change('value', lambda attr, old, new: self.update()) self.control_box.movbox.on_change( 'active', lambda attr, old, new: self.toggle_gridlines()) self.control_box.gradient.on_change( 'active', lambda attr, old, new: self.update_colors()) self.control_box.upperbox.on_change( 'active', lambda attr, old, new: self.update()) def toggle_gridlines(self): self.main_plot.toggle_gridlines(0 in self.control_box.movbox.active) def update_colors(self): use_gradient = self.control_box.gradient.active self.display_data.update_colors(use_gradient) def update(self): new_team = self.control_box.team.value upper_only = not self.control_box.upperbox.active start, end = convert_time_values( (self.control_box.dp1.value, self.control_box.dp2.value)) self.display_data.update_team(new_team, upper_only, start, end) self.update_colors() self.main_plot.set_axis_labels( self.display_data.get_short_name(new_team), upper_only) self.control_box.update_ticker(self.display_data.scorigami_df) def get_layout(self): return row(self.control_box.get_layout(), self.main_plot.get_plot())
def __init__(self, win, x, y, fgcolor, bgcolor): ControlBox.__init__(self, win, x, y, fgcolor, bgcolor) self.axis = ""