gencharts/__init__.py
def _patch_json(self, json_data):
        """
        Patch the Altair generated json to the newest Vega Lite spec
        """
        json_data = json.loads(json_data)
        # add schema
        json_data["$schema"] = "https://vega.github.io/schema/vega-lite/2.0.0-beta.15.json"
        # add top level width and height
        json_data["width"] = json_data["config"]["cell"]["width"]
        json_data["height"] = json_data["config"]["cell"]["height"]
        del(json_data["config"]["cell"])
        return json.dumps(json_data)
def _patch_json(self, json_data):
        """
        Patch the Altair generated json to the newest Vega Lite spec
        """
        json_data = json.loads(json_data)
        # add schema
        json_data["$schema"] = "https://vega.github.io/schema/vega-lite/2.0.0-beta.15.json"
        # add top level width and height
        json_data["width"] = json_data["config"]["cell"]["width"]
        json_data["height"] = json_data["config"]["cell"]["height"]
        del(json_data["config"]["cell"])
        return json.dumps(json_data)
def _patch_json ( self , json_data ) : json_data = json . loads ( json_data ) # add schema json_data [ "$schema" ] = "https://vega.github.io/schema/vega-lite/2.0.0-beta.15.json" # add top level width and height json_data [ "width" ] = json_data [ "config" ] [ "cell" ] [ "width" ] json_data [ "height" ] = json_data [ "config" ] [ "cell" ] [ "height" ] del ( json_data [ "config" ] [ "cell" ] ) return json . dumps ( json_data )
Patch the Altair generated json to the newest Vega Lite spec
Patch the Altair generated json to the newest Vega Lite spec