def METHOD_NAME(self):
    if self._graph_widget is None:
        return
    # re-generate the graph
    if not self._proximity_graph:
        self._graph = None
        self._graph_widget.graph = None
        self._graph_widget.request_relayout()
        return
    self._graph = self._create_ui_graph()
    self._graph_widget.graph = self._graph