gencharts/__init__.py
def serialize(self, dataobj, xfield, yfield, time_unit=None,
                  chart_type="line", width=800,
                  height=300, color=None, size=None,
                  scale=Scale(zero=False), shape=None, options={}):
        """
        Serialize to an Altair chart object from either a pandas dataframe, a dictionnary,
        a list or an Altair Data object
        """
        dataset = dataobj
        if self._is_dict(dataobj) is True:
            dataset = self._dict_to_df(dataobj, xfield, yfield)
        elif isinstance(dataobj, list):
            dataset = Data(values=dataobj)
        xencode, yencode = self._encode_fields(
            xfield, yfield, time_unit)
        opts = dict(x=xencode, y=yencode)
        if color is not None:
            opts["color"] = color
        if size is not None:
            opts["size"] = size
        if shape is not None:
            opts["shape"] = shape
        chart = self._chart_class(dataset, chart_type, **options).encode(
            **opts
        ).configure_cell(
            width=width,
            height=height,
        )
        return chart
def serialize(self, dataobj, xfield, yfield, time_unit=None,
                  chart_type="line", width=800,
                  height=300, color=None, size=None,
                  scale=Scale(zero=False), shape=None, options={}):
        """
        Serialize to an Altair chart object from either a pandas dataframe, a dictionnary,
        a list or an Altair Data object
        """
        dataset = dataobj
        if self._is_dict(dataobj) is True:
            dataset = self._dict_to_df(dataobj, xfield, yfield)
        elif isinstance(dataobj, list):
            dataset = Data(values=dataobj)
        xencode, yencode = self._encode_fields(
            xfield, yfield, time_unit)
        opts = dict(x=xencode, y=yencode)
        if color is not None:
            opts["color"] = color
        if size is not None:
            opts["size"] = size
        if shape is not None:
            opts["shape"] = shape
        chart = self._chart_class(dataset, chart_type, **options).encode(
            **opts
        ).configure_cell(
            width=width,
            height=height,
        )
        return chart
Serialize to an Altair chart object from either a pandas dataframe, a dictionnary,
        a list or an Altair Data object