code: def transformed_data(chart, row_limit=None, exclude=None):
      """
      Evaluate the transform associated with a Chart and return the transformed
      data as one or more DataFrames
  
      :param chart: altair Chart, LayerChart, HConcatChart, VConcatChart, or ConcatChart
      :param row_limit: Maximum number of rows to return. None (default) for unlimited
      :param exclude: list of mark names to exclude.
      :return:
          - DataFrame of transformed data for Chart input
          - list of DataFrames for LayerChart, HConcatChart, VConcatChart, ConcatChart
      """
  
      from . import (
          runtime,
          get_local_tz,
          get_inline_datasets_for_spec,
          vegalite_compilers,
      )
  
      if isinstance(chart, Chart):
          # Add dummy mark if None specified
          if chart.mark == Undefined:
              chart = chart.mark_point()
  
      # Deep copy chart so that we can rename marks without affecting caller
      chart = chart.copy(deep=True)
  
      # Rename leaf chart with magic names
      chart_names = name_chart(chart, 0, exclude=exclude)
  
      # Compile to vega and retrieve inline datasets
      with data_transformers.enable("vegafusion-inline"):
          vega_spec = vegalite_compilers.get()(
              chart.to_json(validate=False)
          )
          inline_datasets = get_inline_datasets_for_spec(vega_spec)
  
      # Build mapping from mark names to vega datasets
      facet_mapping = get_facet_mapping(vega_spec)
      dataset_mapping = get_datasets_for_named_marks(
          vega_spec, chart_names, facet_mapping
      )
  
      # Build a list of vega dataset names that corresponds to the order
      # of the chart components
      dataset_names = []
      for chart_name in chart_names:
          if chart_name in dataset_mapping:
              dataset_names.append(dataset_mapping[chart_name])
          else:
              raise ValueError("Failed to locate all datasets")
  
      # Extract transformed datasets
      datasets, warnings = runtime.pre_transform_datasets(
          vega_spec,
          dataset_names,
          get_local_tz(),
          row_limit=row_limit,
          inline_datasets=inline_datasets,
      )
  
      if isinstance(chart, (Chart, FacetChart)):
          # Return DataFrame (or None if it was excluded) if input was a simple Chart
          if not datasets:
              return None
          else:
              return datasets[0]
      else:
          # Otherwise return the list of DataFrames
          return datasets
  
file_path: vegafusion/python/vegafusion/vegafusion/evaluation.py
imports: from altair import data_transformers, Chart, FacetChart, LayerChart, HConcatChart, VConcatChart, ConcatChart
  from altair.utils.schemapi import Undefined
label_desc: Use image node_id 2 for calling a global function with example usage: transformed_data(chart, row_limit, exclude) and returns: datasets, None, datasets