code: def valid_chart(chart_type=None, x=None, y=None, z=None, **inputs):
      """
      Helper function to determine based on inputs (chart_type, x, y, z...) whether a chart can be build or not.
      For example, charts must have an x & y value and for 3-dimensional charts they must have a Z-Axis as well.
  
      :param chart_type: type of chart to build (line, bar, scatter, pie, heatmap, wordcloud, 3dscatter, surface)
      :type chart_type: str, optional
      :param x: column to use for the X-Axis
      :type x: str, optional
      :param y: columns to use for the Y-Axes
      :type y: list of str, optional
      :param z: column to use for the Z-Axis
      :type z: str, optional
      :param inputs: keyword arguments containing
      :return: `True` if executed from test, `False` otherwise
      :rtype: bool
      """
      if chart_type == "maps":
          map_type = inputs.get("map_type")
          if map_type == "choropleth" and all(
              inputs.get(p) is not None
              for p in ["loc_mode", "loc", "map_val"]
          ):
              if inputs.get("loc_mode") == "geojson-id" and any(
                  inputs.get(p) is None
                  for p in ["geojson", "featureidkey"]
              ):
                  return False
              return True
          elif map_type in ["scattergeo", "mapbox"] and all(
              inputs.get(p) is not None for p in ["lat", "lon"]
          ):
              return True
          return False
  
      if chart_type == "candlestick":
          cs_props = [
              "cs_x",
              "cs_open",
              "cs_close",
              "cs_high",
              "cs_low",
          ]
          return all(inputs.get(p) is not None for p in cs_props)
  
      if chart_type in ["treemap", "funnel"]:
          chart_props = ["{}_value", "{}_label"]
          return all(
              inputs.get(p.format(chart_type)) is not None
              for p in chart_props
          )
  
      if chart_type == "clustergram":
          if (
              inputs.get("clustergram_value") is None
              or inputs.get("clustergram_label") is None
          ):
              return False
          if len(make_list(inputs["clustergram_value"])) == 0:
              return False
          return True
  
      if chart_type == "pareto":
          pareto_props = ["pareto_x", "pareto_bars", "pareto_line"]
          return all(inputs.get(p) is not None for p in pareto_props)
  
      if chart_type == "histogram":
          return inputs.get("histogram_col") is not None
  
      if not x:
          return False
  
      if not y:
          return (
              chart_type == "wordcloud" and inputs.get("agg") == "count"
          )
  
      if chart_type in ZAXIS_CHARTS and z is None:
          return False
  
      if (
          len(inputs.get("extended_aggregation", [])) == 0
          and inputs.get("agg") == "rolling"
          and (
              inputs.get("window") is None
              or inputs.get("rolling_comp") is None
          )
      ):
          return False
      return True
  
imports: import copy
  import numpy
  import pandas
  import dtale.global_state
  import dtale.pandas_util
  from dtale.column_analysis import handle_cleaners
  from dtale.constants import CHART_JOINER_CHAR
  from dtale.query import build_col_key, run_query
  from dtale.utils import ChartBuildingError, build_formatters, classify_type, find_dtype, find_dtype_formatter, flatten_lists, get_dtypes, json_int, make_list, triple_quote
label_desc: Use image node_id 3 for calling a global function with example usage: valid_chart(chart_type, x, y, z) and returns: True, False, all, all, True, all, unknown, False, unknown, False, False, True, False, False, False, True