diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index 2dfdc8ee1..c6d37c096 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -4,6 +4,7 @@ import contextlib import inspect import json +from typing import Any import jsonschema import numpy as np @@ -137,7 +138,14 @@ def __repr__(self): return "Undefined" -Undefined = UndefinedType() +# In the future Altair may implement a more complete set of type hints. +# But for now, we'll add an annotation to indicate that the type checker +# should permit any value passed to a function argument whose default +# value is Undefined. +UndefinedLike = Any + + +Undefined: UndefinedLike = UndefinedType() class SchemaBase(object): diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index fcddd7f93..573a1f697 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -15,7 +15,6 @@ Top-Level Objects .. autosummary:: :toctree: generated/toplevel/ - :caption: Top-Level Objects :nosignatures: Chart @@ -33,7 +32,6 @@ Encoding Channels .. autosummary:: :toctree: generated/channels/ - :caption: Encoding Channels :nosignatures: Angle @@ -142,7 +140,6 @@ API Functions .. autosummary:: :toctree: generated/api/ - :caption: API Functions :nosignatures: binding @@ -150,16 +147,18 @@ API Functions binding_radio binding_range binding_select + check_fields_and_encodings concat condition graticule hconcat layer - parameter + param repeat selection selection_interval selection_multi + selection_point selection_single sequence sphere @@ -173,7 +172,6 @@ Low-Level Schema Wrappers .. autosummary:: :toctree: generated/core/ - :caption: Low-Level Schema Wrappers :nosignatures: Aggregate @@ -286,6 +284,7 @@ Low-Level Schema Wrappers Day DensityTransform DerivedStream + Dict DictInlineDataset DictSelectionInit DictSelectionInitInterval @@ -332,6 +331,7 @@ Low-Level Schema Wrappers FieldOrDatumDefWithConditionStringDatumDefText FieldOrDatumDefWithConditionStringFieldDefText FieldOrDatumDefWithConditionStringFieldDefstring + FieldRange FieldRangePredicate FieldValidPredicate FilterTransform @@ -414,7 +414,6 @@ Low-Level Schema Wrappers Orientation OverlayMarkDef Padding - Parameter ParameterExtent ParameterName ParameterPredicate diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index 3ca87b991..e078f7881 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -2,6 +2,7 @@ import contextlib import inspect import json +from typing import Any import jsonschema import numpy as np @@ -135,7 +136,14 @@ def __repr__(self): return "Undefined" -Undefined = UndefinedType() +# In the future Altair may implement a more complete set of type hints. +# But for now, we'll add an annotation to indicate that the type checker +# should permit any value passed to a function argument whose default +# value is Undefined. +UndefinedLike = Any + + +Undefined: UndefinedLike = UndefinedType() class SchemaBase(object):