How to use the altair.utils.use_signature function in altair

To help you get started, we’ve selected a few altair examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github altair-viz / altair / altair / vegalite / v4 / schema / mixins.py View on Github external
    @use_signature(core.RectConfig)
    def configure_image(self, *args, **kwargs):
        copy = self.copy(deep=['config'])
        if copy.config is Undefined:
            copy.config = core.Config()
        copy.config["image"] = core.RectConfig(*args, **kwargs)
        return copy
github altair-viz / altair / altair / vegalite / v2 / schema / mixins.py View on Github external
    @use_signature(core.MarkConfig)
    def configure_circle(self, *args, **kwargs):
        copy = self.copy(deep=False)
        if copy.config is Undefined:
            copy.config = core.Config()
        else:
            copy.config = copy.config.copy(deep=False)
        copy.config["circle"] = core.MarkConfig(*args, **kwargs)
        return copy
github altair-viz / altair / altair / vegalite / v4 / schema / mixins.py View on Github external
    @use_signature(core.AxisConfig)
    def configure_axisTop(self, *args, **kwargs):
        copy = self.copy(deep=['config'])
        if copy.config is Undefined:
            copy.config = core.Config()
        copy.config["axisTop"] = core.AxisConfig(*args, **kwargs)
        return copy
github altair-viz / altair / altair / vegalite / v4 / schema / mixins.py View on Github external
    @use_signature(core.CompositionConfig)
    def configure_concat(self, *args, **kwargs):
        copy = self.copy(deep=['config'])
        if copy.config is Undefined:
            copy.config = core.Config()
        copy.config["concat"] = core.CompositionConfig(*args, **kwargs)
        return copy
github altair-viz / altair / altair / vegalite / v4 / schema / mixins.py View on Github external
    @use_signature(core.MarkConfig)
    def configure_square(self, *args, **kwargs):
        copy = self.copy(deep=['config'])
        if copy.config is Undefined:
            copy.config = core.Config()
        copy.config["square"] = core.MarkConfig(*args, **kwargs)
        return copy
github altair-viz / altair / altair / vegalite / v2 / api.py View on Github external
# consolidate inline data to top-level datasets
    if data_transformers.consolidate_datasets:
        data = _consolidate_data(data, context)

    # if data is still not a recognized type, then return
    if not isinstance(data, (dict, core.Data)):
        warnings.warn("data of type {} not recognized".format(type(data)))

    return data


# ------------------------------------------------------------------------
# Aliases & specializations
Bin = core.BinParams

@utils.use_signature(core.LookupData)
class LookupData(core.LookupData):
    def to_dict(self, *args, **kwargs):
        """Convert the chart to a dictionary suitable for JSON export"""
        copy = self.copy(ignore=['data'])
        context = kwargs.get('context', {})
        copy.data = _prepare_data(copy.data, context)
        return super(LookupData, copy).to_dict(*args, **kwargs)


@utils.use_signature(core.FacetMapping)
class FacetMapping(core.FacetMapping):
    _class_is_valid_at_instantiation = False

    def to_dict(self, *args, **kwargs):
        copy = self.copy()
        context = kwargs.get('context', {})
github altair-viz / altair / altair / vegalite / v4 / schema / mixins.py View on Github external
    @use_signature(core.MarkConfig)
    def configure_mark(self, *args, **kwargs):
        copy = self.copy(deep=['config'])
        if copy.config is Undefined:
            copy.config = core.Config()
        copy.config["mark"] = core.MarkConfig(*args, **kwargs)
        return copy
github altair-viz / altair / altair / vegalite / v3 / api.py View on Github external
@utils.use_signature(core.BindRadioSelect)
def binding_select(**kwargs):
    """A select binding"""
    return core.BindRadioSelect(input='select', **kwargs)
github altair-viz / altair / altair / vegalite / v4 / api.py View on Github external
@utils.use_signature(core.SingleSelection)
def selection_single(**kwargs):
    """Create a selection with type='single'"""
    return selection(type='single', **kwargs)