code: def generate_app_mini(
      ctx_item,
      url_base_pathname=None,
      requests_pathname_prefix=None,
      routes_pathname_prefix=None,
  ):
      """Generates the mini Dash application including callbacks..
  
      Returns:
          The dash app itself.
      """
      _log.info("Generating mini dash")
  
      # Initialize
      app = UDash(
          __name__,
          url_base_pathname=url_base_pathname,
          requests_pathname_prefix=requests_pathname_prefix,
          routes_pathname_prefix=routes_pathname_prefix,
      )
      app.scripts.config.serve_locally = True
      app.css.config.serve_locally = True
      app.config["suppress_callback_exceptions"] = True
      app.ctx_item = ctx_item
      app.logger.handlers = []
      app.title = "InterpretML"
      server = app.server
  
      # Items in drop-down.
      explanation, selector = ctx_item
      data_options = [{"label": "Summary", "value": -1}]
      options_list = []
  
      has_selector = selector is not None
  
      select_css = ""
      if has_selector:
          for i in range(len(selector)):
              col_strs = []
              for col_idx in range(min(3, len(selector.columns))):
                  col_strs.append(
                      "{0} ({1})".format(
                          selector.columns[col_idx],
                          selector.iloc[i, col_idx],
                      )
                  )
  
              label_str = " | ".join(col_strs)
              label_str = "{0} : {1}".format(i, label_str)
              options_list.append({"label": label_str, "value": i})
          data_options.extend(options_list)
      else:
          select_css = "hdn"
  
      # Define selector component
      selector_component = html.Div(
          [
              html.Div(
                  [
                      html.Div(
                          html.Div(
                              "Select Component to Graph",
                              className="card-title",
                          ),
                          className="card-header",
                      ),
                      html.Div(
                          [
                              dcc.Dropdown(
                                  id="component-drop",
                                  options=data_options,
                                  multi=False,
                                  value=-1,
                              )
                          ],
                          className="card-body",
                      ),
                  ],
                  className="card",
              )
          ],
          className=select_css,
      )
  
      # Define viz component
      viz_component = html.Div(id="viz-container")
  
      # Define layout
      app.layout = html.Div(
          [
              html.Div([selector_component, viz_component]),
              # NOTE: Workaround for tables not rendering
              # TODO: Check if this is needed with the new tables.
              html.Div(
                  dt.DataTable(data=[{}]), style={"display": "none"}
              ),
          ],
          className="mini-app",
      )
  
      @app.callback(
          Output("viz-container", "children"),
          [Input("component-drop", "value")],
      )
      def update_viz_container(value):
          if value is None:
              return None
  
          explanation, selector = app.ctx_item
          if value == -1:
              output_div = gen_overall_plot(explanation, int(value))
          else:
              output_div = gen_plot(explanation, int(value), 0, 0)
  
          return output_div
  
      @server.errorhandler(Exception)
      def handle_error(e):  # pragma: no cover
          _log.error(e, exc_info=True)
          return (
              "Internal Server Error caught by udash. See logs if available.",
              500,
          )
  
      _log.info("Generated mini dash")
      return app
  
file_path: interpret/python/interpret-core/interpret/visual/_udash.py
imports: import dash
  from dash import html
  from dash import dcc
  from dash import dash_table
  import dash_cytoscape
  from dash.dependencies import Input, Output
  import dash.development.base_component
  from pandas.core.generic import NDFrame
  from plotly import graph_objs
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: generate_app_mini(ctx_item, url_base_pathname, requests_pathname_prefix, routes_pathname_prefix) and returns: app, output_div, str,  int, None