How to use the altair.vega.v3.schema.core.VegaSchema 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 / vega / v3 / schema / core.py View on Github external
----------
    type : enum('treelinks')

    key : oneOf(scaleField, paramField, expr)

    signal : string

    """
    _schema = {'$ref': '#/defs/treelinksTransform'}
    _rootschema = Root._schema

    def __init__(self, type=Undefined, key=Undefined, signal=Undefined, **kwds):
        super(treelinksTransform, self).__init__(type=type, key=key, signal=signal, **kwds)


class treemapTransform(VegaSchema):
    """treemapTransform schema wrapper

    Mapping(required=[type])

    Attributes
    ----------
    type : enum('treemap')

    field : oneOf(scaleField, paramField, expr)

    method : anyOf(enum('squarify', 'resquarify', 'binary', 'dice', 'slice', 'slicedice'),
    signal)

    padding : anyOf(float, signal)

    paddingBottom : anyOf(float, signal)
github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
foldTransform, formulaTransform, imputeTransform, joinaggregateTransform, lookupTransform,
    pivotTransform, projectTransform, sampleTransform, sequenceTransform, windowTransform,
    identifierTransform, linkpathTransform, pieTransform, stackTransform, contourTransform,
    geojsonTransform, geopathTransform, geopointTransform, geoshapeTransform,
    graticuleTransform, forceTransform, nestTransform, packTransform, partitionTransform,
    stratifyTransform, treeTransform, treelinksTransform, treemapTransform, voronoiTransform,
    wordcloudTransform, crossfilterTransform, resolvefilterTransform)
    """
    _schema = {'$ref': '#/defs/transform'}
    _rootschema = Root._schema

    def __init__(self, *args, **kwds):
        super(transform, self).__init__(*args, **kwds)


class transformMark(VegaSchema):
    """transformMark schema wrapper

    oneOf(binTransform, collectTransform, extentTransform, formulaTransform,
    joinaggregateTransform, lookupTransform, sampleTransform, windowTransform,
    identifierTransform, linkpathTransform, pieTransform, stackTransform, geojsonTransform,
    geopathTransform, geopointTransform, geoshapeTransform, forceTransform, packTransform,
    partitionTransform, stratifyTransform, treeTransform, treemapTransform, voronoiTransform,
    wordcloudTransform, crossfilterTransform, resolvefilterTransform)
    """
    _schema = {'$ref': '#/defs/transformMark'}
    _rootschema = Root._schema

    def __init__(self, *args, **kwds):
        super(transformMark, self).__init__(*args, **kwds)

github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
initonly : anyOf(boolean, signal)

    signal : string

    as : anyOf(string, signal)

    """
    _schema = {'$ref': '#/defs/formulaTransform'}
    _rootschema = Root._schema

    def __init__(self, expr=Undefined, type=Undefined, initonly=Undefined, signal=Undefined, **kwds):
        super(formulaTransform, self).__init__(expr=expr, type=type, initonly=initonly, signal=signal,
                                               **kwds)


class imputeTransform(VegaSchema):
    """imputeTransform schema wrapper

    Mapping(required=[type, field, key])

    Attributes
    ----------
    field : oneOf(scaleField, paramField, expr)

    key : oneOf(scaleField, paramField, expr)

    type : enum('impute')

    groupby : oneOf(List(oneOf(scaleField, paramField, expr)), signal)

    keyvals : oneOf(List(Mapping(required=[])), signal)
github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
import pkgutil
import json

def load_schema():
    """Load the json schema associated with this module's functions"""
    return json.loads(pkgutil.get_data(__name__, 'vega-schema.json').decode('utf-8'))


class VegaSchema(SchemaBase):
    @classmethod
    def _default_wrapper_classes(cls):
        return VegaSchema.__subclasses__()


