Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@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
@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
@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
@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
@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
# 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', {})
@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
@utils.use_signature(core.BindRadioSelect)
def binding_select(**kwargs):
"""A select binding"""
return core.BindRadioSelect(input='select', **kwargs)
@utils.use_signature(core.SingleSelection)
def selection_single(**kwargs):
"""Create a selection with type='single'"""
return selection(type='single', **kwargs)