def prepare_spec()

in databao/visualizers/vega_vis_tool.py [0:0]


    def prepare_spec(cls, spec: dict[str, Any], df: pd.DataFrame) -> dict[str, Any]:
        spec = spec.copy()
        if "$schema" not in spec:
            spec["$schema"] = _VEGA_LITE_SCHEMA_URL

        # Remove fields not supported by data-tools that cause no html to be rendered
        spec_remove_data(spec)

        # The data must be included in the spec directly
        spec = spec_add_data(spec, df)
        return spec