def update_legend(self):

        if self.field in self.categorical_fields:
            cat_legend = create_categorical_legend(self.colormap, aliases=self.colornames)
            self.legend_side_vbox.children = [cat_legend]
            self.legend_bottom_vbox.children = []

        else:
            legend_fig = create_ramp_legend(self.agg,
                                            self.color_ramp,
                                            how=self.transfer_function,
                                            width=self.plot_width)

            self.legend_bottom_vbox.children = [legend_fig]
            self.legend_side_vbox.children = []
Exemplo n.º 2
0
    def update_legend(self):

        if self.field in self.categorical_fields:
            cat_legend = create_categorical_legend(self.colormap,
                                                   aliases=self.colornames)
            self.legend_side_vbox.children = [cat_legend]
            self.legend_bottom_vbox.children = []

        else:
            legend_fig = create_ramp_legend(self.agg,
                                            self.color_ramp,
                                            how=self.transfer_function,
                                            width=self.plot_width)

            self.legend_bottom_vbox.children = [legend_fig]
            self.legend_side_vbox.children = []