class Root(VegaSchema):
    """Root schema wrapper

    allOf(scope, Mapping(required=[]))
    """
    _schema = load_schema()
    _rootschema = _schema

    def __init__(self, autosize=Undefined, axes=Undefined, background=Undefined, config=Undefined,
                 data=Undefined, description=Undefined, encode=Undefined, height=Undefined,
                 layout=Undefined, legends=Undefined, marks=Undefined, padding=Undefined,
                 projections=Undefined, scales=Undefined, signals=Undefined, title=Undefined,
                 usermeta=Undefined, width=Undefined, **kwds):
        super(Root, self).__init__(autosize=autosize, axes=axes, background=background, config=config,
                                   data=data, description=description, encode=encode, height=height,
                                   layout=layout, legends=legends, marks=marks, padding=padding,
                                   projections=projections, scales=scales, signals=signals, title=title,
github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
oneOf(List(allOf(rule, allOf(stringModifiers, anyOf(oneOf(signal, Mapping(required=[value]),
     Mapping(required=[field]), Mapping(required=[range])), Mapping(required=[scale, value]),
    Mapping(required=[scale, band]), Mapping(required=[offset]))))), allOf(stringModifiers,
    anyOf(oneOf(signal, Mapping(required=[value]), Mapping(required=[field]),
    Mapping(required=[range])), Mapping(required=[scale, value]), Mapping(required=[scale,
    band]), Mapping(required=[offset]))))
    """
    _schema = {'$ref': '#/refs/arrayValue'}
    _rootschema = Root._schema

    def __init__(self, *args, **kwds):
        super(arrayValue, self).__init__(*args, **kwds)


class nullableStringValue(VegaSchema):
    """nullableStringValue schema wrapper

    oneOf(List(allOf(rule, allOf(stringModifiers, anyOf(oneOf(signal, Mapping(required=[value]),
     Mapping(required=[field]), Mapping(required=[range])), Mapping(required=[scale, value]),
    Mapping(required=[scale, band]), Mapping(required=[offset]))))), allOf(stringModifiers,
    anyOf(oneOf(signal, Mapping(required=[value]), Mapping(required=[field]),
    Mapping(required=[range])), Mapping(required=[scale, value]), Mapping(required=[scale,
    band]), Mapping(required=[offset]))))
    """
    _schema = {'$ref': '#/refs/nullableStringValue'}
    _rootschema = Root._schema

    def __init__(self, *args, **kwds):
        super(nullableStringValue, self).__init__(*args, **kwds)

github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
----------
    expr : exprString

    type : enum('filter')

    signal : string

    """
    _schema = {'$ref': '#/defs/filterTransform'}
    _rootschema = Root._schema

    def __init__(self, expr=Undefined, type=Undefined, signal=Undefined, **kwds):
        super(filterTransform, self).__init__(expr=expr, type=type, signal=signal, **kwds)


class flattenTransform(VegaSchema):
    """flattenTransform schema wrapper

    Mapping(required=[type, fields])

    Attributes
    ----------
    fields : oneOf(List(oneOf(scaleField, paramField, expr)), signal)

    type : enum('flatten')

    signal : string

    as : oneOf(List(anyOf(string, signal)), signal)

    """
    _schema = {'$ref': '#/defs/flattenTransform'}
github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
----------
    a : numberValue

    b : numberValue

    l : numberValue

    """
    _schema = {'$ref': '#/refs/colorLAB'}
    _rootschema = Root._schema

    def __init__(self, a=Undefined, b=Undefined, l=Undefined, **kwds):
        super(colorLAB, self).__init__(a=a, b=b, l=l, **kwds)


class colorHCL(VegaSchema):
    """colorHCL schema wrapper

    Mapping(required=[h, c, l])

    Attributes
    ----------
    c : numberValue

    h : numberValue

    l : numberValue

    """
    _schema = {'$ref': '#/refs/colorHCL'}
    _rootschema = Root._schema
github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
----------
    h : numberValue

    l : numberValue

    s : numberValue

    """
    _schema = {'$ref': '#/refs/colorHSL'}
    _rootschema = Root._schema

    def __init__(self, h=Undefined, l=Undefined, s=Undefined, **kwds):
        super(colorHSL, self).__init__(h=h, l=l, s=s, **kwds)


class colorLAB(VegaSchema):
    """colorLAB schema wrapper

    Mapping(required=[l, a, b])

    Attributes
    ----------
    a : numberValue

    b : numberValue

    l : numberValue

    """
    _schema = {'$ref': '#/refs/colorLAB'}
    _rootschema = Root._schema
github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
super(sortOrder, self).__init__(*args, **kwds)


class scaleField(VegaSchema):
    """scaleField schema wrapper

    oneOf(string, signal)
    """
    _schema = {'$ref': '#/refs/scaleField'}
    _rootschema = Root._schema

    def __init__(self, *args, **kwds):
        super(scaleField, self).__init__(*args, **kwds)


class scaleInterpolate(VegaSchema):
    """scaleInterpolate schema wrapper

    oneOf(string, signal, Mapping(required=[type]))
    """
    _schema = {'$ref': '#/refs/scaleInterpolate'}
    _rootschema = Root._schema

    def __init__(self, *args, **kwds):
        super(scaleInterpolate, self).__init__(*args, **kwds)


class scaleData(VegaSchema):
    """scaleData schema wrapper

    oneOf(Mapping(required=[data, field]), Mapping(required=[data, fields]),
    Mapping(required=[fields]))
github altair-viz / altair / altair / vega / v3 / schema / core.py View on Github external
signal : string

    as : oneOf(List(anyOf(string, signal, None)), signal)

    """
    _schema = {'$ref': '#/defs/aggregateTransform'}
    _rootschema = Root._schema

    def __init__(self, type=Undefined, cross=Undefined, drop=Undefined, fields=Undefined,
                 groupby=Undefined, key=Undefined, ops=Undefined, signal=Undefined, **kwds):
        super(aggregateTransform, self).__init__(type=type, cross=cross, drop=drop, fields=fields,
                                                 groupby=groupby, key=key, ops=ops, signal=signal,
                                                 **kwds)


class binTransform(VegaSchema):
    """binTransform schema wrapper

    Mapping(required=[type, field, extent])

    Attributes
    ----------
    extent : oneOf(List(anyOf(float, signal)), signal)

    field : oneOf(scaleField, paramField, expr)

    type : enum('bin')

    anchor : anyOf(float, signal)

    base : anyOf(float, signal)