code: def widget(self, which_viz='viz'):
      '''
      Generate a widget visualization using the widget. The export_viz_to_widget
      method passes the visualization JSON to the instantiated widget, which is
      returned and visualized on the front-end.
      '''
      if hasattr(self, 'widget_class') == True:
  
        # run clustering if necessary
        if len(self.viz['row_nodes']) == 0:
          self.cluster()
  
        self.widget_instance = self.widget_class(network = self.export_viz_to_widget(which_viz))
  
        return self.widget_instance
      else:
        print('Can not make widget because Network has no attribute widget_class')
        print('Please instantiate Network with clustergrammer_widget using: Network(clustergrammer_widget)'f widget(self, which_viz='viz'):
      '''
      Generate a widget visualization using the widget. The export_viz_to_widget
      method passes the visualization JSON to the instantiated widget, which is
      returned and visualized on the front-end.
      '''
      if hasattr(self, 'widget_class') == True:
  
        # run clustering if necessary
        if len(self.viz['row_nodes']) == 0:
          self.cluster()
  
        self.widget_instance = self.widget_class(network = self.export_viz_to_widget(which_viz))
  
        return self.widget_instance
      else:
        print('Can not make widget because Network has no attribute widget_class')
        print('Please instantiate Network with clustergrammer_widget using: Network(clustergrammer_widget)')
docs: Generate a widget visualization using the widget. The export_viz_to_widget
      method passes the visualization JSON to the instantiated widget, which is
      returned and visualized on the front-end.