code: def test_load_drilldown_content(custom_data):
      import dtale.views as views
  
      with app.test_client() as c:
          custom_data.loc[:, "Col4"] = 4
          df, _ = views.format_data(custom_data)
          build_data_inst({c.port: df})
          fig_data_outputs = "..drilldown-content-1.children...drilldown-x-input-1.style.."
          inputs = {
              "id": "input-data",
              "property": "data",
              "value": {
                  "data_id": c.port,
                  "chart_type": "bar",
                  "x": "security_id",
                  "y": ["Col0"],
                  "z": None,
                  "group": None,
                  "agg": None,
                  "window": None,
                  "rolling_comp": None,
                  "animate_by": "date",
              },
          }
          params = build_dash_request(
              fig_data_outputs,
              "chart-click-data-1.modified_timestamp",
              [
                  ts_builder("chart-click-data-1"),
                  {
                      "id": "drilldown-chart-type-1",
                      "property": "value",
                      "value": None,
                  },
                  {
                      "id": "drilldown-x-dropdown-1",
                      "property": "value",
                      "value": None,
                  },
              ],
              [
                  inputs,
                  {
                      "id": "chart-input-data",
                      "property": "data",
                      "value": {
                          "cpg": False,
                          "barmode": "group",
                          "barsort": None,
                      },
                  },
                  {"id": "yaxis-data", "property": "data", "value": {}},
                  {
                      "id": "map-input-data",
                      "property": "data",
                      "value": {},
                  },
                  {
                      "id": "chart-click-data-1",
                      "property": "data",
                      "value": {},
                  },
                  {
                      "id": "drilldown-toggle",
                      "property": "on",
                      "value": False,
                  },
              ],
          )
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert response.get_json() is None
          assert response.status_code == 204
          params["state"][-1]["value"] = True
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert response.get_json() is None
          assert response.status_code == 204
          params["state"][0]["value"]["agg"] = "mean"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert response.get_json() is None
          assert response.status_code == 204
          params["inputs"][-1]["value"] = "security_id"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          response = response.get_json()["response"]
          assert response["drilldown-content-1"]["children"] is None
          assert (
              response["drilldown-x-input-1"]["style"]["display"]
              == "none"
          )
          params["state"][-2]["value"] = {
              "points": [
                  {
                      "x": 100000,
                      "y": 1.23,
                      "customdata": pd.Timestamp(
                          df.date.values[0]
                      ).strftime("%Y%m%d"),
                  }
              ]
          }
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          exception = print_traceback(
              response,
              chart_key="drilldown-content-1",
              return_output=True,
          )
          assert "NotImplementedError: chart type: None" in exception
          params["inputs"][-2]["value"] = "histogram"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
  
          def _chart_title(resp, histogram=False):
              if histogram:
                  return resp.get_json()["response"][
                      "drilldown-content-1"
                  ]["children"]["props"]["figure"]["layout"]["title"][
                      "text"
                  ]
              return resp.get_json()["response"]["drilldown-content-1"][
                  "children"
              ]["props"]["children"][1]["props"]["figure"]["layout"][
                  "title"
              ][
                  "text"
              ]
  
          assert (
              _chart_title(response, True)
              == "Histogram of Col0 (1 data points)"
          )
          params["inputs"][-2]["value"] = "bar"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert _chart_title(response) == "Col0 by security_id"
  
          params["inputs"][-2]["value"] = "histogram"
          params["state"][0]["value"]["chart_type"] = "3d_scatter"
          params["state"][0]["value"]["y"] = "Col4"
          params["state"][0]["value"]["z"] = "Col0"
          params["state"][-2]["value"]["points"][0]["y"] = 4
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert (
              _chart_title(response, True)
              == "Histogram of Col0 (1 data points)"
          )
          params["inputs"][-2]["value"] = "bar"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert _chart_title(response) == "Col0 by security_id"
  
          params["inputs"][-2]["value"] = "histogram"
          params["state"][0]["value"]["chart_type"] = "heatmap"
          date_val = pd.Timestamp(
              df[
                  (df.security_id == 100000) & (df.Col4 == 4)
              ].date.values[0]
          ).strftime("%Y%m%d")
          params["state"][-2]["value"] = {
              "points": [
                  {
                      "x": 100000,
                      "y": 4,
                      "z": 1,
                      "text": "date: {}<br>security_id: 100000<br>Col4: 4<br>Col0: 1".format(
                          date_val
                      ),
                      "customdata": date_val,
                  }
              ]
          }
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert (
              _chart_title(response, True)
              == "Histogram of Col0 (1 data points)"
          )
          params["inputs"][-2]["value"] = "bar"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert _chart_title(response) == "Col0 by security_id"
  
          params["inputs"][-2]["value"] = "histogram"
          params["state"][0]["value"]["chart_type"] = "maps"
          params["state"][-3]["value"] = {
              "map_type": "choropleth",
              "loc": "security_id",
              "map_val": "Col0",
          }
          params["state"][-2]["value"]["points"][0]["location"] = 100000
          params["state"][-2]["value"]["points"][0]["z"] = 1.23
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert (
              _chart_title(response, True)
              == "Histogram of Col0 (1 data points)"
          )
          params["inputs"][-2]["value"] = "bar"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert _chart_title(response) == "Col0 by security_id"
  
          params["inputs"][-2]["value"] = "histogram"
          params["state"][-3]["value"] = {
              "map_type": "scattergeo",
              "lat": "security_id",
              "lon": "Col4",
              "map_val": "Col0",
          }
          params["state"][-2]["value"]["points"][0]["lat"] = 100000
          params["state"][-2]["value"]["points"][0]["lon"] = 4
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert (
              _chart_title(response, True)
              == "Histogram of Col0 (1 data points)"
          )
          params["inputs"][-2]["value"] = "bar"
          response = c.post(
              "/dtale/charts/_dash-update-component", json=params
          )
          assert _chart_title(response) == "Col0 by lat_lon"
  
file_path: dtale/tests/dtale/dash/test_drilldown.py
imports: import pandas
  import pytest
  from tests.dtale import build_data_inst
  from tests.dtale.dash.test_dash import build_dash_request, print_traceback, ts_builder
  from tests.dtale.test_views import app
label_desc: Use image node_id 4 for calling a global function with example usage: test_load_drilldown_content(custom_data) and returns: resp, resp