Group Parameters Into Tabs / Plotly (un)directed graphs in 2D and 3D

I just spent the afternoon trying to figure out how to group class params into tabs.
I finally succeeded: given a set of parameters, e.g., reset_layout, layout, etc.,
collect them into groups that can then be displayed in Tabs

    def _build_gui(self):
        # collect the parameters into tabs
        tab_general   = pn.Param(self, parameters=['reset_layout', 'layout'],                                show_name=False)
        tab_styling   = pn.Param(self, parameters=['node_color', 'node_size', 'edge_color', 'edge_width',],  show_name=False)
        tab_arrows    = pn.Param(self, parameters=['arrow_size', 'arrow_starting_ratio', 'arrow_tip_ratio'], show_name=False)
        tab_signal    = pn.Param(self, parameters=['allow_signal', 'signal_display_option', 'signal_cmap', 
                                                   'signal_marker_size', 'signal_bar_width'],                show_name=False)
        tab_camera    = pn.Param(self, parameters=['camera_r', 'camera_theta', 'camera_phi'],                show_name=False)

        # create the tabs
        self.controls = pn.Tabs(('General', tab_general), ('Styling', tab_styling), ('Arrows', tab_arrows),
                                ('Signal',  tab_signal),  ('Camera',  tab_camera))

I was building a display for signals on graphs that can be used in a panel plotly plane if anybody is interested. The code is in A6_plotly.ipynb · main · ea42gh / AlgebraicGraphTheory · GitLab

1 Like