class_docstr: The dashboard class, wraps the dashboard component.
class_docstr_tok: ["The","dashboard","class",",","wraps","the","dashboard","component","."]
code: def add_route(self):
      # To enable multiple dashboards to run in the same notebook we need to
      # prevent them from using the same method names (in addition to using
      # dedicated ports). Below we rename the function for that purpose and
      # manually add the URL rule instead of using the route decorator.
      def visual():
          return self.load_index()
  
      self.add_url_rule(visual, "/", methods=["GET"])
  
      def get_config():
          return json.dumps(
              {WidgetRequestResponseConstants.data: self.config}
          )
  
      self.add_url_rule(get_config, "/config", methods=["POST"])
  
      def get_model_data():
          return json.dumps(
              {WidgetRequestResponseConstants.data: self.model_data},
              default=serialize_json_safe,
          )
  
      self.add_url_rule(get_model_data, "/model_data", methods=["POST"])
      return
  
imports: import json
  import os
  import uuid
  from html.parser import HTMLParser
  from rai_core_flask import FlaskHelper
  from raiutils.data_processing import serialize_json_safe
  from raiwidgets.interfaces import WidgetRequestResponseConstants
label_desc: Use image node_id 2 for calling the Dashboard obj's underlying member method code with example usage: obj.add_route() and returns: self, json, json