repo
stringclasses
358 values
pull_number
int64
6
67.9k
instance_id
stringlengths
12
49
issue_numbers
listlengths
1
7
base_commit
stringlengths
40
40
patch
stringlengths
87
101M
test_patch
stringlengths
72
22.3M
problem_statement
stringlengths
3
256k
hints_text
stringlengths
0
545k
created_at
stringlengths
20
20
PASS_TO_PASS
listlengths
0
0
FAIL_TO_PASS
listlengths
0
0
conda/conda
7,989
conda__conda-7989
[ "7976", "7952" ]
523fcfddf8f149b3ee2e1788027df1060b02987e
diff --git a/conda/core/initialize.py b/conda/core/initialize.py --- a/conda/core/initialize.py +++ b/conda/core/initialize.py @@ -1118,7 +1118,9 @@ def _read_windows_registry(target_path): # pragma: no cover try: value_tuple = winreg.QueryValueEx(key, value_name) - value_value = value_tuple[0].strip() + value_value = value_tuple[0] + if isinstance(value_value, str): + value_value = value_value.strip() value_type = value_tuple[1] return value_value, value_type except Exception: @@ -1187,13 +1189,13 @@ def init_long_path(target_path): # win10, build 14352 was the first preview release that supported this if int(win_ver) >= 10 and int(win_rev) >= 14352: prev_value, value_type = _read_windows_registry(target_path) - if prev_value != "1": + if str(prev_value) != "1": if context.verbosity: print('\n') print(target_path) - print(make_diff(prev_value, "1")) + print(make_diff(str(prev_value), '1')) if not context.dry_run: - _write_windows_registry(target_path, "1", winreg.REG_DWORD) + _write_windows_registry(target_path, 1, winreg.REG_DWORD) return Result.MODIFIED else: return Result.NO_CHANGE
diff --git a/tests/common/pkg_formats/test_python.py b/tests/common/pkg_formats/test_python.py --- a/tests/common/pkg_formats/test_python.py +++ b/tests/common/pkg_formats/test_python.py @@ -398,7 +398,7 @@ def test_metadata(): # Python Distributions # ----------------------------------------------------------------------------- [email protected](datetime.now() < datetime(2018, 12, 1), [email protected](datetime.now() < datetime(2019, 1, 1), reason="This test needs to be refactored for the case of raising a hard " "error when the anchor_file doesn't exist.", strict=True) diff --git a/tests/core/test_initialize.py b/tests/core/test_initialize.py --- a/tests/core/test_initialize.py +++ b/tests/core/test_initialize.py @@ -826,7 +826,7 @@ def _read_windows_registry_mock(target_path): @pytest.mark.skipif(not on_win, reason="win-only test") def test_init_enable_long_path(self): - self.dummy_value = "0" + self.dummy_value = 0 def _read_windows_registry_mock(target_path): return self.dummy_value, "REG_DWORD" @@ -844,9 +844,9 @@ def _write_windows_registry_mock(target_path, value, dtype): try: target_path = r'HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem\\LongPathsEnabled' - assert initialize._read_windows_registry(target_path)[0] == "0" + assert initialize._read_windows_registry(target_path)[0] == 0 initialize.init_long_path(target_path) - assert initialize._read_windows_registry(target_path)[0] == "1" + assert initialize._read_windows_registry(target_path)[0] == 1 finally: initialize._read_windows_registry = orig_read_windows_registry initialize._write_windows_registry = orig_write_windows_registry diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -584,8 +584,13 @@ def test_strict_channel_priority(self): assert not stderr json_obj = json_loads(stdout) channel_groups = groupby("channel",json_obj["actions"]["LINK"]) + channel_groups = sorted(list(channel_groups)) # conda-forge should be the only channel in the solution on unix - assert list(channel_groups) == ["conda-forge"] + # fiona->gdal->libgdal->m2w64-xz brings in pkgs/msys2 on win + if on_win: + assert channel_groups == ["conda-forge", "pkgs/msys2"] + else: + assert channel_groups == ["conda-forge"] def test_strict_resolve_get_reduced_index(self): channels = (Channel("defaults"),) @@ -925,8 +930,7 @@ def test_install_freeze_installed_flag(self): run_command(Commands.INSTALL, prefix, "conda-forge::tensorflow>=1.4 --dry-run --freeze-installed") - @pytest.mark.xfail(on_win and datetime.now() < datetime(2018, 11, 1), - reason="need to talk with @msarahan about blas patches on Windows", + @pytest.mark.xfail(on_win, reason="nomkl not present on windows", strict=True) def test_install_features(self): with make_temp_env("python=2 numpy=1.13 nomkl") as prefix: diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -1025,7 +1025,7 @@ def test_no_features(): ] [email protected](datetime.now() < datetime(2018, 12, 1), reason="bogus test; talk with @mcg1969") [email protected](datetime.now() < datetime(2019, 1, 1), reason="bogus test; talk with @mcg1969") def test_multiple_solution(): assert False # index2 = index.copy()
nomkl tests running on Windows fail Appears some `nomkl` feature tests are being run on Windows and [failing on CI]( https://ci.appveyor.com/project/ContinuumAnalyticsFOSS/conda/builds/20408292/job/q40u301c397wpyji?fullLog=true#L1181 ). IIUC `nomkl` does not exist on Windows. So this is as expected. Should these tests be marked as known fails, skipped, or similar? Conda Init (v4.6.0b1 ) --system cmd.exe chokes ``` # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "c:\users\wani\downloads\repos\conda\conda\exceptions.py", line 1001, in __call__ return func(*args, **kwargs) File "c:\users\wani\downloads\repos\conda\conda\cli\main.py", line 84, in _main exit_code = do_call(args, p) File "c:\users\wani\downloads\repos\conda\conda\cli\conda_argparse.py", line 81, in do_call exit_code = getattr(module, func_name)(args, parser) File "c:\users\wani\downloads\repos\conda\conda\cli\main_init.py", line 52, in execute anaconda_prompt) File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 106, in initialize run_plan(plan2) File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 552, in run_plan result = globals()[step['function']](*step.get('args', ()), **step.get('kwargs', {})) File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 1196, in init_long_path _write_windows_registry(target_path, "1", winreg.REG_DWORD) File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 1143, in _write_windows_registry winreg.SetValueEx(key, value_name, 0, value_type, value_value) ValueError: Could not convert the data to the specified type. `$ C:\ProgramData\MinicondaX\Scripts\conda-script.py init --system cmd.exe` ```
2018-11-25T17:18:44Z
[]
[]
conda/conda
7,998
conda__conda-7998
[ "7976" ]
c429cf4f2f009a4ca27a2715a5317781269a5e9b
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -105,6 +105,7 @@ def ssl_verify_validation(value): class Context(Configuration): add_pip_as_python_dependency = PrimitiveParameter(True) + allow_conda_downgrades = PrimitiveParameter(False) allow_cycles = PrimitiveParameter(True) # allow cyclical dependencies, or raise allow_softlinks = PrimitiveParameter(False) auto_update_conda = PrimitiveParameter(True, aliases=('self_update',)) @@ -590,6 +591,7 @@ def list_parameters(self): 'bld_path', 'conda_build', 'croot', + 'allow_conda_downgrades', 'debug', 'default_python', 'dry_run', diff --git a/conda/history.py b/conda/history.py --- a/conda/history.py +++ b/conda/history.py @@ -233,7 +233,7 @@ def get_user_requests(self): conda_versions_from_history = tuple(x['conda_version'] for x in res if 'conda_version' in x) - if conda_versions_from_history: + if conda_versions_from_history and not context.allow_conda_downgrades: minimum_conda_version = sorted(conda_versions_from_history, key=VersionOrder)[-1] minimum_major_minor = '.'.join(take(2, minimum_conda_version.split('.'))) current_major_minor = '.'.join(take(2, CONDA_VERSION.split('.')))
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -805,8 +805,7 @@ def test_only_deps_flag(self): assert package_is_installed(prefix, 'openssl') assert package_is_installed(prefix, 'itsdangerous') - @pytest.mark.xfail(on_win and datetime.now() < datetime(2018, 9, 15), - reason="need to talk with @msarahan about blas patches on Windows", + @pytest.mark.xfail(on_win, reason="nomkl not present on windows", strict=True) def test_install_features(self): with make_temp_env("python=2 numpy=1.13 nomkl") as prefix:
nomkl tests running on Windows fail Appears some `nomkl` feature tests are being run on Windows and [failing on CI]( https://ci.appveyor.com/project/ContinuumAnalyticsFOSS/conda/builds/20408292/job/q40u301c397wpyji?fullLog=true#L1181 ). IIUC `nomkl` does not exist on Windows. So this is as expected. Should these tests be marked as known fails, skipped, or similar?
2018-11-29T04:11:33Z
[]
[]
conda/conda
8,015
conda__conda-8015
[ "7621" ]
b3d8da6f0320dac75ded2f4ed0f788a00e370dc2
diff --git a/conda/core/link.py b/conda/core/link.py --- a/conda/core/link.py +++ b/conda/core/link.py @@ -13,7 +13,7 @@ import warnings from .package_cache_data import PackageCacheData -from .path_actions import (CompilePycAction, CreateNonadminAction, CreatePrefixRecordAction, +from .path_actions import (CompileMultiPycAction, CreateNonadminAction, CreatePrefixRecordAction, CreatePythonEntryPointAction, LinkPathAction, MakeMenuAction, RegisterEnvironmentLocationAction, RemoveLinkedPackageRecordAction, RemoveMenuAction, UnlinkPathAction, UnregisterEnvironmentLocationAction, @@ -386,28 +386,33 @@ def _verify_prefix_level(target_prefix, prefix_action_group): link_paths_dict = defaultdict(list) for axn in create_lpr_actions: for link_path_action in axn.all_link_path_actions: - path = link_path_action.target_short_path - path = lower_on_win(path) - link_paths_dict[path].append(axn) - if path not in unlink_paths and lexists(join(target_prefix, path)): - # we have a collision; at least try to figure out where it came from - colliding_prefix_rec = first( - (prefix_rec for prefix_rec in PrefixData(target_prefix).iter_records()), - key=lambda prefix_rec: path in prefix_rec.files - ) - if colliding_prefix_rec: - yield KnownPackageClobberError( - path, - axn.package_info.repodata_record.dist_str(), - colliding_prefix_rec.dist_str(), - context, - ) - else: - yield UnknownPackageClobberError( - path, - axn.package_info.repodata_record.dist_str(), - context, + if isinstance(link_path_action, CompileMultiPycAction): + target_short_paths = link_path_action.target_short_paths + else: + target_short_paths = (link_path_action.target_short_path, ) + for path in target_short_paths: + path = lower_on_win(path) + link_paths_dict[path].append(axn) + if path not in unlink_paths and lexists(join(target_prefix, path)): + # we have a collision; at least try to figure out where it came from + colliding_prefix_rec = first( + (prefix_rec for prefix_rec in + PrefixData(target_prefix).iter_records()), + key=lambda prefix_rec: path in prefix_rec.files ) + if colliding_prefix_rec: + yield KnownPackageClobberError( + path, + axn.package_info.repodata_record.dist_str(), + colliding_prefix_rec.dist_str(), + context, + ) + else: + yield UnknownPackageClobberError( + path, + axn.package_info.repodata_record.dist_str(), + context, + ) # Verification 2. there's only a single instance of each path for path, axns in iteritems(link_paths_dict): @@ -683,8 +688,8 @@ def _make_link_actions(transaction_context, package_info, target_prefix, request create_menu_actions = MakeMenuAction.create_actions(*required_quad) python_entry_point_actions = CreatePythonEntryPointAction.create_actions(*required_quad) - compile_pyc_actions = CompilePycAction.create_actions(*required_quad, - file_link_actions=file_link_actions) + compile_pyc_actions = CompileMultiPycAction.create_actions( + *required_quad, file_link_actions=file_link_actions) # if requested_spec: # application_entry_point_actions = CreateApplicationEntryPointAction.create_actions( diff --git a/conda/core/path_actions.py b/conda/core/path_actions.py --- a/conda/core/path_actions.py +++ b/conda/core/path_actions.py @@ -16,6 +16,7 @@ from .. import CondaError from .._vendor.auxlib.compat import with_metaclass from .._vendor.auxlib.ish import dals +from .._vendor.toolz import concat from ..base.constants import CONDA_TARBALL_EXTENSION from ..base.context import context from ..common.compat import iteritems, on_win, text_type @@ -26,8 +27,9 @@ from ..common.url import has_platform, path_to_url, unquote from ..exceptions import CondaUpgradeError, CondaVerificationError, PaddingError, SafetyError from ..gateways.connection.download import download -from ..gateways.disk.create import (compile_pyc, copy, create_hard_link_or_copy, - create_link, create_python_entry_point, extract_tarball, +from ..gateways.disk.create import (compile_multiple_pyc, copy, + create_hard_link_or_copy, create_link, + create_python_entry_point, extract_tarball, make_menu, mkdir_p, write_as_json_to_file) from ..gateways.disk.delete import rm_rf, try_rmdir_all_empty from ..gateways.disk.permissions import make_writable @@ -88,6 +90,44 @@ def __repr__(self): return "%s(%s)" % (self.__class__.__name__, ', '.join(args)) +@with_metaclass(ABCMeta) +class MultiPathAction(object): + + _verified = False + + @abstractmethod + def verify(self): + # if verify fails, it should return an exception object rather than raise + # at the end of a verification run, all errors will be raised as a CondaMultiError + # after successful verification, the verify method should set self._verified = True + raise NotImplementedError() + + @abstractmethod + def execute(self): + raise NotImplementedError() + + @abstractmethod + def reverse(self): + raise NotImplementedError() + + @abstractmethod + def cleanup(self): + raise NotImplementedError() + + @abstractproperty + def target_full_paths(self): + raise NotImplementedError() + + @property + def verified(self): + return self._verified + + def __repr__(self): + args = ('%s=%r' % (key, value) for key, value in iteritems(vars(self)) + if key not in REPR_IGNORE_KWARGS) + return "%s(%s)" % (self.__class__.__name__, ', '.join(args)) + + @with_metaclass(ABCMeta) class PrefixPathAction(PathAction): @@ -444,7 +484,7 @@ def reverse(self): rm_rf(self.target_full_path) -class CompilePycAction(CreateInPrefixPathAction): +class CompileMultiPycAction(MultiPathAction): @classmethod def create_actions(cls, transaction_context, package_info, target_prefix, requested_link_type, @@ -453,41 +493,69 @@ def create_actions(cls, transaction_context, package_info, target_prefix, reques if noarch is not None and noarch.type == NoarchType.python: noarch_py_file_re = re.compile(r'^site-packages[/\\][^\t\n\r\f\v]+\.py$') py_ver = transaction_context['target_python_version'] - py_files = (axn.target_short_path for axn in file_link_actions - if noarch_py_file_re.match(axn.source_short_path)) - return tuple(cls(transaction_context, package_info, target_prefix, - pf, pyc_path(pf, py_ver)) - for pf in py_files) + py_files = tuple((axn.target_short_path for axn in file_link_actions + if noarch_py_file_re.match(axn.source_short_path))) + pyc_files = tuple((pyc_path(pf, py_ver) for pf in py_files)) + return (cls(transaction_context, package_info, target_prefix, py_files, pyc_files), ) else: return () def __init__(self, transaction_context, package_info, target_prefix, - source_short_path, target_short_path): - super(CompilePycAction, self).__init__(transaction_context, package_info, - target_prefix, source_short_path, - target_prefix, target_short_path) - self.prefix_path_data = PathDataV1( - _path=self.target_short_path, - path_type=PathType.pyc_file, - ) + source_short_paths, target_short_paths): + self.transaction_context = transaction_context + self.package_info = package_info + self.target_prefix = target_prefix + self.source_short_paths = source_short_paths + self.target_short_paths = target_short_paths + self.prefix_path_data = None + self.prefix_paths_data = [ + PathDataV1(_path=p, path_type=PathType.pyc_file,) for p in self.target_short_paths] self._execute_successful = False + @property + def target_full_paths(self): + def join_or_none(prefix, short_path): + if prefix is None or short_path is None: + return None + else: + return join(prefix, win_path_ok(short_path)) + return (join_or_none(self.target_prefix, p) for p in self.target_short_paths) + + @property + def source_full_paths(self): + def join_or_none(prefix, short_path): + if prefix is None or short_path is None: + return None + else: + return join(prefix, win_path_ok(short_path)) + return (join_or_none(self.target_prefix, p) for p in self.source_short_paths) + + def verify(self): + self._verified = True + + def cleanup(self): + # create actions typically won't need cleanup + pass + def execute(self): # compile_pyc is sometimes expected to fail, for example a python 3.6 file # installed into a python 2 environment, but no code paths actually importing it # technically then, this file should be removed from the manifest in conda-meta, but # at the time of this writing that's not currently happening - log.trace("compiling %s", self.target_full_path) + log.trace("compiling %s", ' '.join(self.target_full_paths)) target_python_version = self.transaction_context['target_python_version'] python_short_path = get_python_short_path(target_python_version) python_full_path = join(self.target_prefix, win_path_ok(python_short_path)) - compile_pyc(python_full_path, self.source_full_path, self.target_full_path) + compile_multiple_pyc(python_full_path, self.source_full_paths, self.target_full_paths, + self.target_prefix, self.transaction_context['target_python_version']) self._execute_successful = True def reverse(self): + # this removes all pyc files even if they were not created if self._execute_successful: - log.trace("reversing pyc creation %s", self.target_full_path) - rm_rf(self.target_full_path) + log.trace("reversing pyc creation %s", ' '.join(self.target_full_paths)) + for target_full_path in self.target_full_paths: + rm_rf(target_full_path) class CreatePythonEntryPointAction(CreateInPrefixPathAction): @@ -754,12 +822,25 @@ def execute(self): package_tarball_full_path = extracted_package_dir + CONDA_TARBALL_EXTENSION # TODO: don't make above assumption; put package_tarball_full_path in package_info - files = (x.target_short_path for x in self.all_link_path_actions if x) + def files_from_action(link_path_action): + if isinstance(link_path_action, CompileMultiPycAction): + return link_path_action.target_short_paths + else: + return (link_path_action.target_short_path, ) + + def paths_from_action(link_path_action): + if isinstance(link_path_action, CompileMultiPycAction): + return link_path_action.prefix_paths_data + else: + if link_path_action.prefix_path_data is None: + return () + else: + return (link_path_action.prefix_path_data, ) + files = concat((files_from_action(x) for x in self.all_link_path_actions if x)) paths_data = PathsData( paths_version=1, - paths=(x.prefix_path_data for x in self.all_link_path_actions - if x and x.prefix_path_data), + paths=concat((paths_from_action(x) for x in self.all_link_path_actions if x)), ) self.prefix_record = PrefixRecord.from_objects( diff --git a/conda/gateways/disk/create.py b/conda/gateways/disk/create.py --- a/conda/gateways/disk/create.py +++ b/conda/gateways/disk/create.py @@ -11,6 +11,7 @@ from shutil import copyfileobj, copystat import sys import tarfile +import tempfile from . import mkdir_p from .delete import rm_rf @@ -336,29 +337,53 @@ def create_link(src, dst, link_type=LinkType.hardlink, force=False): raise CondaError("Did not expect linktype=%r" % link_type) -def compile_pyc(python_exe_full_path, py_full_path, pyc_full_path): - if lexists(pyc_full_path): - maybe_raise(BasicClobberError(None, pyc_full_path, context), context) +def compile_multiple_pyc(python_exe_full_path, py_full_paths, pyc_full_paths, prefix, py_ver): + py_full_paths = tuple(py_full_paths) + pyc_full_paths = tuple(pyc_full_paths) + if len(py_full_paths) == 0: + return [] - command = '"%s" -Wi -m py_compile "%s"' % (python_exe_full_path, py_full_path) - log.trace(command) - result = subprocess_call(command, raise_on_error=False) + for pyc_full_path in pyc_full_paths: + if lexists(pyc_full_path): + maybe_raise(BasicClobberError(None, pyc_full_path, context), context) - if not isfile(pyc_full_path): - message = dals(""" - pyc file failed to compile successfully - python_exe_full_path: %s - py_full_path: %s - pyc_full_path: %s - compile rc: %s - compile stdout: %s - compile stderr: %s - """) - log.info(message, python_exe_full_path, py_full_path, pyc_full_path, - result.rc, result.stdout, result.stderr) - return None - - return pyc_full_path + fd, filename = tempfile.mkstemp() + try: + for f in py_full_paths: + f = os.path.relpath(f, prefix) + if hasattr(f, 'encode'): + f = f.encode(sys.getfilesystemencoding()) + os.write(fd, f + b"\n") + os.close(fd) + command = ["-Wi", "-m", "compileall", "-q", "-l", "-i", filename] + # if the python version in the prefix is 3.5+, we have some extra args. + # -j 0 will do the compilation in parallel, with os.cpu_count() cores + if int(py_ver[0]) >= 3 and int(py_ver.split('.')[1]) > 5: + command.extend(["-j", "0"]) + command = '"%s" ' % python_exe_full_path + " ".join(command) + log.trace(command) + result = subprocess_call(command, raise_on_error=False, path=prefix) + finally: + os.remove(filename) + + created_pyc_paths = [] + for py_full_path, pyc_full_path in zip(py_full_paths, pyc_full_paths): + if not isfile(pyc_full_path): + message = dals(""" + pyc file failed to compile successfully + python_exe_full_path: %s + py_full_path: %s + pyc_full_path: %s + compile rc: %s + compile stdout: %s + compile stderr: %s + """) + log.info(message, python_exe_full_path, py_full_path, pyc_full_path, + result.rc, result.stdout, result.stderr) + else: + created_pyc_paths.append(pyc_full_path) + + return created_pyc_paths def create_package_cache_directory(pkgs_dir): diff --git a/conda/gateways/subprocess.py b/conda/gateways/subprocess.py --- a/conda/gateways/subprocess.py +++ b/conda/gateways/subprocess.py @@ -48,7 +48,7 @@ def subprocess_call(command, env=None, path=None, stdin=None, raise_on_error=Tru log.debug("executing>> %s", command_str) p = Popen(command_arg, cwd=cwd, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) ACTIVE_SUBPROCESSES.add(p) - stdin = ensure_binary(stdin) if isinstance(stdin, string_types) else None + stdin = ensure_binary(stdin) if isinstance(stdin, string_types) else stdin stdout, stderr = p.communicate(input=stdin) rc = p.returncode ACTIVE_SUBPROCESSES.remove(p)
diff --git a/tests/core/test_path_actions.py b/tests/core/test_path_actions.py --- a/tests/core/test_path_actions.py +++ b/tests/core/test_path_actions.py @@ -21,7 +21,7 @@ from conda.common.path import get_bin_directory_short_path, get_python_noarch_target_path, \ get_python_short_path, get_python_site_packages_short_path, parse_entry_point_def, pyc_path, \ win_path_ok -from conda.core.path_actions import CompilePycAction, CreatePythonEntryPointAction, LinkPathAction +from conda.core.path_actions import CompileMultiPycAction, CreatePythonEntryPointAction, LinkPathAction from conda.exceptions import ParseError from conda.gateways.disk.create import create_link, mkdir_p from conda.gateways.disk.delete import rm_rf @@ -92,7 +92,7 @@ def tearDown(self): rm_rf(self.pkgs_dir) assert not lexists(self.pkgs_dir) - def test_CompilePycAction_generic(self): + def test_CompileMultiPycAction_generic(self): package_info = AttrDict( package_metadata=AttrDict( noarch=AttrDict( @@ -100,14 +100,14 @@ def test_CompilePycAction_generic(self): ) noarch = package_info.package_metadata and package_info.package_metadata.noarch assert noarch.type == NoarchType.generic - axns = CompilePycAction.create_actions({}, package_info, self.prefix, None, ()) + axns = CompileMultiPycAction.create_actions({}, package_info, self.prefix, None, ()) assert axns == () package_info = AttrDict(package_metadata=None) - axns = CompilePycAction.create_actions({}, package_info, self.prefix, None, ()) + axns = CompileMultiPycAction.create_actions({}, package_info, self.prefix, None, ()) assert axns == () - def test_CompilePycAction_noarch_python(self): + def test_CompileMultiPycAction_noarch_python(self): if not softlink_supported(__file__, self.prefix) and on_win: pytest.skip("softlink not supported") @@ -124,25 +124,48 @@ def test_CompilePycAction_noarch_python(self): source_short_path='site-packages/something.py', target_short_path=get_python_noarch_target_path('site-packages/something.py', sp_dir), ), + AttrDict( + source_short_path='site-packages/another.py', + target_short_path=get_python_noarch_target_path('site-packages/another.py', sp_dir), + ), AttrDict( # this one shouldn't get compiled source_short_path='something.py', target_short_path=get_python_noarch_target_path('something.py', sp_dir), ), + AttrDict( + # this one shouldn't get compiled + source_short_path='another.py', + target_short_path=get_python_noarch_target_path('another.py', sp_dir), + ), ] - axns = CompilePycAction.create_actions(transaction_context, package_info, self.prefix, - None, file_link_actions) + axns = CompileMultiPycAction.create_actions(transaction_context, package_info, self.prefix, + None, file_link_actions) assert len(axns) == 1 axn = axns[0] - assert axn.source_full_path == join(self.prefix, win_path_ok(get_python_noarch_target_path('site-packages/something.py', sp_dir))) - assert axn.target_full_path == join(self.prefix, win_path_ok(pyc_path(get_python_noarch_target_path('site-packages/something.py', sp_dir), + source_full_paths = tuple(axn.source_full_paths) + source_full_path0 = source_full_paths[0] + source_full_path1 = source_full_paths[1] + assert len(source_full_paths) == 2 + assert source_full_path0 == join(self.prefix, win_path_ok(get_python_noarch_target_path('site-packages/something.py', sp_dir))) + assert source_full_path1 == join(self.prefix, win_path_ok(get_python_noarch_target_path('site-packages/another.py', sp_dir))) + target_full_paths = tuple(axn.target_full_paths) + target_full_path0 = target_full_paths[0] + target_full_path1 = target_full_paths[1] + assert len(target_full_paths) == 2 + assert target_full_path0 == join(self.prefix, win_path_ok(pyc_path(get_python_noarch_target_path('site-packages/something.py', sp_dir), + target_python_version))) + assert target_full_path1 == join(self.prefix, win_path_ok(pyc_path(get_python_noarch_target_path('site-packages/another.py', sp_dir), target_python_version))) # make .py file in prefix that will be compiled - mkdir_p(dirname(axn.source_full_path)) - with open(axn.source_full_path, 'w') as fh: + mkdir_p(dirname(source_full_path0)) + with open(source_full_path0, 'w') as fh: fh.write("value = 42\n") + mkdir_p(dirname(source_full_path1)) + with open(source_full_path1, 'w') as fh: + fh.write("value = 43\n") # symlink the current python python_full_path = join(self.prefix, get_python_short_path(target_python_version)) @@ -150,19 +173,25 @@ def test_CompilePycAction_noarch_python(self): create_link(sys.executable, python_full_path, LinkType.softlink) axn.execute() - assert isfile(axn.target_full_path) + assert isfile(target_full_path0) + assert isfile(target_full_path1) # remove the source .py file so we're sure we're importing the pyc file below - rm_rf(axn.source_full_path) - assert not isfile(axn.source_full_path) + rm_rf(source_full_path0) + assert not isfile(source_full_path0) + rm_rf(source_full_path1) + assert not isfile(source_full_path1) if (3,) > sys.version_info >= (3, 5): # we're probably dropping py34 support soon enough anyway - imported_pyc_file = load_python_file(axn.target_full_path) + imported_pyc_file = load_python_file(target_full_path0) assert imported_pyc_file.value == 42 + imported_pyc_file = load_python_file(target_full_path1) + assert imported_pyc_file.value == 43 axn.reverse() - assert not isfile(axn.target_full_path) + assert not isfile(target_full_path0) + assert not isfile(target_full_path1) def test_CreatePythonEntryPointAction_generic(self): package_info = AttrDict(package_metadata=None)
allow for multi-path PathActions; build .pyc files in one pass per package from @mingwandroid > Is it known / expected that installing a few noarch: python packages takes >5 minutes (still running) on Windows? > > Looking in process hacker I see it spending all its time firing up new python interpreters to compile .pyc files. One instantiation of python per .pyc to be compiled. > > Can we not use a single process here? > > 10 minutes now, killing it.
xref: https://github.com/conda/conda/issues/7778 xref: #7768
2018-12-05T22:02:42Z
[]
[]
conda/conda
8,067
conda__conda-8067
[ "7976" ]
64bde065f8343276f168d2034201115dff7c5753
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -127,6 +127,7 @@ class Context(Configuration): DEFAULT_AGGRESSIVE_UPDATE_PACKAGES, aliases=('aggressive_update_packages',)) safety_checks = PrimitiveParameter(SafetyChecks.warn) + extra_safety_checks = PrimitiveParameter(False) path_conflict = PrimitiveParameter(PathConflict.clobber) pinned_packages = SequenceParameter(string_types, string_delimiter='&') # TODO: consider a different string delimiter # NOQA @@ -217,7 +218,7 @@ class Context(Configuration): deps_modifier = PrimitiveParameter(DepsModifier.NOT_SET) update_modifier = PrimitiveParameter(UpdateModifier.UPDATE_SPECS) sat_solver = PrimitiveParameter(None, element_type=string_types + (NoneType,)) - solver_ignore_timestamps = PrimitiveParameter(True) + solver_ignore_timestamps = PrimitiveParameter(False) # no_deps = PrimitiveParameter(NULL, element_type=(type(NULL), bool)) # CLI-only # only_deps = PrimitiveParameter(NULL, element_type=(type(NULL), bool)) # CLI-only @@ -707,6 +708,7 @@ def category_map(self): 'path_conflict', 'rollback_enabled', 'safety_checks', + 'extra_safety_checks', 'shortcuts', 'non_admin_enabled', )), @@ -1025,6 +1027,10 @@ def description_map(self): Enforce available safety guarantees during package installation. The value must be one of 'enabled', 'warn', or 'disabled'. """), + 'extra_safety_checks': dals(""" + Spend extra time validating package contents. Currently, runs sha256 verification + on every file within each package during installation. + """), 'shortcuts': dals(""" Allow packages to create OS-specific shortcuts (e.g. in the Windows Start Menu) at install time. diff --git a/conda/core/path_actions.py b/conda/core/path_actions.py --- a/conda/core/path_actions.py +++ b/conda/core/path_actions.py @@ -43,6 +43,7 @@ from ..models.records import (Link, PackageCacheRecord, PackageRecord, PathDataV1, PathsData, PrefixRecord) + log = getLogger(__name__) REPR_IGNORE_KWARGS = ( @@ -300,29 +301,11 @@ def verify(self): ) elif source_path_data.path_type == PathType.hardlink: - try: - reported_sha256 = source_path_data.sha256 - except AttributeError: - reported_sha256 = None - source_sha256 = compute_sha256sum(self.source_full_path) - if reported_sha256 and reported_sha256 != source_sha256: - return SafetyError(dals(""" - The package for %s located at %s - appears to be corrupted. The path '%s' - has a sha256 mismatch. - reported sha256: %s - actual sha256: %s - """ % (self.package_info.repodata_record.name, - self.package_info.extracted_package_dir, - self.source_short_path, - reported_sha256, - source_sha256, - ))) - try: reported_size_in_bytes = source_path_data.size_in_bytes except AttributeError: reported_size_in_bytes = None + source_size_in_bytes = 0 if reported_size_in_bytes: source_size_in_bytes = getsize(self.source_full_path) if reported_size_in_bytes != source_size_in_bytes: @@ -339,6 +322,28 @@ def verify(self): source_size_in_bytes, ))) + try: + reported_sha256 = source_path_data.sha256 + except AttributeError: + reported_sha256 = None + # sha256 is expensive. Only run if file sizes agree, and then only if enabled + if (source_size_in_bytes and reported_size_in_bytes == source_size_in_bytes + and context.extra_safety_checks): + source_sha256 = compute_sha256sum(self.source_full_path) + + if reported_sha256 and reported_sha256 != source_sha256: + return SafetyError(dals(""" + The package for %s located at %s + appears to be corrupted. The path '%s' + has a sha256 mismatch. + reported sha256: %s + actual sha256: %s + """ % (self.package_info.repodata_record.name, + self.package_info.extracted_package_dir, + self.source_short_path, + reported_sha256, + source_sha256, + ))) self.prefix_path_data = PathDataV1.from_objects( source_path_data, sha256=reported_sha256, diff --git a/conda/gateways/disk/create.py b/conda/gateways/disk/create.py --- a/conda/gateways/disk/create.py +++ b/conda/gateways/disk/create.py @@ -352,7 +352,7 @@ def compile_multiple_pyc(python_exe_full_path, py_full_paths, pyc_full_paths, pr for f in py_full_paths: f = os.path.relpath(f, prefix) if hasattr(f, 'encode'): - f = f.encode(sys.getfilesystemencoding()) + f = f.encode(sys.getfilesystemencoding(), errors='replace') os.write(fd, f + b"\n") os.close(fd) command = ["-Wi", "-m", "compileall", "-q", "-l", "-i", filename] diff --git a/conda/models/channel.py b/conda/models/channel.py --- a/conda/models/channel.py +++ b/conda/models/channel.py @@ -129,7 +129,8 @@ def make_simple_channel(channel_alias, channel_url, name=None): location, name = ca.location, test_url.replace(ca.location, '', 1) else: url_parts = urlparse(test_url) - location, name = Url(host=url_parts.host, port=url_parts.port).url, url_parts.path + location = Url(host=url_parts.host, port=url_parts.port).url + name = url_parts.path or '' return Channel(scheme=scheme, auth=auth, location=location, token=token, name=name.strip('/')) else: diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -309,6 +309,20 @@ def _get_strict_channel(self, package_name): channel_name = self._strict_channel_cache[package_name] = by_cp[highest_priority] return channel_name + def _broader(self, ms, specs): + """prevent introduction of matchspecs that broaden our selection of choices""" + is_broader = False + matching_specs = [s for s in specs if s.name == ms.name] + + if matching_specs and ( + # is there a version constraint defined for any existing spec, but not MS? + (any('version' in _ for _ in matching_specs) and 'version' not in ms) + # is there a build constraint on any of the specs, but not on ms? + or (any('build' in _ for _ in matching_specs) and 'build' not in ms) + ): + is_broader = True + return is_broader + @time_recorder(module_name=__name__) def get_reduced_index(self, specs): # TODO: fix this import; this is bad @@ -430,34 +444,64 @@ def filter_group(_specs): # Determine all valid packages in the dependency graph reduced_index2 = {prec: prec for prec in (make_feature_record(fstr) for fstr in features)} - processed_specs = set() - specs_queue = set(specs) - while specs_queue: - this_spec = specs_queue.pop() - processed_specs.add(this_spec) + explicit_spec_list = set(specs) + for explicit_spec in explicit_spec_list: add_these_precs2 = tuple( - prec for prec in self.find_matches(this_spec) - if prec not in reduced_index2 and self.valid2(prec, filter_out) - ) + prec for prec in self.find_matches(explicit_spec) + if prec not in reduced_index2 and self.valid2(prec, filter_out)) + if strict_channel_priority and add_these_precs2: - strict_chanel_name = self._get_strict_channel(add_these_precs2[0].name) + strict_channel_name = self._get_strict_channel(add_these_precs2[0].name) add_these_precs2 = tuple( - prec for prec in add_these_precs2 if prec.channel.name == strict_chanel_name + prec for prec in add_these_precs2 if prec.channel.name == strict_channel_name ) - reduced_index2.update((prec, prec) for prec in add_these_precs2) - # We do not pull packages into the reduced index due - # to a track_features dependency. Remember, a feature - # specifies a "soft" dependency: it must be in the - # environment, but it is not _pulled_ in. The SAT - # logic doesn't do a perfect job of capturing this - # behavior, but keeping these packages out of the - # reduced index helps. Of course, if _another_ - # package pulls it in by dependency, that's fine. - specs_queue.update( - ms for prec in add_these_precs2 for ms in self.ms_depends(prec) - if "track_features" not in ms and ms not in processed_specs - ) + + for pkg in add_these_precs2: + # what we have seen is only relevant within the context of a single package + # that is picked up because of an explicit spec. We don't want the + # broadening check to apply across packages at the explicit level; only + # at the level of deps below that explicit package. + seen_pkgs = {pkg} + seen_specs = set() + + dep_specs = set(self.ms_depends(pkg)) + this_pkg_constraints = self.ms_depends(pkg) + + while(dep_specs): + ms = dep_specs.pop() + seen_specs.add(ms) + dep_packages = set(self.find_matches(ms)) - seen_pkgs + for dep_pkg in dep_packages: + seen_pkgs.add(dep_pkg) + if not self.valid2(dep_pkg, filter_out): + continue + + # expand the reduced index + if dep_pkg not in reduced_index2: + if strict_channel_priority: + strict_channel_name = self._get_strict_channel(dep_pkg.name) + if dep_pkg.channel.name == strict_channel_name: + reduced_index2[dep_pkg] = dep_pkg + else: + reduced_index2[dep_pkg] = dep_pkg + + # recurse to deps of this dep + new_specs = set(self.ms_depends(dep_pkg)) - seen_specs + for ms in new_specs: + # We do not pull packages into the reduced index due + # to a track_features dependency. Remember, a feature + # specifies a "soft" dependency: it must be in the + # environment, but it is not _pulled_ in. The SAT + # logic doesn't do a perfect job of capturing this + # behavior, but keeping these packags out of the + # reduced index helps. Of course, if _another_ + # package pulls it in by dependency, that's fine. + if ('track_features' not in ms + and not self._broader(ms, this_pkg_constraints) + and ms not in seen_specs): + dep_specs.add(ms) + self._reduced_index_cache[cache_key] = reduced_index2 return reduced_index2 @@ -943,6 +987,25 @@ def mysat(specs, add_if=False): constraints = r2.generate_spec_constraints(C, specs) return C.sat(constraints, add_if) + # Return a solution of packages + def clean(sol): + return [q for q in (C.from_index(s) for s in sol) + if q and q[0] != '!' and '@' not in q] + + def is_converged(solution): + """ Determine if the SAT problem has converged to a single solution. + + This is determined by testing for a SAT solution with the current + clause set and a clause in which at least one of the packages in + the current solution is excluded. If a solution exists the problem + has not converged as multiple solutions still exist. + """ + psolution = clean(solution) + nclause = tuple(C.Not(C.from_name(q)) for q in psolution) + if C.sat((nclause,), includeIf=False) is None: + return True + return False + r2 = Resolve(reduced_index, True, True, channels=self.channels) C = r2.gen_clauses() solution = mysat(specs, True) @@ -1025,21 +1088,19 @@ def mysat(specs, add_if=False): log.debug('Additional package channel/version/build metrics: %d/%d/%d', obj5a, obj5, obj6) - # Maximize timestamps - log.debug("Solve: maximize timestamps") - eq_t.update(eq_req_t) - solution, obj6t = C.minimize(eq_t, solution) - log.debug('Timestamp metric: %d', obj6t) - # Prune unnecessary packages log.debug("Solve: prune unnecessary packages") eq_c = r2.generate_package_count(C, specm) solution, obj7 = C.minimize(eq_c, solution, trymax=True) log.debug('Weak dependency count: %d', obj7) - def clean(sol): - return [q for q in (C.from_index(s) for s in sol) - if q and q[0] != '!' and '@' not in q] + converged = is_converged(solution) + if not converged: + # Maximize timestamps + eq_t.update(eq_req_t) + solution, obj6t = C.minimize(eq_t, solution) + log.debug('Timestamp metric: %d', obj6t) + log.debug('Looking for alternate solutions') nsol = 1 psolutions = [] diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -74,6 +74,7 @@ def package_files(*root_directories): "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", ], packages=conda._vendor.auxlib.packaging.find_packages(exclude=( "tests",
diff --git a/tests/common/pkg_formats/test_python.py b/tests/common/pkg_formats/test_python.py --- a/tests/common/pkg_formats/test_python.py +++ b/tests/common/pkg_formats/test_python.py @@ -398,32 +398,6 @@ def test_metadata(): # Python Distributions # ----------------------------------------------------------------------------- [email protected](datetime.now() < datetime(2019, 1, 1), - reason="This test needs to be refactored for the case of raising a hard " - "error when the anchor_file doesn't exist.", - strict=True) -def test_basepydist_check_path_data(): - test_cases = ( - (('path', 'sha256=1', '45'), ('path', '1', 45), None), - (('path', 'sha256=1', 45), ('path', '1', 45), None), - (('path', '', 45), ('path', None, 45), None), - (('path', None, 45), ('path', None, 45), None), - (('path', 'md5=', 45), (), AssertionError), - ) - - with pytest.warns(MetadataWarning): - dist = PythonDistribution('/path-not-found/', "1.8") - - for args, expected_output, raises_ in test_cases: - if raises_: - with pytest.raises(raises_): - output = dist._check_path_data(*args) - else: - output = dist._check_path_data(*args) - _print_output(output, expected_output) - assert output == expected_output - - def test_basepydist_parse_requires_file_data(): key = 'g' test_cases = ( diff --git a/tests/core/test_path_actions.py b/tests/core/test_path_actions.py --- a/tests/core/test_path_actions.py +++ b/tests/core/test_path_actions.py @@ -3,8 +3,6 @@ from logging import getLogger from os.path import basename, dirname, isdir, isfile, join, lexists, getsize -from shlex import split as shlex_split -from subprocess import check_output import sys from tempfile import gettempdir from unittest import TestCase @@ -14,10 +12,8 @@ from conda._vendor.auxlib.collection import AttrDict from conda._vendor.toolz.itertoolz import groupby -from conda.base.constants import PREFIX_MAGIC_FILE -from conda.base.context import context, reset_context +from conda.base.context import context from conda.common.compat import PY2, on_win -from conda.common.io import env_var from conda.common.path import get_bin_directory_short_path, get_python_noarch_target_path, \ get_python_short_path, get_python_site_packages_short_path, parse_entry_point_def, pyc_path, \ win_path_ok @@ -33,11 +29,6 @@ from conda.models.enums import LinkType, NoarchType, PathType from conda.models.records import PathDataV1 -try: - from unittest.mock import Mock, patch -except ImportError: - from mock import Mock, patch - log = getLogger(__name__) @@ -111,7 +102,6 @@ def test_CompileMultiPycAction_generic(self): def test_CompileMultiPycAction_noarch_python(self): if not softlink_supported(__file__, self.prefix) and on_win: pytest.skip("softlink not supported") - target_python_version = '%d.%d' % sys.version_info[:2] sp_dir = get_python_site_packages_short_path(target_python_version) transaction_context = { diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -702,7 +702,7 @@ def test_conda_downgrade(): 'channel-4::patchelf-0.9-hf484d3e_2', 'channel-4::tk-8.6.7-hc745277_3', 'channel-4::xz-5.2.4-h14c3975_4', - 'channel-4::yaml-0.1.7-h014fa73_2', + 'channel-4::yaml-0.1.7-had09818_2', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::readline-7.0-ha6073c6_4', 'channel-4::sqlite-3.24.0-h84994c4_0', @@ -1181,7 +1181,7 @@ def test_python2_update(): 'channel-4::ncurses-6.1-hf484d3e_0', 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::tk-8.6.7-hc745277_3', - 'channel-4::yaml-0.1.7-h014fa73_2', + 'channel-4::yaml-0.1.7-had09818_2', 'channel-4::zlib-1.2.11-ha838bed_2', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::readline-7.0-ha6073c6_4', @@ -1223,7 +1223,7 @@ def test_python2_update(): 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::tk-8.6.7-hc745277_3', 'channel-4::xz-5.2.4-h14c3975_4', - 'channel-4::yaml-0.1.7-h014fa73_2', + 'channel-4::yaml-0.1.7-had09818_2', 'channel-4::zlib-1.2.11-ha838bed_2', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::readline-7.0-ha6073c6_4', @@ -1794,7 +1794,7 @@ def test_remove_with_constrained_dependencies(): 'channel-4::patchelf-0.9-hf484d3e_2', 'channel-4::tk-8.6.7-hc745277_3', 'channel-4::xz-5.2.4-h14c3975_4', - 'channel-4::yaml-0.1.7-h014fa73_2', + 'channel-4::yaml-0.1.7-had09818_2', 'channel-4::zlib-1.2.11-ha838bed_2', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::readline-7.0-ha6073c6_4', diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -337,6 +337,7 @@ def test_safety_checks(self): with make_temp_env() as prefix: with open(join(prefix, 'condarc'), 'a') as fh: fh.write("safety_checks: enabled\n") + fh.write("extra_safety_checks: true\n") reload_config(prefix) assert context.safety_checks is SafetyChecks.enabled @@ -350,12 +351,7 @@ def test_safety_checks(self): reported size: 32 bytes actual size: 16 bytes """) - message2 = dals(""" - The path 'site-packages/spiffy_test_app/__init__.py' - has a sha256 mismatch. - reported sha256: 1234567890123456789012345678901234567890123456789012345678901234 - actual sha256: 32d822669b582f82da97225f69e3ef01ab8b63094e447a9acca148a6e79afbed - """) + message2 = dals("has a sha256 mismatch.") assert message1 in error_message assert message2 in error_message diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -229,8 +229,6 @@ def test_generate_eq_1(): 'channel-1::distribute-0.6.34-py26_1': 1, 'channel-1::distribute-0.6.34-py27_1': 1, 'channel-1::distribute-0.6.34-py33_1': 1, - 'channel-1::gevent-0.13.7-py26_0': 1, - 'channel-1::gevent-0.13.7-py27_0': 1, 'channel-1::ipython-0.13.1-py26_1': 1, 'channel-1::ipython-0.13.1-py27_1': 1, 'channel-1::ipython-0.13.1-py33_1': 1, @@ -258,34 +256,16 @@ def test_generate_eq_1(): 'channel-1::numpy-1.5.1-py27_3': 3, 'channel-1::numpy-1.6.2-py26_3': 2, 'channel-1::numpy-1.6.2-py26_4': 2, - # 'channel-1::numpy-1.6.2-py26_p4': 2, 'channel-1::numpy-1.6.2-py27_3': 2, 'channel-1::numpy-1.6.2-py27_4': 2, - # 'channel-1::numpy-1.6.2-py27_p4': 2, 'channel-1::numpy-1.7.0-py26_0': 1, 'channel-1::numpy-1.7.0-py27_0': 1, 'channel-1::numpy-1.7.0-py33_0': 1, - 'channel-1::pandas-0.10.0-np16py26_0': 2, - 'channel-1::pandas-0.10.0-np16py27_0': 2, - 'channel-1::pandas-0.10.0-np17py26_0': 2, - 'channel-1::pandas-0.10.0-np17py27_0': 2, 'channel-1::pandas-0.10.1-np16py26_0': 1, 'channel-1::pandas-0.10.1-np16py27_0': 1, 'channel-1::pandas-0.10.1-np17py26_0': 1, 'channel-1::pandas-0.10.1-np17py27_0': 1, 'channel-1::pandas-0.10.1-np17py33_0': 1, - 'channel-1::pandas-0.8.1-np16py26_0': 5, - 'channel-1::pandas-0.8.1-np16py27_0': 5, - 'channel-1::pandas-0.8.1-np17py26_0': 5, - 'channel-1::pandas-0.8.1-np17py27_0': 5, - 'channel-1::pandas-0.9.0-np16py26_0': 4, - 'channel-1::pandas-0.9.0-np16py27_0': 4, - 'channel-1::pandas-0.9.0-np17py26_0': 4, - 'channel-1::pandas-0.9.0-np17py27_0': 4, - 'channel-1::pandas-0.9.1-np16py26_0': 3, - 'channel-1::pandas-0.9.1-np16py27_0': 3, - 'channel-1::pandas-0.9.1-np17py26_0': 3, - 'channel-1::pandas-0.9.1-np17py27_0': 3, 'channel-1::pip-1.2.1-py26_1': 1, 'channel-1::pip-1.2.1-py27_1': 1, 'channel-1::pip-1.2.1-py33_1': 1, @@ -337,7 +317,6 @@ def test_generate_eq_1(): 'channel-1::xlwt-0.7.4-py27_0': 1, } assert eqb == { - 'channel-1::cairo-1.12.2-0': 1, 'channel-1::cubes-0.10.2-py27_0': 1, 'channel-1::dateutil-2.1-py26_0': 1, 'channel-1::dateutil-2.1-py27_0': 1, @@ -346,35 +325,12 @@ def test_generate_eq_1(): 'channel-1::gevent-websocket-0.3.6-py27_1': 1, 'channel-1::gevent_zeromq-0.2.5-py26_1': 1, 'channel-1::gevent_zeromq-0.2.5-py27_1': 1, - 'channel-1::libnetcdf-4.2.1.1-0': 1, - 'channel-1::numexpr-2.0.1-np16py26_1': 2, 'channel-1::numexpr-2.0.1-np16py26_2': 1, - 'channel-1::numexpr-2.0.1-np16py26_ce0': 3, - 'channel-1::numexpr-2.0.1-np16py26_p1': 2, - 'channel-1::numexpr-2.0.1-np16py26_p2': 1, - 'channel-1::numexpr-2.0.1-np16py26_pro0': 3, - 'channel-1::numexpr-2.0.1-np16py27_1': 2, 'channel-1::numexpr-2.0.1-np16py27_2': 1, - 'channel-1::numexpr-2.0.1-np16py27_ce0': 3, - 'channel-1::numexpr-2.0.1-np16py27_p1': 2, - 'channel-1::numexpr-2.0.1-np16py27_p2': 1, - 'channel-1::numexpr-2.0.1-np16py27_pro0': 3, - 'channel-1::numexpr-2.0.1-np17py26_1': 2, 'channel-1::numexpr-2.0.1-np17py26_2': 1, - 'channel-1::numexpr-2.0.1-np17py26_ce0': 3, - 'channel-1::numexpr-2.0.1-np17py26_p1': 2, - 'channel-1::numexpr-2.0.1-np17py26_p2': 1, - 'channel-1::numexpr-2.0.1-np17py26_pro0': 3, - 'channel-1::numexpr-2.0.1-np17py27_1': 2, 'channel-1::numexpr-2.0.1-np17py27_2': 1, - 'channel-1::numexpr-2.0.1-np17py27_ce0': 3, - 'channel-1::numexpr-2.0.1-np17py27_p1': 2, - 'channel-1::numexpr-2.0.1-np17py27_p2': 1, - 'channel-1::numexpr-2.0.1-np17py27_pro0': 3, 'channel-1::numpy-1.6.2-py26_3': 1, 'channel-1::numpy-1.6.2-py27_3': 1, - 'channel-1::py2cairo-1.10.0-py26_0': 1, - 'channel-1::py2cairo-1.10.0-py27_0': 1, 'channel-1::pycurl-7.19.0-py26_0': 1, 'channel-1::pycurl-7.19.0-py27_0': 1, 'channel-1::pysal-1.5.0-np15py27_0': 1, @@ -1025,23 +981,6 @@ def test_no_features(): ] [email protected](datetime.now() < datetime(2019, 1, 1), reason="bogus test; talk with @mcg1969") -def test_multiple_solution(): - assert False -# index2 = index.copy() -# fn = 'pandas-0.11.0-np16py27_1.tar.bz2' -# res1 = set([fn]) -# for k in range(1,15): -# fn2 = Dist('%s_%d.tar.bz2'%(fn[:-8],k)) -# index2[fn2] = index[Dist(add_defaults_if_no_channel(fn))] -# res1.add(fn2) -# index2 = {Dist(key): value for key, value in iteritems(index2)} -# r = Resolve(index2) -# res = r.solve(['pandas', 'python 2.7*', 'numpy 1.6*'], returnall=True) -# res = set([y for y in res if y.name.startswith('pandas')]) -# assert len(res) <= len(res1) - - def test_broken_install(): installed = r.install(['pandas', 'python 2.7*', 'numpy 1.6*']) _installed = [rec.dist_str() for rec in installed]
nomkl tests running on Windows fail Appears some `nomkl` feature tests are being run on Windows and [failing on CI]( https://ci.appveyor.com/project/ContinuumAnalyticsFOSS/conda/builds/20408292/job/q40u301c397wpyji?fullLog=true#L1181 ). IIUC `nomkl` does not exist on Windows. So this is as expected. Should these tests be marked as known fails, skipped, or similar?
2019-01-08T15:10:18Z
[]
[]
conda/conda
8,154
conda__conda-8154
[ "8150" ]
b69054c6de710b8f46abbec2710205395369aec4
diff --git a/conda/core/subdir_data.py b/conda/core/subdir_data.py --- a/conda/core/subdir_data.py +++ b/conda/core/subdir_data.py @@ -448,15 +448,15 @@ def fetch_repodata_remote_request(url, etag, mod_stamp): status_code = getattr(e.response, 'status_code', None) if status_code in (403, 404): if not url.endswith('/noarch'): + log.info("Unable to retrieve repodata (%d error) for %s", status_code, url) + return None + else: if context.allow_non_channel_urls: stderrlog.warning("Unable to retrieve repodata (%d error) for %s", status_code, url) return None else: raise UnavailableInvalidChannel(Channel(dirname(url)), status_code) - else: - log.info("Unable to retrieve repodata (%d error) for %s", status_code, url) - return None elif status_code == 401: channel = Channel(url)
diff --git a/tests/core/test_repodata.py b/tests/core/test_repodata.py --- a/tests/core/test_repodata.py +++ b/tests/core/test_repodata.py @@ -12,7 +12,7 @@ from conda.common.io import env_var from conda.core.index import get_index from conda.core.subdir_data import Response304ContentUnchanged, cache_fn_url, read_mod_and_etag, \ - SubdirData + SubdirData, fetch_repodata_remote_request, UnavailableInvalidChannel from conda.models.channel import Channel try: @@ -163,6 +163,24 @@ def test_cache_fn_url_repo_anaconda_com(self): assert hash4 != hash6 +class FetchLocalRepodataTests(TestCase): + + def test_fetch_repodata_remote_request_invalid_arch(self): + # see https://github.com/conda/conda/issues/8150 + url = 'file:///fake/fake/fake/linux-64' + etag = None + mod_stamp = 'Mon, 28 Jan 2019 01:01:01 GMT' + result = fetch_repodata_remote_request(url, etag, mod_stamp) + assert result is None + + def test_fetch_repodata_remote_request_invalid_noarch(self): + url = 'file:///fake/fake/fake/noarch' + etag = None + mod_stamp = 'Mon, 28 Jan 2019 01:01:01 GMT' + with pytest.raises(UnavailableInvalidChannel): + result = fetch_repodata_remote_request(url, etag, mod_stamp) + + # @pytest.mark.integration # class SubdirDataTests(TestCase): #
Local filesystem channel fails with conda 4.6 ## Current Behavior After updating to conda 4.6.1, using a local channel with for example `conda search -c file:///some/path '*'` fails with an `UnavailableInvalidChannel` error, while it worked as expected with conda 4.5.12. ### Steps to Reproduce ``` $ tree /opt/conda/conda-bld /opt/conda/conda-bld └── noarch    └── mypkg-1.0.0-py_0.tar.bz2 $ conda index /opt/conda/conda-bld $ conda search -c file:///opt/conda/conda-bld '*' UnavailableInvalidChannel: The channel is not accessible or is invalid. channel name: opt/conda/conda-bld channel url: file:///opt/conda/conda-bld error code: 404 You will need to adjust your conda configuration to proceed. Use `conda config --show channels` to view your configuration's current state, and use `conda config --show-sources` to view config file locations. As of conda 4.3, a valid channel must contain a `noarch/repodata.json` and associated `noarch/repodata.json.bz2` file, even if `noarch/repodata.json` is empty. Use `conda index /opt/conda/conda-bld`, or create `noarch/repodata.json` and associated `noarch/repodata.json.bz2`. ``` When switching back to conda 4.5.12 it works as expected: ``` $ conda install -y conda==4.5.12 $ conda search -c file:///opt/conda/conda-bld '*' Loading channels: done # Name Version Build Channel mypkg 1.0.0 py_0 conda-bld ``` ## Expected Behavior The local channel should be used successfully as with conda 4.5.12. ## Environment Information conda: 4.5.12 conda-build: 3.17.8 python: 3.7.1
Thanks for reporting. conda-build 3.17.8 was built with 4.6.1 (https://ci.appveyor.com/project/conda-forge/conda-build-feedstock/builds/21915370), so I don't think it's 4.6.1 itself. Probably something subtle went wrong with conda-build 3.17.8 in its interaction with conda. I see the same issues on my windows machines when using conda 4.6 but also for channels which are not related to the local conda-bld channel. In my case these are channels on network shares. I'm getting this error for local channels accessed through HTTP. Exact same error message. Downgrading to 4.5.12 fixes this issue. It appears as if conda 4.6.1 is expecting the presence of a `repodata.json` file in both the noarch directory and the directory of the current platform (for example linux-64). Conda 4.5.12 only required the noarch repodata.json file to exist. I'll prepare a patch to restore the previous behavior. Until then creating an empty linux-64/win-64/osx-64 directory in the conda-bld directory and then running `conda index` will create the necessary files. Good find, thanks @jjhelmus
2019-01-28T19:00:04Z
[]
[]
conda/conda
8,160
conda__conda-8160
[ "8080" ]
37ebed39eb6d11e125664a8647f09c938f778468
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -745,8 +745,8 @@ def category_map(self): )), ('Hidden and Undocumented', ( 'allow_cycles', # allow cyclical dependencies, or raise - 'add_pip_as_python_dependency', 'allow_conda_downgrades', + 'add_pip_as_python_dependency', 'debug', 'default_python', 'enable_private_envs', diff --git a/conda/history.py b/conda/history.py --- a/conda/history.py +++ b/conda/history.py @@ -23,7 +23,7 @@ from .common.compat import ensure_text_type, iteritems, open, text_type from .common.path import paths_equal from .core.prefix_data import PrefixData -from .exceptions import CondaHistoryError, CondaUpgradeError, NotWritableError +from .exceptions import CondaHistoryError, NotWritableError from .gateways.disk.update import touch from .models.dist import dist_str_to_quad from .models.version import VersionOrder, version_relation_re @@ -255,7 +255,15 @@ def get_user_requests(self): "base_prefix": context.root_prefix, "minimum_version": minimum_major_minor, } - raise CondaUpgradeError(message) + message += dedent(""" + To work around this restriction, one can also set the config parameter + 'allow_conda_downgrades' to False at their own risk. + """) + + # we need to rethink this. It's fine as a warning to try to get users + # to avoid breaking their system. However, right now it is preventing + # normal conda operation after downgrading conda. + # raise CondaUpgradeError(message) return res
diff --git a/tests/test_history.py b/tests/test_history.py --- a/tests/test_history.py +++ b/tests/test_history.py @@ -185,23 +185,24 @@ def test_specs_line_parsing_43(self): } -def test_minimum_conda_version_error(): - with tempdir() as prefix: - assert not isfile(join(prefix, 'conda-meta', 'history')) - mkdir_p(join(prefix, 'conda-meta')) - copy2(join(dirname(__file__), 'conda-meta', 'history'), - join(prefix, 'conda-meta', 'history')) - - with open(join(prefix, 'conda-meta', 'history'), 'a') as fh: - fh.write("==> 2018-07-09 11:18:09 <==\n") - fh.write("# cmd: blarg\n") - fh.write("# conda version: 42.42.4242\n") - - h = History(prefix) - - with pytest.raises(CondaUpgradeError) as exc: - h.get_user_requests() - exception_string = repr(exc.value) - print(exception_string) - assert "minimum conda version: 42.42" in exception_string - assert "$ conda install -p" in exception_string \ No newline at end of file +# behavior disabled as part of https://github.com/conda/conda/pull/8160 +# def test_minimum_conda_version_error(): +# with tempdir() as prefix: +# assert not isfile(join(prefix, 'conda-meta', 'history')) +# mkdir_p(join(prefix, 'conda-meta')) +# copy2(join(dirname(__file__), 'conda-meta', 'history'), +# join(prefix, 'conda-meta', 'history')) + +# with open(join(prefix, 'conda-meta', 'history'), 'a') as fh: +# fh.write("==> 2018-07-09 11:18:09 <==\n") +# fh.write("# cmd: blarg\n") +# fh.write("# conda version: 42.42.4242\n") + +# h = History(prefix) + +# with pytest.raises(CondaUpgradeError) as exc: +# h.get_user_requests() +# exception_string = repr(exc.value) +# print(exception_string) +# assert "minimum conda version: 42.42" in exception_string +# assert "$ conda install -p" in exception_string
conda-4.5.12 does not work after downgrading from conda-4.6rc1 after conda update -c conda-canary conda and later (because conda-4.6rc1 kept wanting to upgrade to python-3.7) conda install conda=4.5 python=3.6 conda-4.5.12 now refuses to work ``` (base) $ conda install -c conda-forge conda=4.6 Solving environment: failed CondaUpgradeError: This environment has previously been operated on by a conda version that's newer than the conda currently being used. A newer version of conda is required. target environment location: /home/dm/anaconda3 current conda version: 4.5.12 minimum conda version: 4.6 (base) $ conda update -c conda-forge conda Solving environment: failed CondaUpgradeError: This environment has previously been operated on by a conda version that's newer than the conda currently being used. A newer version of conda is required. target environment location: /home/dm/anaconda3 current conda version: 4.5.12 minimum conda version: 4.6 ```
2019-01-29T17:21:31Z
[]
[]
conda/conda
8,163
conda__conda-8163
[ "8157" ]
8c06cd39221581dfbfa7aded871c22456874de8a
diff --git a/conda/cli/common.py b/conda/cli/common.py --- a/conda/cli/common.py +++ b/conda/cli/common.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import, division, print_function, unicode_literals +from logging import getLogger from os.path import basename, dirname import re import sys @@ -161,7 +162,7 @@ def disp_features(features): @swallow_broken_pipe def stdout_json(d): - print(json_dump(d)) + getLogger("conda.stdout").info(json_dump(d)) def stdout_json_success(success=True, **kwargs): diff --git a/conda/cli/main_config.py b/conda/cli/main_config.py --- a/conda/cli/main_config.py +++ b/conda/cli/main_config.py @@ -5,6 +5,7 @@ from collections import OrderedDict import json +from logging import getLogger import os from os.path import isfile, join import sys @@ -16,7 +17,8 @@ from ..base.constants import (ChannelPriority, DepsModifier, PathConflict, SafetyChecks, UpdateModifier) from ..base.context import context, sys_rc_path, user_rc_path -from ..common.compat import Mapping, Sequence, isiterable, iteritems, itervalues, string_types +from ..common.compat import (Mapping, Sequence, isiterable, iteritems, itervalues, string_types, + text_type) from ..common.configuration import pretty_list, pretty_map from ..common.io import timeout from ..common.serialize import yaml, yaml_dump, yaml_load @@ -98,21 +100,23 @@ def describe_all_parameters(): def execute_config(args, parser): - + stdout_write = getLogger("conda.stdout").info + stderr_write = getLogger("conda.stderr").info json_warnings = [] json_get = {} if args.show_sources: if context.json: - print(json.dumps(context.collect_all(), sort_keys=True, - indent=2, separators=(',', ': '))) + stdout_write( + json.dumps(context.collect_all(), sort_keys=True, indent=2, separators=(',', ': ')) + ) else: lines = [] for source, reprs in iteritems(context.collect_all()): lines.append("==> %s <==" % source) lines.extend(format_dict(reprs)) lines.append('') - print('\n'.join(lines)) + stdout_write('\n'.join(lines)) return if args.show is not None: @@ -129,8 +133,9 @@ def execute_config(args, parser): d = OrderedDict((key, getattr(context, key)) for key in paramater_names) if context.json: - print(json.dumps(d, sort_keys=True, indent=2, separators=(',', ': '), - cls=EntityEncoder)) + stdout_write(json.dumps( + d, sort_keys=True, indent=2, separators=(',', ': '), cls=EntityEncoder + )) else: # Add in custom formatting if 'custom_channels' in d: @@ -145,7 +150,7 @@ def execute_config(args, parser): for multichannel_name, channels in iteritems(d['custom_multichannels']) } - print('\n'.join(format_dict(d))) + stdout_write('\n'.join(format_dict(d))) context.validate_configuration() return @@ -159,14 +164,15 @@ def execute_config(args, parser): from ..common.io import dashlist raise ArgumentError("Invalid configuration parameters: %s" % dashlist(not_params)) if context.json: - print(json.dumps([context.describe_parameter(name) for name in paramater_names], - sort_keys=True, indent=2, separators=(',', ': '), - cls=EntityEncoder)) + stdout_write(json.dumps( + [context.describe_parameter(name) for name in paramater_names], + sort_keys=True, indent=2, separators=(',', ': '), cls=EntityEncoder + )) else: builder = [] builder.extend(concat(parameter_description_builder(name) for name in paramater_names)) - print('\n'.join(builder)) + stdout_write('\n'.join(builder)) else: if context.json: skip_categories = ('CLI-only', 'Hidden and Undocumented') @@ -174,11 +180,12 @@ def execute_config(args, parser): parameter_names for category, parameter_names in context.category_map.items() if category not in skip_categories )) - print(json.dumps([context.describe_parameter(name) for name in paramater_names], - sort_keys=True, indent=2, separators=(',', ': '), - cls=EntityEncoder)) + stdout_write(json.dumps( + [context.describe_parameter(name) for name in paramater_names], + sort_keys=True, indent=2, separators=(',', ': '), cls=EntityEncoder + )) else: - print(describe_all_parameters()) + stdout_write(describe_all_parameters()) return if args.validate: @@ -234,7 +241,7 @@ def execute_config(args, parser): if key not in primitive_parameters + sequence_parameters: message = "unknown key %s" % key if not context.json: - print(message, file=sys.stderr) + stderr_write(message) else: json_warnings.append(message) continue @@ -246,7 +253,7 @@ def execute_config(args, parser): continue if isinstance(rc_config[key], (bool, string_types)): - print("--set", key, rc_config[key]) + stdout_write(" ".join(("--set", key, text_type(rc_config[key])))) else: # assume the key is a list-type # Note, since conda config --add prepends, these are printed in # the reverse order so that entering them in this order will @@ -256,10 +263,12 @@ def execute_config(args, parser): for q, item in enumerate(reversed(items)): # Use repr so that it can be pasted back in to conda config --add if key == "channels" and q in (0, numitems-1): - print("--add", key, repr(item), - " # lowest priority" if q == 0 else " # highest priority") + stdout_write(" ".join(( + "--add", key, repr(item), + " # lowest priority" if q == 0 else " # highest priority" + ))) else: - print("--add", key, repr(item)) + stdout_write(" ".join(("--add", key, repr(item)))) if args.stdin: content = timeout(5, sys.stdin.read) @@ -292,7 +301,7 @@ def execute_config(args, parser): item, key, "top" if prepend else "bottom") arglist = rc_config[key] = [p for p in arglist if p != item] if not context.json: - print(message, file=sys.stderr) + stderr_write(message) else: json_warnings.append(message) arglist.insert(0 if prepend else len(arglist), item) diff --git a/conda/cli/main_info.py b/conda/cli/main_info.py --- a/conda/cli/main_info.py +++ b/conda/cli/main_info.py @@ -304,7 +304,9 @@ def execute(args, parser): info_dict = get_info_dict(args.system) if (args.all or all(not getattr(args, opt) for opt in options)) and not context.json: - print(get_main_info_str(info_dict)) + stdout_logger = getLogger("conda.stdoutlog") + stdout_logger.info(get_main_info_str(info_dict)) + stdout_logger.info("\n") if args.envs: from ..core.envs_manager import list_all_known_prefixes diff --git a/conda/core/path_actions.py b/conda/core/path_actions.py --- a/conda/core/path_actions.py +++ b/conda/core/path_actions.py @@ -137,6 +137,10 @@ def __init__(self, transaction_context, target_prefix, target_short_path): self.target_prefix = target_prefix self.target_short_path = target_short_path + @property + def target_short_paths(self): + return (self.target_short_path,) + @property def target_full_path(self): trgt, shrt_pth = self.target_prefix, self.target_short_path diff --git a/conda/exceptions.py b/conda/exceptions.py --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -5,6 +5,7 @@ from datetime import timedelta from errno import ENOSPC +from functools import partial import json from logging import getLogger import os @@ -1003,10 +1004,14 @@ def __call__(self, func, *args, **kwargs): _, exc_val, exc_tb = sys.exc_info() return self.handle_exception(exc_val, exc_tb) - @property - def out_stream(self): + def write_out(self, content_str): from .base.context import context - return sys.stdout if context.json else sys.stderr + if True: + logger = getLogger("conda.%s" % ("stdout" if context.json else "stderr")) + logger.info(content_str) + else: + stream = sys.stdout if context.json else sys.stderr + stream.write(content_str) @property def http_timeout(self): @@ -1136,7 +1141,7 @@ def print_unexpected_error_report(self, error_report): "An unexpected error has occurred. Conda has prepared the above report." ) message_builder.append('') - self.out_stream.write('\n'.join(message_builder)) + self.write_out('\n'.join(message_builder)) def print_expected_error_report(self, error_report): from .base.context import context @@ -1171,7 +1176,7 @@ def print_expected_error_report(self, error_report): "A reportable application error has occurred. Conda has prepared the above report." ) message_builder.append('') - self.out_stream.write('\n'.join(message_builder)) + self.write_out('\n'.join(message_builder)) def _calculate_ask_do_upload(self): from .base.context import context @@ -1202,18 +1207,14 @@ def _calculate_ask_do_upload(self): return ask_for_upload, do_upload def ask_for_upload(self): - message_builder = [ - "If submitted, this report will be used by core maintainers to improve", - "future releases of conda.", - "Would you like conda to send this report to the core maintainers?", - ] - message_builder.append( - "[y/N]: " - ) - self.out_stream.write('\n'.join(message_builder)) + self.write_out(dals(""" + If submitted, this report will be used by core maintainers to improve + future releases of conda. + Would you like conda to send this report to the core maintainers? + """)) ask_response = None try: - ask_response = timeout(40, input) + ask_response = timeout(40, partial(input, "[y/N]: ")) do_upload = ask_response and boolify(ask_response) except Exception as e: # pragma: no cover log.debug('%r', e) @@ -1250,18 +1251,17 @@ def _execute_upload(self, error_report): log.info('%r', e) try: if response and response.ok: - self.out_stream.write("Upload successful.\n") + self.write_out("Upload successful.") else: - self.out_stream.write("Upload did not complete.") + self.write_out("Upload did not complete.") if response and response.status_code: - self.out_stream.write(" HTTP %s" % response.status_code) - self.out_stream.write("\n") + self.write_out(" HTTP %s" % response.status_code) except Exception as e: log.debug("%r" % e) def print_upload_confirm(self, do_upload, ask_for_upload, ask_response): if ask_response and do_upload: - self.out_stream.write( + self.write_out( "\n" "Thank you for helping to improve conda.\n" "Opt-in to always sending reports (and not see this message again)\n" @@ -1270,19 +1270,19 @@ def print_upload_confirm(self, do_upload, ask_for_upload, ask_response): " $ conda config --set report_errors true\n" "\n" ) + elif ask_response is None and ask_for_upload: + # means timeout was reached for `input` + self.write_out( # lgtm [py/unreachable-statement] + '\nTimeout reached. No report sent.\n' + ) elif ask_for_upload: - self.out_stream.write( + self.write_out( "\n" "No report sent. To permanently opt-out, use\n" "\n" " $ conda config --set report_errors false\n" "\n" ) - elif ask_response is None and ask_for_upload: - # means timeout was reached for `input` - self.out_stream.write( # lgtm [py/unreachable-statement] - '\nTimeout reached. No report sent.\n' - ) def conda_exception_handler(func, *args, **kwargs): diff --git a/conda/gateways/logging.py b/conda/gateways/logging.py --- a/conda/gateways/logging.py +++ b/conda/gateways/logging.py @@ -85,7 +85,6 @@ def initialize_logging(): initialize_std_loggers() -@memoize def initialize_std_loggers(): # Set up special loggers 'conda.stdout'/'conda.stderr' which output directly to the # corresponding sys streams, filter token urls and don't propagate. @@ -93,6 +92,7 @@ def initialize_std_loggers(): for stream in ('stdout', 'stderr'): logger = getLogger('conda.%s' % stream) + logger.handlers = [] logger.setLevel(INFO) handler = StdStreamHandler(stream) handler.setLevel(INFO) @@ -102,6 +102,7 @@ def initialize_std_loggers(): logger.propagate = False stdlog_logger = getLogger('conda.%slog' % stream) + stdlog_logger.handlers = [] stdlog_logger.setLevel(DEBUG) stdlog_handler = StdStreamHandler(stream) stdlog_handler.terminator = '' @@ -111,6 +112,7 @@ def initialize_std_loggers(): stdlog_logger.propagate = False verbose_logger = getLogger('conda.stdout.verbose') + verbose_logger.handlers = [] verbose_logger.setLevel(INFO) verbose_handler = StdStreamHandler('stdout') verbose_handler.setLevel(INFO)
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -1691,7 +1691,7 @@ def test_bad_anaconda_token_infinite_loop(self): run_command(Commands.CONFIG, prefix, "--add channels %s" % channel_url) stdout, stderr = run_command(Commands.CONFIG, prefix, "--show") yml_obj = yaml_load(stdout) - assert yml_obj['channels'] == [channel_url, 'defaults'] + assert yml_obj['channels'] == [channel_url.replace('cqgccfm1mfma', '<TOKEN>'), 'defaults'] with pytest.raises(PackagesNotFoundError): run_command(Commands.SEARCH, prefix, "boltons", "--json") @@ -1742,7 +1742,8 @@ def test_anaconda_token_with_private_package(self): run_command(Commands.CONFIG, prefix, "--remove channels defaults") stdout, stderr = run_command(Commands.CONFIG, prefix, "--show") yml_obj = yaml_load(stdout) - assert yml_obj['channels'] == [channel_url] + + assert yml_obj['channels'] == ["https://conda.anaconda.org/t/<TOKEN>/kalefranz"] stdout, stderr = run_command(Commands.SEARCH, prefix, "anyjson", "--platform", "linux-64", "--json")
CondaHTTPError leaks channel tokens ## Current Behavior If the channel repo timeout occurs (or something else), the following gets outputted (potentially to a log that can be scraped) ``` CondaHTTPError: HTTP 504 GATEWAY_TIMEOUT for url <https://conda.anaconda.org/t/this-is-a-token/org/noarch/pkg-name.tar.bz2> ``` ## Expected Behavior if `conda info` hides the token, the token should be hidden in the error as well. ## Environment Information ``` active environment : base active env location : /opt/conda shell level : 1 user config file : /root/.condarc populated config files : /root/.condarc conda version : 4.5.12 conda-build version : not installed python version : 3.7.1.final.0 base environment : /opt/conda (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/pro/linux-64 https://repo.anaconda.com/pkgs/pro/noarch https://conda.anaconda.org/t/<TOKEN>/org/linux-64 https://conda.anaconda.org/t/<TOKEN>/org/noarch package cache : /opt/conda/pkgs /root/.conda/pkgs envs directories : /opt/conda/envs /root/.conda/envs platform : linux-64 user-agent : conda/4.5.12 requests/2.21.0 CPython/3.7.1 Linux/4.4.0-93-generic debian/9 glibc/2.24 UID:GID : 0:0 netrc file : None offline mode : False ```
Another scenario where the token can be leaked is when the channel already exists and `conda config --append` warns that it will be moved. Thanks for alerting us to this. We'll add the filtering to our exception handlers to clean this up.
2019-01-29T21:06:20Z
[]
[]
conda/conda
8,165
conda__conda-8165
[ "8136" ]
41476d921d30bac16f4692a6281c1194721ebf6f
diff --git a/conda/history.py b/conda/history.py --- a/conda/history.py +++ b/conda/history.py @@ -260,7 +260,7 @@ def get_user_requests(self): 'allow_conda_downgrades' to False at their own risk. """) - # we need to rethink this. It's fine as a warning to try to get users + # TODO: we need to rethink this. It's fine as a warning to try to get users # to avoid breaking their system. However, right now it is preventing # normal conda operation after downgrading conda. # raise CondaUpgradeError(message) diff --git a/conda_env/cli/main_update.py b/conda_env/cli/main_update.py --- a/conda_env/cli/main_update.py +++ b/conda_env/cli/main_update.py @@ -107,7 +107,7 @@ def execute(args, parser): for installer_type in env.dependencies: try: installers[installer_type] = get_installer(installer_type) - except InvalidInstaller as e: + except InvalidInstaller: sys.stderr.write(textwrap.dedent(""" Unable to install package for {0}. diff --git a/conda_env/env.py b/conda_env/env.py --- a/conda_env/env.py +++ b/conda_env/env.py @@ -78,7 +78,9 @@ def from_environment(name, prefix, no_builds=False, ignore_channels=False): Returns: Environment object """ # requested_specs_map = History(prefix).get_requested_specs_map() - precs = tuple(PrefixGraph(PrefixData(prefix).iter_records()).graph) + pd = PrefixData(prefix, pip_interop_enabled=True) + + precs = tuple(PrefixGraph(pd.iter_records()).graph) grouped_precs = groupby(lambda x: x.package_type, precs) conda_precs = sorted(concatv( grouped_precs.get(None, ()),
diff --git a/tests/conda_env/support/pip_argh.yml b/tests/conda_env/support/pip_argh.yml new file mode 100644 --- /dev/null +++ b/tests/conda_env/support/pip_argh.yml @@ -0,0 +1,6 @@ +name: pip_argh + +dependencies: + - pip + - pip: + - argh==0.26.2 diff --git a/tests/conda_env/test_create.py b/tests/conda_env/test_create.py --- a/tests/conda_env/test_create.py +++ b/tests/conda_env/test_create.py @@ -1,13 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function -from argparse import ArgumentParser -from contextlib import contextmanager from logging import Handler, getLogger from os.path import exists, join -from shlex import split -from shutil import rmtree -from tempfile import mkdtemp from unittest import TestCase from uuid import uuid4 @@ -19,18 +14,12 @@ from conda.install import on_win from conda.models.enums import PackageType from conda.models.match_spec import MatchSpec -from conda_env.cli.main import do_call as do_call_conda_env -from conda_env.cli.main_create import configure_parser as create_configure_parser -from conda_env.cli.main_update import configure_parser as update_configure_parser from . import support_file +from .utils import make_temp_envs_dir, Commands, run_command PYTHON_BINARY = 'python.exe' if on_win else 'bin/python' -def escape_for_winpath(p): - return p.replace('\\', '\\\\') - - def disable_dotlog(): class NullHandler(Handler): def emit(self, record): @@ -47,38 +36,6 @@ def reenable_dotlog(handlers): dotlogger.handlers = handlers -class Commands: - CREATE = "create" - UPDATE = "update" - - -parser_config = { - Commands.CREATE: create_configure_parser, - Commands.UPDATE: update_configure_parser, -} - - -def run_command(command, env_name, *arguments): - p = ArgumentParser() - sub_parsers = p.add_subparsers(metavar='command', dest='cmd') - parser_config[command](sub_parsers) - - arguments = list(map(escape_for_winpath, arguments)) - command_line = "{0} -n {1} -f {2}".format(command, env_name, " ".join(arguments)) - - args = p.parse_args(split(command_line)) - do_call_conda_env(args, p) - - -@contextmanager -def make_temp_envs_dir(): - envs_dir = mkdtemp() - try: - yield envs_dir - finally: - rmtree(envs_dir, ignore_errors=True) - - def package_is_installed(prefix, spec, pip=None): spec = MatchSpec(spec) prefix_recs = tuple(PrefixData(prefix).query(spec)) diff --git a/tests/conda_env/test_env.py b/tests/conda_env/test_env.py --- a/tests/conda_env/test_env.py +++ b/tests/conda_env/test_env.py @@ -1,9 +1,21 @@ from collections import OrderedDict import os +from os.path import join import random import unittest +from uuid import uuid4 +from conda.core.prefix_data import PrefixData +from conda.base.context import reset_context +from conda.common.io import env_vars from conda.common.serialize import yaml_load +from conda.install import on_win +import ruamel_yaml + +from . import support_file +from .utils import make_temp_envs_dir, Commands, run_command + +PYTHON_BINARY = 'python.exe' if on_win else 'bin/python' try: @@ -14,8 +26,6 @@ from conda_env import env from conda_env import exceptions -from . import support_file - class FakeStream(object): def __init__(self): @@ -340,3 +350,31 @@ def _test_saves_yaml_representation_of_file(self): self.assert_(len(actual) > 0, msg='sanity check') self.assertEqual(e.to_yaml(), actual) + + +class SaveExistingEnvTestCase(unittest.TestCase): + def test_create_advanced_pip(self): + with make_temp_envs_dir() as envs_dir: + with env_vars({ + 'CONDA_ENVS_DIRS': envs_dir, + 'CONDA_PIP_INTEROP_ENABLED': 'true', + }, reset_context): + env_name = str(uuid4())[:8] + prefix = join(envs_dir, env_name) + python_path = join(prefix, PYTHON_BINARY) + + run_command(Commands.CREATE, env_name, + support_file('pip_argh.yml')) + out_file = join(envs_dir, 'test_env.yaml') + + # make sure that the export reconsiders the presence of pip interop being enabled + PrefixData._cache_.clear() + + with env_vars({ + 'CONDA_ENVS_DIRS': envs_dir, + }, reset_context): + # note: out of scope of pip interop var. Should be enabling conda pip interop itself. + run_command(Commands.EXPORT, env_name, out_file) + with open(out_file) as f: + d = ruamel_yaml.load(f) + assert {'pip': ['argh==0.26.2']} in d['dependencies'] diff --git a/tests/conda_env/utils.py b/tests/conda_env/utils.py new file mode 100644 --- /dev/null +++ b/tests/conda_env/utils.py @@ -0,0 +1,49 @@ +from argparse import ArgumentParser +from contextlib import contextmanager +from tempfile import mkdtemp +from shlex import split + +from conda.gateways.disk.delete import rm_rf + +from conda_env.cli.main import do_call as do_call_conda_env +from conda_env.cli.main_create import configure_parser as create_configure_parser +from conda_env.cli.main_update import configure_parser as update_configure_parser +from conda_env.cli.main_export import configure_parser as export_configure_parser + + +class Commands: + CREATE = "create" + UPDATE = "update" + EXPORT = "export" + + +parser_config = { + Commands.CREATE: create_configure_parser, + Commands.UPDATE: update_configure_parser, + Commands.EXPORT: export_configure_parser, +} + + +def escape_for_winpath(p): + return p.replace('\\', '\\\\') + + +@contextmanager +def make_temp_envs_dir(): + envs_dir = mkdtemp() + try: + yield envs_dir + finally: + rm_rf(envs_dir) + + +def run_command(command, env_name, *arguments): + p = ArgumentParser() + sub_parsers = p.add_subparsers(metavar='command', dest='cmd') + parser_config[command](sub_parsers) + + arguments = list(map(escape_for_winpath, arguments)) + command_line = "{0} -n {1} -f {2}".format(command, env_name, " ".join(arguments)) + + args = p.parse_args(split(command_line)) + do_call_conda_env(args, p)
conda env export omits pip packages (again) <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> conda env export omits pip install'ed packages. I can see this has come up before. This time it's on conda 4.6.0. I tried changing the pip version to 10.*, 18.1, 18.0, but this did not fix the issue. Even when exporting with the -vv flag there are no informative outputs printed to the log. The failure to include pip appears to be completely silent. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> I test using conda-forge and and the base channels. First conda-forge: ``` (base) 09:36:54 login27:~/python/neuroconda$ conda create -n test-forge -c conda-forge python=3.6 Collecting package metadata: done Solving environment: done ## Package Plan ## environment location: /imaging/local/software/centos7/anaconda3/envs/test-forge added / updated specs: - python=3.6 The following NEW packages will be INSTALLED: ca-certificates conda-forge/linux-64::ca-certificates-2018.11.29-ha4d7672_0 certifi conda-forge/linux-64::certifi-2018.11.29-py36_1000 libffi conda-forge/linux-64::libffi-3.2.1-hf484d3e_1005 libgcc-ng conda-forge/linux-64::libgcc-ng-7.3.0-hdf63c60_0 libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-7.3.0-hdf63c60_0 ncurses conda-forge/linux-64::ncurses-6.1-hf484d3e_1002 openssl conda-forge/linux-64::openssl-1.0.2p-h14c3975_1002 pip conda-forge/linux-64::pip-18.1-py36_1000 python conda-forge/linux-64::python-3.6.7-hd21baee_1001 readline conda-forge/linux-64::readline-7.0-hf8c457e_1001 setuptools conda-forge/linux-64::setuptools-40.6.3-py36_0 sqlite conda-forge/linux-64::sqlite-3.26.0-h67949de_1000 tk conda-forge/linux-64::tk-8.6.9-h84994c4_1000 wheel conda-forge/linux-64::wheel-0.32.3-py36_0 xz conda-forge/linux-64::xz-5.2.4-h14c3975_1001 zlib conda-forge/linux-64::zlib-1.2.11-h14c3975_1004 Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate test-forge # # To deactivate an active environment, use # # $ conda deactivate (base) 09:37:38 login27:~/python/neuroconda$ conda activate test-forge (test-forge) 09:38:20 login27:~/python/neuroconda$ pip install --no-deps pybids Collecting pybids Installing collected packages: pybids Successfully installed pybids-0.7.0 (test-forge) 09:38:50 login27:~/python/neuroconda$ conda env export -f test.yml (test-forge) 09:39:22 login27:~/python/neuroconda$ cat test.yml name: test-forge channels: - conda-forge - defaults - r dependencies: - ca-certificates=2018.11.29=ha4d7672_0 - certifi=2018.11.29=py36_1000 - libffi=3.2.1=hf484d3e_1005 - libgcc-ng=7.3.0=hdf63c60_0 - libstdcxx-ng=7.3.0=hdf63c60_0 - ncurses=6.1=hf484d3e_1002 - openssl=1.0.2p=h14c3975_1002 - pip=18.1=py36_1000 - python=3.6.7=hd21baee_1001 - readline=7.0=hf8c457e_1001 - setuptools=40.6.3=py36_0 - sqlite=3.26.0=h67949de_1000 - tk=8.6.9=h84994c4_1000 - wheel=0.32.3=py36_0 - xz=5.2.4=h14c3975_1001 - zlib=1.2.11=h14c3975_1004 prefix: /imaging/local/software/centos7/anaconda3/envs/test-forge (test-forge) 09:46:10 login27:~/python/neuroconda$ conda list pybids # packages in environment at /imaging/local/software/centos7/anaconda3/envs/test-forge: # # Name Version Build Channel pybids 0.7.0 pypi_0 pypi ``` Then base: ``` (base) 09:49:44 login27:~/python/neuroconda$ conda create -n test-base -c base python=3.6 Collecting package metadata: done Solving environment: done ## Package Plan ## environment location: /imaging/local/software/centos7/anaconda3/envs/test-base added / updated specs: - python=3.6 The following packages will be downloaded: package | build ---------------------------|----------------- ca-certificates-2018.12.5 | 0 123 KB certifi-2018.11.29 | py36_0 146 KB libedit-3.1.20181209 | hc058e9b_0 188 KB ncurses-6.1 | he6710b0_1 958 KB openssl-1.1.1a | h7b6447c_0 5.0 MB pip-18.1 | py36_0 1.8 MB python-3.6.8 | h0371630_0 34.4 MB readline-7.0 | h7b6447c_5 392 KB setuptools-40.6.3 | py36_0 625 KB sqlite-3.26.0 | h7b6447c_0 1.9 MB tk-8.6.8 | hbc83047_0 3.1 MB wheel-0.32.3 | py36_0 35 KB zlib-1.2.11 | h7b6447c_3 120 KB ------------------------------------------------------------ Total: 48.8 MB The following NEW packages will be INSTALLED: ca-certificates pkgs/main/linux-64::ca-certificates-2018.12.5-0 certifi pkgs/main/linux-64::certifi-2018.11.29-py36_0 libedit pkgs/main/linux-64::libedit-3.1.20181209-hc058e9b_0 libffi pkgs/main/linux-64::libffi-3.2.1-hd88cf55_4 libgcc-ng pkgs/main/linux-64::libgcc-ng-8.2.0-hdf63c60_1 libstdcxx-ng pkgs/main/linux-64::libstdcxx-ng-8.2.0-hdf63c60_1 ncurses pkgs/main/linux-64::ncurses-6.1-he6710b0_1 openssl pkgs/main/linux-64::openssl-1.1.1a-h7b6447c_0 pip pkgs/main/linux-64::pip-18.1-py36_0 python pkgs/main/linux-64::python-3.6.8-h0371630_0 readline pkgs/main/linux-64::readline-7.0-h7b6447c_5 setuptools pkgs/main/linux-64::setuptools-40.6.3-py36_0 sqlite pkgs/main/linux-64::sqlite-3.26.0-h7b6447c_0 tk pkgs/main/linux-64::tk-8.6.8-hbc83047_0 wheel pkgs/main/linux-64::wheel-0.32.3-py36_0 xz pkgs/main/linux-64::xz-5.2.4-h14c3975_4 zlib pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3 Proceed ([y]/n)? y Downloading and Extracting Packages openssl-1.1.1a | 5.0 MB | ######################################################################################################################################################################## | 100% zlib-1.2.11 | 120 KB | ######################################################################################################################################################################## | 100% certifi-2018.11.29 | 146 KB | ######################################################################################################################################################################## | 100% setuptools-40.6.3 | 625 KB | ######################################################################################################################################################################## | 100% ca-certificates-2018 | 123 KB | ######################################################################################################################################################################## | 100% libedit-3.1.20181209 | 188 KB | ######################################################################################################################################################################## | 100% sqlite-3.26.0 | 1.9 MB | ######################################################################################################################################################################## | 100% ncurses-6.1 | 958 KB | ######################################################################################################################################################################## | 100% tk-8.6.8 | 3.1 MB | ######################################################################################################################################################################## | 100% python-3.6.8 | 34.4 MB | ######################################################################################################################################################################## | 100% readline-7.0 | 392 KB | ######################################################################################################################################################################## | 100% wheel-0.32.3 | 35 KB | ######################################################################################################################################################################## | 100% pip-18.1 | 1.8 MB | ######################################################################################################################################################################## | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate test-base # # To deactivate an active environment, use # # $ conda deactivate (base) 09:50:45 login27:~/python/neuroconda$ conda activate test-base (test-base) 09:51:13 login27:~/python/neuroconda$ pip install --no-deps pybids Collecting pybids Installing collected packages: pybids Successfully installed pybids-0.7.0 (test-base) 09:51:32 login27:~/python/neuroconda$ conda env export -f test.yml (test-base) 09:51:57 login27:~/python/neuroconda$ cat test.yml name: test-base channels: - defaults - conda-forge - r dependencies: - ca-certificates=2018.12.5=0 - certifi=2018.11.29=py36_0 - libedit=3.1.20181209=hc058e9b_0 - libffi=3.2.1=hd88cf55_4 - libgcc-ng=8.2.0=hdf63c60_1 - libstdcxx-ng=8.2.0=hdf63c60_1 - ncurses=6.1=he6710b0_1 - openssl=1.1.1a=h7b6447c_0 - pip=18.1=py36_0 - python=3.6.8=h0371630_0 - readline=7.0=h7b6447c_5 - setuptools=40.6.3=py36_0 - sqlite=3.26.0=h7b6447c_0 - tk=8.6.8=hbc83047_0 - wheel=0.32.3=py36_0 - xz=5.2.4=h14c3975_4 - zlib=1.2.11=h7b6447c_3 prefix: /imaging/local/software/centos7/anaconda3/envs/test-base (test-base) 09:52:00 login27:~/python/neuroconda$ conda list pybids # packages in environment at /imaging/local/software/centos7/anaconda3/envs/test-base: # # Name Version Build Channel pybids 0.7.0 pypi_0 pypi ``` ## Expected Behavior <!-- What do you think should happen? --> pip installed packages should appear in '-pip:' sub category. If this functionality is broken for whatever reason conda should complain loudly about this when exporting. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` (test-base) 09:54:19 login27:~/python/neuroconda$ conda info active environment : test-base active env location : /imaging/local/software/centos7/anaconda3/envs/test-base shell level : 3 user config file : /home/jc01/.condarc populated config files : /home/jc01/.condarc conda version : 4.6.0 conda-build version : 3.10.5 python version : 3.6.5.final.0 base environment : /imaging/local/software/centos7/anaconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://conda.anaconda.org/r/linux-64 https://conda.anaconda.org/r/noarch package cache : /imaging/local/software/centos7/anaconda3/pkgs /home/jc01/.conda/pkgs envs directories : /imaging/local/software/centos7/anaconda3/envs /home/jc01/.conda/envs platform : linux-64 user-agent : conda/4.6.0 requests/2.18.4 CPython/3.6.5 Linux/3.10.0-862.el7.x86_64 centos/7.5.1804 glibc/2.17 UID:GID : 6303:50 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ==> /home/jc01/.condarc <== ssl_verify: False channels: - conda-forge - defaults - r ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at /imaging/local/software/centos7/anaconda3/envs/test-base: # # Name Version Build Channel ca-certificates 2018.12.5 0 defaults certifi 2018.11.29 py36_0 defaults libedit 3.1.20181209 hc058e9b_0 defaults libffi 3.2.1 hd88cf55_4 defaults libgcc-ng 8.2.0 hdf63c60_1 defaults libstdcxx-ng 8.2.0 hdf63c60_1 defaults ncurses 6.1 he6710b0_1 defaults openssl 1.1.1a h7b6447c_0 defaults pip 18.1 py36_0 defaults pybids 0.7.0 pypi_0 pypi python 3.6.8 h0371630_0 defaults readline 7.0 h7b6447c_5 defaults setuptools 40.6.3 py36_0 defaults sqlite 3.26.0 h7b6447c_0 defaults tk 8.6.8 hbc83047_0 defaults wheel 0.32.3 py36_0 defaults xz 5.2.4 h14c3975_4 defaults zlib 1.2.11 h7b6447c_3 defaults ``` </p></details>
... However, downgrading to conda 4.5.9 restores normal pip export function. But broke my installation as detailed in #7788. I repaired it using the instructions there (removing `# conda version` lines from conda-meta/history). I then was able to `conda update conda`... to 4.5.12, which is now the latest available version on base and conda-forge. Anyway, exporting on 4.5.12 also works fine. Which raises the question of how I ended up on 4.6.0 in the first place. I looked in the history file, and it seems `conda update -n base conda` put me on 4.6.0 on 16 January. So it looks like there was a conda-forge 4.6.0 release that got pulled. And that's where my problems started. ... And now that the 4.6.1 release is official, I tried the update again (from conda-forge). Same problem. However, it turns out that you can get pip export to work again if you turn on the new pip_interop_enabled flag: ``` (cbu_nipy_1_03dev) 02:34:09 login27:~/python/neuroconda$ conda config --set pip_interop_enabled False (cbu_nipy_1_03dev) 02:34:15 login27:~/python/neuroconda$ conda env export -f test.yml (cbu_nipy_1_03dev) 02:34:23 login27:~/python/neuroconda$ cat test.yml | grep pip - apipkg=1.5=py_0 - pip=10.0.1=py36_0 (cbu_nipy_1_03dev) 02:34:39 login27:~/python/neuroconda$ conda config --set pip_interop_enabled True (cbu_nipy_1_03dev) 02:34:44 login27:~/python/neuroconda$ conda env export -f test.yml (cbu_nipy_1_03dev) 02:34:56 login27:~/python/neuroconda$ cat test.yml | grep pip - apipkg=1.5=py_0 - pip=10.0.1=py36_0 - pip: ``` Hope this is useful for someone. thanks! was trolling thru the source code trying to figure out how to re-enable this
2019-01-29T21:50:38Z
[]
[]
conda/conda
8,184
conda__conda-8184
[ "8178" ]
8eeb1bba428cceb56c6dae120c51e35b3332b854
diff --git a/conda/common/pkg_formats/python.py b/conda/common/pkg_formats/python.py --- a/conda/common/pkg_formats/python.py +++ b/conda/common/pkg_formats/python.py @@ -113,7 +113,8 @@ def _check_files(self): for fname in self.MANDATORY_FILES: if self._metadata_dir_full_path: fpath = join(self._metadata_dir_full_path, fname) - assert isfile(fpath) + if not isfile(fpath): + raise OSError(ENOENT, strerror(ENOENT), fpath) def _check_path_data(self, path, checksum, size): """Normalizes record data content and format.""" diff --git a/conda/core/prefix_data.py b/conda/core/prefix_data.py --- a/conda/core/prefix_data.py +++ b/conda/core/prefix_data.py @@ -256,7 +256,8 @@ def _load_site_packages(self): for af in non_conda_anchor_files: try: python_record = read_python_record(self.prefix_path, af, python_pkg_record.version) - except EnvironmentError: + except EnvironmentError as e: + log.info("Python record ignored for anchor path '%s'\n due to %s", af, e) continue except ValidationError: import sys
diff --git a/tests/common/pkg_formats/test_python.py b/tests/common/pkg_formats/test_python.py --- a/tests/common/pkg_formats/test_python.py +++ b/tests/common/pkg_formats/test_python.py @@ -5,6 +5,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals from datetime import datetime +from errno import ENOENT import os from os.path import basename, lexists from pprint import pprint @@ -523,8 +524,9 @@ def test_pydist_check_files(): # Test mandatory file not found os.remove(fpaths[0]) - with pytest.raises(AssertionError): + with pytest.raises(EnvironmentError) as exc: PythonInstalledDistribution(temp_path, "2.7", None) + assert exc.value.errno == ENOENT def test_python_dist_info():
conda pip interop AssertionError in 4.6.1 This is the error with the most reports for 4.6.1 (over 100 in the last 24 hours). I've got a PR in the works to resolve this one. ``` error: AssertionError() command: D:\Users\rahul\Anaconda3\Scripts\conda-script.py list user_agent: conda/4.6.1 requests/2.18.4 CPython/3.6.5 Windows/10 Windows/10.0.17763 _messageid: -9223372036617369010 _messagetime: 1548792058544 / 2019-01-29 14:00:58 Traceback (most recent call last): File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\exceptions.py", line 1001, in __call__ return func(*args, **kwargs) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main exit_code = do_call(args, p) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 81, in do_call exit_code = getattr(module, func_name)(args, parser) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\cli\main_list.py", line 142, in execute show_channel_urls=context.show_channel_urls) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\cli\main_list.py", line 80, in print_packages show_channel_urls=show_channel_urls) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\cli\main_list.py", line 45, in list_packages installed = sorted(PrefixData(prefix, pip_interop_enabled=True).iter_records(), File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\core\prefix_data.py", line 116, in iter_records return itervalues(self._prefix_records) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\core\prefix_data.py", line 145, in _prefix_records return self.__prefix_records or self.load() or self.__prefix_records File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\core\prefix_data.py", line 69, in load self._load_site_packages() File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\core\prefix_data.py", line 258, in _load_site_packages python_record = read_python_record(self.prefix_path, af, python_pkg_record.version) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 245, in read_python_record pydist = PythonDistribution.init(prefix_path, anchor_file, python_version) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\common\pkg_formats\python.py", line 78, in init return PythonInstalledDistribution(prefix_path, anchor_file, python_version) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\common\pkg_formats\python.py", line 382, in __init__ super(PythonInstalledDistribution, self).__init__(anchor_full_path, python_version) File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\common\pkg_formats\python.py", line 106, in __init__ self._check_files() File "D:\Users\rahul\Anaconda3\lib\site-packages\conda\common\pkg_formats\python.py", line 116, in _check_files assert isfile(fpath) AssertionError ```
2019-01-30T14:49:40Z
[]
[]
conda/conda
8,198
conda__conda-8198
[ "8185" ]
7a68286a737c7b5cd48c83d39bd615f99d939304
diff --git a/conda/core/prefix_data.py b/conda/core/prefix_data.py --- a/conda/core/prefix_data.py +++ b/conda/core/prefix_data.py @@ -7,6 +7,7 @@ from logging import getLogger from os import listdir from os.path import basename, isdir, isfile, join, lexists +import re from .._vendor.auxlib.exceptions import ValidationError from ..base.constants import CONDA_TARBALL_EXTENSION, PREFIX_MAGIC_FILE @@ -220,7 +221,9 @@ def _load_site_packages(self): # Get anchor files for corresponding conda (handled) python packages prefix_graph = PrefixGraph(self.iter_records()) python_records = prefix_graph.all_descendants(python_pkg_record) - conda_python_packages = get_conda_anchor_files_and_records(python_records) + conda_python_packages = get_conda_anchor_files_and_records( + site_packages_dir, python_records + ) # Get all anchor files and compare against conda anchor files to find clobbered conda # packages and python packages installed via other means (not handled by conda) @@ -276,16 +279,27 @@ def _load_site_packages(self): return new_packages -def get_conda_anchor_files_and_records(python_records): +def get_conda_anchor_files_and_records(site_packages_short_path, python_records): """Return the anchor files for the conda records of python packages.""" anchor_file_endings = ('.egg-info/PKG-INFO', '.dist-info/RECORD', '.egg-info') conda_python_packages = odict() + matcher = re.compile( + r"^%s/[^/]+(?:%s)$" % ( + re.escape(site_packages_short_path), + r"|".join(re.escape(fn) for fn in anchor_file_endings) + ) + ).match + for prefix_record in python_records: - for fpath in prefix_record.files: - if fpath.endswith(anchor_file_endings) and 'site-packages' in fpath: - # Then 'fpath' is an anchor file - conda_python_packages[fpath] = prefix_record + anchor_paths = tuple(fpath for fpath in prefix_record.files if matcher(fpath)) + if len(anchor_paths) > 1: + anchor_path = sorted(anchor_paths, key=len)[0] + log.info("Package %s has multiple python anchor files.\n" + " Using %s", prefix_record.record_id(), anchor_path) + conda_python_packages[anchor_path] = prefix_record + elif anchor_paths: + conda_python_packages[anchor_paths[0]] = prefix_record return conda_python_packages
diff --git a/tests/core/test_prefix_data.py b/tests/core/test_prefix_data.py --- a/tests/core/test_prefix_data.py +++ b/tests/core/test_prefix_data.py @@ -136,18 +136,19 @@ def test_pip_interop_osx(): def test_get_conda_anchor_files_and_records(): valid_tests = [ - os.sep.join(('v', 'site-packages', 'spam', '.egg-info', 'PKG-INFO')), - os.sep.join(('v', 'site-packages', 'foo', '.dist-info', 'RECORD')), - os.sep.join(('v', 'site-packages', 'bar', '.egg-info')), + 'v/site-packages/spam.egg-info/PKG-INFO', + 'v/site-packages/foo.dist-info/RECORD', + 'v/site-packages/bar.egg-info', ] invalid_tests = [ - os.sep.join(('i', 'site-packages', '.egg-link')), - os.sep.join(('i', 'spam', '.egg-info', 'PKG-INFO')), - os.sep.join(('i', 'foo', '.dist-info', 'RECORD')), - os.sep.join(('i', 'bar', '.egg-info')), - os.sep.join(('i', 'site-packages', 'spam')), - os.sep.join(('i', 'site-packages', 'foo')), - os.sep.join(('i', 'site-packages', 'bar')), + 'v/site-packages/valid-package/_vendor/invalid-now.egg-info/PKG-INFO', + 'i/site-packages/stuff.egg-link', + 'i/spam.egg-info/PKG-INFO', + 'i/foo.dist-info/RECORD', + 'i/bar.egg-info', + 'i/site-packages/spam', + 'i/site-packages/foo', + 'i/site-packages/bar', ] tests = valid_tests + invalid_tests records = [] @@ -156,10 +157,10 @@ def test_get_conda_anchor_files_and_records(): record.files = [path] records.append(record) - output = get_conda_anchor_files_and_records(records) + output = get_conda_anchor_files_and_records("v/site-packages", records) expected_output = odict() for i in range(len(valid_tests)): expected_output[valid_tests[i]] = records[i] _print_output(output, expected_output) - assert output, expected_output + assert output == expected_output
Package is wrongly listed as from `pypi` channel / `conda list` crashes with a stacktrace ## Current Behavior * `conda list` lists a package (`bleach`) as being from `pypi` instead of `conda-forge` * sometimes `conda list` fails with a stacktrace ### Steps to Reproduce ``` λ conda create -n test_bleach -c conda-forge bleach=3.1.0 Collecting package metadata: done Solving environment: done ## Package Plan ## environment location: W:\Miniconda3\envs\test_bleach added / updated specs: - bleach=3.1.0 The following packages will be downloaded: package | build ---------------------------|----------------- bleach-3.1.0 | py_0 110 KB conda-forge certifi-2018.11.29 | py37_1000 144 KB conda-forge pip-19.0.1 | py37_0 1.8 MB conda-forge python-3.7.1 | hc182675_1000 20.9 MB conda-forge setuptools-40.7.1 | py37_0 633 KB conda-forge six-1.12.0 | py37_1000 21 KB conda-forge vc-14 | 0 985 B conda-forge vs2015_runtime-14.0.25420 | 0 1.9 MB conda-forge webencodings-0.5.1 | py_1 12 KB conda-forge wheel-0.32.3 | py37_0 51 KB conda-forge wincertstore-0.2 | py37_1002 13 KB conda-forge ------------------------------------------------------------ Total: 25.6 MB The following NEW packages will be INSTALLED: bleach conda-forge/noarch::bleach-3.1.0-py_0 certifi conda-forge/win-64::certifi-2018.11.29-py37_1000 pip conda-forge/win-64::pip-19.0.1-py37_0 python conda-forge/win-64::python-3.7.1-hc182675_1000 setuptools conda-forge/win-64::setuptools-40.7.1-py37_0 six conda-forge/win-64::six-1.12.0-py37_1000 vc conda-forge/win-64::vc-14-0 vs2015_runtime conda-forge/win-64::vs2015_runtime-14.0.25420-0 webencodings conda-forge/noarch::webencodings-0.5.1-py_1 wheel conda-forge/win-64::wheel-0.32.3-py37_0 wincertstore conda-forge/win-64::wincertstore-0.2-py37_1002 Proceed ([y]/n)? Downloading and Extracting Packages six-1.12.0 | 21 KB | ############################################################################ | 100% vs2015_runtime-14.0. | 1.9 MB | ############################################################################ | 100% wheel-0.32.3 | 51 KB | ############################################################################ | 100% wincertstore-0.2 | 13 KB | ############################################################################ | 100% certifi-2018.11.29 | 144 KB | ############################################################################ | 100% setuptools-40.7.1 | 633 KB | ############################################################################ | 100% webencodings-0.5.1 | 12 KB | ############################################################################ | 100% python-3.7.1 | 20.9 MB | ############################################################################ | 100% vc-14 | 985 B | ############################################################################ | 100% bleach-3.1.0 | 110 KB | ############################################################################ | 100% pip-19.0.1 | 1.8 MB | ############################################################################ | 100% Preparing transaction: done Verifying transaction: done Executing transaction: \ WARNING conda.core.envs_manager:register_env(43): Unable to register environment. Path not writ able. environment location: W:\Miniconda3\envs\test_bleach registry file: C:\Users\tadeu\.conda\environments.txt done # # To activate this environment, use: # > activate test_bleach # # To deactivate an active environment, use: # > deactivate # # * for power-users using bash, you must source # λ conda list -n test_bleach # packages in environment at W:\Miniconda3\envs\test_bleach: # # Name Version Build Channel certifi 2018.11.29 py37_1000 conda-forge pip 19.0.1 py37_0 conda-forge python 3.7.1 hc182675_1000 conda-forge setuptools 40.7.1 py37_0 conda-forge six 1.12.0 py37_1000 conda-forge vc 14 0 conda-forge vs2015_runtime 14.0.25420 0 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.32.3 py37_0 conda-forge wincertstore 0.2 py37_1002 conda-forge ``` NOTE: doesn't even appear in the first listing, before `activate` ^ ``` λ conda activate test_bleach (test_bleach) λ conda list # packages in environment at W:\Miniconda3\envs\test_bleach: # # Name Version Build Channel bleach 3.1.0 pypi_0 pypi certifi 2018.11.29 py37_1000 conda-forge pip 19.0.1 py37_0 conda-forge python 3.7.1 hc182675_1000 conda-forge setuptools 40.7.1 py37_0 conda-forge six 1.12.0 py37_1000 conda-forge vc 14 0 conda-forge vs2015_runtime 14.0.25420 0 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.32.3 py37_0 conda-forge wincertstore 0.2 py37_1002 conda-forge ``` Note that `bleach` is listed as if coming from pip/`pypi`! Sometimes there is a more serious error on `conda list` (seems to be very related, but I couldn't get an easy way to reproduce it yet), it will print this stacktrace: ``` Traceback (most recent call last): File "W:\Miniconda\lib\site-packages\conda\exceptions.py", line 1001, in __call__ return func(*args, **kwargs) File "W:\Miniconda\lib\site-packages\conda\cli\main.py", line 84, in _main exit_code = do_call(args, p) File "W:\Miniconda\lib\site-packages\conda\cli\conda_argparse.py", line 81, in do_call exit_code = getattr(module, func_name)(args, parser) File "W:\Miniconda\lib\site-packages\conda\cli\main_list.py", line 142, in execute show_channel_urls=context.show_channel_urls) File "W:\Miniconda\lib\site-packages\conda\cli\main_list.py", line 80, in print_packages show_channel_urls=show_channel_urls) File "W:\Miniconda\lib\site-packages\conda\cli\main_list.py", line 45, in list_packages installed = sorted(PrefixData(prefix, pip_interop_enabled=True).iter_records(), File "W:\Miniconda\lib\site-packages\conda\core\prefix_data.py", line 116, in iter_records return itervalues(self._prefix_records) File "W:\Miniconda\lib\site-packages\conda\core\prefix_data.py", line 145, in _prefix_records return self.__prefix_records or self.load() or self.__prefix_records File "W:\Miniconda\lib\site-packages\conda\core\prefix_data.py", line 69, in load self._load_site_packages() File "W:\Miniconda\lib\site-packages\conda\core\prefix_data.py", line 237, in _load_site_packages prefix_rec = self._prefix_records.pop(conda_python_packages[conda_anchor_file].name) KeyError: 'bleach' ``` ## Expected Behavior The package should be listed with the proper channel and there should be no error with stacktrace in `conda list`. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : None shell level : 0 user config file : C:\Users\tadeu\.condarc populated config files : conda version : 4.6.1 conda-build version : not installed python version : 3.7.1.final.0 base environment : W:\Miniconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/win-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : W:\Miniconda3\pkgs C:\Users\tadeu\.conda\pkgs C:\Users\tadeu\AppData\Local\conda\conda\pkgs envs directories : W:\Miniconda3\envs C:\Users\tadeu\.conda\envs C:\Users\tadeu\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.6.1 requests/2.21.0 CPython/3.7.1 Windows/10 Windows/10.0.17134 administrator : True netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at W:\Miniconda3: # # Name Version Build Channel asn1crypto 0.24.0 py37_0 defaults ca-certificates 2018.12.5 0 defaults certifi 2018.11.29 py37_0 defaults cffi 1.11.5 py37h74b6da3_1 defaults chardet 3.0.4 py37_1 defaults conda 4.6.1 py37_0 defaults conda-env 2.6.0 1 defaults console_shortcut 0.1.1 3 defaults cryptography 2.4.2 py37h7a1dbc1_0 defaults idna 2.8 py37_0 defaults menuinst 1.4.14 py37hfa6e2cd_0 defaults openssl 1.1.1a he774522_0 defaults pip 18.1 py37_0 defaults pycosat 0.6.3 py37hfa6e2cd_0 defaults pycparser 2.19 py37_0 defaults pyopenssl 18.0.0 py37_0 defaults pysocks 1.6.8 py37_0 defaults python 3.7.1 h8c8aaf0_6 defaults pywin32 223 py37hfa6e2cd_1 defaults requests 2.21.0 py37_0 defaults ruamel_yaml 0.15.46 py37hfa6e2cd_0 defaults setuptools 40.6.3 py37_0 defaults six 1.12.0 py37_0 defaults sqlite 3.26.0 he774522_0 defaults urllib3 1.24.1 py37_0 defaults vc 14.1 h0510ff6_4 defaults vs2015_runtime 14.15.26706 h3a45250_0 defaults wheel 0.32.3 py37_0 defaults win_inet_pton 1.0.1 py37_1 defaults wincertstore 0.2 py37_0 defaults yaml 0.1.7 hc54c509_2 defaults ``` </p></details>
Note that this is reproducible without `conda-forge`: ``` λ conda create -n test_bleach_2 bleach Collecting package metadata: done Solving environment: done ## Package Plan ## environment location: W:\Miniconda3\envs\test_bleach_2 added / updated specs: - bleach The following packages will be downloaded: package | build ---------------------------|----------------- bleach-3.1.0 | py37_0 222 KB python-3.7.2 | h8c8aaf0_0 17.7 MB webencodings-0.5.1 | py37_1 19 KB wheel-0.32.3 | py37_0 53 KB ------------------------------------------------------------ Total: 18.0 MB The following NEW packages will be INSTALLED: bleach pkgs/main/win-64::bleach-3.1.0-py37_0 ca-certificates pkgs/main/win-64::ca-certificates-2018.12.5-0 certifi pkgs/main/win-64::certifi-2018.11.29-py37_0 openssl pkgs/main/win-64::openssl-1.1.1a-he774522_0 pip pkgs/main/win-64::pip-18.1-py37_0 python pkgs/main/win-64::python-3.7.2-h8c8aaf0_0 setuptools pkgs/main/win-64::setuptools-40.6.3-py37_0 six pkgs/main/win-64::six-1.12.0-py37_0 sqlite pkgs/main/win-64::sqlite-3.26.0-he774522_0 vc pkgs/main/win-64::vc-14.1-h0510ff6_4 vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.15.26706-h3a45250_0 webencodings pkgs/main/win-64::webencodings-0.5.1-py37_1 wheel pkgs/main/win-64::wheel-0.32.3-py37_0 wincertstore pkgs/main/win-64::wincertstore-0.2-py37_0 Proceed ([y]/n)? Downloading and Extracting Packages wheel-0.32.3 | 53 KB | ############################################################################ | 100% webencodings-0.5.1 | 19 KB | ############################################################################ | 100% bleach-3.1.0 | 222 KB | ############################################################################ | 100% python-3.7.2 | 17.7 MB | ############################################################################ | 100% Preparing transaction: done Verifying transaction: done Executing transaction: / WARNING conda.core.envs_manager:register_env(43): Unable to register environment. Path not writ able. environment location: W:\Miniconda3\envs\test_bleach_2 registry file: C:\Users\tadeu\.conda\environments.txt done # # To activate this environment, use # # $ conda activate test_bleach_2 # # To deactivate an active environment, use # # $ conda deactivate λ conda list -n test_bleach_2 # packages in environment at W:\Miniconda3\envs\test_bleach_2: # # Name Version Build Channel ca-certificates 2018.12.5 0 certifi 2018.11.29 py37_0 openssl 1.1.1a he774522_0 pip 18.1 py37_0 python 3.7.2 h8c8aaf0_0 setuptools 40.6.3 py37_0 six 1.12.0 py37_0 sqlite 3.26.0 he774522_0 vc 14.1 h0510ff6_4 vs2015_runtime 14.15.26706 h3a45250_0 webencodings 0.5.1 py37_1 wheel 0.32.3 py37_0 wincertstore 0.2 py37_0 λ activate test_bleach_2 conda.bat activate test_bleach_2 (test_bleach_2) λ conda list # packages in environment at W:\Miniconda3\envs\test_bleach_2: # # Name Version Build Channel bleach 3.1.0 pypi_0 pypi ca-certificates 2018.12.5 0 certifi 2018.11.29 py37_0 openssl 1.1.1a he774522_0 pip 18.1 py37_0 python 3.7.2 h8c8aaf0_0 setuptools 40.6.3 py37_0 six 1.12.0 py37_0 sqlite 3.26.0 he774522_0 vc 14.1 h0510ff6_4 vs2015_runtime 14.15.26706 h3a45250_0 webencodings 0.5.1 py37_1 wheel 0.32.3 py37_0 wincertstore 0.2 py37_0 ``` I've noticed that there's something weird in the `conda-meta/history` file: ``` ==> 2019-01-30 13:57:26 <== # cmd: W:\Miniconda3\Scripts\conda-script.py create -n test_bleach_2 bleach # conda version: 4.6.1 +defaults::bleach-3.1.0-py37_0 +defaults::ca-certificates-2018.12.5-0 +defaults::certifi-2018.11.29-py37_0 +defaults::openssl-1.1.1a-he774522_0 +defaults::pip-18.1-py37_0 +defaults::python-3.7.2-h8c8aaf0_0 +defaults::setuptools-40.6.3-py37_0 +defaults::six-1.12.0-py37_0 +defaults::sqlite-3.26.0-he774522_0 +defaults::vc-14.1-h0510ff6_4 +defaults::vs2015_runtime-14.15.26706-h3a45250_0 +defaults::webencodings-0.5.1-py37_1 +defaults::wheel-0.32.3-py37_0 +defaults::wincertstore-0.2-py37_0 # update specs: ['bleach'] ``` `bleach` is installed from `defaults`, but in the end there is this `"update specs: ['bleach']"` I saw this in the uploaded error reports. Several times, but only with the `bleach` package. Seems like there's something peculiar going on with https://conda.anaconda.org/conda-forge/noarch/bleach-3.1.0-py_0.tar.bz2? What type of json files associated with `bleach` do you see in the `conda-meta/` directory? There's no json for `bleach` in `conda-meta/`, right after the env creation: ``` certifi-2018.11.29-py37_1000.json history pip-19.0.1-py37_0.json python-3.7.1-hc182675_1000.json setuptools-40.7.1-py37_0.json six-1.12.0-py37_1000.json vc-14-0.json vs2015_runtime-14.0.25420-0.json webencodings-0.5.1-py_1.json wheel-0.32.3-py37_0.json wincertstore-0.2-py37_1002.json ``` I've reproduced exactly the same behavior on macOS instead of Windows. ``` $ conda create -n test_bleach_2 -c conda-forge bleach Collecting package metadata: done Solving environment: done ## Package Plan ## environment location: /Users/kfranz/continuum/conda/devenv/envs/test_bleach_2 added / updated specs: - bleach The following packages will be downloaded: package | build ---------------------------|----------------- bleach-3.1.0 | py_0 110 KB conda-forge bzip2-1.0.6 | h1de35cc_1002 148 KB conda-forge ca-certificates-2018.11.29 | ha4d7672_0 143 KB conda-forge certifi-2018.11.29 | py37_1000 145 KB conda-forge libcxx-7.0.0 | h2d50403_2 1.1 MB conda-forge libffi-3.2.1 | h0a44026_1005 42 KB conda-forge llvm-meta-7.0.0 | 0 2 KB conda-forge ncurses-6.1 | h0a44026_1002 1.3 MB conda-forge openssl-1.0.2p | h1de35cc_1002 3.0 MB conda-forge pip-19.0.1 | py37_0 1.8 MB conda-forge python-3.7.1 | h145921a_1000 21.8 MB conda-forge readline-7.0 | hcfe32e1_1001 393 KB conda-forge setuptools-40.7.1 | py37_0 632 KB conda-forge six-1.12.0 | py37_1000 22 KB conda-forge sqlite-3.26.0 | h1765d9f_1000 2.4 MB conda-forge tk-8.6.9 | ha441bb4_1000 3.1 MB conda-forge webencodings-0.5.1 | py_1 12 KB conda-forge wheel-0.32.3 | py37_0 34 KB conda-forge xz-5.2.4 | h1de35cc_1001 268 KB conda-forge zlib-1.2.11 | h1de35cc_1004 101 KB conda-forge ------------------------------------------------------------ Total: 36.6 MB The following NEW packages will be INSTALLED: bleach conda-forge/noarch::bleach-3.1.0-py_0 bzip2 conda-forge/osx-64::bzip2-1.0.6-h1de35cc_1002 ca-certificates conda-forge/osx-64::ca-certificates-2018.11.29-ha4d7672_0 certifi conda-forge/osx-64::certifi-2018.11.29-py37_1000 libcxx conda-forge/osx-64::libcxx-7.0.0-h2d50403_2 libffi conda-forge/osx-64::libffi-3.2.1-h0a44026_1005 llvm-meta conda-forge/noarch::llvm-meta-7.0.0-0 ncurses conda-forge/osx-64::ncurses-6.1-h0a44026_1002 openssl conda-forge/osx-64::openssl-1.0.2p-h1de35cc_1002 pip conda-forge/osx-64::pip-19.0.1-py37_0 python conda-forge/osx-64::python-3.7.1-h145921a_1000 readline conda-forge/osx-64::readline-7.0-hcfe32e1_1001 setuptools conda-forge/osx-64::setuptools-40.7.1-py37_0 six conda-forge/osx-64::six-1.12.0-py37_1000 sqlite conda-forge/osx-64::sqlite-3.26.0-h1765d9f_1000 tk conda-forge/osx-64::tk-8.6.9-ha441bb4_1000 webencodings conda-forge/noarch::webencodings-0.5.1-py_1 wheel conda-forge/osx-64::wheel-0.32.3-py37_0 xz conda-forge/osx-64::xz-5.2.4-h1de35cc_1001 zlib conda-forge/osx-64::zlib-1.2.11-h1de35cc_1004 Proceed ([y]/n)? y Downloading and Extracting Packages libcxx-7.0.0 | 1.1 MB | ###################################################################################################################################################### | 100% certifi-2018.11.29 | 145 KB | ###################################################################################################################################################### | 100% bleach-3.1.0 | 110 KB | ###################################################################################################################################################### | 100% setuptools-40.7.1 | 632 KB | ###################################################################################################################################################### | 100% openssl-1.0.2p | 3.0 MB | ###################################################################################################################################################### | 100% xz-5.2.4 | 268 KB | ###################################################################################################################################################### | 100% pip-19.0.1 | 1.8 MB | ###################################################################################################################################################### | 100% bzip2-1.0.6 | 148 KB | ###################################################################################################################################################### | 100% six-1.12.0 | 22 KB | ###################################################################################################################################################### | 100% libffi-3.2.1 | 42 KB | ###################################################################################################################################################### | 100% python-3.7.1 | 21.8 MB | ###################################################################################################################################################### | 100% ca-certificates-2018 | 143 KB | ###################################################################################################################################################### | 100% ncurses-6.1 | 1.3 MB | ###################################################################################################################################################### | 100% sqlite-3.26.0 | 2.4 MB | ###################################################################################################################################################### | 100% zlib-1.2.11 | 101 KB | ###################################################################################################################################################### | 100% wheel-0.32.3 | 34 KB | ###################################################################################################################################################### | 100% readline-7.0 | 393 KB | ###################################################################################################################################################### | 100% llvm-meta-7.0.0 | 2 KB | ###################################################################################################################################################### | 100% tk-8.6.9 | 3.1 MB | ###################################################################################################################################################### | 100% webencodings-0.5.1 | 12 KB | ###################################################################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate test_bleach_2 # # To deactivate an active environment, use # # $ conda deactivate $ conda list -n test_bleach_2 # packages in environment at /Users/kfranz/continuum/conda/devenv/envs/test_bleach_2: # # Name Version Build Channel bzip2 1.0.6 h1de35cc_1002 conda-forge ca-certificates 2018.11.29 ha4d7672_0 conda-forge certifi 2018.11.29 py37_1000 conda-forge libcxx 7.0.0 h2d50403_2 conda-forge libffi 3.2.1 h0a44026_1005 conda-forge llvm-meta 7.0.0 0 conda-forge ncurses 6.1 h0a44026_1002 conda-forge openssl 1.0.2p h1de35cc_1002 conda-forge pip 19.0.1 py37_0 conda-forge python 3.7.1 h145921a_1000 conda-forge readline 7.0 hcfe32e1_1001 conda-forge setuptools 40.7.1 py37_0 conda-forge six 1.12.0 py37_1000 conda-forge sqlite 3.26.0 h1765d9f_1000 conda-forge tk 8.6.9 ha441bb4_1000 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.32.3 py37_0 conda-forge xz 5.2.4 h1de35cc_1001 conda-forge zlib 1.2.11 h1de35cc_1004 conda-forge $ conda activate test_bleach_2 $ conda list # packages in environment at /Users/kfranz/continuum/conda/devenv/envs/test_bleach_2: # # Name Version Build Channel bleach 3.1.0 pypi_0 pypi bzip2 1.0.6 h1de35cc_1002 conda-forge ca-certificates 2018.11.29 ha4d7672_0 conda-forge certifi 2018.11.29 py37_1000 conda-forge libcxx 7.0.0 h2d50403_2 conda-forge libffi 3.2.1 h0a44026_1005 conda-forge llvm-meta 7.0.0 0 conda-forge ncurses 6.1 h0a44026_1002 conda-forge openssl 1.0.2p h1de35cc_1002 conda-forge pip 19.0.1 py37_0 conda-forge python 3.7.1 h145921a_1000 conda-forge readline 7.0 hcfe32e1_1001 conda-forge setuptools 40.7.1 py37_0 conda-forge six 1.12.0 py37_1000 conda-forge sqlite 3.26.0 h1765d9f_1000 conda-forge tk 8.6.9 ha441bb4_1000 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.32.3 py37_0 conda-forge xz 5.2.4 h1de35cc_1001 conda-forge zlib 1.2.11 h1de35cc_1004 conda-forge ``` Ok the bit of logic in play here is at https://github.com/conda/conda/blob/7a68286a737c7b5cd48c83d39bd615f99d939304/conda/core/prefix_data.py#L232-L252 The problem is that we're actually deleting the `bleach` record in `conda-meta`. The value of `clobbered_conda_anchor_files` is `{'lib/python3.7/site-packages/bleach/_vendor/html5lib-1.0.1.dist-info/RECORD'}`. The value of `conda_anchor_files` is `{'lib/python3.7/site-packages/bleach/_vendor/html5lib-1.0.1.dist-info/RECORD', 'lib/python3.7/site-packages/setuptools-40.7.1-py3.7.egg-info/PKG-INFO', 'lib/python3.7/site-packages/six-1.12.0-py3.7.egg-info/PKG-INFO', 'lib/python3.7/site-packages/webencodings-0.5.1-py2.7.egg-info/PKG-INFO', 'lib/python3.7/site-packages/bleach-3.1.0.dist-info/RECORD', 'lib/python3.7/site-packages/pip-19.0.1-py3.7.egg-info/PKG-INFO', 'lib/python3.7/site-packages/wheel-0.32.3-py3.7.egg-info/PKG-INFO', 'lib/python3.7/site-packages/certifi-2018.11.29-py3.7.egg-info'}`, which has two entries for the bleach package. So the root cause is in https://github.com/conda/conda/blob/7a68286a737c7b5cd48c83d39bd615f99d939304/conda/core/prefix_data.py#L280-L291 Alternately, maybe we should consider that bleach package malformed?
2019-01-31T14:32:07Z
[]
[]
conda/conda
8,229
conda__conda-8229
[ "7789" ]
bd3151e764a7534c71c0f64628b7162a552d9365
diff --git a/conda/core/link.py b/conda/core/link.py --- a/conda/core/link.py +++ b/conda/core/link.py @@ -6,9 +6,10 @@ from collections import defaultdict, namedtuple from logging import getLogger import os -from os.path import basename, dirname, isdir, join +from os.path import abspath, basename, dirname, isdir, join from subprocess import CalledProcessError import sys +import tempfile from traceback import format_exception_only import warnings @@ -596,7 +597,8 @@ def _execute_actions(pkg_idx, axngroup): for axn_idx, action in enumerate(axngroup.actions): action.execute() if axngroup.type in ('unlink', 'link'): - run_script(target_prefix, prec, 'post-unlink' if is_unlink else 'post-link') + run_script(target_prefix, prec, 'post-unlink' if is_unlink else 'post-link', + activate=True) except Exception as e: # this won't be a multi error # reverse this package log.debug("Error in action #%d for pkg_idx #%d %r", axn_idx, pkg_idx, action, @@ -958,7 +960,7 @@ def _calculate_change_report(prefix, unlink_precs, link_precs, download_urls, sp return change_report -def run_script(prefix, prec, action='post-link', env_prefix=None): +def run_script(prefix, prec, action='post-link', env_prefix=None, activate=False): """ call the post-link (or pre-unlink) script, and return True on success, False on failure @@ -994,13 +996,35 @@ def run_script(prefix, prec, action='post-link', env_prefix=None): if on_win: try: - command_args = [os.environ[str('COMSPEC')], '/d', '/c', path] + comspec = os.environ[str('COMSPEC')] except KeyError: log.info("failed to run %s for %s due to COMSPEC KeyError", action, prec.dist_str()) return False + if activate: + conda_bat = env.get("CONDA_BAT", abspath(join(context.root_prefix, 'bin', 'conda'))) + with tempfile.NamedTemporaryFile( + mode='w', prefix=prefix, suffix='.bat', delete=False) as fh: + fh.write('@CALL \"{0}\" activate \"{1}\"\n'.format(conda_bat, prefix)) + fh.write('echo "PATH: %PATH%\n') + fh.write('@CALL \"{0}\"\n'.format(path)) + script_caller = fh.name + command_args = [comspec, '/d', '/c', script_caller] + else: + command_args = [comspec, '/d', '/c', path] + else: shell_path = 'sh' if 'bsd' in sys.platform else 'bash' - command_args = [shell_path, "-x", path] + if activate: + conda_exe = env.get("CONDA_EXE", abspath(join(context.root_prefix, 'bin', 'conda'))) + with tempfile.NamedTemporaryFile(mode='w', prefix=prefix, delete=False) as fh: + fh.write("eval \"$(\"{0}\" \"shell.posix\" \"hook\")\"\n".format(conda_exe)), + fh.write("conda activate \"{0}\"\n".format(prefix)), + fh.write("source \"{}\"\n".format(path)) + script_caller = fh.name + command_args = [shell_path, "-x", script_caller] + else: + command_args = [shell_path, "-x", path] + script_caller = None env['ROOT_PREFIX'] = context.root_prefix env['PREFIX'] = env_prefix or prefix @@ -1036,6 +1060,9 @@ def run_script(prefix, prec, action='post-link', env_prefix=None): else: messages(prefix) return True + finally: + if script_caller is not None: + os.remove(script_caller) def messages(prefix):
diff --git a/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/activate_d_test.bat b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/activate_d_test.bat new file mode 100644 --- /dev/null +++ b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/activate_d_test.bat @@ -0,0 +1,2 @@ +echo "setting TEST_VAR" +set TEST_VAR=1 diff --git a/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/bld.bat b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/bld.bat new file mode 100644 --- /dev/null +++ b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/bld.bat @@ -0,0 +1,6 @@ +mkdir %PREFIX%\etc\conda\activate.d +copy %RECIPE_DIR%\activate_d_test.bat %PREFIX%\etc\conda\activate.d\test.bat + +mkdir %PREFIX%\etc\conda\deactivate.d +echo "echo setting TEST_VAR" > %PREFIX%\etc\conda\deactivate.d\test.bat +echo set TEST_VAR= > %PREFIX%\etc\conda\deactivate.d\test.bat diff --git a/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/build.sh b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/build.sh new file mode 100644 --- /dev/null +++ b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/build.sh @@ -0,0 +1,7 @@ +mkdir -p $PREFIX/etc/conda/activate.d +echo "echo 'setting TEST_VAR' && export TEST_VAR=1" > $PREFIX/etc/conda/activate.d/test.sh +chmod +x $PREFIX/etc/conda/activate.d/test.sh + +mkdir -p $PREFIX/etc/conda/deactivate.d +echo "echo 'unsetting TEST_VAR' && unset TEST_VAR" > $PREFIX/etc/conda/deactivate.d/test.sh +chmod +x $PREFIX/etc/conda/deactivate.d/test.sh diff --git a/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/meta.yaml b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/meta.yaml new file mode 100644 --- /dev/null +++ b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/meta.yaml @@ -0,0 +1,13 @@ +package: + name: _conda_test_env_activated_when_post_link_executed + version: 1.0 + +about: + summary: test package that checks for an activated env in the post link script + description: | + This is a test packages that checks that conda environment are activated + when running a post link script. This package has an activate.d script which + sets the environment variable TEST_VAR. The packages post link script tests + that this variable is set, if it is not the script fails. If this post + link script is run under a different environment, for example the base env, + there is a good chance that it will fail. diff --git a/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/post-link.bat b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/post-link.bat new file mode 100644 --- /dev/null +++ b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/post-link.bat @@ -0,0 +1,8 @@ + +echo "TEST_VAR is set to :%TEST_VAR%:" >> %PREFIX%\.messages.txt +if "%TEST_VAR%"=="1" ( + echo "Success: TEST_VAR is set correctly" >> %PREFIX%\.messages.txt + exit 0 +) +echo "ERROR: TEST_VAR is not set or set incorrectly" >> %PREFIX%\.messages.txt +exit 1 diff --git a/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/post-link.sh b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/post-link.sh new file mode 100644 --- /dev/null +++ b/tests/data/_conda_test_env_activated_when_post_link_executed_recipe/post-link.sh @@ -0,0 +1,8 @@ +# send feedback to .messages to make debugging easier +echo "TEST_VAR is set to :${TEST_VAR}:" >> "$PREFIX/.messages.txt" +if [ "${TEST_VAR}" != "1" ]; then + echo "Error: TEST_VAR is not set or set incorrectly" >> "$PREFIX/.messages.txt"; + exit 1; +fi +echo "Success: TEST_VAR is set correctly" >> "$PREFIX/.messages.txt" +exit 0 diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -247,7 +247,7 @@ def package_is_installed(prefix, spec): spec = MatchSpec(spec) prefix_recs = tuple(PrefixData(prefix).query(spec)) if len(prefix_recs) > 1: - raise AssertionError("Multiple packages installed.%s" + raise AssertionError("Multiple packages installed.%s" % (dashlist(prec.dist_str() for prec in prefix_recs))) return bool(len(prefix_recs)) @@ -2152,6 +2152,13 @@ def test_run_script_called(self): assert package_is_installed(prefix, 'openssl') assert rs.call_count == 1 + def test_post_link_run_in_env(self): + test_pkg = '_conda_test_env_activated_when_post_link_executed' + # a non-unicode name must be provided here as activate.d scripts + # are not execuated on windows, see https://github.com/conda/conda/issues/8241 + with make_temp_env(test_pkg, '-c conda-test', name='post_link_test') as prefix: + assert package_is_installed(prefix, test_pkg) + def test_conda_info_python(self): stdout, stderr = run_command(Commands.INFO, None, "python=3.5") assert "python 3.5.1 0" in stdout
Envs need to be activated before post-link scripts run In Python 3.7, we removed a patch to Python that put Library/bin on PATH. This was done because putting that on PATH broke the new conda activate stuff somehow. A side effect of this change is that packages with post-link scripts may fail to run (see https://github.com/ContinuumIO/anaconda-issues/issues/10082 for one example). At a minimum, we should be activating environments before we run post-link scripts. We should think about pre-unlink and pre-link, too, I guess.
Without https://github.com/conda/conda/issues/6820, I'm a little bit nervous about the effect this could have on install times. I guess we'll see.
2019-02-05T21:36:30Z
[]
[]
conda/conda
8,259
conda__conda-8259
[ "8258" ]
18ef83386b1cc7f99f956a4fcd841a28c5237839
diff --git a/conda/core/path_actions.py b/conda/core/path_actions.py --- a/conda/core/path_actions.py +++ b/conda/core/path_actions.py @@ -6,7 +6,7 @@ from abc import ABCMeta, abstractmethod, abstractproperty from errno import EXDEV from logging import getLogger -from os.path import basename, dirname, getsize, join +from os.path import basename, dirname, getsize, join, isdir import re from uuid import uuid4 @@ -32,7 +32,7 @@ create_hard_link_or_copy, create_link, create_python_entry_point, extract_tarball, make_menu, mkdir_p, write_as_json_to_file) -from ..gateways.disk.delete import rm_rf +from ..gateways.disk.delete import rm_rf, path_is_clean from ..gateways.disk.permissions import make_writable from ..gateways.disk.read import (compute_md5sum, compute_sha256sum, islink, lexists, read_index_json) @@ -370,7 +370,8 @@ def execute(self): def reverse(self): if self._execute_successful: log.trace("reversing link creation %s", self.target_prefix) - rm_rf(self.target_full_path, clean_empty_parents=True) + if not isdir(self.target_full_path) or path_is_clean(self.target_full_path): + rm_rf(self.target_full_path, clean_empty_parents=True) class PrefixReplaceLinkAction(LinkPathAction): @@ -975,7 +976,8 @@ def reverse(self): backoff_rename(self.holding_full_path, self.target_full_path, force=True) def cleanup(self): - rm_rf(self.holding_full_path, clean_empty_parents=True) + if not isdir(self.holding_full_path) or path_is_clean(self.target_full_path): + rm_rf(self.holding_full_path, clean_empty_parents=True) class RemoveMenuAction(RemoveFromPrefixPathAction):
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -330,6 +330,15 @@ def test_create_install_update_remove_smoketest(self): assert not package_is_installed(prefix, 'flask') assert package_is_installed(prefix, 'python=3') + def test_install_broken_post_install_keeps_existing_folders(self): + # regression test for https://github.com/conda/conda/issues/8258 + with make_temp_env("python=3.5") as prefix: + assert exists(join(prefix, BIN_DIRECTORY)) + assert package_is_installed(prefix, 'python=3') + + run_command(Commands.INSTALL, prefix, '-c', 'conda-test', 'failing_post_link', use_exception_handler=True) + assert exists(join(prefix, BIN_DIRECTORY)) + def test_safety_checks(self): # This test uses https://anaconda.org/conda-test/spiffy-test-app/0.5/download/noarch/spiffy-test-app-0.5-pyh6afbcc8_0.tar.bz2 # which is a modification of https://anaconda.org/conda-test/spiffy-test-app/1.0/download/noarch/spiffy-test-app-1.0-pyh6afabb7_0.tar.bz2
conda/bin deleted when conda install errors in 4.6.3 <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> ``` The files in the anaconda/bin directory were deleted when running `conda install` on a new local build of a recipe. When the recipe errors/fails conda tries to roll back. During the role back, rm_rf is called on the anaconda/bin folder. The complete contents of the folder are deleted. This is from conda 4.6.3 ``` ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` conda install --use-local -v -y <recipe> ``` ## Expected Behavior <!-- What do you think should happen? --> ``` If conda install is unsuccessful conda should not remove the entire contents of the anaconda/bin folder. ``` ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` Not available. Unfortunetly, the conda binary is no longer available to run any conda command. But the conda version was 4.6.3 ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` ``` </p></details> ### Output from the command ``` No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 INFO:conda_build.variants:Adding in variants from internal_defaults INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic WARNING: symlink_conda() is deprecated. INFO:conda_build.build:Packaging hg19-civic INFO:conda_build.build:Packaging hg19-civic-1-0 No files or script found for output hg19-civic WARNING:conda_build.build:No files or script found for output hg19-civic /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml Collecting package metadata: ...working... done Solving environment: ...working... done initializing UnlinkLinkTransaction with target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 unlink_precs: link_precs: bioconda::gsort-0.0.6-1 local::hg19-civic-1-0 ## Package Plan ## environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 added / updated specs: - hg19-civic The following packages will be downloaded: package | build ---------------------------|----------------- hg19-civic-1 | 0 6 KB local ------------------------------------------------------------ Total: 6 KB The following NEW packages will be INSTALLED: gsort bioconda/linux-64::gsort-0.0.6-1 hg19-civic uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0 Preparing transaction: ...working... done Verifying transaction: ...working... done Executing transaction: ...working... ===> LINKING PACKAGE: bioconda::gsort-0.0.6-1 <=== prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/gsort-0.0.6-1 ===> LINKING PACKAGE: local::hg19-civic-1-0 <=== prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0 $ bash -x /uufs/chpc.utah.edu/common/home/u0055382/anaconda2nTV9V8 ==> cwd: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin <== ==> exit code: 1 <== ==> stdout <== ***************************** Inactive or out-of-date environment variables: > $ggd_hg19_civic To activate inactive or out-of-date vars, run: source activate base ***************************** Retrieving the latest data downloads from CIViC Creating civic_genes, civic_gene_summaries, and civic_variants BED files ==> stderr <== + [[ hB != hxB ]] + XTRACE_STATE=-x + [[ hxB != hxB ]] + VERBOSE_STATE=+v + set +xv + unset XTRACE_STATE VERBOSE_STATE ++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix hook + eval 'export CONDA_EXE="/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda" # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause __conda_hashr() { if [ -n "${ZSH_VERSION:+x}" ]; then \rehash elif [ -n "${POSH_VERSION:+x}" ]; then : # pass else \hash -r fi } __conda_activate() { if [ -n "${CONDA_PS1_BACKUP:+x}" ]; then # Handle transition from shell activated with conda <= 4.3 to a subsequent activation # after conda updated to >= 4.4. See issue #6173. PS1="$CONDA_PS1_BACKUP" \unset CONDA_PS1_BACKUP fi \local cmd="$1" shift \local ask_conda ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix "$cmd" "$@")" || \return $? \eval "$ask_conda" __conda_hashr } __conda_reactivate() { \local ask_conda ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix reactivate)" || \return $? \eval "$ask_conda" __conda_hashr } conda() { if [ "$#" -lt 1 ]; then "$CONDA_EXE" else \local cmd="$1" shift case "$cmd" in activate|deactivate) __conda_activate "$cmd" "$@" ;; install|update|upgrade|remove|uninstall) "$CONDA_EXE" "$cmd" "$@" && __conda_reactivate ;; *) "$CONDA_EXE" "$cmd" "$@" ;; esac fi } if [ -z "${CONDA_SHLVL+x}" ]; then \export CONDA_SHLVL=0 PATH="$(dirname "$(dirname "$CONDA_EXE")")/condabin:${PATH:-}" \export PATH # We'\''re not allowing PS1 to be unbound. It must at least be set. # However, we'\''re not exporting it, which can cause problems when starting a second shell # via a first shell (i.e. starting zsh from bash). if [ -z "${PS1+x}" ]; then PS1= fi fi conda activate base' ++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda ++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda ++ '[' -z '' ']' ++ export CONDA_SHLVL=0 ++ CONDA_SHLVL=0 ++++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda +++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin ++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper ++ export PATH ++ '[' -z '' ']' ++ PS1= ++ conda activate base ++ '[' 2 -lt 1 ']' ++ local cmd=activate ++ shift ++ case "$cmd" in ++ __conda_activate activate base ++ '[' -n '' ']' ++ local cmd=activate ++ shift ++ local ask_conda +++ PS1= +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate base ++ ask_conda='PS1='\''(base) '\'' \export CONDA_DEFAULT_ENV='\''base'\'' \export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\'' \export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\'' \export CONDA_PROMPT_MODIFIER='\''(base) '\'' \export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\'' \export CONDA_SHLVL='\''1'\'' \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' ++ eval 'PS1='\''(base) '\'' \export CONDA_DEFAULT_ENV='\''base'\'' \export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\'' \export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\'' \export CONDA_PROMPT_MODIFIER='\''(base) '\'' \export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\'' \export CONDA_SHLVL='\''1'\'' \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' +++ PS1='(base) ' +++ export CONDA_DEFAULT_ENV=base +++ CONDA_DEFAULT_ENV=base +++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda +++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda +++ export CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 +++ CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 +++ export 'CONDA_PROMPT_MODIFIER=(base) ' +++ CONDA_PROMPT_MODIFIER='(base) ' +++ export CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python +++ CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python +++ export CONDA_SHLVL=1 +++ CONDA_SHLVL=1 +++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper +++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper ++ __conda_hashr ++ '[' -n '' ']' ++ '[' -n '' ']' ++ hash -r + conda activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 + '[' 2 -lt 1 ']' + local cmd=activate + shift + case "$cmd" in + __conda_activate activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 + '[' -n '' ']' + local cmd=activate + shift + local ask_conda ++ PS1='(base) ' ++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 + ask_conda='PS1='\''(base) '\'' \export CONDA_PROMPT_MODIFIER='\''(base) '\'' \export CONDA_SHLVL='\''1'\'' \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' + eval 'PS1='\''(base) '\'' \export CONDA_PROMPT_MODIFIER='\''(base) '\'' \export CONDA_SHLVL='\''1'\'' \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' ++ PS1='(base) ' ++ export 'CONDA_PROMPT_MODIFIER=(base) ' ++ CONDA_PROMPT_MODIFIER='(base) ' ++ export CONDA_SHLVL=1 ++ CONDA_SHLVL=1 ++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper ++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper + __conda_hashr + '[' -n '' ']' + '[' -n '' ']' + hash -r + source /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh ++ set -eo pipefail -o nounset +++ conda info --root +++ '[' 2 -lt 1 ']' +++ local cmd=info +++ shift +++ case "$cmd" in +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --root ++ export CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 ++ CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 +++ find /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/ -name 'hg19-civic-1*' +++ grep -v .tar.bz2 +++ grep '1-.*0$\|1\_.*0$' ++ PKG_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0 ++ export RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ++ RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ++ '[' -d /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ']' ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ++ recipe_env_name=ggd_hg19-civic +++ echo ggd_hg19-civic +++ sed s/-/_/g ++ recipe_env_name=ggd_hg19_civic +++ conda info --envs +++ grep '*' +++ '[' 2 -lt 1 ']' +++ local cmd=info +++ shift +++ case "$cmd" in +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --envs +++ grep -o '\/.*' ++ env_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 ++ activate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d ++ deactivate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d ++ echo 'export ggd_hg19_civic=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1' ++ echo 'unset ggd_hg19_civic' ++ ggd show-env ++ cd /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ++ bash /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0/info/recipe/recipe.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 498k 100 498k 0 0 1100k 0 --:--:-- --:--:-- --:--:-- 1103k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 73962 100 73962 0 0 419k 0 --:--:-- --:--:-- --:--:-- 419k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3281k 100 3281k 0 0 9483k 0 --:--:-- --:--:-- --:--:-- 9456k % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 162 100 162 0 0 650 0 --:--:-- --:--:-- --:--:-- 650 100 4122 100 4122 0 0 7926 0 --:--:-- --:--:-- --:--:-- 7926 Traceback (most recent call last): File "merge_civic_files.py", line 8, in <module> gene_coords = open("../ensembl/sorted.ensembl.gene.coords", "r") IOError: [Errno 2] No such file or directory: '../ensembl/sorted.ensembl.gene.coords' ===> REVERSING PACKAGE LINK: local::hg19-civic-1-0 <=== prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6. Please remove this file manually (you may need to reboot to free file handles) rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin failed An error occurred while installing package 'local::hg19-civic-1-0'. LinkError: post-link script failed for package local::hg19-civic-1-0 running your command again with `-v` will provide additional information location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh ==> script messages <== <None> Attempting to roll back. Rolling back transaction: ...working... ===> REVERSING PACKAGE LINK: bioconda::gsort-0.0.6-1 <=== prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6. Please remove this file manually (you may need to reboot to free file handles) rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin done Traceback (most recent call last): File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1002, in __call__ return func(*args, **kwargs) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 84, in _main exit_code = do_call(args, p) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call exit_code = getattr(module, func_name)(args, parser) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main_install.py", line 20, in execute install(args, parser, 'install') File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 271, in install handle_txn(unlink_link_transaction, prefix, args, newenv) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 300, in handle_txn unlink_link_transaction.execute() File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 242, in execute self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups))))) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 563, in _execute rollback_excs, CondaMultiError: post-link script failed for package local::hg19-civic-1-0 running your command again with `-v` will provide additional information location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh ==> script messages <== <None> Traceback (most recent call last): File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/ggd", line 11, in <module> File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/__main__.py", line 40, in main args.func(parser, args) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 116, in check_recipe _install(bz2,str(recipe['package']['name'])) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 74, in _install stdout=sys.stdout) File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['conda', 'install', '-v', '--use-local', '-y', 'hg19-civic']' returned non-zero exit status 1 ``` Note. The script states: ``` Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6. Please remove this file manually (you may need to reboot to free file handles) rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin ``` however, the contents of anaconda2/bin was deleted.
That's pretty bad. Sorry. Well fix this ASAP. Thanks for reporting. On Mon, Feb 11, 2019, 17:07 Michael Cormier <[email protected] wrote: > Current Behavior > > The files in the anaconda/bin directory were deleted when running `conda install` on a new local build of a recipe. When the recipe errors/fails conda tries to roll back. During the role back, rm_rf is called on the anaconda/bin folder. The complete contents of the folder are deleted. This is from conda 4.6.3 > > Steps to Reproduce > > conda install --use-local -v -y <recipe> > > Expected Behavior > > If conda install is unsuccessful conda should not remove the entire contents of the anaconda/bin folder. > > Environment Information `conda info` > > Not available. Unfortunetly, the conda binary is no longer available to run any conda command. But the conda version was 4.6.3 > > `conda config --show-sources` > > `conda list --show-channel-urls` > > Output from the command > > No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 > WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 > INFO:conda_build.variants:Adding in variants from internal_defaults > INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic > WARNING: symlink_conda() is deprecated. > INFO:conda_build.build:Packaging hg19-civic > INFO:conda_build.build:Packaging hg19-civic-1-0 > No files or script found for output hg19-civic > WARNING:conda_build.build:No files or script found for output hg19-civic > /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json > /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive > INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml > Collecting package metadata: ...working... done > Solving environment: ...working... done > initializing UnlinkLinkTransaction with > target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > unlink_precs: > > link_precs: > bioconda::gsort-0.0.6-1 > local::hg19-civic-1-0 > > > > ## Package Plan ## > > environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > > added / updated specs: > - hg19-civic > > > The following packages will be downloaded: > > package | build > ---------------------------|----------------- > hg19-civic-1 | 0 6 KB local > ------------------------------------------------------------ > Total: 6 KB > > The following NEW packages will be INSTALLED: > > gsort bioconda/linux-64::gsort-0.0.6-1 > hg19-civic uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0 > > > Preparing transaction: ...working... done > Verifying transaction: ...working... done > Executing transaction: ...working... ===> LINKING PACKAGE: bioconda::gsort-0.0.6-1 <=== > prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/gsort-0.0.6-1 > > > ===> LINKING PACKAGE: local::hg19-civic-1-0 <=== > prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > source=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0 > > > $ bash -x /uufs/chpc.utah.edu/common/home/u0055382/anaconda2nTV9V8 > ==> cwd: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin <== > ==> exit code: 1 <== > ==> stdout <== > ***************************** > > Inactive or out-of-date environment variables: > > $ggd_hg19_civic > > To activate inactive or out-of-date vars, run: > source activate base > > ***************************** > > Retrieving the latest data downloads from CIViC > Creating civic_genes, civic_gene_summaries, and civic_variants BED files > > ==> stderr <== > + [[ hB != hxB ]] > + XTRACE_STATE=-x > + [[ hxB != hxB ]] > + VERBOSE_STATE=+v > + set +xv > + unset XTRACE_STATE VERBOSE_STATE > ++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix hook > + eval 'export CONDA_EXE="/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda" > # Copyright (C) 2012 Anaconda, Inc > # SPDX-License-Identifier: BSD-3-Clause > > __conda_hashr() { > if [ -n "${ZSH_VERSION:+x}" ]; then > \rehash > elif [ -n "${POSH_VERSION:+x}" ]; then > : # pass > else > \hash -r > fi > } > > __conda_activate() { > if [ -n "${CONDA_PS1_BACKUP:+x}" ]; then > # Handle transition from shell activated with conda <= 4.3 to a subsequent activation > # after conda updated to >= 4.4. See issue #6173. > PS1="$CONDA_PS1_BACKUP" > \unset CONDA_PS1_BACKUP > fi > > \local cmd="$1" > shift > \local ask_conda > ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix "$cmd" "$@")" || \return $? > \eval "$ask_conda" > __conda_hashr > } > > __conda_reactivate() { > \local ask_conda > ask_conda="$(PS1="$PS1" "$CONDA_EXE" shell.posix reactivate)" || \return $? > \eval "$ask_conda" > __conda_hashr > } > > conda() { > if [ "$#" -lt 1 ]; then > "$CONDA_EXE" > else > \local cmd="$1" > shift > case "$cmd" in > activate|deactivate) > __conda_activate "$cmd" "$@" > ;; > install|update|upgrade|remove|uninstall) > "$CONDA_EXE" "$cmd" "$@" && __conda_reactivate > ;; > *) "$CONDA_EXE" "$cmd" "$@" ;; > esac > fi > } > > if [ -z "${CONDA_SHLVL+x}" ]; then > \export CONDA_SHLVL=0 > PATH="$(dirname "$(dirname "$CONDA_EXE")")/condabin:${PATH:-}" > \export PATH > > # We'\''re not allowing PS1 to be unbound. It must at least be set. > # However, we'\''re not exporting it, which can cause problems when starting a second shell > # via a first shell (i.e. starting zsh from bash). > if [ -z "${PS1+x}" ]; then > PS1= > fi > fi > > > conda activate base' > ++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda > ++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda > ++ '[' -z '' ']' > ++ export CONDA_SHLVL=0 > ++ CONDA_SHLVL=0 > ++++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda > +++ dirname /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin > ++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper > ++ export PATH > ++ '[' -z '' ']' > ++ PS1= > ++ conda activate base > ++ '[' 2 -lt 1 ']' > ++ local cmd=activate > ++ shift > ++ case "$cmd" in > ++ __conda_activate activate base > ++ '[' -n '' ']' > ++ local cmd=activate > ++ shift > ++ local ask_conda > +++ PS1= > +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate base > ++ ask_conda='PS1='\''(base) '\'' > \export CONDA_DEFAULT_ENV='\''base'\'' > \export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\'' > \export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\'' > \export CONDA_PROMPT_MODIFIER='\''(base) '\'' > \export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\'' > \export CONDA_SHLVL='\''1'\'' > \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' > ++ eval 'PS1='\''(base) '\'' > \export CONDA_DEFAULT_ENV='\''base'\'' > \export CONDA_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda'\'' > \export CONDA_PREFIX='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2'\'' > \export CONDA_PROMPT_MODIFIER='\''(base) '\'' > \export CONDA_PYTHON_EXE='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python'\'' > \export CONDA_SHLVL='\''1'\'' > \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' > +++ PS1='(base) ' > +++ export CONDA_DEFAULT_ENV=base > +++ CONDA_DEFAULT_ENV=base > +++ export CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda > +++ CONDA_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda > +++ export CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > +++ CONDA_PREFIX=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > +++ export 'CONDA_PROMPT_MODIFIER=(base) ' > +++ CONDA_PROMPT_MODIFIER='(base) ' > +++ export CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python > +++ CONDA_PYTHON_EXE=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/python > +++ export CONDA_SHLVL=1 > +++ CONDA_SHLVL=1 > +++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper > +++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper > ++ __conda_hashr > ++ '[' -n '' ']' > ++ '[' -n '' ']' > ++ hash -r > + conda activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > + '[' 2 -lt 1 ']' > + local cmd=activate > + shift > + case "$cmd" in > + __conda_activate activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > + '[' -n '' ']' > + local cmd=activate > + shift > + local ask_conda > ++ PS1='(base) ' > ++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda shell.posix activate /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > + ask_conda='PS1='\''(base) '\'' > \export CONDA_PROMPT_MODIFIER='\''(base) '\'' > \export CONDA_SHLVL='\''1'\'' > \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' > + eval 'PS1='\''(base) '\'' > \export CONDA_PROMPT_MODIFIER='\''(base) '\'' > \export CONDA_SHLVL='\''1'\'' > \export PATH='\''/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper'\''' > ++ PS1='(base) ' > ++ export 'CONDA_PROMPT_MODIFIER=(base) ' > ++ CONDA_PROMPT_MODIFIER='(base) ' > ++ export CONDA_SHLVL=1 > ++ CONDA_SHLVL=1 > ++ export PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper > ++ PATH=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/condabin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin:/uufs/chpc.utah.edu/common/home/u0055382/htslib/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/lumpy-sv/bin:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/uufs/kingspeak.peaks/sys/pkg/slurm/std/bin:/opt/dell/srvadmin/bin:/uufs/chpc.utah.edu/common/home/u0055382/bin:/uufs/chpc.utah.edu/common/home/u0055382/svtyper > + __conda_hashr > + '[' -n '' ']' > + '[' -n '' ']' > + hash -r > + source /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh > ++ set -eo pipefail -o nounset > +++ conda info --root > +++ '[' 2 -lt 1 ']' > +++ local cmd=info > +++ shift > +++ case "$cmd" in > +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --root > ++ export CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > ++ CONDA_ROOT=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > +++ find /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/ -name 'hg19-civic-1*' > +++ grep -v .tar.bz2 > +++ grep '1-.*0$\|1\_.*0$' > ++ PKG_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0 > ++ export RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 > ++ RECIPE_DIR=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 > ++ '[' -d /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 ']' > ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 > ++ recipe_env_name=ggd_hg19-civic > +++ echo ggd_hg19-civic > +++ sed s/-/_/g > ++ recipe_env_name=ggd_hg19_civic > +++ conda info --envs > +++ grep '*' > +++ '[' 2 -lt 1 ']' > +++ local cmd=info > +++ shift > +++ case "$cmd" in > +++ /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/conda info --envs > +++ grep -o '\/.*' > ++ env_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > ++ activate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d > ++ deactivate_dir=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d > ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/activate.d > ++ mkdir -p /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/etc/conda/deactivate.d > ++ echo 'export ggd_hg19_civic=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1' > ++ echo 'unset ggd_hg19_civic' > ++ ggd show-env > ++ cd /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/share/ggd/Homo_sapiens/hg19/hg19-civic/1 > ++ bash /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/pkgs/hg19-civic-1-0/info/recipe/recipe.sh > % Total % Received % Xferd Average Speed Time Time Time Current > Dload Upload Total Spent Left Speed > 100 498k 100 498k 0 0 1100k 0 --:--:-- --:--:-- --:--:-- 1103k > % Total % Received % Xferd Average Speed Time Time Time Current > Dload Upload Total Spent Left Speed > 100 73962 100 73962 0 0 419k 0 --:--:-- --:--:-- --:--:-- 419k > % Total % Received % Xferd Average Speed Time Time Time Current > Dload Upload Total Spent Left Speed > 100 3281k 100 3281k 0 0 9483k 0 --:--:-- --:--:-- --:--:-- 9456k > % Total % Received % Xferd Average Speed Time Time Time Current > Dload Upload Total Spent Left Speed > 100 162 100 162 0 0 650 0 --:--:-- --:--:-- --:--:-- 650 > 100 4122 100 4122 0 0 7926 0 --:--:-- --:--:-- --:--:-- 7926 > Traceback (most recent call last): > File "merge_civic_files.py", line 8, in <module> > gene_coords = open("../ensembl/sorted.ensembl.gene.coords", "r") > IOError: [Errno 2] No such file or directory: '../ensembl/sorted.ensembl.gene.coords' > > > > ===> REVERSING PACKAGE LINK: local::hg19-civic-1-0 <=== > prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > > > Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6. Please remove this file manually (you may need to reboot to free file handles) > > rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) > rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] > Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? > > rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin > > failed > An error occurred while installing package 'local::hg19-civic-1-0'. > LinkError: post-link script failed for package local::hg19-civic-1-0 > running your command again with `-v` will provide additional information > location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh > ==> script messages <== > <None> > > Attempting to roll back. > > > Rolling back transaction: ...working... ===> REVERSING PACKAGE LINK: bioconda::gsort-0.0.6-1 <=== > prefix=/uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > > > rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) > rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] > Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? > > Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6. Please remove this file manually (you may need to reboot to free file handles) > > rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) > rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] > Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? > > rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin > > done > Traceback (most recent call last): > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1002, in __call__ > return func(*args, **kwargs) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 84, in _main > exit_code = do_call(args, p) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call > exit_code = getattr(module, func_name)(args, parser) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/main_install.py", line 20, in execute > install(args, parser, 'install') > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 271, in install > handle_txn(unlink_link_transaction, prefix, args, newenv) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/cli/install.py", line 300, in handle_txn > unlink_link_transaction.execute() > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 242, in execute > self._execute(tuple(concat(interleave(itervalues(self.prefix_action_groups))))) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/conda/core/link.py", line 563, in _execute > rollback_excs, > CondaMultiError: post-link script failed for package local::hg19-civic-1-0 > running your command again with `-v` will provide additional information > location of failed script: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.hg19-civic-post-link.sh > ==> script messages <== > <None> > > > > Traceback (most recent call last): > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/ggd", line 11, in <module> > > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/__main__.py", line 40, in main > args.func(parser, args) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 116, in check_recipe > _install(bz2,str(recipe['package']['name'])) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/site-packages/ggd/check_recipe.py", line 74, in _install > stdout=sys.stdout) > File "/uufs/chpc.utah.edu/common/home/u0055382/anaconda2/lib/python2.7/subprocess.py", line 190, in check_call > raise CalledProcessError(retcode, cmd) > subprocess.CalledProcessError: Command '['conda', 'install', '-v', '--use-local', '-y', 'hg19-civic']' returned non-zero exit status 1 > > > Note. The script states: > > Could not remove or rename /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin/.nfs000000010afff996000008c6. Please remove this file manually (you may need to reboot to free file handles) > > rsync: delete_file: unlink(.nfs000000010afff996000008c6) failed: Device or resource busy (16) > rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2] > Removing folder /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin the fast way (with rsync) failed. Do you have rsync available? > > rm_rf failed for /uufs/chpc.utah.edu/common/home/u0055382/anaconda2/bin > > however, the contents of anaconda2/bin was deleted. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/conda/conda/issues/8258>, or mute the thread > <https://github.com/notifications/unsubscribe-auth/AACV-c7InmuUJe5eeAV9s0j_Ks1CFmlxks5vMfehgaJpZM4a1Pvw> > . > Sorry, I'm trying to make sense of this, but there's a lot of confusing information here: 1. It looks like you got into this by doing a conda build command: ``` No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 INFO:conda_build.variants:Adding in variants from internal_defaults INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic WARNING: symlink_conda() is deprecated. INFO:conda_build.build:Packaging hg19-civic INFO:conda_build.build:Packaging hg19-civic-1-0 No files or script found for output hg19-civic WARNING:conda_build.build:No files or script found for output hg19-civic /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml ``` 2. Then it goes to install stuff in what looks like a base environment install. I don't understand how the conda build command led to this. There's no way that I know of to do that. ``` Solving environment: ...working... done initializing UnlinkLinkTransaction with target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 unlink_precs: link_precs: bioconda::gsort-0.0.6-1 local::hg19-civic-1-0 ## Package Plan ## environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 added / updated specs: - hg19-civic The following packages will be downloaded: package | build ---------------------------|----------------- hg19-civic-1 | 0 6 KB local ------------------------------------------------------------ Total: 6 KB The following NEW packages will be INSTALLED: gsort bioconda/linux-64::gsort-0.0.6-1 hg19-civic uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0 ``` Sorry, but we're going to need more info to make any sense of the situation. What order of commands made this happen? 1) conda build is called to build a local conda package. 2) conda install is calles to install the local package created in step 1. On Mon, Feb 11, 2019 at 4:57 PM Mike Sarahan <[email protected]> wrote: > Sorry, I'm trying to make sense of this, but there's a lot of confusing > information here: > > 1. It looks like you got into this by doing a conda build command: > > No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 > WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11 > INFO:conda_build.variants:Adding in variants from internal_defaults > INFO:conda_build.metadata:Attempting to finalize metadata for hg19-civic > WARNING: symlink_conda() is deprecated. > INFO:conda_build.build:Packaging hg19-civic > INFO:conda_build.build:Packaging hg19-civic-1-0 > No files or script found for output hg19-civic > WARNING:conda_build.build:No files or script found for output hg19-civic > /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1115 Found invalid license "None" in info/index.json > /scratch/local/u0055382/tmp1fopUu/hg19-civic-1-0.tar.bz2: C1134 Found pre/post link file "bin/.hg19-civic-post-link.sh" in archive > INFO:conda_build.variants:Adding in variants from /scratch/local/u0055382/tmpSvYdIK/info/recipe/conda_build_config.yaml > > > 1. Then it goes to install stuff in what looks like a base environment > install. I don't understand how the conda build command led to this. > There's no way that I know of to do that. > > Solving environment: ...working... done > initializing UnlinkLinkTransaction with > target_prefix: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > unlink_precs: > > link_precs: > bioconda::gsort-0.0.6-1 > local::hg19-civic-1-0 > > > > ## Package Plan ## > > environment location: /uufs/chpc.utah.edu/common/home/u0055382/anaconda2 > > added / updated specs: > - hg19-civic > > > The following packages will be downloaded: > > package | build > ---------------------------|----------------- > hg19-civic-1 | 0 6 KB local > ------------------------------------------------------------ > Total: 6 KB > > The following NEW packages will be INSTALLED: > > gsort bioconda/linux-64::gsort-0.0.6-1 > hg19-civic uufs/chpc.utah.edu/common/home/u0055382/anaconda2/conda-bld/noarch::hg19-civic-1-0 > > Sorry, but we're going to need more info to make any sense of the > situation. What order of commands made this happen? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/conda/conda/issues/8258#issuecomment-462544519>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AhmyhiKY6vWYH1-BX028RHType0G0Et4ks5vMgN9gaJpZM4a1Pvw> > . > Here's the problem with what you're saying: ``` conda install --use-local -v -y <recipe> ``` conda does not operate on recipes. This command makes no sense. Conda-build builds packages from recipes, and packages are what conda operates on. Your command history does not show a conda-build command (only some output that looks like conda-build output), and it also does not show a ``conda install`` command (only output that looks like conda install output). Please clarify what exactly you did. My appoligies, it should be <pkg> rather than <recipe>. That is: conda install --use-local -v -y <pkg> I have a script that will run conda build on a recipe, and if the recipe is successfully built into a package it will run conda install on the new package. The actual commands are masked by the script that is running them, but both conda build and conda install are being called. On Mon, Feb 11, 2019 at 5:04 PM Mike Sarahan <[email protected]> wrote: > Here's the problem with what you're saying: > > conda install --use-local -v -y <recipe> > > conda does not operate on recipes. This command makes no sense. > Conda-build builds packages from recipes, and packages are what conda > operates on. Your command history does not show a conda-build command (only > some output that looks like conda-build output), and it also does not show > a conda install command (only output that looks like conda install > output). Please clarify what exactly you did. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/conda/conda/issues/8258#issuecomment-462546196>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AhmyhtmuxMYp-tB6Zr3vxOkJFwf1suL6ks5vMgUegaJpZM4a1Pvw> > . > Thanks, I've created a reproducer. It removes the folder where the post-link script was - so $PREFIX/bin on unix, and %PREFIX%\Scripts on Windows. I'll look into a fix and add a test. This should fix it. The problem is that the transaction thinks it created the folder (because it always tries to), so it should also try to remove it. ``` diff --git a/conda/core/path_actions.py b/conda/core/path_actions.py index b6375c769..5fd15f082 100644 --- a/conda/core/path_actions.py +++ b/conda/core/path_actions.py @@ -6,7 +6,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera from abc import ABCMeta, abstractmethod, abstractproperty from errno import EXDEV from logging import getLogger -from os.path import basename, dirname, getsize, join +from os.path import basename, dirname, getsize, join, isdir import re from uuid import uuid4 @@ -370,7 +370,8 @@ class LinkPathAction(CreateInPrefixPathAction): def reverse(self): if self._execute_successful: log.trace("reversing link creation %s", self.target_prefix) - rm_rf(self.target_full_path, clean_empty_parents=True) + if not isdir(self.target_full_path): + rm_rf(self.target_full_path, clean_empty_parents=True) class PrefixReplaceLinkAction(LinkPathAction): @@ -975,7 +976,8 @@ class UnlinkPathAction(RemoveFromPrefixPathAction): backoff_rename(self.holding_full_path, self.target_full_path, force=True) def cleanup(self): - rm_rf(self.holding_full_path, clean_empty_parents=True) + if not isdir(self.holding_full_path): + rm_rf(self.holding_full_path, clean_empty_parents=True) class RemoveMenuAction(RemoveFromPrefixPathAction): ``` I'll put up a PR with the test package a little later.
2019-02-12T02:00:08Z
[]
[]
conda/conda
8,289
conda__conda-8289
[ "8241" ]
3fb40e1e02609ea851bbbd13186b62bddb3b2f8f
diff --git a/conda/activate.py b/conda/activate.py --- a/conda/activate.py +++ b/conda/activate.py @@ -532,8 +532,13 @@ def expand(path): def ensure_binary(value): + encoding = 'utf-8' + if on_win: + import ctypes + acp = ctypes.cdll.kernel32.GetACP() + encoding = str(acp) try: - return value.encode('utf-8') + return value.encode(encoding) except AttributeError: # pragma: no cover # AttributeError: '<>' object has no attribute 'encode' # In this case assume already binary type and do nothing diff --git a/conda/common/compat.py b/conda/common/compat.py --- a/conda/common/compat.py +++ b/conda/common/compat.py @@ -215,7 +215,7 @@ def ensure_text_type(value): except ImportError: # pragma: no cover from pip._vendor.requests.packages.chardet import detect encoding = detect(value).get('encoding') or 'utf-8' - return value.decode(encoding) + return value.decode(encoding, errors='replace') except UnicodeEncodeError: # pragma: no cover # it's already text_type, so ignore? # not sure, surfaced with tests/models/test_match_spec.py test_tarball_match_specs
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -2156,7 +2156,7 @@ def test_post_link_run_in_env(self): test_pkg = '_conda_test_env_activated_when_post_link_executed' # a non-unicode name must be provided here as activate.d scripts # are not execuated on windows, see https://github.com/conda/conda/issues/8241 - with make_temp_env(test_pkg, '-c conda-test', name='post_link_test') as prefix: + with make_temp_env(test_pkg, '-c conda-test') as prefix: assert package_is_installed(prefix, test_pkg) def test_conda_info_python(self):
activate.d scripts not run on windows if prefix contains unicode activate.d scripts are not run on windows if the path contains unicode characters. A test for this is to create environments with and without unicode characters with the `_test_set_env_in_activate_d` package in the `jjhelmus` channel. When activated the `TEST_VAR` variable should be set to "1". In environments with unicode characters running the activate.d script fails because of an invalid path in the activation script.
2019-02-14T20:30:16Z
[]
[]
conda/conda
8,342
conda__conda-8342
[ "8341" ]
ad31c75a4e73a423ef584b2918adece9301d6c6e
diff --git a/conda/activate.py b/conda/activate.py --- a/conda/activate.py +++ b/conda/activate.py @@ -530,8 +530,7 @@ def ensure_binary(value): encoding = 'utf-8' if on_win: import ctypes - acp = ctypes.cdll.kernel32.GetACP() - encoding = str(acp) + encoding = 'cp' + str(ctypes.cdll.kernel32.GetACP()) try: return value.encode(encoding) except AttributeError: # pragma: no cover @@ -736,7 +735,7 @@ def _build_activate_shell_custom(self, export_vars): if on_win: import ctypes export_vars.update({ - "PYTHONIOENCODING": ctypes.cdll.kernel32.GetACP(), + "PYTHONIOENCODING": 'cp' + str(ctypes.cdll.kernel32.GetACP()), }) def _hook_preamble(self):
diff --git a/tests/test_activate.py b/tests/test_activate.py --- a/tests/test_activate.py +++ b/tests/test_activate.py @@ -38,7 +38,7 @@ if on_win: import ctypes - PYTHONIOENCODING = ctypes.cdll.kernel32.GetACP() + PYTHONIOENCODING = 'cp' + str(ctypes.cdll.kernel32.GetACP()) else: PYTHONIOENCODING = None
LookupError: unknown encoding: 65001 caused by pull/8289 <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> ![image](https://user-images.githubusercontent.com/4780199/53404057-d250fa00-39ef-11e9-9b54-57a880fc09e7.png) ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` chcp 65001 conda update --all ``` ## Expected Behavior <!-- What do you think should happen? --> No Exception should be throw ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : None user config file : C:\Users\xxxxx\.condarc populated config files : C:\Users\xxxxx\.condarc conda version : 4.6.7 conda-build version : not installed python version : 3.7.2.final.0 base environment : D:\Miniconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/win-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : D:\Miniconda3\pkgs C:\Users\xxxxx\.conda\pkgs C:\Users\xxxxx\AppData\Local\conda\conda\pkgs envs directories : D:\Miniconda3\envs C:\Users\xxxxx\.conda\envs C:\Users\xxxxx\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.6.7 requests/2.21.0 CPython/3.7.2 Windows/10 Windows/10.0.17763 administrator : False netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ==> C:\Users\xxxxx\.condarc <== ssl_verify: True channels: - defaults report_errors: False ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at D:\Miniconda3: # # Name Version Build Channel asn1crypto 0.24.0 py37_0 defaults backcall 0.1.0 py37_0 defaults bleach 3.1.0 py37_0 defaults ca-certificates 2019.1.23 0 defaults certifi 2018.11.29 py37_0 defaults cffi 1.11.5 py37h74b6da3_1 defaults chardet 3.0.4 py37_1 defaults colorama 0.4.1 py37_0 defaults conda 4.6.7 py37_0 defaults conda-env 2.6.0 1 defaults console_shortcut 0.1.1 3 defaults cryptography 2.5 py37h7a1dbc1_0 defaults decorator 4.3.2 py37_0 defaults entrypoints 0.3 py37_0 defaults idna 2.8 py37_0 defaults ipykernel 5.1.0 py37h39e3cac_0 defaults ipython 7.3.0 py37h39e3cac_0 defaults ipython_genutils 0.2.0 py37_0 defaults jedi 0.13.2 py37_0 defaults jinja2 2.10 py37_0 defaults jsonschema 2.6.0 py37_0 defaults jupyter_client 5.2.4 py37_0 defaults jupyter_core 4.4.0 py37_0 defaults jupyterlab_server 0.2.0 py37_0 defaults libsodium 1.0.16 h9d3ae62_0 defaults m2w64-gcc-libgfortran 5.3.0 6 defaults m2w64-gcc-libs 5.3.0 7 defaults m2w64-gcc-libs-core 5.3.0 7 defaults m2w64-gmp 6.1.0 2 defaults m2w64-libwinpthread-git 5.0.0.4634.697f757 2 defaults markupsafe 1.1.0 py37he774522_0 defaults menuinst 1.4.14 py37hfa6e2cd_0 defaults mistune 0.8.4 py37he774522_0 defaults msys2-conda-epoch 20160418 1 defaults nbconvert 5.3.1 py37_0 defaults nbformat 4.4.0 py37_0 defaults notebook 5.7.4 py37_0 defaults openssl 1.1.1a he774522_0 defaults pandoc 2.2.3.2 0 defaults pandocfilters 1.4.2 py37_1 defaults parso 0.3.2 py37_0 defaults pickleshare 0.7.5 py37_0 defaults pip 19.0.1 py37_0 defaults prometheus_client 0.5.0 py37_0 defaults prompt_toolkit 2.0.8 py_0 defaults pycosat 0.6.3 py37hfa6e2cd_0 defaults pycparser 2.19 py37_0 defaults pygments 2.3.1 py37_0 defaults pyopenssl 19.0.0 py37_0 defaults pysocks 1.6.8 py37_0 defaults python 3.7.2 h8c8aaf0_10 defaults python-dateutil 2.7.5 py37_0 defaults pywin32 223 py37hfa6e2cd_1 defaults pywinpty 0.5.5 py37_1000 defaults pyzmq 17.1.2 py37ha925a31_2 defaults requests 2.21.0 py37_0 defaults ruamel_yaml 0.15.46 py37hfa6e2cd_0 defaults send2trash 1.5.0 py37_0 defaults setuptools 40.8.0 py37_0 defaults six 1.12.0 py37_0 defaults sqlite 3.26.0 he774522_0 defaults terminado 0.8.1 py37_1 defaults testpath 0.4.2 py37_0 defaults tornado 5.1.1 py37hfa6e2cd_0 defaults traitlets 4.3.2 py37_0 defaults urllib3 1.24.1 py37_0 defaults vc 14.1 h0510ff6_4 defaults vs2015_runtime 14.15.26706 h3a45250_0 defaults wcwidth 0.1.7 py37_0 defaults webencodings 0.5.1 py37_1 defaults wheel 0.32.3 py37_0 defaults win_inet_pton 1.0.1 py37_1 defaults wincertstore 0.2 py37_0 defaults winpty 0.4.3 4 defaults yaml 0.1.7 hc54c509_2 defaults zeromq 4.3.1 h33f27b4_3 defaults ``` </p></details>
pr https://github.com/conda/conda/pull/8289 caused this problem by introduce: ``` if on_win: import ctypes acp = ctypes.cdll.kernel32.GetACP() encoding = str(acp) try: return value.encode(encoding) ``` https://github.com/conda/conda/blob/master/conda/activate.py#L533-L534 cdll.kernel32.GetACP() returns codepage number, which should not be use as encode format without 'cp' prefix. instead it should be: ``` encoding = 'cp' + str(cdll.kernel32.GetACP()) ``` ![image](https://user-images.githubusercontent.com/4780199/53404770-4f30a380-39f1-11e9-9865-201be93efbdb.png) I believe it also caused issue https://github.com/conda/conda/issues/8327 ``` "PYTHONIOENCODING": ctypes.cdll.kernel32.GetACP(), ``` https://github.com/conda/conda/blob/master/conda/activate.py#L739 here should be another problem, 'cp' prefix should be included
2019-02-26T10:57:13Z
[]
[]
conda/conda
8,444
conda__conda-8444
[ "8391" ]
b94d9f4d750c8028531eb589a5e2d7fad819d806
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -354,9 +354,19 @@ def _find_inconsistent_packages(self, ssc): log.debug("inconsistent precs: %s", dashlist(inconsistent_precs) if inconsistent_precs else 'None') if inconsistent_precs: + print(dedent(""" + The environment is inconsistent, please check the package plan carefully + The following packages are causing the inconsistency:""")) + print(dashlist(inconsistent_precs)) for prec in inconsistent_precs: # pop and save matching spec in specs_map - ssc.add_back_map[prec.name] = (prec, ssc.specs_map.pop(prec.name, None)) + spec = ssc.specs_map.pop(prec.name, None) + ssc.add_back_map[prec.name] = (prec, spec) + # inconsistent environments should maintain the python version + # unless explicitly requested by the user. This along with the logic in + # _add_specs maintains the major.minor version + if prec.name == 'python': + ssc.specs_map['python'] = spec ssc.solution_precs = tuple(prec for prec in ssc.solution_precs if prec not in inconsistent_precs) return ssc diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -892,6 +892,13 @@ def bad_installed(self, installed, new_specs): sat_name_map[self.to_sat_name(prec)] = prec specs.append(MatchSpec('%s %s %s' % (prec.name, prec.version, prec.build))) new_index = {prec: prec for prec in itervalues(sat_name_map)} + name_map = {p.name: p for p in new_index} + if 'python' in name_map and 'pip' not in name_map: + python_prec = new_index[name_map['python']] + if 'pip' in python_prec.depends: + # strip pip dependency from python if not installed in environment + new_deps = [d for d in python_prec.depends if d != 'pip'] + python_prec.depends = new_deps r2 = Resolve(new_index, True, channels=self.channels) C = r2.gen_clauses() constraints = r2.generate_spec_constraints(C, specs)
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -598,7 +598,7 @@ def test_create_empty_env(self): assert stderr == '' self.assertIsInstance(stdout, str) - @pytest.mark.skipif(on_win and context.subdir == "win-32", reason="conda-forge doesn't do win-32") + @pytest.mark.skipif(reason="conda-forge doesn't have a full set of packages") def test_strict_channel_priority(self): stdout, stderr = run_command( Commands.CREATE, "/", diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -1030,6 +1030,20 @@ def test_broken_install(): # always insure installed packages _are_ in the index +def test_pip_depends_removed_on_inconsistent_env(): + installed = r.install(['python 2.7*']) + pkg_names = [p.name for p in installed] + assert 'python' in pkg_names + assert 'pip' not in pkg_names + # add pip as python dependency + for pkg in installed: + if pkg.name == 'python': + pkg.depends += ('pip', ) + assert pkg.name != 'pip' + bad_pkgs = r.bad_installed(installed, [])[0] + assert bad_pkgs is None + + def test_remove(): installed = r.install(['pandas', 'python 2.7*']) _installed = [rec.dist_str() for rec in installed]
conda install command upgraded Python from 3.6 to 3.7 but did not upgrade all other packages ## Current Behavior I'm using my "catch-all" environment where I have a whole bunch of stuff installed, managed by conda. The full revision history is below. I tried to install two packages (that were possibly already there). The package plan upgraded Python to 3.7, which I would expect to upgrade *all* packages, at least those that are not pure Python. After I proceeded with the installation against my better judgment, indeed, everything was borked — IPython, NumPy, etc. ### Steps to Reproduce Unfortunately I don't have a minimal example, but I am providing my full environment history in case it is sufficient. I was at Rev 33, and typed: ``` conda install pygithub tqdm --channel conda-forge ``` (But the channel had no real effect as far as I can tell.) This resulted in rev 34 which included Python 3.7, but not py37 packages of everything else installed in the environment. conda output: <details> ``` $ conda install pygithub tqdm --channel conda-forge Collecting package metadata: done Solving environment: / WARNING conda.common.logic:get_sat_solver_cls(278): Could not run SAT solver through interface 'pycryptosat'. done ## Package Plan ## environment location: /home/jni/miniconda3/envs/cf added / updated specs: - pygithub - tqdm The following packages will be downloaded: package | build ---------------------------|----------------- asn1crypto-0.24.0 | py37_1003 154 KB conda-forge certifi-2018.11.29 | py37_1000 145 KB conda-forge cffi-1.12.2 | py37h9745a5d_0 217 KB conda-forge chardet-3.0.4 | py37_1003 167 KB conda-forge cryptography-2.5 | py37hb7f436b_1 643 KB conda-forge curl-7.64.0 | h646f8bb_0 143 KB conda-forge deprecated-1.2.4 | py_0 9 KB conda-forge idna-2.8 | py37_1000 100 KB conda-forge krb5-1.16.3 | hc83ff2d_1000 1.4 MB conda-forge libcurl-7.64.0 | h01ee5af_0 586 KB conda-forge libgfortran-3.0.0 | 1 281 KB conda-forge libspatialite-4.3.0a | h9968ff2_1023 3.1 MB conda-forge openssl-1.0.2r | h14c3975_0 3.1 MB conda-forge pip-19.0.3 | py37_0 1.8 MB conda-forge pygithub-1.43.5 | py37_0 2.0 MB conda-forge pyjwt-1.7.1 | py_0 17 KB conda-forge pyopenssl-19.0.0 | py37_0 81 KB conda-forge pysocks-1.6.8 | py37_1002 22 KB conda-forge python-3.7.1 | hd21baee_1001 36.4 MB conda-forge requests-2.21.0 | py37_1000 84 KB conda-forge setuptools-40.8.0 | py37_0 625 KB conda-forge six-1.12.0 | py37_1000 22 KB conda-forge tqdm-4.31.1 | py_0 40 KB conda-forge urllib3-1.24.1 | py37_1000 148 KB conda-forge wheel-0.33.1 | py37_0 34 KB conda-forge wrapt-1.11.1 | py37h14c3975_0 45 KB conda-forge ------------------------------------------------------------ Total: 51.3 MB The following NEW packages will be INSTALLED: deprecated conda-forge/noarch::deprecated-1.2.4-py_0 pip conda-forge/linux-64::pip-19.0.3-py37_0 The following packages will be UPDATED: asn1crypto 0.24.0-py36_0 --> 0.24.0-py37_1003 cffi 1.11.5-py36_0 --> 1.12.2-py37h9745a5d_0 chardet 3.0.4-py36_0 --> 3.0.4-py37_1003 cryptography pkgs/main::cryptography-2.4.2-py36h1b~ --> conda-forge::cryptography-2.5-py37hb7f436b_1 curl pkgs/main::curl-7.62.0-hbc83047_0 --> conda-forge::curl-7.64.0-h646f8bb_0 idna 2.6-py36_1 --> 2.8-py37_1000 krb5 1.14.6-0 --> 1.16.3-hc83ff2d_1000 libcurl pkgs/main::libcurl-7.62.0-h20c2e04_0 --> conda-forge::libcurl-7.64.0-h01ee5af_0 libspatialite pkgs/main::libspatialite-4.3.0a-h7274~ --> conda-forge::libspatialite-4.3.0a-h9968ff2_1023 pycparser conda-forge/linux-64::pycparser-2.18-~ --> conda-forge/noarch::pycparser-2.19-py_0 pygithub 1.39-py36_0 --> 1.43.5-py37_0 pyjwt 1.6.4-py_0 --> 1.7.1-py_0 pyopenssl 18.0.0-py36_0 --> 19.0.0-py37_0 pysocks 1.6.8-py36_1 --> 1.6.8-py37_1002 python pkgs/main::python-3.6.8-h0371630_0 --> conda-forge::python-3.7.1-hd21baee_1001 requests 2.18.4-py36_1 --> 2.21.0-py37_1000 setuptools 39.1.0-py36_0 --> 40.8.0-py37_0 six 1.11.0-py36_1 --> 1.12.0-py37_1000 tqdm 4.26.0-py_0 --> 4.31.1-py_0 urllib3 1.22-py36_0 --> 1.24.1-py37_1000 wheel 0.31.0-py36_0 --> 0.33.1-py37_0 wrapt pkgs/main::wrapt-1.10.11-py36h14c3975~ --> conda-forge::wrapt-1.11.1-py37h14c3975_0 The following packages will be SUPERSEDED by a higher-priority channel: dbus pkgs/main::dbus-1.13.2-h714fa37_1 --> conda-forge::dbus-1.13.0-h4e0c4b3_1000 expat pkgs/main::expat-2.2.6-he6710b0_0 --> conda-forge::expat-2.2.5-hf484d3e_1002 gst-plugins-base pkgs/main::gst-plugins-base-1.14.0-hb~ --> conda-forge::gst-plugins-base-1.12.5-h3865690_1000 gstreamer pkgs/main::gstreamer-1.14.0-hb453b48_1 --> conda-forge::gstreamer-1.12.5-h0cc0488_1000 libgcc-ng pkgs/main::libgcc-ng-8.2.0-hdf63c60_1 --> conda-forge::libgcc-ng-7.3.0-hdf63c60_0 libgfortran pkgs/free --> conda-forge libstdcxx-ng pkgs/main::libstdcxx-ng-8.2.0-hdf63c6~ --> conda-forge::libstdcxx-ng-7.3.0-hdf63c60_0 pcre pkgs/main::pcre-8.42-h439df22_0 --> conda-forge::pcre-8.41-hf484d3e_1003 qt pkgs/main::qt-5.9.7-h5867ecd_1 --> conda-forge::qt-5.6.2-hf70d934_9 The following packages will be DOWNGRADED: certifi 2018.11.29-py36_1000 --> 2018.11.29-py37_1000 openssl 1.1.1a-h14c3975_1000 --> 1.0.2r-h14c3975_0 Proceed ([y]/n)? y Downloading and Extracting Packages deprecated-1.2.4 | 9 KB | ################################################################################################################################################################################################################### | 100% python-3.7.1 | 36.4 MB | ################################################################################################################################################################################################################### | 100% libspatialite-4.3.0a | 3.1 MB | ################################################################################################################################################################################################################### | 100% six-1.12.0 | 22 KB | ################################################################################################################################################################################################################### | 100% certifi-2018.11.29 | 145 KB | ################################################################################################################################################################################################################### | 100% tqdm-4.31.1 | 40 KB | ################################################################################################################################################################################################################### | 100% idna-2.8 | 100 KB | ################################################################################################################################################################################################################### | 100% pyopenssl-19.0.0 | 81 KB | ################################################################################################################################################################################################################### | 100% libgfortran-3.0.0 | 281 KB | ################################################################################################################################################################################################################### | 100% pyjwt-1.7.1 | 17 KB | ################################################################################################################################################################################################################### | 100% cffi-1.12.2 | 217 KB | ################################################################################################################################################################################################################### | 100% pysocks-1.6.8 | 22 KB | ################################################################################################################################################################################################################### | 100% chardet-3.0.4 | 167 KB | ################################################################################################################################################################################################################### | 100% pygithub-1.43.5 | 2.0 MB | ################################################################################################################################################################################################################### | 100% curl-7.64.0 | 143 KB | ################################################################################################################################################################################################################### | 100% wheel-0.33.1 | 34 KB | ################################################################################################################################################################################################################### | 100% requests-2.21.0 | 84 KB | ################################################################################################################################################################################################################### | 100% libcurl-7.64.0 | 586 KB | ################################################################################################################################################################################################################### | 100% pip-19.0.3 | 1.8 MB | ################################################################################################################################################################################################################### | 100% krb5-1.16.3 | 1.4 MB | ################################################################################################################################################################################################################### | 100% cryptography-2.5 | 643 KB | ################################################################################################################################################################################################################### | 100% urllib3-1.24.1 | 148 KB | ################################################################################################################################################################################################################### | 100% asn1crypto-0.24.0 | 154 KB | ################################################################################################################################################################################################################### | 100% openssl-1.0.2r | 3.1 MB | ################################################################################################################################################################################################################### | 100% setuptools-40.8.0 | 625 KB | ################################################################################################################################################################################################################### | 100% wrapt-1.11.1 | 45 KB | ################################################################################################################################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done ``` </details> revision history: <details> ``` $ conda list --revisions 2018-05-19 15:23:23 (rev 0) +affine-2.2.0 (conda-forge) +altair-2.0.1 (conda-forge) +appdirs-1.4.3 (conda-forge) +asn1crypto-0.24.0 (conda-forge) +attrs-18.1.0 (conda-forge) +backcall-0.1.0 (conda-forge) +backports-1.0 (conda-forge) +backports.weakref-1.0rc1 (conda-forge) +beautifulsoup4-4.6.0 (conda-forge) +blas-1.1 (conda-forge) +bleach-1.5.0 (conda-forge) +blosc-1.14.0 (conda-forge) +bokeh-0.12.15 (conda-forge) +boost-1.66.0 (conda-forge) +boost-cpp-1.66.0 (conda-forge) +boto3-1.7.24 (conda-forge) +botocore-1.10.24 (conda-forge) +bottleneck-1.2.1 (conda-forge) +branca-0.3.0 (conda-forge) +bzip2-1.0.6 (conda-forge) +ca-certificates-2018.4.16 (conda-forge) +cairo-1.14.12 +cartopy-0.16.0 (conda-forge) +certifi-2018.4.16 (conda-forge) +cffi-1.11.5 (conda-forge) +chardet-3.0.4 (conda-forge) +click-6.7 (conda-forge) +click-plugins-1.0.3 (conda-forge) +cligj-0.4.0 (conda-forge) +cloudpickle-0.5.3 (conda-forge) +colorcet-1.0.0 (conda-forge) +coverage-4.5.1 (conda-forge) +cryptography-2.2.1 (conda-forge) +curl-7.59.0 (conda-forge) +cycler-0.10.0 (conda-forge) +cython-0.28.2 (conda-forge) +cytoolz-0.9.0.1 (conda-forge) +dask-0.15.2 (conda-forge) +dask-core-0.15.2 (conda-forge) +datashader-0.6.2 (conda-forge) +datashape-0.5.4 (conda-forge) +dbus-1.13.2 +decorator-4.3.0 (conda-forge) +descartes-1.1.0 (conda-forge) +distributed-1.18.1 (conda-forge) +docutils-0.14 (conda-forge) +entrypoints-0.2.3 (conda-forge) +et_xmlfile-1.0.1 (conda-forge) +expat-2.2.5 (conda-forge) +fastcache-1.0.2 (conda-forge) +fftw-3.3.7 (conda-forge) +fiona-1.7.11 (conda-forge) +folium-0.5.0 (conda-forge) +fontconfig-2.12.6 (conda-forge) +freetype-2.8.1 (conda-forge) +freexl-1.0.5 (conda-forge) +funcsigs-1.0.2 (conda-forge) +gdal-2.2.2 +geopandas-0.3.0 (conda-forge) +geos-3.6.2 (conda-forge) +giflib-5.1.4 (conda-forge) +glib-2.53.6 +gmp-6.1.2 (conda-forge) +gmpy2-2.0.8 (conda-forge) +gputools-0.2.6 (talley) +graphite2-1.3.11 (conda-forge) +graphviz-2.38.0 (conda-forge) +gst-plugins-base-1.12.4 +gstreamer-1.12.4 +h5netcdf-0.5.1 (conda-forge) +h5py-2.8.0 (conda-forge) +harfbuzz-1.7.6 +hdf4-4.2.13 (conda-forge) +hdf5-1.10.1 (conda-forge) +heapdict-1.0.0 (conda-forge) +holoviews-1.10.4 (conda-forge) +html5lib-0.9999999 (conda-forge) +hypothesis-3.56.9 (conda-forge) +icu-58.2 (conda-forge) +idna-2.6 (conda-forge) +imageio-2.3.0 (conda-forge) +ipykernel-4.8.2 (conda-forge) +ipython-6.4.0 (conda-forge) +ipython_genutils-0.2.0 (conda-forge) +ipywidgets-7.2.1 (conda-forge) +jdcal-1.4 (conda-forge) +jedi-0.12.0 (conda-forge) +jinja2-2.10 (conda-forge) +jmespath-0.9.3 (conda-forge) +jpeg-9b (conda-forge) +json-c-0.12.1 (conda-forge) +jsonschema-2.6.0 (conda-forge) +jupyter-1.0.0 (conda-forge) +jupyter_client-5.2.3 (conda-forge) +jupyter_console-5.2.0 (conda-forge) +jupyter_core-4.4.0 (conda-forge) +kealib-1.4.7 (conda-forge) +kiwisolver-1.0.1 (conda-forge) +krb5-1.14.6 (conda-forge) +libdap4-3.19.2 (conda-forge) +libffi-3.2.1 (conda-forge) +libgcc-ng-7.2.0 +libgdal-2.2.2 +libgfortran-3.0.0 +libiconv-1.15 (conda-forge) +libkml-1.3.0 (conda-forge) +libnetcdf-4.4.1.1 (conda-forge) +libpng-1.6.34 (conda-forge) +libpq-9.6.6 +libprotobuf-3.5.2 (conda-forge) +libsodium-1.0.16 (conda-forge) +libspatialindex-1.8.5 (conda-forge) +libspatialite-4.3.0a +libssh2-1.8.0 (conda-forge) +libstdcxx-ng-7.2.0 +libtiff-4.0.9 (conda-forge) +libtool-2.4.6 (conda-forge) +libxcb-1.13 (conda-forge) +libxml2-2.9.8 (conda-forge) +libxslt-1.1.32 (conda-forge) +line_profiler-2.1.2 (conda-forge) +llvmlite-0.23.0 (conda-forge) +locket-0.2.0 (conda-forge) +lxml-4.2.1 (conda-forge) +lzo-2.10 (conda-forge) +mako-1.0.7 (conda-forge) +markdown-2.6.11 (conda-forge) +markupsafe-1.0 (conda-forge) +matplotlib-2.2.2 +memory_profiler-0.52.0 (conda-forge) +mistune-0.8.3 (conda-forge) +mock-2.0.0 (conda-forge) +more-itertools-4.1.0 (conda-forge) +mpc-1.1.0 (conda-forge) +mpfr-3.1.5 (conda-forge) +mpmath-1.0.0 (conda-forge) +msgpack-python-0.5.6 (conda-forge) +multipledispatch-0.5.0 (conda-forge) +munch-2.3.2 (conda-forge) +nbconvert-5.3.1 (conda-forge) +nbformat-4.4.0 (conda-forge) +ncurses-5.9 (conda-forge) +netcdf4-1.3.1 (conda-forge) +networkx-2.1 (conda-forge) +notebook-5.5.0 (conda-forge) +numba-0.38.0 (conda-forge) +numexpr-2.6.5 (conda-forge) +numpy-1.11.3 (conda-forge) +ocl-icd-2.2.9 (conda-forge) +olefile-0.45.1 (conda-forge) +openblas-0.2.20 (conda-forge) +openjpeg-2.3.0 (conda-forge) +openpyxl-2.5.3 (conda-forge) +openssl-1.0.2o (conda-forge) +owslib-0.16.0 (conda-forge) +packaging-17.1 (conda-forge) +pandas-0.23.0 (conda-forge) +pandoc-2.2.1 (conda-forge) +pandocfilters-1.4.2 (conda-forge) +pango-1.40.14 (conda-forge) +param-1.6.1 (conda-forge) +parso-0.2.0 (conda-forge) +partd-0.3.8 (conda-forge) +patsy-0.5.0 (conda-forge) +pbr-4.0.2 (conda-forge) +pcre-8.41 (conda-forge) +pexpect-4.5.0 (conda-forge) +pickleshare-0.7.4 (conda-forge) +pillow-5.1.0 (conda-forge) +pint-0.8.1 (conda-forge) +pip-9.0.3 (conda-forge) +pixman-0.34.0 (conda-forge) +plotly-2.6.0 (conda-forge) +pluggy-0.6.0 (conda-forge) +poppler-0.60.1 +poppler-data-0.4.9 (conda-forge) +proj4-4.9.3 (conda-forge) +prompt_toolkit-1.0.15 (conda-forge) +protobuf-3.5.2 (conda-forge) +psutil-5.4.5 (conda-forge) +psycopg2-2.7.4 (conda-forge) +ptyprocess-0.5.2 (conda-forge) +py-1.5.3 (conda-forge) +pycparser-2.18 (conda-forge) +pyepsg-0.3.2 (conda-forge) +pygments-2.2.0 (conda-forge) +pyopencl-2018.1.1 (conda-forge) +pyopengl-3.1.1a1 (conda-forge) +pyopenssl-18.0.0 (conda-forge) +pyparsing-2.2.0 (conda-forge) +pyproj-1.9.5.1 (conda-forge) +pyqt-5.9.2 +pysal-1.14.3 (conda-forge) +pyshp-1.2.12 (conda-forge) +pysocks-1.6.8 (conda-forge) +pytables-3.4.3 (conda-forge) +pytest-3.5.1 (conda-forge) +pytest-cov-2.5.1 (conda-forge) +python-3.6.3 +python-dateutil-2.7.3 (conda-forge) +python-graphviz-0.8.3 (conda-forge) +pytools-2018.4 (conda-forge) +pytz-2018.4 (conda-forge) +pywavelets-0.5.2 (conda-forge) +pyyaml-3.12 (conda-forge) +pyzmq-17.0.0 (conda-forge) +qt-5.9.4 +qtconsole-4.3.1 (conda-forge) +rasterio-0.36.0 (conda-forge) +readline-7.0 (conda-forge) +reikna-0.6.8 (conda-forge) +requests-2.18.4 (conda-forge) +rtree-0.8.3 (conda-forge) +s3transfer-0.1.13 (conda-forge) +scikit-image-0.13.1 (conda-forge) +scikit-learn-0.19.1 (conda-forge) +scipy-1.1.0 (conda-forge) +seaborn-0.8.1 (conda-forge) +send2trash-1.5.0 (conda-forge) +setuptools-39.1.0 (conda-forge) +shapely-1.6.4 (conda-forge) +simplegeneric-0.8.1 (conda-forge) +sip-4.19.8 (conda-forge) +six-1.11.0 (conda-forge) +snakeviz-0.4.2 +snuggs-1.4.1 (conda-forge) +sortedcontainers-1.5.10 (conda-forge) +spimagine-0.2.5 (talley) +sqlalchemy-1.2.7 (conda-forge) +sqlite-3.22.0 (conda-forge) +statsmodels-0.8.0 (conda-forge) +sympy-1.1.1 (conda-forge) +tblib-1.3.2 (conda-forge) +tensorflow-1.3.0 (conda-forge) +terminado-0.8.1 (conda-forge) +testpath-0.3.1 (conda-forge) +tk-8.6.7 (conda-forge) +toolz-0.9.0 (conda-forge) +tornado-4.4.3 (conda-forge) +tqdm-4.23.3 (conda-forge) +traitlets-4.3.2 (conda-forge) +typing-3.6.4 (conda-forge) +urllib3-1.22 (conda-forge) +util-linux-2.21 +vigra-1.11.1 (conda-forge) +vincent-0.4.4 (conda-forge) +wcwidth-0.1.7 (conda-forge) +webencodings-0.5 (conda-forge) +werkzeug-0.14.1 (conda-forge) +wheel-0.31.0 (conda-forge) +widgetsnbextension-3.2.1 (conda-forge) +xarray-0.10.4 (conda-forge) +xerces-c-3.2.1 (conda-forge) +xgboost-0.71 (conda-forge) +xlrd-1.1.0 (conda-forge) +xlwt-1.3.0 (conda-forge) +xorg-libxau-1.0.8 (conda-forge) +xorg-libxdmcp-1.1.2 (conda-forge) +xz-5.2.3 (conda-forge) +yaml-0.1.7 (conda-forge) +zeromq-4.2.5 (conda-forge) +zict-0.1.3 (conda-forge) +zlib-1.2.11 (conda-forge) 2018-05-31 08:58:13 (rev 1) +asv-0.2.1 (conda-forge) 2018-05-31 09:00:04 (rev 2) ca-certificates {2018.4.16 (conda-forge) -> 2018.03.07} certifi {2018.4.16 (conda-forge) -> 2018.4.16} openssl {1.0.2o (conda-forge) -> 1.0.2o} 2018-05-31 09:01:58 (rev 3) ca-certificates {2018.03.07 -> 2018.4.16 (conda-forge)} certifi {2018.4.16 -> 2018.4.16 (conda-forge)} openssl {1.0.2o -> 1.0.2o (conda-forge)} 2018-05-31 09:05:23 (rev 4) numpy {1.11.3 (conda-forge) -> 1.14.3 (conda-forge)} -spimagine-0.2.5 (talley) 2018-06-01 08:49:49 (rev 5) +ipdb-0.11 (conda-forge) 2018-06-06 12:30:52 (rev 6) +gast-0.2.0 (conda-forge) +ply-3.11 (conda-forge) +pythran-0.8.5 (conda-forge) 2018-06-07 11:27:13 (rev 7) +altgraph-0.15 (conda-forge) +macholib-1.8 (conda-forge) +pycrypto-2.6.1 (conda-forge) +pyinstaller-3.3.1 (conda-forge) 2018-06-12 16:46:45 (rev 8) +vispy-0.5.3 (conda-forge) 2018-06-15 19:48:49 (rev 9) fiona {1.7.11 (conda-forge) -> 1.7.12 (conda-forge)} 2018-06-22 16:33:56 (rev 10) +ipyvolume-0.4.5 (conda-forge) +ipywebrtc-0.3.0 (conda-forge) +traittypes-0.2.1 (conda-forge) 2018-07-14 15:19:20 (rev 11) numba {0.38.0 (conda-forge) -> 0.38.1 (conda-forge)} 2018-07-25 13:42:17 (rev 12) +pudb-2018.1 (conda-forge) +urwid-1.3.1 (conda-forge) 2018-08-24 15:05:37 (rev 13) ca-certificates {2018.4.16 (conda-forge) -> 2018.8.13 (conda-forge)} certifi {2018.4.16 (conda-forge) -> 2018.8.13 (conda-forge)} openssl {1.0.2o (conda-forge) -> 1.0.2o (conda-forge)} seaborn {0.8.1 (conda-forge) -> 0.9.0 (conda-forge)} 2018-09-18 10:21:40 (rev 14) bokeh {0.12.15 (conda-forge) -> 0.13.0} 2018-09-21 15:47:27 (rev 15) ca-certificates {2018.8.13 (conda-forge) -> 2018.8.24 (conda-forge)} certifi {2018.8.13 (conda-forge) -> 2018.8.24 (conda-forge)} openssl {1.0.2o (conda-forge) -> 1.0.2p (conda-forge)} +flask-1.0.2 (conda-forge) +itsdangerous-0.24 (conda-forge) 2018-10-01 15:54:43 (rev 16) certifi {2018.8.24 (conda-forge) -> 2018.8.24 (conda-forge)} tqdm {4.23.3 (conda-forge) -> 4.26.0 (conda-forge)} +pygithub-1.39 (conda-forge) +pyjwt-1.6.4 (conda-forge) 2018-10-02 19:25:36 (rev 17) +conda-4.5.11 (conda-forge) +conda-build-3.15.1 (conda-forge) +conda-env-2.6.0 (conda-forge) +conda-forge-pinning-2018.10.01 (conda-forge) +conda-smithy-3.1.12 (conda-forge) +filelock-3.0.4 (conda-forge) +gitdb2-2.0.4 (conda-forge) +gitpython-2.1.11 (conda-forge) +glob2-0.6 (conda-forge) +patchelf-0.9 (conda-forge) +pkginfo-1.4.2 (conda-forge) +pycosat-0.6.3 (conda-forge) +ruamel.yaml-0.15.71 (conda-forge) +ruamel_yaml-0.15.71 (conda-forge) +smmap2-2.0.4 (conda-forge) 2018-10-02 22:58:20 (rev 18) cairo {1.14.12 -> 1.14.12 (conda-forge)} dbus {1.13.2 -> 1.13.0 (conda-forge)} fontconfig {2.12.6 (conda-forge) -> 2.13.1 (conda-forge)} freetype {2.8.1 (conda-forge) -> 2.9.1 (conda-forge)} glib {2.53.6 -> 2.55.0 (conda-forge)} graphviz {2.38.0 (conda-forge) -> 2.38.0 (conda-forge)} gst-plugins-base {1.12.4 -> 1.12.5 (conda-forge)} gstreamer {1.12.4 -> 1.12.5 (conda-forge)} harfbuzz {1.7.6 -> 1.9.0 (conda-forge)} jpeg {9b (conda-forge) -> 9c (conda-forge)} matplotlib {2.2.2 -> 2.2.3 (conda-forge)} pango {1.40.14 (conda-forge) -> 1.40.14 (conda-forge)} pillow {5.1.0 (conda-forge) -> 5.3.0 (conda-forge)} poppler {0.60.1 -> 0.67.0 (conda-forge)} pyqt {5.9.2 -> 5.6.0} qt {5.9.4 -> 5.6.2 (conda-forge)} sqlite {3.22.0 (conda-forge) -> 3.24.0} tk {8.6.7 (conda-forge) -> 8.6.8 (conda-forge)} xz {5.2.3 (conda-forge) -> 5.2.4 (conda-forge)} +gettext-0.19.8.1 (conda-forge) +libedit-3.1.20170329 (conda-forge) +libgcc-7.2.0 (conda-forge) +libuuid-2.32.1 (conda-forge) +xorg-kbproto-1.0.7 (conda-forge) +xorg-libice-1.0.9 (conda-forge) +xorg-libsm-1.2.2 (conda-forge) +xorg-libx11-1.6.6 (conda-forge) +xorg-libxext-1.3.3 (conda-forge) +xorg-libxpm-3.5.12 (conda-forge) +xorg-libxrender-0.9.10 (conda-forge) +xorg-libxt-1.1.5 (conda-forge) +xorg-renderproto-0.11.1 (conda-forge) +xorg-xextproto-7.3.0 (conda-forge) +xorg-xproto-7.0.31 (conda-forge) 2018-10-03 10:40:36 (rev 19) cairo {1.14.12 (conda-forge) -> 1.14.12 (conda-forge)} dbus {1.13.0 (conda-forge) -> 1.13.2} glib {2.55.0 (conda-forge) -> 2.56.2 (conda-forge)} gst-plugins-base {1.12.5 (conda-forge) -> 1.14.0} gstreamer {1.12.5 (conda-forge) -> 1.14.0} harfbuzz {1.9.0 (conda-forge) -> 1.9.0 (conda-forge)} libgcc-ng {7.2.0 -> 8.2.0} libstdcxx-ng {7.2.0 -> 8.2.0} matplotlib {2.2.3 (conda-forge) -> 3.0.0} pcre {8.41 (conda-forge) -> 8.42} poppler {0.67.0 (conda-forge) -> 0.65.0} pyqt {5.6.0 -> 5.9.2} qt {5.6.2 (conda-forge) -> 5.9.6} +libcurl-7.61.1 2018-10-23 01:20:41 (rev 20) +alabaster-0.7.12 +astroid-2.0.4 +babel-2.6.0 +imagesize-1.1.0 +isort-4.3.4 +jeepney-0.4 +keyring-15.1.0 +lazy-object-proxy-1.3.1 +mccabe-0.6.1 +numpydoc-0.8.0 +pycodestyle-2.4.0 +pyflakes-2.0.0 +pylint-2.1.1 +qtawesome-0.5.1 +qtpy-1.5.1 +rope-0.11.0 +secretstorage-3.1.0 +snowballstemmer-1.2.1 +sphinx-1.8.1 +sphinxcontrib-1.0 +sphinxcontrib-websupport-1.1.0 +spyder-3.3.1 +spyder-kernels-0.2.6 +typed-ast-1.1.0 +wrapt-1.10.11 2018-11-09 17:45:13 (rev 21) ca-certificates {2018.8.24 (conda-forge) -> 2018.10.15 (conda-forge)} certifi {2018.8.24 (conda-forge) -> 2018.10.15 (conda-forge)} openssl {1.0.2p (conda-forge) -> 1.0.2p (conda-forge)} 2018-11-20 19:27:42 (rev 22) scikit-learn {0.19.1 (conda-forge) -> 0.20.0 (conda-forge)} 2018-11-20 19:29:59 (rev 23) numpy {1.14.3 (conda-forge) -> 1.15.4 (conda-forge)} openblas {0.2.20 (conda-forge) -> 0.3.3 (conda-forge)} scikit-learn {0.20.0 (conda-forge) -> 0.20.0 (conda-forge)} scipy {1.1.0 (conda-forge) -> 1.1.0 (conda-forge)} 2018-11-20 20:11:33 (rev 24) +umap-learn-0.3.6 (conda-forge) 2018-11-21 17:30:18 (rev 25) bokeh {0.13.0 -> 1.0.1 (conda-forge)} 2018-12-28 09:27:38 (rev 26) pylint {2.1.1 -> 2.2.2} 2018-12-28 09:36:52 (rev 27) +flake8-3.6.0 2019-01-17 16:50:53 (rev 28) +mypy-0.650 +mypy_extensions-0.4.1 2019-02-04 20:37:24 (rev 29) ca-certificates {2018.10.15 (conda-forge) -> 2018.11.29 (conda-forge)} certifi {2018.10.15 (conda-forge) -> 2018.11.29 (conda-forge)} cryptography {2.2.1 (conda-forge) -> 2.4.2} curl {7.59.0 (conda-forge) -> 7.62.0} dask {0.15.2 (conda-forge) -> 1.1.1 (conda-forge)} dask-core {0.15.2 (conda-forge) -> 1.1.1 (conda-forge)} distributed {1.18.1 (conda-forge) -> 1.25.3 (conda-forge)} expat {2.2.5 (conda-forge) -> 2.2.6} h5py {2.8.0 (conda-forge) -> 2.8.0 (conda-forge)} hdf5 {1.10.1 (conda-forge) -> 1.10.2 (conda-forge)} kealib {1.4.7 (conda-forge) -> 1.4.9 (conda-forge)} libcurl {7.61.1 -> 7.62.0} libedit {3.1.20170329 (conda-forge) -> 3.1.20170329 (conda-forge)} libgdal {2.2.2 -> 2.2.4 (conda-forge)} libnetcdf {4.4.1.1 (conda-forge) -> 4.6.1 (conda-forge)} libpng {1.6.34 (conda-forge) -> 1.6.36 (conda-forge)} libpq {9.6.6 -> 9.5.3 (conda-forge)} libssh2 {1.8.0 (conda-forge) -> 1.8.0 (conda-forge)} ncurses {5.9 (conda-forge) -> 6.1 (conda-forge)} netcdf4 {1.3.1 (conda-forge) -> 1.4.1 (conda-forge)} openjpeg {2.3.0 (conda-forge) -> 2.3.0 (conda-forge)} openssl {1.0.2p (conda-forge) -> 1.1.1a (conda-forge)} poppler {0.65.0 -> 0.67.0 (conda-forge)} psycopg2 {2.7.4 (conda-forge) -> 2.6.2} pytables {3.4.3 (conda-forge) -> 3.4.4 (conda-forge)} python {3.6.3 -> 3.6.8} qt {5.9.6 -> 5.9.7} readline {7.0 (conda-forge) -> 7.0 (conda-forge)} sqlite {3.24.0 -> 3.26.0 (conda-forge)} tornado {4.4.3 (conda-forge) -> 5.1.1 (conda-forge)} vigra {1.11.1 (conda-forge) -> 1.11.1 (conda-forge)} xerces-c {3.2.1 (conda-forge) -> 3.2.0 (conda-forge)} +cftime-1.0.3.4 (conda-forge) +geotiff-1.4.2 (conda-forge) 2019-02-04 20:41:40 (rev 30) matplotlib {3.0.0 -> 3.0.2 (conda-forge)} tk {8.6.8 (conda-forge) -> 8.6.9 (conda-forge)} +matplotlib-base-3.0.2 (conda-forge) 2019-02-05 22:35:36 (rev 31) +pytest-flake8-1.0.4 (conda-forge) 2019-02-11 13:21:58 (rev 32) +visvis-1.11.1 (conda-forge) 2019-02-15 11:03:22 (rev 33) cython {0.28.2 (conda-forge) -> 0.29.5 (conda-forge)} 2019-03-08 15:01:24 (rev 34) asn1crypto {0.24.0 (conda-forge) -> 0.24.0 (conda-forge)} certifi {2018.11.29 (conda-forge) -> 2018.11.29 (conda-forge)} cffi {1.11.5 (conda-forge) -> 1.12.2 (conda-forge)} chardet {3.0.4 (conda-forge) -> 3.0.4 (conda-forge)} cryptography {2.4.2 -> 2.5 (conda-forge)} curl {7.62.0 -> 7.64.0 (conda-forge)} dbus {1.13.2 -> 1.13.0 (conda-forge)} expat {2.2.6 -> 2.2.5 (conda-forge)} gst-plugins-base {1.14.0 -> 1.12.5 (conda-forge)} gstreamer {1.14.0 -> 1.12.5 (conda-forge)} idna {2.6 (conda-forge) -> 2.8 (conda-forge)} krb5 {1.14.6 (conda-forge) -> 1.16.3 (conda-forge)} libcurl {7.62.0 -> 7.64.0 (conda-forge)} libgcc-ng {8.2.0 -> 7.3.0 (conda-forge)} libgfortran {3.0.0 -> 3.0.0 (conda-forge)} libspatialite {4.3.0a -> 4.3.0a (conda-forge)} libstdcxx-ng {8.2.0 -> 7.3.0 (conda-forge)} openssl {1.1.1a (conda-forge) -> 1.0.2r (conda-forge)} pcre {8.42 -> 8.41 (conda-forge)} pip {9.0.3 (conda-forge) -> 19.0.3 (conda-forge)} pycparser {2.18 (conda-forge) -> 2.19 (conda-forge)} pygithub {1.39 (conda-forge) -> 1.43.5 (conda-forge)} pyjwt {1.6.4 (conda-forge) -> 1.7.1 (conda-forge)} pyopenssl {18.0.0 (conda-forge) -> 19.0.0 (conda-forge)} pysocks {1.6.8 (conda-forge) -> 1.6.8 (conda-forge)} python {3.6.8 -> 3.7.1 (conda-forge)} qt {5.9.7 -> 5.6.2 (conda-forge)} requests {2.18.4 (conda-forge) -> 2.21.0 (conda-forge)} setuptools {39.1.0 (conda-forge) -> 40.8.0 (conda-forge)} six {1.11.0 (conda-forge) -> 1.12.0 (conda-forge)} tqdm {4.26.0 (conda-forge) -> 4.31.1 (conda-forge)} urllib3 {1.22 (conda-forge) -> 1.24.1 (conda-forge)} wheel {0.31.0 (conda-forge) -> 0.33.1 (conda-forge)} wrapt {1.10.11 -> 1.11.1 (conda-forge)} -asv-0.2.1 (conda-forge) -bleach-1.5.0 (conda-forge) -html5lib-0.9999999 (conda-forge) -notebook-5.5.0 (conda-forge) -scikit-image-0.13.1 (conda-forge) +deprecated-1.2.4 (conda-forge) ``` </details> `conda install --revision=33`, thankfully, gave me back my working environment. ## Expected Behavior <!-- What do you think should happen? --> Either Python should not be updated, or everything should be updated. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` $ conda info active environment : cf active env location : /home/jni/miniconda3/envs/cf shell level : 1 user config file : /home/jni/.condarc populated config files : /home/jni/.condarc conda version : 4.6.7 conda-build version : not installed python version : 3.6.8.final.0 base environment : /home/jni/miniconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/jni/miniconda3/pkgs /home/jni/.conda/pkgs envs directories : /home/jni/miniconda3/envs /home/jni/.conda/envs platform : linux-64 user-agent : conda/4.6.7 requests/2.18.4 CPython/3.6.8 Linux/4.15.0-29-generic ubuntu/18.04.1 glibc/2.27 UID:GID : 1000:1000 netrc file : /home/jni/.netrc offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` $ conda config --show-sources ==> /home/jni/.condarc <== add_pip_as_python_dependency: True create_default_packages: - ipykernel - jupyter - jupyter_contrib_nbextensions - pip - blas=*=openblas channel_priority: strict channels: - conda-forge - defaults show_channel_urls: True sat_solver: pycryptosat ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` $ conda list --show-channel-urls # packages in environment at /home/jni/miniconda3/envs/cf: # # Name Version Build Channel adafruit-ampy 1.0.5 pypi_0 pypi ads 0.12.3 pypi_0 pypi affine 2.2.0 py_0 conda-forge alabaster 0.7.11 pypi_0 pypi altair 2.0.1 py_0 conda-forge altgraph 0.15 py_0 conda-forge appdirs 1.4.3 py_0 conda-forge argh 0.26.2 pypi_0 pypi asn1crypto 0.24.0 py36_0 conda-forge astroid 2.0.4 py36_0 defaults asv 0.3.dev1258+f1ec1c15 dev_0 <develop> attrs 18.1.0 py_0 conda-forge autopep8 1.4.3 pypi_0 pypi babel 2.6.0 pypi_0 pypi backcall 0.1.0 py_0 conda-forge backports 1.0 py36_1 conda-forge backports.weakref 1.0rc1 py36_1 conda-forge beautifulsoup4 4.6.0 py36_0 conda-forge binary 1.0.0 pypi_0 pypi blas 1.1 openblas conda-forge bleach 2.1.4 pypi_0 pypi blinker 1.4 pypi_0 pypi blosc 1.14.0 1 conda-forge bokeh 1.0.1 py36_1000 conda-forge boost 1.66.0 py36_1 conda-forge boost-cpp 1.66.0 1 conda-forge boto3 1.7.24 py_0 conda-forge botocore 1.10.24 py_0 conda-forge bottleneck 1.2.1 py36_1 conda-forge branca 0.3.0 py_0 conda-forge bs4 0.0.1 pypi_0 pypi bzip2 1.0.6 1 conda-forge ca-certificates 2018.11.29 ha4d7672_0 conda-forge cachetools 2.1.0 pypi_0 pypi cairo 1.14.12 h276e583_5 conda-forge cartopy 0.16.0 py36_0 conda-forge certifi 2018.11.29 py36_1000 conda-forge cffi 1.11.5 py36_0 conda-forge cftime 1.0.3.4 py36h3010b51_1000 conda-forge chardet 3.0.4 py36_0 conda-forge click 6.7 py_1 conda-forge click-plugins 1.0.3 py36_0 conda-forge cligj 0.4.0 py36_0 conda-forge cloudpickle 0.6.1 pypi_0 pypi cmarkgfm 0.4.2 pypi_0 pypi colorcet 1.0.0 py_0 conda-forge colorlog 3.1.4 pypi_0 pypi conda 4.5.11 py36_0 conda-forge conda-build 3.15.1 py36_0 conda-forge conda-env 2.6.0 1 conda-forge conda-forge-pinning 2018.10.01 0 conda-forge conda-smithy 3.1.12 py_0 conda-forge configparser 3.5.0 pypi_0 pypi coverage 4.5.1 py36_0 conda-forge cryptography 2.4.2 py36h1ba5d50_0 defaults curl 7.62.0 hbc83047_0 defaults cycler 0.10.0 py36_0 conda-forge cython 0.29.5 py36hf484d3e_0 conda-forge cytoolz 0.9.0.1 py36_0 conda-forge dask 1.1.1 py_0 conda-forge dask-core 1.1.1 py_0 conda-forge dask-image 0.2.0+28.g67f8a8c.dirty dev_0 <develop> datashader 0.6.2 py_0 conda-forge datashape 0.5.4 py36_0 conda-forge dbus 1.13.2 h714fa37_1 defaults decorator 4.3.0 py_0 conda-forge descartes 1.1.0 py_1 conda-forge distributed 1.24.0 pypi_0 pypi docutils 0.14 py36_0 conda-forge entrypoints 0.2.3 py36_1 conda-forge et_xmlfile 1.0.1 py36_0 conda-forge expat 2.2.6 he6710b0_0 defaults fastcache 1.0.2 py36_0 conda-forge feedgenerator 1.9 pypi_0 pypi fftw 3.3.7 0 conda-forge filelock 3.0.4 py_1 conda-forge fiona 1.7.12 py36_0 conda-forge flake8 3.6.0 py36_0 defaults flask 1.0.2 py_1 conda-forge folium 0.5.0 py_0 conda-forge fontconfig 2.13.1 h65d0f4c_0 conda-forge freetype 2.9.1 h6debe1e_4 conda-forge freexl 1.0.5 0 conda-forge funcsigs 1.0.2 py_2 conda-forge future 0.16.0 pypi_0 pypi gala 0.5.dev0 dev_0 <develop> gast 0.2.0 py_0 conda-forge gdal 2.2.2 py36hc209d97_1 defaults geopandas 0.3.0 py36_0 conda-forge geos 3.6.2 1 conda-forge geotiff 1.4.2 hfe6da40_1005 conda-forge gettext 0.19.8.1 h5e8e0c9_1 conda-forge gevent 1.4.0 pypi_0 pypi giflib 5.1.4 0 conda-forge gitdb2 2.0.4 py_0 conda-forge gitpython 2.1.11 py_0 conda-forge glib 2.56.2 h464dc38_0 conda-forge glob2 0.6 py_0 conda-forge gmp 6.1.2 0 conda-forge gmpy2 2.0.8 py36_1 conda-forge google-api-core 1.2.1 pypi_0 pypi google-api-python-client 1.6.7 pypi_0 pypi google-auth 1.5.0 pypi_0 pypi google-cloud-bigquery 1.3.0 pypi_0 pypi google-cloud-core 0.28.1 pypi_0 pypi google-resumable-media 0.3.1 pypi_0 pypi googleapis-common-protos 1.5.3 pypi_0 pypi gosync 0.4 pypi_0 pypi gputools 0.2.6 py36_0 talley grader 0.1 dev_0 <develop> graphite2 1.3.11 0 conda-forge graphviz 2.38.0 h08bfae6_9 conda-forge greenlet 0.4.15 pypi_0 pypi gst-plugins-base 1.14.0 hbbd80ab_1 defaults gstreamer 1.14.0 hb453b48_1 defaults h5glance 0.4 pypi_0 pypi h5netcdf 0.5.1 py_0 conda-forge h5py 2.8.0 py36h3010b51_1003 conda-forge harfbuzz 1.9.0 hee26f79_1 conda-forge hdf4 4.2.13 0 conda-forge hdf5 1.10.2 hc401514_3 conda-forge heapdict 1.0.0 py36_0 conda-forge holoviews 1.10.4 py_0 conda-forge html5lib 1.0.1 pypi_0 pypi htmlgen 1.2.2 pypi_0 pypi httplib2 0.11.3 pypi_0 pypi httpretty 0.8.10 pypi_0 pypi hypothesis 3.56.9 py36_0 conda-forge icu 58.2 0 conda-forge idna 2.6 py36_1 conda-forge imageio 2.3.0 py36_0 conda-forge imagesize 1.1.0 pypi_0 pypi ipdb 0.11 py36_0 conda-forge ipykernel 4.8.2 py36_0 conda-forge ipython 6.4.0 py36_0 conda-forge ipython_genutils 0.2.0 py36_0 conda-forge ipyvolume 0.4.5 py36_0 conda-forge ipywebrtc 0.3.0 py36_0 conda-forge ipywidgets 7.2.1 py36_1 conda-forge isort 4.3.4 py36_0 defaults itsdangerous 0.24 py_2 conda-forge jdcal 1.4 py36_0 conda-forge jedi 0.12.0 py36_0 conda-forge jeepney 0.4 py36_0 defaults jinja2 2.10 py36_0 conda-forge jmespath 0.9.3 py36_0 conda-forge jpeg 9c h470a237_1 conda-forge json-c 0.12.1 0 conda-forge jsonschema 2.6.0 py36_1 conda-forge jupyter 1.0.0 py_1 conda-forge jupyter_client 5.2.3 py36_0 conda-forge jupyter_console 5.2.0 py36_0 conda-forge jupyter_core 4.4.0 py_0 conda-forge jupytercontrib 0.0.6 pypi_0 pypi jupyterthemes 0.20.0 pypi_0 pypi kealib 1.4.9 h0bee7d0_2 conda-forge keyring 15.1.0 py36_0 defaults kids-cache 0.0.7 pypi_0 pypi kiwisolver 1.0.1 py36_1 conda-forge krb5 1.14.6 0 conda-forge lazy-object-proxy 1.3.1 py36h14c3975_2 defaults lesscpy 0.13.0 pypi_0 pypi libcurl 7.62.0 h20c2e04_0 defaults libdap4 3.19.2 1 conda-forge libedit 3.1.20170329 hf8c457e_1001 conda-forge libffi 3.2.1 3 conda-forge libgcc 7.2.0 h69d50b8_2 conda-forge libgcc-ng 8.2.0 hdf63c60_1 defaults libgdal 2.2.4 he036fc0_8 conda-forge libgfortran 3.0.0 1 defaults libiconv 1.15 0 conda-forge libkml 1.3.0 6 conda-forge libnetcdf 4.6.1 h628ed10_200 conda-forge libpng 1.6.36 h84994c4_1000 conda-forge libpq 9.5.3 1 conda-forge libprotobuf 3.5.2 0 conda-forge libsodium 1.0.16 0 conda-forge libspatialindex 1.8.5 1 conda-forge libspatialite 4.3.0a h72746d6_18 defaults libssh2 1.8.0 1 conda-forge libstdcxx-ng 8.2.0 hdf63c60_1 defaults libtiff 4.0.9 0 conda-forge libtool 2.4.6 0 conda-forge libuuid 2.32.1 h470a237_2 conda-forge libxcb 1.13 0 conda-forge libxml2 2.9.8 0 conda-forge libxslt 1.1.32 0 conda-forge line_profiler 2.1.2 py36_0 conda-forge llc 0.2.0 pypi_0 pypi llvmlite 0.23.0 py36_1 conda-forge locket 0.2.0 py36_1 conda-forge lxml 4.2.1 py36_0 conda-forge lzo 2.10 0 conda-forge macholib 1.8 py_0 conda-forge mako 1.0.7 pypi_0 pypi markdown 2.6.11 py_0 conda-forge markupsafe 1.0 py36_0 conda-forge matplotlib 3.0.2 py36_1002 conda-forge matplotlib-base 3.0.2 py36h167e16e_1002 conda-forge mccabe 0.6.1 py36_1 defaults memory_profiler 0.52.0 py36_0 conda-forge microscopium 0.1.dev0 dev_0 <develop> mistune 0.8.3 py36_1 conda-forge mock 2.0.0 py36_0 conda-forge more-itertools 4.1.0 py_0 conda-forge mpc 1.1.0 4 conda-forge mpfr 3.1.5 0 conda-forge mpmath 1.0.0 py_0 conda-forge msgpack-python 0.5.6 pypi_0 pypi multipledispatch 0.5.0 py36_0 conda-forge munch 2.3.2 py_0 conda-forge mypy 0.650 py36_0 defaults mypy_extensions 0.4.1 py36_0 defaults napari 0.0.5.1+59.g425c4d3.dirty dev_0 <develop> nbconvert 5.3.1 py_1 conda-forge nbformat 4.4.0 py36_0 conda-forge ncurses 6.1 hf484d3e_1002 conda-forge netcdf4 1.4.1 py36ha292673_200 conda-forge networkx 2.1 py36_0 conda-forge notebook 5.7.4 pypi_0 pypi notedown 1.5.1 pypi_0 pypi numba 0.38.1 py36_0 conda-forge numexpr 2.6.5 py36_0 conda-forge numpy 1.14.3 pypi_0 pypi numpydoc 0.8.0 pypi_0 pypi oauth2client 4.1.2 pypi_0 pypi ocl-icd 2.2.9 4 conda-forge olefile 0.45.1 py36_0 conda-forge openblas 0.3.3 ha44fe06_1 conda-forge openjpeg 2.3.0 hf38bd82_1003 conda-forge openpyxl 2.5.3 py36_0 conda-forge openssl 1.1.1a h14c3975_1000 conda-forge owslib 0.16.0 py_0 conda-forge packaging 17.1 py_0 conda-forge pandas 0.23.0 py36_0 conda-forge pandoc 2.2.1 0 conda-forge pandoc-attributes 0.1.7 pypi_0 pypi pandocfilters 1.4.2 py36_0 conda-forge pango 1.40.14 he752989_2 conda-forge param 1.6.1 py_0 conda-forge parso 0.2.0 py_0 conda-forge partd 0.3.8 py36_0 conda-forge patchelf 0.9 hfc679d8_2 conda-forge pathtools 0.1.2 pypi_0 pypi patsy 0.5.0 py36_0 conda-forge pbr 4.0.2 py_0 conda-forge pcre 8.42 h439df22_0 defaults pelican 4.0.0 pypi_0 pypi pelita 0.9.1 dev_0 <develop> pexpect 4.5.0 py36_0 conda-forge pickleshare 0.7.4 py36_0 conda-forge pillow 5.3.0 py36hc736899_0 conda-forge pims 0.4.1 pypi_0 pypi pint 0.8.1 py36_0 conda-forge pip 10.0.1 pypi_0 pypi pipenv 2018.7.1 pypi_0 pypi pixman 0.34.0 2 conda-forge pkginfo 1.4.2 pypi_0 pypi plotly 2.6.0 py36_0 conda-forge pluggy 0.6.0 py_0 conda-forge ply 3.11 pypi_0 pypi poppler 0.67.0 h2fc8fa2_1002 conda-forge poppler-data 0.4.9 0 conda-forge proj4 4.9.3 5 conda-forge prometheus-client 0.5.0 pypi_0 pypi prompt_toolkit 1.0.15 py36_0 conda-forge protobuf 3.5.2 py36_0 conda-forge psutil 5.4.5 py36_0 conda-forge psycopg2 2.6.2 py36_0 defaults ptyprocess 0.5.2 py36_0 conda-forge pudb 2018.1 py36_0 conda-forge py 1.5.3 py_0 conda-forge pyasn1 0.4.2 pypi_0 pypi pyasn1-modules 0.2.1 pypi_0 pypi pycodestyle 2.4.0 py36_0 defaults pycosat 0.6.3 py36h470a237_1 conda-forge pycparser 2.18 py36_0 conda-forge pycrypto 2.6.1 py36_1 conda-forge pydrive 1.3.1 pypi_0 pypi pyepsg 0.3.2 py36_0 conda-forge pyflakes 2.0.0 py36_0 defaults pygithub 1.39 py36_0 conda-forge pygments 2.2.0 py36_0 conda-forge pyinstaller 3.3.1 py36_0 conda-forge pyjwt 1.6.4 py_0 conda-forge pylint 2.2.2 py36_0 defaults pyopencl 2018.1.1 py36_2 conda-forge pyopengl 3.1.1a1 py36_0 conda-forge pyopenssl 18.0.0 py36_0 conda-forge pyparsing 2.2.0 py36_0 conda-forge pypinfo 14.0.0 pypi_0 pypi pyproj 1.9.5.1 py36_0 conda-forge pyqt 5.9.2 py36h05f1152_2 defaults pyqt5 5.11.3 pypi_0 pypi pyqt5-sip 4.19.13 pypi_0 pypi pysal 1.14.3 py36_0 conda-forge pyserial 3.4 pypi_0 pypi pyshp 1.2.12 py_0 conda-forge pysocks 1.6.8 py36_1 conda-forge pytables 3.4.4 py36h4f72b40_1 conda-forge pytest 3.5.1 py36_0 conda-forge pytest-cov 2.5.1 py36_0 conda-forge pytest-flake8 1.0.4 py36_0 conda-forge pytest-runner 4.2 pypi_0 pypi python 3.6.8 h0371630_0 defaults python-dateutil 2.7.3 py_0 conda-forge python-dotenv 0.8.2 pypi_0 pypi python-graphviz 0.8.3 py36_0 conda-forge pythran 0.8.5 py36_blas_openblash0eace8b_0 [blas_openblas] conda-forge pytools 2018.4 py_0 conda-forge pytz 2018.4 py_0 conda-forge pyudev 0.21.0 pypi_0 pypi pywavelets 0.5.2 py36_1 conda-forge pyyaml 3.12 py36_1 conda-forge pyzmq 17.0.0 py36_4 conda-forge qt 5.9.7 h5867ecd_1 defaults qtawesome 0.5.1 py36_1 defaults qtconsole 4.3.1 py36_0 conda-forge qtpy 1.5.1 py36_0 defaults rasterio 0.36.0 py36_3 conda-forge readline 7.0 hf8c457e_1001 conda-forge readme-renderer 22.0 pypi_0 pypi reikna 0.6.8 py36_0 conda-forge requests 2.18.4 py36_1 conda-forge requests-toolbelt 0.8.0 pypi_0 pypi rope 0.11.0 py36_0 defaults rsa 3.4.2 pypi_0 pypi rshell 0.0.14 pypi_0 pypi rtree 0.8.3 py36_0 conda-forge ruamel.yaml 0.15.71 py36h470a237_0 conda-forge ruamel_yaml 0.15.71 py36h470a237_0 conda-forge s3transfer 0.1.13 py36_0 conda-forge scikit-image 0.15.dev0 dev_0 <develop> scikit-learn 0.20.0 py36_blas_openblash00c3548_201 [blas_openblas] conda-forge scipy 1.1.0 py36_blas_openblashb06ca3d_202 [blas_openblas] conda-forge seaborn 0.9.0 py_0 conda-forge secretstorage 3.1.0 py36_0 defaults send2trash 1.5.0 py_0 conda-forge setuptools 39.1.0 py36_0 conda-forge shapely 1.6.4 py36_0 conda-forge simplegeneric 0.8.1 py36_0 conda-forge sip 4.19.8 pypi_0 pypi six 1.11.0 py36_1 conda-forge skan 0.8.0.dev0 dev_0 <develop> slicerator 0.9.8 pypi_0 pypi smmap2 2.0.4 py_0 conda-forge snakeviz 0.4.2 py36h8fadade_0 defaults snowballstemmer 1.2.1 pypi_0 pypi snuggs 1.4.1 py36_0 conda-forge sortedcontainers 1.5.10 py36_0 conda-forge sphinx 1.8.1 pypi_0 pypi sphinx-copybutton 0.2.5 pypi_0 pypi sphinx-gallery 0.2.0 pypi_0 pypi sphinxcontrib 1.0 py36_1 defaults sphinxcontrib-websupport 1.1.0 pypi_0 pypi spyder 3.3.1 py36_1 defaults spyder-kernels 0.2.6 py36_0 defaults sqlalchemy 1.2.7 py36h65ede16_0 conda-forge sqlite 3.26.0 h67949de_1000 conda-forge statsmodels 0.8.0 py36_0 conda-forge sympy 1.1.1 py36_0 conda-forge tblib 1.3.2 py36_0 conda-forge tensorflow 1.3.0 py36_0 conda-forge terminado 0.8.1 py36_0 conda-forge testpath 0.3.1 py36_0 conda-forge tinydb 3.9.0.post1 pypi_0 pypi tinyrecord 0.1.5 pypi_0 pypi tk 8.6.9 h84994c4_1000 conda-forge toolz 0.9.0 py_0 conda-forge tornado 5.1.1 pypi_0 pypi tqdm 4.26.0 py_0 conda-forge traitlets 4.3.2 py36_0 conda-forge traittypes 0.2.1 py36_0 conda-forge twine 1.12.1 pypi_0 pypi typed-ast 1.1.0 py36h14c3975_0 defaults typing 3.6.4 py36_0 conda-forge umap-learn 0.3.6 py36_1000 conda-forge unidecode 1.0.23 pypi_0 pypi uritemplate 3.0.0 pypi_0 pypi urllib3 1.22 py36_0 conda-forge urwid 1.3.1 py36_0 conda-forge util-linux 2.21 0 defaults vigra 1.11.1 py36hec99981_7 conda-forge vincent 0.4.4 py36_0 conda-forge viridis 0.4.2 pypi_0 pypi virtualenv 16.0.0 pypi_0 pypi virtualenv-clone 0.3.0 pypi_0 pypi vispy 0.5.3 py36_0 conda-forge visvis 1.11.1 py_0 conda-forge watchdog 0.8.3 pypi_0 pypi wcwidth 0.1.7 py36_0 conda-forge webencodings 0.5 py36_0 conda-forge werkzeug 0.14.1 py_0 conda-forge wheel 0.31.0 py36_0 conda-forge widgetsnbextension 3.2.1 py36_0 conda-forge wrapt 1.10.11 py36h14c3975_2 defaults xarray 0.10.4 py36_0 conda-forge xerces-c 3.2.0 h5d6a6da_2 conda-forge xgboost 0.71 py36_0 conda-forge xlrd 1.1.0 py_2 conda-forge xlwt 1.3.0 py36_0 conda-forge xorg-kbproto 1.0.7 h470a237_2 conda-forge xorg-libice 1.0.9 h470a237_4 conda-forge xorg-libsm 1.2.2 h8c8a85c_6 conda-forge xorg-libx11 1.6.6 h470a237_0 conda-forge xorg-libxau 1.0.8 3 conda-forge xorg-libxdmcp 1.1.2 3 conda-forge xorg-libxext 1.3.3 h470a237_4 conda-forge xorg-libxpm 3.5.12 h470a237_2 conda-forge xorg-libxrender 0.9.10 h470a237_2 conda-forge xorg-libxt 1.1.5 h470a237_2 conda-forge xorg-renderproto 0.11.1 h470a237_2 conda-forge xorg-xextproto 7.3.0 h470a237_2 conda-forge xorg-xproto 7.0.31 h470a237_7 conda-forge xz 5.2.4 h470a237_1 conda-forge yaml 0.1.7 0 conda-forge zeromq 4.2.5 1 conda-forge zerorpc 0.6.1 pypi_0 pypi zict 0.1.3 py_0 conda-forge zlib 1.2.11 0 conda-forge ``` </p></details>
Thanks for the detailed post. There have been a few others like this. Just to clarify: you have one or more pip-installed packages in there, but the ones that are flaking out are not just the pip-installed ones, right? I will try to replicate this issue but given changing metadata over time it might be difficult to track down. @jni Can you try running the update command with the `-vv` argument? That turns on debugging which could help explain what choices the solver is making. Here is what is going on here: Conda has determined that the environment is inconsistent because `pip` is not installed from a conda package. The `python` package has a dependency on `pip` due to the "add_pip_as_python_dependency: True" configuration. This dependency can only be met by conda packages and conda, seeing that pip has been installed from pypi, does not see this dependency as being met. After conda determines the environment is inconsistent it determines a set of consistent packages, which does not include python, and then solves for this environment and the requested packages. In the view of the solver, python nor any of the python packages are installed so it is free to select any version of python. Since higher version numbers are preferred by the solver, it chooses python 3.7.1 which is the latest version in the conda-forge channel. There is no need to update or modify the other packages because in the view of the solver they are not installed. Similar behavior can be seen in the following example on Linux of macOS: ``` conda create -y -n example python=3.6 psutil conda remove -y -n example --force sqlite # intentionally break the environment conda install -n example imagesize # This will upgrade python to 3.7 but not update psutil ``` There are a number of things that are going wrong here that should be fixed: * Packages that have been overwritten by pip or a development install need to be included in the solver in some manner. * Users should be warned an invalid environment is detected, currently debugging needs to be turned to even see any indication of this. * When an invalid environment is detected, conda should try to preserve as many package are installed and try to fix the environment rather than solving for only the valid portion. @jjhelmus I assume you no longer need the `-vv` output from me? And thank you very much for that explanation. @jni No need for a the `-vv` output. Your report log was excellent and had the details needed to create some good tests cases to prevent these type of issue in the future.
2019-03-24T22:55:56Z
[]
[]
conda/conda
8,528
conda__conda-8528
[ "8532" ]
a154ace0a50f6cac7c6121dc831f72dc497e82be
diff --git a/conda/activate.py b/conda/activate.py --- a/conda/activate.py +++ b/conda/activate.py @@ -1,3 +1,4 @@ + # -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause @@ -7,6 +8,7 @@ from errno import ENOENT from glob import glob from itertools import chain +from logging import getLogger import os from os.path import abspath, basename, dirname, expanduser, expandvars, isdir, join import re @@ -22,6 +24,8 @@ from .common.compat import FILESYSTEM_ENCODING, PY2, iteritems, on_win, string_types, text_type from .common.path import paths_equal +log = getLogger(__name__) + class _Activator(object): # Activate and deactivate have three tasks @@ -546,8 +550,13 @@ def index_of_path(paths, test_path): if first_idx is None: first_idx = 0 else: - last_idx = index_of_path(path_list, prefix_dirs[-1]) - assert last_idx is not None + prefix_dirs_idx = len(prefix_dirs) - 1 + last_idx = None + while last_idx is None and prefix_dirs_idx > -1: + last_idx = index_of_path(path_list, prefix_dirs[prefix_dirs_idx]) + if last_idx is None: + log.info("Did not find path entry {}".format(prefix_dirs[prefix_dirs_idx])) + prefix_dirs_idx = prefix_dirs_idx - 1 # this compensates for an extra Library/bin dir entry from the interpreter on # windows. If that entry isn't being added, it should have no effect. library_bin_dir = self.path_conversion( @@ -724,7 +733,11 @@ def _hook_preamble(self): # result += join(self.unset_var_tmpl % key) + '\n' result += join(self.export_var_tmpl % (key, '')) + '\n' else: - result += join(self.export_var_tmpl % (key, value)) + '\n' + if key in ('PYTHONPATH', 'CONDA_EXE'): + result += join(self.export_var_tmpl % ( + key, self.path_conversion(value))) + '\n' + else: + result += join(self.export_var_tmpl % (key, value)) + '\n' return result @@ -760,13 +773,16 @@ def _hook_preamble(self): if on_win: return ('setenv CONDA_EXE `cygpath %s`\n' 'setenv _CONDA_ROOT `cygpath %s`\n' - 'setenv _CONDA_EXE `cygpath %s`' - % (context.conda_exe, context.conda_prefix, context.conda_exe)) + 'setenv _CONDA_EXE `cygpath %s`\n' + 'setenv CONDA_PYTHON_EXE `cygpath %s`' + % (context.conda_exe, context.conda_prefix, context.conda_exe, sys.executable)) else: return ('setenv CONDA_EXE "%s"\n' 'setenv _CONDA_ROOT "%s"\n' - 'setenv _CONDA_EXE "%s"' - % (context.conda_exe, context.conda_prefix, context.conda_exe)) + 'setenv _CONDA_EXE "%s"\n' + 'setenv CONDA_PYTHON_EXE "%s"' + % (context.conda_exe, context.conda_prefix, context.conda_exe, + sys.executable)) class XonshActivator(_Activator): @@ -842,13 +858,15 @@ def _hook_preamble(self): if on_win: return ('set -gx CONDA_EXE (cygpath "%s")\n' 'set _CONDA_ROOT (cygpath "%s")\n' - 'set _CONDA_EXE (cygpath "%s")' - % (context.conda_exe, context.conda_prefix, context.conda_exe)) + 'set _CONDA_EXE (cygpath "%s")\n' + 'set -gx CONDA_PYTHON_EXE (cygpath "%s")' + % (context.conda_exe, context.conda_prefix, context.conda_exe, sys.executable)) else: return ('set -gx CONDA_EXE "%s"\n' 'set _CONDA_ROOT "%s"\n' - 'set _CONDA_EXE "%s"' - % (context.conda_exe, context.conda_prefix, context.conda_exe)) + 'set _CONDA_EXE "%s"\n' + 'set -gx CONDA_PYTHON_EXE "%s"' + % (context.conda_exe, context.conda_prefix, context.conda_exe, sys.executable)) class PowerShellActivator(_Activator): @@ -862,8 +880,8 @@ def __init__(self, arguments=None): self.command_join = '\n' self.unset_var_tmpl = 'Remove-Item Env:/%s' - self.export_var_tmpl = '$env:%s = "%s"' - self.set_var_tmpl = '$env:%s = "%s"' + self.export_var_tmpl = '$Env:%s = "%s"' + self.set_var_tmpl = '$Env:%s = "%s"' self.run_script_tmpl = '. "%s"' self.hook_source_path = join(CONDA_PACKAGE_ROOT, 'shell', 'condabin', 'conda-hook.ps1') @@ -873,12 +891,15 @@ def __init__(self, arguments=None): def _hook_preamble(self): if context.dev: return dedent("""\ - $Env:CONDA_EXE = "{context.conda_exe}" + $Env:PYTHONPATH = "{python_path}" + $Env:CONDA_EXE = "{sys_exe}" $Env:_CE_M = "-m" $Env:_CE_CONDA = "conda" - $Env:_CONDA_ROOT = "{context.conda_prefix}" + $Env:_CONDA_ROOT = "{python_path}{s}conda" $Env:_CONDA_EXE = "{context.conda_exe}" - """.format(context=context)) + """.format(s=os.sep, + python_path=dirname(CONDA_PACKAGE_ROOT), + sys_exe=sys.executable, context=context)) else: return dedent("""\ $Env:CONDA_EXE = "{context.conda_exe}" diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -502,7 +502,8 @@ def conda_exe_vars_dict(self): ('PYTHONPATH', os.path.dirname(CONDA_PACKAGE_ROOT) + '{}{}'.format( os.pathsep, os.environ.get('PYTHONPATH', ''))), ('_CE_M', '-m'), - ('_CE_CONDA', 'conda')]) + ('_CE_CONDA', 'conda'), + ('CONDA_PYTHON_EXE', sys.executable)]) else: bin_dir = 'Scripts' if on_win else 'bin' exe = 'conda.exe' if on_win else 'conda' @@ -510,7 +511,8 @@ def conda_exe_vars_dict(self): # error-on-undefined. return OrderedDict([('CONDA_EXE', os.path.join(sys.prefix, bin_dir, exe)), ('_CE_M', ''), - ('_CE_CONDA', '')]) + ('_CE_CONDA', ''), + ('CONDA_PYTHON_EXE', sys.executable)]) @memoizedproperty def channel_alias(self): diff --git a/conda/cli/main_init.py b/conda/cli/main_init.py --- a/conda/cli/main_init.py +++ b/conda/cli/main_init.py @@ -37,7 +37,6 @@ def execute(args, parser): if args.dev: assert len(selected_shells) == 1, "--dev can only handle one shell at a time right now" shell = selected_shells[0] - # assert shell == 'bash' return initialize_dev(shell) else: diff --git a/conda/core/initialize.py b/conda/core/initialize.py --- a/conda/core/initialize.py +++ b/conda/core/initialize.py @@ -184,6 +184,7 @@ def initialize_dev(shell, dev_env_prefix=None, conda_source_root=None): 'CONDA_PREFIX', 'CONDA_PREFIX_1', 'CONDA_PREFIX_2', + 'CONDA_PYTHON_EXE', 'CONDA_PROMPT_MODIFIER', 'CONDA_SHLVL', ) diff --git a/conda_env/cli/main_update.py b/conda_env/cli/main_update.py --- a/conda_env/cli/main_update.py +++ b/conda_env/cli/main_update.py @@ -73,7 +73,7 @@ def execute(args, parser): if not (args.name or args.prefix): if not env.name: - # Note, this is a hack fofr get_prefix that assumes argparse results + # Note, this is a hack fofr get_prefix that assumes argparse results # TODO Refactor common.get_prefix name = os.environ.get('CONDA_DEFAULT_ENV', False) if not name:
diff --git a/tests/__init__.py b/tests/__init__.py --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,6 @@ # This is just here so that tests is a package, so that dotted relative # imports work. +from __future__ import print_function from conda.gateways.logging import initialize_logging import pytest import sys @@ -23,9 +24,6 @@ from subprocess import check_output - - - def encode_for_env_var(value): if isinstance(value, str): return value @@ -41,6 +39,20 @@ def encode_for_env_var(value): return str(value) +def conda_ensure_sys_python_is_base_env_python(): + # Exit if we try to run tests from a non-base env. The tests end up installing + # menuinst into the env they are called with and that breaks non-base env activation + # as it emits a message to stderr: + # WARNING menuinst_win32:<module>(157): menuinst called from non-root env C:\opt\conda\envs\py27 + # So lets just sys.exit on that. + + if 'CONDA_PYTHON_EXE' in os.environ: + if os.path.normpath(os.environ['CONDA_PYTHON_EXE']) != sys.executable: + print("ERROR :: Running tests from a non-base Python interpreter. Tests requires installing" \ + " menuinst and that causes stderr output when activated.", file=sys.stderr) + sys.exit(-1) + + def conda_move_to_front_of_PATH(): if 'CONDA_PREFIX' in os.environ: from conda.activate import (PosixActivator, CmdExeActivator) @@ -64,7 +76,23 @@ def conda_move_to_front_of_PATH(): # prefix from the *original* value of PATH, calling it N times will # just return the same value every time, even if you update PATH. p = activator._remove_prefix_from_path(os.environ['CONDA_PREFIX']) - new_path = os.pathsep.join(p) + + # Replace any non sys.prefix condabin with sys.prefix condabin + new_p = [] + found_condabin = False + for pe in p: + if pe.endswith('condabin'): + if not found_condabin: + found_condabin = True + if join(sys.prefix, 'condabin') != pe: + print("Incorrect condabin, swapping {} to {}".format(pe, join(sys.prefix, 'condabin'))) + new_p.append(join(sys.prefix, 'condabin')) + else: + new_p.append(pe) + else: + new_p.append(pe) + + new_path = os.pathsep.join(new_p) new_path = encode_for_env_var(new_path) os.environ['PATH'] = new_path activator = activator_cls() @@ -73,6 +101,7 @@ def conda_move_to_front_of_PATH(): new_path = encode_for_env_var(new_path) os.environ['PATH'] = new_path + def conda_check_versions_aligned(): # Next problem. If we use conda to provide our git or otherwise do not # have it on PATH and if we also have no .version file then conda is @@ -106,5 +135,6 @@ def conda_check_versions_aligned(): fh.write(version_from_git) +conda_ensure_sys_python_is_base_env_python() conda_move_to_front_of_PATH() conda_check_versions_aligned() diff --git a/tests/core/test_initialize.py b/tests/core/test_initialize.py --- a/tests/core/test_initialize.py +++ b/tests/core/test_initialize.py @@ -385,10 +385,14 @@ def test_install_conda_sh(self): with open(target_path) as fh: created_file_contents = fh.read() - line0, line1, line2, _, remainder = created_file_contents.split('\n', 4) - assert line0 == "export CONDA_EXE='%s'" % context.conda_exe + from conda.activate import PosixActivator + activator = PosixActivator() + + line0, line1, line2, line3, _, remainder = created_file_contents.split('\n', 5) + assert line0 == "export CONDA_EXE='%s'" % activator.path_conversion(context.conda_exe) assert line1 == "export _CE_M=''" assert line2 == "export _CE_CONDA=''" + assert line3.startswith("export CONDA_PYTHON_EXE=") with open(join(CONDA_PACKAGE_ROOT, 'shell', 'etc', 'profile.d', 'conda.sh')) as fh: original_contents = fh.read() @@ -407,16 +411,19 @@ def test_install_conda_fish(self): with open(target_path) as fh: created_file_contents = fh.read() - first_line, second_line, third_line, remainder = created_file_contents.split('\n', 3) + first_line, second_line, third_line, fourth_line, remainder = created_file_contents.split('\n', 4) if on_win: win_conda_exe = join(conda_prefix, 'Scripts', 'conda.exe') + win_py_exe = join(conda_prefix, 'python.exe') assert first_line == 'set -gx CONDA_EXE (cygpath "%s")' % win_conda_exe assert second_line == 'set _CONDA_ROOT (cygpath "%s")' % conda_prefix assert third_line == 'set _CONDA_EXE (cygpath "%s")' % win_conda_exe + assert fourth_line == 'set -gx CONDA_PYTHON_EXE (cygpath "%s")' % win_py_exe else: assert first_line == 'set -gx CONDA_EXE "%s"' % join(conda_prefix, 'bin', 'conda') assert second_line == 'set _CONDA_ROOT "%s"' % conda_prefix assert third_line == 'set _CONDA_EXE "%s"' % join(conda_prefix, 'bin', 'conda') + assert fourth_line == 'set -gx CONDA_PYTHON_EXE "%s"' % join(conda_prefix, 'bin', 'python') with open(join(CONDA_PACKAGE_ROOT, 'shell', 'etc', 'fish', 'conf.d', 'conda.fish')) as fh: original_contents = fh.read() @@ -458,15 +465,17 @@ def test_install_conda_csh(self): with open(target_path) as fh: created_file_contents = fh.read() - first_line, second_line, third_line, remainder = created_file_contents.split('\n', 3) + first_line, second_line, third_line, fourth_line, remainder = created_file_contents.split('\n', 4) if on_win: assert first_line == 'setenv CONDA_EXE `cygpath %s`' % join(conda_prefix, 'Scripts', 'conda.exe') assert second_line == 'setenv _CONDA_ROOT `cygpath %s`' % conda_prefix assert third_line == 'setenv _CONDA_EXE `cygpath %s`' % join(conda_prefix, 'Scripts', 'conda.exe') + assert fourth_line == 'setenv CONDA_PYTHON_EXE `cygpath %s`' % join(conda_prefix, 'python.exe') else: assert first_line == 'setenv CONDA_EXE "%s"' % join(conda_prefix, 'bin', 'conda') assert second_line == 'setenv _CONDA_ROOT "%s"' % conda_prefix assert third_line == 'setenv _CONDA_EXE "%s"' % join(conda_prefix, 'bin', 'conda') + assert fourth_line == 'setenv CONDA_PYTHON_EXE "%s"' % join(conda_prefix, 'bin', 'python') with open(join(CONDA_PACKAGE_ROOT, 'shell', 'etc', 'profile.d', 'conda.csh')) as fh: original_contents = fh.read() diff --git a/tests/test_activate.py b/tests/test_activate.py --- a/tests/test_activate.py +++ b/tests/test_activate.py @@ -1151,11 +1151,11 @@ def test_powershell_basic(self): new_path_parts = activator._add_prefix_to_path(self.prefix) conda_exe_export, conda_exe_unset = activator.get_scripts_export_unset_vars() e_activate_data = dals(""" - $env:PATH = "%(new_path)s" - $env:CONDA_PREFIX = "%(prefix)s" - $env:CONDA_SHLVL = "1" - $env:CONDA_DEFAULT_ENV = "%(prefix)s" - $env:CONDA_PROMPT_MODIFIER = "(%(prefix)s) " + $Env:PATH = "%(new_path)s" + $Env:CONDA_PREFIX = "%(prefix)s" + $Env:CONDA_SHLVL = "1" + $Env:CONDA_DEFAULT_ENV = "%(prefix)s" + $Env:CONDA_PROMPT_MODIFIER = "(%(prefix)s) " %(conda_exe_export)s . "%(activate1)s" """) % { @@ -1182,9 +1182,9 @@ def test_powershell_basic(self): new_path_parts = activator._replace_prefix_in_path(self.prefix, self.prefix) assert reactivate_data == dals(""" . "%(deactivate1)s" - $env:PATH = "%(new_path)s" - $env:CONDA_SHLVL = "1" - $env:CONDA_PROMPT_MODIFIER = "(%(prefix)s) " + $Env:PATH = "%(new_path)s" + $Env:CONDA_SHLVL = "1" + $Env:CONDA_PROMPT_MODIFIER = "(%(prefix)s) " . "%(activate1)s" """) % { 'activate1': join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.ps1'), @@ -1205,8 +1205,8 @@ def test_powershell_basic(self): Remove-Item Env:/CONDA_PREFIX Remove-Item Env:/CONDA_DEFAULT_ENV Remove-Item Env:/CONDA_PROMPT_MODIFIER - $env:PATH = "%(new_path)s" - $env:CONDA_SHLVL = "0" + $Env:PATH = "%(new_path)s" + $Env:CONDA_SHLVL = "0" %(conda_exe_export)s """) % { 'new_path': new_path, @@ -1304,7 +1304,8 @@ class InteractiveShell(object): 'powershell': { 'activator': 'powershell', 'args': ('-NoProfile', '-NoLogo'), - 'init_command': 'python -m conda shell.powershell hook --dev | Out-String | Invoke-Expression', + 'init_command': '{} -m conda shell.powershell hook --dev | Out-String | Invoke-Expression'\ + .format(sys.executable), 'print_env_var': '$Env:%s', 'exit_cmd': 'exit' }, @@ -1353,7 +1354,6 @@ def __enter__(self): # set state for context joiner = os.pathsep.join if self.shell_name == 'fish' else self.activator.pathsep_join PATH = joiner(self.activator.path_conversion(concatv( - (dirname(sys.executable),), self.activator._get_starting_path_list(), (dirname(which(self.shell_name)),), ))) @@ -1412,7 +1412,7 @@ def get_env_var(self, env_var, default=None): self.sendline(self.print_env_var % env_var) # The \r\n\( is the newline after the env var and the start of the prompt. # If we knew the active env we could add that in as well as the closing ) - self.expect(r'\$Env:{}\r\n([^\r]*)(\r\n)+\('.format(env_var)) + self.expect(r'\$Env:{}\r\n([^\r]*)(\r\n).*'.format(env_var)) value = self.p.match.groups()[0] else: self.sendline('echo get_var_start') @@ -1507,6 +1507,9 @@ def basic_posix(self, shell): prefix2_p = activator.path_conversion(self.prefix2) prefix3_p = activator.path_conversion(self.prefix3) + PATH0 = shell.get_env_var('PATH', '') + assert any(p.endswith("condabin") for p in PATH0.split(":")) + # calling bash -l, as we do for MSYS2, may cause conda activation. shell.sendline('conda deactivate') shell.sendline('conda deactivate') @@ -1515,8 +1518,8 @@ def basic_posix(self, shell): shell.expect('.*\n') shell.assert_env_var('CONDA_SHLVL', '0') - PATH0 = shell.get_env_var('PATH', '').strip(':') - assert any(p.endswith("condabin") for p in PATH0.split(":")) + PATH0 = shell.get_env_var('PATH', '') + assert len([p for p in PATH0.split(":") if p.endswith("condabin")]) > 0 # Remove sys.prefix from PATH. It interferes with path entry count tests. # We can no longer check this since we'll replace e.g. between 1 and N path # entries with N of them in _replace_prefix_in_path() now. It is debatable @@ -1524,7 +1527,7 @@ def basic_posix(self, shell): if PATH0.startswith(activator.path_conversion(sys.prefix) + ':'): PATH0=PATH0[len(activator.path_conversion(sys.prefix))+1:] shell.sendline('export PATH="{}"'.format(PATH0)) - PATH0 = shell.get_env_var('PATH', '').strip(':') + PATH0 = shell.get_env_var('PATH', '') shell.sendline("type conda") shell.expect(conda_is_a_function) @@ -1544,7 +1547,7 @@ def basic_posix(self, shell): shell.assert_env_var('PS1', '(base).*') shell.assert_env_var('CONDA_SHLVL', '1') - PATH1 = shell.get_env_var('PATH', '').strip(':') + PATH1 = shell.get_env_var('PATH', '') assert len(PATH0.split(':')) + num_paths_added == len(PATH1.split(':')) CONDA_EXE = shell.get_env_var('CONDA_EXE') @@ -1574,8 +1577,11 @@ def basic_posix(self, shell): # goes to use this old conda to generate the activation script for the newly activated env. # it is running the old code (or at best, a mix of new code and old scripts). shell.assert_env_var('CONDA_SHLVL', '2') - shell.assert_env_var('CONDA_PREFIX', prefix_p, True) - PATH2 = shell.get_env_var('PATH', '').strip(':') + CONDA_PREFIX = shell.get_env_var('CONDA_PREFIX', '') + # We get C: vs c: differences on Windows. + # Also, self.prefix instead of prefix_p is deliberate (maybe unfortunate?) + assert CONDA_PREFIX.lower() == self.prefix.lower() + PATH2 = shell.get_env_var('PATH', '') assert len(PATH0.split(':')) + num_paths_added == len(PATH2.split(':')) shell.sendline('env | sort | grep CONDA') @@ -1589,7 +1595,7 @@ def basic_posix(self, shell): shell.expect('PATH=') shell.assert_env_var('PS1', '(charizard).*') shell.assert_env_var('CONDA_SHLVL', '3') - PATH3 = shell.get_env_var('PATH').strip(':') + PATH3 = shell.get_env_var('PATH') assert len(PATH0.split(':')) + num_paths_added == len(PATH3.split(':')) CONDA_EXE2 = shell.get_env_var('CONDA_EXE') @@ -1604,7 +1610,7 @@ def basic_posix(self, shell): shell.sendline('conda' + install + '-yq hdf5=1.10.2') shell.expect('Executing transaction: ...working... done.*\n', timeout=60) - shell.assert_env_var('?', '0', True) + shell.assert_env_var('?', '0', use_exact=True) shell.sendline('h5stat --version') shell.expect(r'.*h5stat: Version 1.10.2.*') @@ -1625,17 +1631,17 @@ def basic_posix(self, shell): shell.sendline('conda' + deactivate) shell.assert_env_var('CONDA_SHLVL', '2') - PATH = shell.get_env_var('PATH').strip(':') + PATH = shell.get_env_var('PATH') assert len(PATH0.split(':')) + num_paths_added == len(PATH.split(':')) shell.sendline('conda' + deactivate) shell.assert_env_var('CONDA_SHLVL', '1') - PATH = shell.get_env_var('PATH').strip(':') + PATH = shell.get_env_var('PATH') assert len(PATH0.split(':')) + num_paths_added == len(PATH.split(':')) shell.sendline('conda' + deactivate) shell.assert_env_var('CONDA_SHLVL', '0') - PATH = shell.get_env_var('PATH').strip(':') + PATH = shell.get_env_var('PATH') assert len(PATH0.split(':')) == len(PATH.split(':')) assert PATH0 == PATH @@ -1653,16 +1659,16 @@ def basic_posix(self, shell): assert CONDA_EXED, "A fully deactivated conda shell must retain CONDA_EXE (and _CE_M and _CE_CONDA in dev)\n" \ " as the shell scripts refer to them." - PATH0 = shell.get_env_var('PATH').strip(':') + PATH0 = shell.get_env_var('PATH') shell.sendline('conda' + activate + '"%s"' % prefix2_p) shell.assert_env_var('CONDA_SHLVL', '1') - PATH1 = shell.get_env_var('PATH').strip(':') + PATH1 = shell.get_env_var('PATH') assert len(PATH0.split(':')) + num_paths_added == len(PATH1.split(':')) shell.sendline('conda' + activate + '"%s" --stack' % self.prefix3) shell.assert_env_var('CONDA_SHLVL', '2') - PATH2 = shell.get_env_var('PATH').strip(':') + PATH2 = shell.get_env_var('PATH') assert 'charizard' in PATH2 assert 'venusaur' in PATH2 assert len(PATH0.split(':')) + num_paths_added * 2 == len(PATH2.split(':')) @@ -1676,7 +1682,7 @@ def basic_posix(self, shell): shell.sendline('conda' + deactivate) shell.assert_env_var('CONDA_SHLVL', '2') - PATH4 = shell.get_env_var('PATH').strip(':') + PATH4 = shell.get_env_var('PATH') assert 'charizard' in PATH4 assert 'venusaur' in PATH4 assert PATH4 == PATH2 @@ -1765,6 +1771,7 @@ def test_powershell_basic_integration(self): shell.p.expect_exact('Alias') shell.sendline('(Get-Command conda).Definition') shell.p.expect_exact('Invoke-Conda') + shell.sendline('(Get-Command Invoke-Conda).Definition') print('## [PowerShell integration] Activating.') shell.sendline('conda activate "%s"' % charizard) @@ -1812,10 +1819,6 @@ def test_powershell_basic_integration(self): @pytest.mark.skipif(not which_powershell() or not on_win or sys.version_info[0] == 2, reason="Windows, Python != 2 (needs dynamic OpenSSL), PowerShell specific test") - @pytest.mark.xfail(sys.version_info[0] == 3, - reason="the PowerShell integration scripts do not manage PATH correctly. Here we " - "see that an unactivated conda cannot be used in PowerShell because it will " - "not have the necessary entries on PATH for OpenSSL to be found.", strict=True) def test_powershell_PATH_management(self): posh_kind, posh_path = which_powershell() print('## [PowerShell activation PATH management] Using {}.'.format(posh_path)) @@ -1826,12 +1829,16 @@ def test_powershell_PATH_management(self): shell.p.expect_exact('Alias') shell.sendline('(Get-Command conda).Definition') shell.p.expect_exact('Invoke-Conda') + shell.sendline('(Get-Command Invoke-Conda).Definition') + shell.p.expect('.*\n') shell.sendline('conda deactivate') shell.sendline('conda deactivate') PATH0 = shell.get_env_var('PATH', '') print("PATH is {}".format(PATH0.split(os.pathsep))) + shell.sendline('(Get-Command conda).CommandType') + shell.p.expect_exact('Alias') shell.sendline('conda create -yqp "{}" bzip2'.format(prefix)) shell.expect('Executing transaction: ...working... done.*\n') @@ -1856,14 +1863,15 @@ def test_cmd_exe_basic_integration(self): shell.sendline('chcp'); shell.expect('.*\n') - # PATH0 = shell.get_env_var('PATH', '').split(os.pathsep) + PATH0 = shell.get_env_var('PATH', '').split(os.pathsep) + print(PATH0) shell.sendline('conda activate --dev "%s"' % charizard) shell.sendline('chcp'); shell.expect('.*\n') shell.assert_env_var('CONDA_SHLVL', '1\r') - # PATH1 = shell.get_env_var('PATH', '').split(os.pathsep) - # print(set(PATH1)-set(PATH0)) + PATH1 = shell.get_env_var('PATH', '').split(os.pathsep) + print(PATH1) shell.sendline('powershell -NoProfile -c ("get-command conda | Format-List Source")') shell.p.expect_exact('Source : ' + conda_bat) @@ -1871,7 +1879,8 @@ def test_cmd_exe_basic_integration(self): shell.assert_env_var('_CE_M', '-m\r') shell.assert_env_var('CONDA_EXE', escape(sys.executable) + '\r') shell.assert_env_var('CONDA_PREFIX', charizard, True) - # PATH2 = shell.get_env_var('PATH', '').split(os.pathsep) + PATH2 = shell.get_env_var('PATH', '').split(os.pathsep) + print(PATH2) shell.sendline('powershell -NoProfile -c ("get-command conda -All | Format-List Source")') shell.p.expect_exact('Source : ' + conda_bat)
CONDA_PYTHON_EXE was removed in 4.6.11 The environment variable `CONDA_PYTHON_EXE` was removed in 910a7ee19. I was using this environment variable in the installer for an application, in order to create a shortcut for the application using the cwp script. Here's what I was doing to get the executable and args for the shortcut: ```python def condify(target, arguments): # format is ROOT_PYTHONW ROOT_CWP_SCRIPT ENV_BASE ENV_PYTHONW # Followed by our actual program and args root_pythonw = os.getenv('CONDA_PYTHON_EXE').replace('.exe', 'w.exe') root_cwp_script = root_pythonw.replace('pythonw.exe', 'cwp.py') env_base = os.getenv('CONDA_PREFIX') env_pythonw = target args = [root_cwp_script, env_base, env_pythonw] + arguments return root_pythonw, args ``` I copied this method (not the above code, just the required aguments to call the cwp script to launch a program) of creating application shortcuts from Spyder. I am not sure how spyder does it now, but I am not sure how to go about correctly creating application shortcuts if I don't have a way of figuring out what the conda python executable is. 4.6.11 was a bugfix release and I did not see comments in the release notes regarding this change, so it was surprising. Can the environment variable be added back in, or if not, could someone let me know what the correct way to make a shortcut programmatically using the cwp.py script now is?
2019-04-09T12:28:52Z
[]
[]
conda/conda
8,564
conda__conda-8564
[ "8566" ]
4f152eed002ae8247cc7f0feac871dc35f322d73
diff --git a/conda/activate.py b/conda/activate.py --- a/conda/activate.py +++ b/conda/activate.py @@ -479,22 +479,21 @@ def _get_starting_path_list(self): clean_paths[sys.platform] if sys.platform in clean_paths else '/usr/bin') path_split = path.split(os.pathsep) - if on_win: - # We used to prepend sys.prefix\Library\bin to PATH on startup but not anymore. - # Instead, in conda 4.6 we add the full suite of entries. This is performed in - # condabin\conda.bat and condabin\ _conda_activate.bat. However, we - # need to ignore the stuff we add there, and only consider actual PATH entries. - prefix_dirs = tuple(self._get_path_dirs(sys.prefix)) - start_index = 0 - while (start_index < len(prefix_dirs) and - start_index < len(path_split) and - paths_equal(path_split[start_index], prefix_dirs[start_index])): - start_index += 1 - path_split = path_split[start_index:] - library_bin_dir = self.path_conversion( - self.sep.join((sys.prefix, 'Library', 'bin'))) - if paths_equal(path_split[0], library_bin_dir): - path_split = path_split[1:] + # We used to prepend sys.prefix\Library\bin to PATH on startup but not anymore. + # Instead, in conda 4.6 we add the full suite of entries. This is performed in + # condabin\conda.bat and condabin\ _conda_activate.bat. However, we + # need to ignore the stuff we add there, and only consider actual PATH entries. + prefix_dirs = tuple(self._get_path_dirs(sys.prefix)) + start_index = 0 + while (start_index < len(prefix_dirs) and + start_index < len(path_split) and + paths_equal(path_split[start_index], prefix_dirs[start_index])): + start_index += 1 + path_split = path_split[start_index:] + library_bin_dir = self.path_conversion( + self.sep.join((sys.prefix, 'Library', 'bin'))) + if paths_equal(path_split[0], library_bin_dir): + path_split = path_split[1:] return path_split def _get_path_dirs(self, prefix, extra_library_bin=False): @@ -682,11 +681,11 @@ def _translation(found_path): # NOQA def path_identity(paths): if isinstance(paths, string_types): - return paths + return os.path.normpath(paths) elif paths is None: return None else: - return tuple(paths) + return tuple(os.path.normpath(_) for _ in paths) class PosixActivator(_Activator):
diff --git a/conda.recipe/run_test.bat b/conda.recipe/run_test.bat new file mode 100644 --- /dev/null +++ b/conda.recipe/run_test.bat @@ -0,0 +1,30 @@ +@echo on +SET CONDA_SHLVL= +REM don't inherit these from the build env setup +SET _CE_CONDA= +SET _CE_M= +SET _CONDA_EXE= +SET +REM CALL stuff is necessary because conda in condabin is a bat script +REM running bat files within other bat files requires CALL or else +REM the outer script (our test script) exits when the inner completes +CALL %PREFIX%\condabin\conda_hook.bat +CALL conda.bat activate base +FOR /F "delims=" %%i IN ('python -c "import sys; print(sys.version_info[0])"') DO set "PYTHON_MAJOR_VERSION=%%i" +SET TEST_PLATFORM=win +FOR /F "delims=" %%i IN ('python -c "import random as r; print(r.randint(0,4294967296))"') DO set "PYTHONHASHSEED=%%i" +where conda +CALL conda info +CALL conda create -y -p .\built-conda-test-env python=3.5 +CALL conda.bat activate .\built-conda-test-env +ECHO %CONDA_PREFIX% +IF NOT "%CONDA_PREFIX%"=="%CD%\built-conda-test-env" EXIT /B 1 +FOR /F "delims=" %%i IN ('python -c "import sys; print(sys.version_info[1])"') DO set "ENV_PYTHON_MINOR_VERSION=%%i" +IF NOT "%ENV_PYTHON_MINOR_VERSION%" == "5" EXIT /B 1 +CALL conda deactivate +SET MSYSTEM=MINGW%ARCH% +SET MSYS2_PATH_TYPE=inherit +SET CHERE_INVOKING=1 +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PREFIX%"') DO set "PREFIXP=%%i" +bash -lc "source %PREFIXP%/Scripts/activate" +py.test tests -m "not integration and not installed" -vv \ No newline at end of file diff --git a/conda.recipe/run_test.sh b/conda.recipe/run_test.sh new file mode 100644 --- /dev/null +++ b/conda.recipe/run_test.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -x + +unset CONDA_SHLVL +unset _CE_CONDA +unset _CE_M +unset CONDA_EXE +eval "$(python -m conda shell.bash hook)" +conda activate base +export PYTHON_MAJOR_VERSION=$(python -c "import sys; print(sys.version_info[0])") +export TEST_PLATFORM=$(python -c "import sys; print('win' if sys.platform.startswith('win') else 'unix')") +export PYTHONHASHSEED=$(python -c "import random as r; print(r.randint(0,4294967296))") && echo "PYTHONHASHSEED=$PYTHONHASHSEED" +env | sort +conda info +conda create -y -p ./built-conda-test-env python=3.5 +conda activate ./built-conda-test-env +echo $CONDA_PREFIX +[ "$CONDA_PREFIX" = "$PWD/built-conda-test-env" ] || exit 1 +[ $(python -c "import sys; print(sys.version_info[1])") = 5 ] || exit 1 +conda deactivate +py.test tests -m "not integration and not installed" -vv diff --git a/tests/test_activate.py b/tests/test_activate.py --- a/tests/test_activate.py +++ b/tests/test_activate.py @@ -1238,8 +1238,9 @@ class InteractiveShell(object): # 'init_command': 'env | sort && mount && which {0} && {0} -V && echo "$({0} -m conda shell.posix hook)" && eval "$({0} -m conda shell.posix hook)"'.format('/c/Users/rdonnelly/mc/python.exe'), # sys.executable.replace('\\', '/')), # 'init_command': 'env | sort && echo "$({0} -m conda shell.posix hook)" && eval "$({0} -m conda shell.posix hook)"'.format(self. # '/c/Users/rdonnelly/mc/python.exe'), # sys.executable.replace('\\', '/')), - 'init_command': 'env | sort && echo "$({0} -m conda shell.posix hook {1})" && eval "$({0} -m conda shell.posix hook {1})" && env | sort'\ - .format(exe_quoted, dev_arg), + 'init_command': ('env | sort && echo "$({0} -m conda shell.posix hook {1})" && ' + 'eval "$({0} -m conda shell.posix hook {1})" && env | sort' + .format(exe_quoted, dev_arg)), 'print_env_var': 'echo "$%s"', }, @@ -1253,7 +1254,8 @@ class InteractiveShell(object): }, 'zsh': { 'base_shell': 'posix', # inheritance implemented in __init__ - 'init_command': 'env | sort && eval "$(python -m conda shell.zsh hook {0})"'.format(dev_arg), + 'init_command': ('env | sort && eval "$({0} -m conda shell.zsh hook {1})"' + .format(exe_quoted, dev_arg)), }, # It should be noted here that we use the latest hook with whatever conda.exe is installed # in sys.prefix (and we will activate all of those PATH entries). We will set PYTHONPATH @@ -1296,7 +1298,7 @@ class InteractiveShell(object): }, 'fish': { 'activator': 'fish', - 'init_command': 'eval (python -m conda shell.fish hook {0})'.format(dev_arg), + 'init_command': 'eval ({0} -m conda shell.fish hook {1})'.format(exe_quoted, dev_arg), 'print_env_var': 'echo $%s', }, # We don't know if the PowerShell executable is called @@ -1729,6 +1731,7 @@ def test_csh_basic_integration(self): self.basic_csh(shell) @pytest.mark.skipif(not which('tcsh'), reason='tcsh not installed') + @pytest.mark.xfail(reason="punting until we officially enable support for tcsh") def test_tcsh_basic_integration(self): with InteractiveShell('tcsh') as shell: self.basic_csh(shell) diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -1210,7 +1210,7 @@ def test_install_freeze_installed_flag(self): assert package_is_installed(prefix, "bleach=2") with pytest.raises(UnsatisfiableError): run_command(Commands.INSTALL, prefix, - "conda-forge::tensorflow>=1.4", "--dry-run", "--freeze-installed") + "conda-forge::tensorflow>=1.4,<1.12", "--dry-run", "--freeze-installed") @pytest.mark.xfail(on_win, reason="nomkl not present on windows", strict=True)
Path exploding on Windows due to conda init ## Current Behavior Every time I issue a conda command in powershell, the windows path gets extended with duplicate entries... eventutually becoming too long to set. **BUG FIX** Note the line below: ``` Write-Output Env:PATH is $Env:PATH; ``` It's a debug output that was never removed that's being added to the PATH and thus the system keeps adding to the PATH over and over and over... ### Steps to Reproduce Do conda init powershell and then using commmands the path keeps growing. It appears to be happening in Conda.psm1: ``` <# .SYNOPSIS Adds the entries of sys.prefix to PATH and returns the old PATH. .EXAMPLE $OldPath = Add-Sys-Prefix-To-Path #> function Add-Sys-Prefix-To-Path() { $OldPath = $Env:PATH; if ($Env:_CE_CONDA -ne '' -And $Env:OS -eq 'Windows_NT') { # Windows has a different layout for the python exe than other platforms. $sysp = Split-Path $Env:CONDA_EXE -Parent; } else { $sysp = Split-Path $Env:CONDA_EXE -Parent; $sysp = Split-Path $sysp -Parent; } if ($Env:OS -eq 'Windows_NT') { $Env:PATH = $sysp + ';' + $sysp + '\Library\mingw-w64\bin;' + $sysp + '\Library\usr\bin;' + $sysp + '\Library\bin;' + $sysp + '\Scripts;' + $sysp + '\bin;' + $Env:PATH; } else { $Env:PATH = $sysp + '/bin:' + $Env:PATH; } Write-Output Env:PATH is $Env:PATH; return $OldPath; } ``` ## Expected Behavior Path should not lengthen with duplicates ## Environment Information
2019-04-16T02:42:50Z
[]
[]
conda/conda
8,644
conda__conda-8644
[ "8274" ]
239ea5f0a1a3d7f8efc5fbe8a4f1f0885d121e67
diff --git a/conda/activate.py b/conda/activate.py --- a/conda/activate.py +++ b/conda/activate.py @@ -838,7 +838,7 @@ def __init__(self, arguments=None): self.sep = '/' self.path_conversion = native_path_to_unix self.script_extension = '.xsh' - self.tempfile_extension = '.xsh' + self.tempfile_extension = None self.command_join = '\n' self.unset_var_tmpl = 'del $%s' @@ -851,7 +851,7 @@ def __init__(self, arguments=None): super(XonshActivator, self).__init__(arguments) def _hook_preamble(self): - return 'CONDA_EXE = "%s"' % context.conda_exe + return '$CONDA_EXE = "%s"' % context.conda_exe class CmdExeActivator(_Activator): diff --git a/conda/core/initialize.py b/conda/core/initialize.py --- a/conda/core/initialize.py +++ b/conda/core/initialize.py @@ -414,7 +414,7 @@ def make_install_plan(conda_prefix): plan.append({ 'function': install_conda_xsh.__name__, 'kwargs': { - 'target_path': join(site_packages_dir, 'xonsh', 'conda.xsh'), + 'target_path': join(site_packages_dir, 'xontrib', 'conda.xsh'), 'conda_prefix': conda_prefix, }, }) @@ -493,6 +493,32 @@ def make_initialize_plan(conda_prefix, shells, for_user, for_system, anaconda_pr }, }) + if 'xonsh' in shells: + if for_user: + config_xonsh_path = expand(join('~', '.xonshrc')) + plan.append({ + 'function': init_xonsh_user.__name__, + 'kwargs': { + 'target_path': config_xonsh_path, + 'conda_prefix': conda_prefix, + 'reverse': reverse, + }, + }) + + if for_system: + if on_win: + config_xonsh_path = expand(join('%ALLUSERSPROFILE%', 'xonsh', 'xonshrc')) + else: + config_xonsh_path = '/etc/xonshrc' + plan.append({ + 'function': init_xonsh_user.__name__, + 'kwargs': { + 'target_path': config_xonsh_path, + 'conda_prefix': conda_prefix, + 'reverse': reverse, + }, + }) + if 'tcsh' in shells and for_user: tcshrc_path = expand(join('~', '.tcshrc')) plan.append({ @@ -1066,6 +1092,91 @@ def init_fish_user(target_path, conda_prefix, reverse): return Result.NO_CHANGE +def _config_xonsh_content(conda_prefix): + if on_win: + from ..activate import native_path_to_unix + conda_exe = native_path_to_unix(join(conda_prefix, 'Scripts', 'conda.exe')) + else: + conda_exe = join(conda_prefix, 'bin', 'conda') + conda_initialize_content = dals(""" + # >>> conda initialize >>> + # !! Contents within this block are managed by 'conda init' !! + import sys as _sys + from types import ModuleType as _ModuleType + _mod = _ModuleType("xontrib.conda", + "Autogenerated from $({conda_exe} shell.xonsh hook)") + __xonsh__.execer.exec($("{conda_exe}" "shell.xonsh" "hook"), + glbs=_mod.__dict__, + filename="$({conda_exe} shell.xonsh hook)") + _sys.modules["xontrib.conda"] = _mod + del _sys, _mod, _ModuleType + # <<< conda initialize <<< + """).format(conda_exe=conda_exe) + return conda_initialize_content + + +def init_xonsh_user(target_path, conda_prefix, reverse): + # target_path: ~/.xonshrc + user_rc_path = target_path + + try: + with open(user_rc_path) as fh: + rc_content = fh.read() + except FileNotFoundError: + rc_content = '' + except: + raise + + rc_original_content = rc_content + + conda_init_comment = "# commented out by conda initialize" + conda_initialize_content = _config_xonsh_content(conda_prefix) + if reverse: + # uncomment any lines that were commented by prior conda init run + rc_content = re.sub( + r"#\s(.*?)\s*{}".format(conda_init_comment), + r"\1", + rc_content, + flags=re.MULTILINE, + ) + + # remove any conda init sections added + rc_content = re.sub( + r"^\s*" + CONDA_INITIALIZE_RE_BLOCK, + "", + rc_content, + flags=re.DOTALL | re.MULTILINE + ) + else: + replace_str = "__CONDA_REPLACE_ME_123__" + rc_content = re.sub( + CONDA_INITIALIZE_RE_BLOCK, + replace_str, + rc_content, + flags=re.MULTILINE, + ) + # TODO: maybe remove all but last of replace_str, if there's more than one occurrence + rc_content = rc_content.replace(replace_str, conda_initialize_content) + + if "# >>> conda initialize >>>" not in rc_content: + rc_content += '\n{0}\n'.format(conda_initialize_content) + + if rc_content != rc_original_content: + if context.verbosity: + print('\n') + print(target_path) + print(make_diff(rc_original_content, rc_content)) + if not context.dry_run: + # Make the directory if needed. + if not exists(dirname(user_rc_path)): + mkdir_p(dirname(user_rc_path)) + with open(user_rc_path, 'w') as fh: + fh.write(rc_content) + return Result.MODIFIED + else: + return Result.NO_CHANGE + + def _bashrc_content(conda_prefix, shell): if on_win: from ..activate import native_path_to_unix
diff --git a/tests/core/test_initialize.py b/tests/core/test_initialize.py --- a/tests/core/test_initialize.py +++ b/tests/core/test_initialize.py @@ -209,7 +209,7 @@ def test_make_install_plan(self): "function": "install_conda_xsh", "kwargs": { "conda_prefix": "/darwin", - "target_path": "/darwin/lib/python2.6/site-packages\\xonsh\\conda.xsh" + "target_path": "/darwin/lib/python2.6/site-packages\\xontrib\\conda.xsh" } }, { @@ -295,7 +295,7 @@ def test_make_install_plan(self): "function": "install_conda_xsh", "kwargs": { "conda_prefix": "/darwin", - "target_path": "/darwin/lib/python2.6/site-packages/xonsh/conda.xsh" + "target_path": "/darwin/lib/python2.6/site-packages/xontrib/conda.xsh" } }, { @@ -344,7 +344,7 @@ def test_make_entry_point(self): assert ep_contents == dals(""" # -*- coding: utf-8 -*- import sys - + if __name__ == '__main__': from conda.entry.point import run sys.exit(run()) @@ -354,7 +354,7 @@ def test_make_entry_point(self): #!%s/bin/python # -*- coding: utf-8 -*- import sys - + if __name__ == '__main__': from conda.entry.point import run sys.exit(run()) @@ -444,9 +444,9 @@ def test_install_conda_xsh(self): first_line, remainder = created_file_contents.split('\n', 1) if on_win: - assert first_line == 'CONDA_EXE = "%s"' % join(conda_prefix, 'Scripts', 'conda.exe') + assert first_line == '$CONDA_EXE = "%s"' % join(conda_prefix, 'Scripts', 'conda.exe') else: - assert first_line == 'CONDA_EXE = "%s"' % join(conda_prefix, 'bin', 'conda') + assert first_line == '$CONDA_EXE = "%s"' % join(conda_prefix, 'bin', 'conda') with open(join(CONDA_PACKAGE_ROOT, 'shell', 'conda.xsh')) as fh: original_contents = fh.read() @@ -708,19 +708,19 @@ def test_init_sh_user_unix(self): export PATH="/some/other/conda/bin:$PATH" export PATH="%(prefix)s/bin:$PATH" export PATH="%(prefix)s/bin:$PATH" - + # >>> conda initialize >>> __conda_setup="$('%(prefix)s/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then fi unset __conda_setup # <<< conda initialize <<< - + . etc/profile.d/conda.sh . etc/profile.d/coda.sh . /somewhere/etc/profile.d/conda.sh source /etc/profile.d/conda.sh - + \t source %(prefix)s/etc/profile.d/conda.sh """) % { 'prefix': win_path_backout(abspath(conda_temp_prefix)), @@ -738,7 +738,7 @@ def test_init_sh_user_unix(self): export PATH="/some/other/conda/bin:$PATH" # export PATH="%(prefix)s/bin:$PATH" # commented out by conda initialize # export PATH="%(prefix)s/bin:$PATH" # commented out by conda initialize - + # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('%(prefix)s/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" @@ -753,12 +753,12 @@ def test_init_sh_user_unix(self): fi unset __conda_setup # <<< conda initialize <<< - + # . etc/profile.d/conda.sh # commented out by conda initialize . etc/profile.d/coda.sh # . /somewhere/etc/profile.d/conda.sh # commented out by conda initialize # source /etc/profile.d/conda.sh # commented out by conda initialize - + # source %(prefix)s/etc/profile.d/conda.sh # commented out by conda initialize """) % { 'prefix': win_path_backout(abspath(conda_temp_prefix)), @@ -770,12 +770,12 @@ def test_init_sh_user_unix(self): export PATH="/some/other/conda/bin:$PATH" export PATH="%(prefix)s/bin:$PATH" export PATH="%(prefix)s/bin:$PATH" - + . etc/profile.d/conda.sh . etc/profile.d/coda.sh . /somewhere/etc/profile.d/conda.sh source /etc/profile.d/conda.sh - + source %(prefix)s/etc/profile.d/conda.sh """) % { 'prefix': win_path_backout(abspath(conda_temp_prefix)), @@ -850,12 +850,12 @@ def test_init_sh_user_windows(self): expected_reversed_content = dals(""" source /c/conda/Scripts/activate root . $(cygpath 'c:\\conda\\Scripts\\activate') root - + . etc/profile.d/conda.sh . etc/profile.d/coda.sh . /somewhere/etc/profile.d/conda.sh source /etc/profile.d/conda.sh - + source %(prefix)s/etc/profile.d/conda.sh """) % { 'prefix': win_path_ok(abspath(conda_prefix)), diff --git a/tests/test_activate.py b/tests/test_activate.py --- a/tests/test_activate.py +++ b/tests/test_activate.py @@ -981,11 +981,7 @@ def test_xonsh_basic(self): rc = activate_main(['', 'shell.xonsh'] + activate_args + [self.prefix]) assert not c.stderr assert rc == 0 - activate_result = c.stdout - - with open(activate_result) as fh: - activate_data = fh.read() - rm_rf(activate_result) + activate_data = c.stdout new_path_parts = activator._add_prefix_to_path(self.prefix) conda_exe_export, conda_exe_unset = activator.get_scripts_export_unset_vars() @@ -1014,13 +1010,10 @@ def test_xonsh_basic(self): }): activator = XonshActivator() with captured() as c: - assert activate_main(['', 'shell.xonsh'] + reactivate_args) == 0 + rc = activate_main(['', 'shell.xonsh'] + reactivate_args) assert not c.stderr - reactivate_result = c.stdout - - with open(reactivate_result) as fh: - reactivate_data = fh.read() - rm_rf(reactivate_result) + assert rc == 0 + reactivate_data = c.stdout new_path_parts = activator._replace_prefix_in_path(self.prefix, self.prefix) e_reactivate_data = dals(""" @@ -1030,23 +1023,21 @@ def test_xonsh_basic(self): $CONDA_PROMPT_MODIFIER = '(%(native_prefix)s) ' source "%(activate1)s" """) % { + 'new_path': activator.pathsep_join(new_path_parts), 'activate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'activate.d', 'activate1.xsh')), 'deactivate1': activator.path_conversion(join(self.prefix, 'etc', 'conda', 'deactivate.d', 'deactivate1.xsh')), 'native_prefix': self.prefix, - 'new_path': activator.pathsep_join(new_path_parts), } assert reactivate_data == e_reactivate_data with captured() as c: - assert activate_main(['', 'shell.xonsh'] + deactivate_args) == 0 + rc = activate_main(['', 'shell.xonsh'] + deactivate_args) assert not c.stderr - deactivate_result = c.stdout - - with open(deactivate_result) as fh: - deactivate_data = fh.read() - rm_rf(deactivate_result) + assert rc == 0 + deactivate_data = c.stdout new_path = activator.pathsep_join(activator._remove_prefix_from_path(self.prefix)) + conda_exe_export, conda_exe_unset = activator.get_scripts_export_unset_vars() e_deactivate_data = dals(""" $PATH = '%(new_path)s' source "%(deactivate1)s"
conda init does nothing for xonsh <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> I'm using xonsh on ubuntu. I first tried to `conda activate base` (or some other environment) in but then I get an error and suggestion to run `conda init`. Next I run `conda init` without error, but no change is reported and I cannot get `conda activate base` to work. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ```xonsh λ which conda /home/pletnes/miniconda3/bin/conda λ conda activate base CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. To initialize your shell, run $ conda init Currently supported shells are: - bash - fish - tcsh - xonsh - zsh - powershell See 'conda init --help' for more information and options. IMPORTANT: You may need to close and restart your shell after running 'conda init'. λ conda init xonsh no change /home/pletnes/miniconda3/condabin/conda no change /home/pletnes/miniconda3/bin/conda no change /home/pletnes/miniconda3/bin/conda-env no change /home/pletnes/miniconda3/bin/activate no change /home/pletnes/miniconda3/bin/deactivate no change /home/pletnes/miniconda3/etc/profile.d/conda.sh no change /home/pletnes/miniconda3/etc/fish/conf.d/conda.fish no change /home/pletnes/miniconda3/shell/condabin/Conda.psm1 no change /home/pletnes/miniconda3/shell/condabin/conda-hook.ps1 no change /home/pletnes/miniconda3/lib/python3.7/site-packages/xonsh/conda.xsh no change /home/pletnes/miniconda3/etc/profile.d/conda.csh λ conda activate base xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True ModuleNotFoundError: No module named 'conda' ``` ## Expected Behavior <!-- What do you think should happen? --> I hoped `conda init xonsh` would create the necessary PATH (or similar) settings in `~/.xonshrc` so that `conda activate <some-env>` works flawlessly. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : base active env location : /home/pletnes/miniconda3 shell level : 1 user config file : /home/pletnes/.condarc populated config files : conda version : 4.6.3 conda-build version : not installed python version : 3.7.1.final.0 base environment : /home/pletnes/miniconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/pletnes/miniconda3/pkgs /home/pletnes/.conda/pkgs envs directories : /home/pletnes/miniconda3/envs /home/pletnes/.conda/envs platform : linux-64 user-agent : conda/4.6.3 requests/2.21.0 CPython/3.7.1 Linux/4.4.0-142-generic ubuntu/16.04.5 glibc/2.23 UID:GID : 3506278:17 netrc file : None offline mode : False ``` And xonsh version: ``` $ xonsh --version xonsh/0.8.10 ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` $ conda config --show-sources # this returned blank? ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` $ conda list --show-channel-urls # packages in environment at /home/paul/miniconda3: # # Name Version Build Channel asn1crypto 0.24.0 py37_0 defaults ca-certificates 2019.1.23 0 defaults certifi 2018.11.29 py37_0 defaults cffi 1.11.5 py37he75722e_1 defaults chardet 3.0.4 py37_1 defaults conda 4.6.3 py37_0 defaults conda-env 2.6.0 1 defaults cryptography 2.4.2 py37h1ba5d50_0 defaults idna 2.8 py37_0 defaults libedit 3.1.20170329 h6b74fdf_2 defaults libffi 3.2.1 hd88cf55_4 defaults libgcc-ng 8.2.0 hdf63c60_1 defaults libstdcxx-ng 8.2.0 hdf63c60_1 defaults ncurses 6.1 he6710b0_1 defaults openssl 1.1.1a h7b6447c_0 defaults pip 18.1 py37_0 defaults pycosat 0.6.3 py37h14c3975_0 defaults pycparser 2.19 py37_0 defaults pyopenssl 18.0.0 py37_0 defaults pysocks 1.6.8 py37_0 defaults python 3.7.1 h0371630_7 defaults readline 7.0 h7b6447c_5 defaults requests 2.21.0 py37_0 defaults ruamel_yaml 0.15.46 py37h14c3975_0 defaults setuptools 40.6.3 py37_0 defaults six 1.12.0 py37_0 defaults sqlite 3.26.0 h7b6447c_0 defaults tk 8.6.8 hbc83047_0 defaults urllib3 1.24.1 py37_0 defaults wheel 0.32.3 py37_0 defaults xz 5.2.4 h14c3975_4 defaults yaml 0.1.7 had09818_2 defaults zlib 1.2.11 h7b6447c_3 defaults ``` </p></details>
2019-05-08T20:45:11Z
[]
[]
conda/conda
8,723
conda__conda-8723
[ "8697" ]
0fd7941d545ef47930da10ea297b6c174050b1de
diff --git a/conda/base/context.py b/conda/base/context.py --- a/conda/base/context.py +++ b/conda/base/context.py @@ -237,6 +237,7 @@ class Context(Configuration): report_errors = PrimitiveParameter(None, element_type=(bool, NoneType)) shortcuts = PrimitiveParameter(True) _verbosity = PrimitiveParameter(0, aliases=('verbose', 'verbosity'), element_type=int) + use_only_tar_bz2 = PrimitiveParameter(False) # ###################################################### # ## Solver Configuration ## @@ -722,6 +723,7 @@ def category_map(self): 'allow_non_channel_urls', 'restore_free_channel', 'repodata_fn', + 'use_only_tar_bz2' )), ('Basic Conda Configuration', ( # TODO: Is there a better category name here? 'envs_dirs', @@ -1129,6 +1131,9 @@ def description_map(self): allowed, along with the --use-local command line flag, be sure to include the 'local' channel in the list. If the list is empty or left undefined, no channel exclusions will be enforced. + """), + 'use_only_tar_bz2': dals(""" + A boolean indicating that only .tar.bz2 conda packages should be downloaded """) }) diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -126,13 +126,14 @@ def get_revision(arg, json=False): except ValueError: raise CondaValueError("expected revision number, not: '%s'" % arg, json) - def install(args, parser, command='install'): """ conda install, conda update, and conda create """ context.validate_configuration() check_non_admin() + if context.use_only_tar_bz2: + args.repodata_fn = 'repodata.json' newenv = bool(command == 'create') isupdate = bool(command == 'update') diff --git a/conda/core/subdir_data.py b/conda/core/subdir_data.py --- a/conda/core/subdir_data.py +++ b/conda/core/subdir_data.py @@ -382,7 +382,8 @@ def _process_raw_repodata_str(self, raw_repodata_str): channel_url = self.url_w_credentials legacy_packages = json_obj.get("packages", {}) - conda_packages = json_obj.get("packages.conda", {}) + conda_packages = {} if context.use_only_tar_bz2 else json_obj.get("packages.conda", {}) + _tar_bz2 = CONDA_PACKAGE_EXTENSION_V1 use_these_legacy_keys = set(iterkeys(legacy_packages)) - set( k[:-6] + _tar_bz2 for k in iterkeys(conda_packages) @@ -407,6 +408,7 @@ def _process_raw_repodata_str(self, raw_repodata_str): log.debug("Ignoring record_version %d from %s", info["record_version"], info['url']) continue + package_record = PackageRecord(**info) _package_records.append(package_record)
diff --git a/tests/core/test_subdir_data.py b/tests/core/test_subdir_data.py --- a/tests/core/test_subdir_data.py +++ b/tests/core/test_subdir_data.py @@ -188,6 +188,15 @@ def test_subdir_data_prefers_conda_to_tar_bz2(): precs = tuple(sd.query("zlib")) assert precs[0].fn.endswith(".conda") + +def test_only_use_tar_bz2(): + channel = Channel(join(dirname(__file__), "..", "data", "conda_format_repo", context.subdir)) + context.use_only_tar_bz2 = True + sd = SubdirData(channel) + precs = tuple(sd.query("zlib")) + assert precs[0].fn.endswith(".tar.bz2") + + # @pytest.mark.integration # class SubdirDataTests(TestCase): #
Option to fall back to old file format The rollout of the new file format has exposed some problems in conda-package-handling. Some/all packages are missing symlinks (at least to folders) which makes conda barf about missing content. We need a way for users to get unstuck if the new format doesn't work for them for whatever reason.
2019-05-24T19:31:44Z
[]
[]
conda/conda
8,775
conda__conda-8775
[ "8772" ]
70a554fb2cc60ddb138ef7ae67bba4e009bd152f
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -78,6 +78,7 @@ def __init__(self, prefix, channels, subdirs=(), specs_to_add=(), specs_to_remov self._index = None self._r = None self._prepared = False + self._pool_cache = {} def solve_for_transaction(self, update_modifier=NULL, deps_modifier=NULL, prune=NULL, ignore_pinned=NULL, force_remove=NULL, force_reinstall=NULL): @@ -388,9 +389,15 @@ def _find_inconsistent_packages(self, ssc): return ssc def _get_package_pool(self, ssc, specs): - pool = ssc.r.get_reduced_index(specs) - grouped_pool = groupby(lambda x: x.name, pool) - return {k: set(v) for k, v in iteritems(grouped_pool)} + specs = frozenset(specs) + if specs in self._pool_cache: + pool = self._pool_cache[specs] + else: + pool = ssc.r.get_reduced_index(specs) + grouped_pool = groupby(lambda x: x.name, pool) + pool = {k: set(v) for k, v in iteritems(grouped_pool)} + self._pool_cache[specs] = pool + return pool def _package_has_updates(self, ssc, spec, installed_pool): installed_prec = installed_pool.get(spec.name) @@ -403,6 +410,7 @@ def _should_freeze(self, ssc, target_prec, conflict_specs, explicit_pool, instal # never, ever freeze anything if we have no history. if not ssc.specs_from_history_map: return False + pkg_name = target_prec.name # if we are FREEZE_INSTALLED (first pass for install) freeze = ssc.update_modifier == UpdateModifier.FREEZE_INSTALLED @@ -418,7 +426,6 @@ def _should_freeze(self, ssc, target_prec, conflict_specs, explicit_pool, instal if update_added: spec_package_pool = self._get_package_pool(ssc, (target_prec.to_match_spec(), )) for spec in self.specs_to_add_names: - new_explicit_pool = explicit_pool ms = MatchSpec(spec) updated_spec = self._package_has_updates(ssc, ms, installed_pool) @@ -436,9 +443,22 @@ def _should_freeze(self, ssc, target_prec, conflict_specs, explicit_pool, instal break # if all package specs have overlapping package choices (satisfiable in at least one way) - no_conflict = (freeze or update_added) and pkg_name not in conflict_specs + no_conflict = ((freeze or update_added) and + pkg_name not in conflict_specs and + (pkg_name not in explicit_pool or + target_prec in explicit_pool[pkg_name]) and + self._compare_pools(ssc, explicit_pool, target_prec.to_match_spec())) return no_conflict + def _compare_pools(self, ssc, explicit_pool, ms): + other_pool = self._get_package_pool(ssc, (ms, )) + match = True + for k in set(other_pool.keys()) & set(explicit_pool.keys()): + if not bool(other_pool[k] & explicit_pool[k]): + match = False + break + return match + def _add_specs(self, ssc): # For the remaining specs in specs_map, add target to each spec. `target` is a reference # to the package currently existing in the environment. Setting target instructs the @@ -462,6 +482,19 @@ def _add_specs(self, ssc): for _ in ssc.prefix_data.iter_records())))) or [] conflict_specs = set(_.name for _ in conflict_specs) + for spec in ssc.specs_map.values(): + ms = MatchSpec(spec) + if (ms.name in explicit_pool and + not bool(set(ssc.r.find_matches(ms)) & explicit_pool[ms.name])): + conflict_specs.add(ms.name) + # PrefixGraph here does a toposort, so that we're iterating from parents downward. This + # ensures that any conflict from an indirect child should also get picked up. + for prec in PrefixGraph(ssc.prefix_data.iter_records()).records: + if prec.name in conflict_specs: + continue + if any(MatchSpec(dep).name in conflict_specs for dep in prec.get("depends", [])): + conflict_specs.add(prec.name) + for pkg_name, spec in iteritems(ssc.specs_map): matches_for_spec = tuple(prec for prec in ssc.solution_precs if spec.match(prec)) if matches_for_spec: @@ -492,8 +525,8 @@ def _add_specs(self, ssc): pin_overrides = set() for s in ssc.pinned_specs: if s.name in explicit_pool: - if s.name not in self.specs_to_add_names: - ssc.specs_map[s.name] = s + if s.name not in self.specs_to_add_names and not ssc.ignore_pinned: + ssc.specs_map[s.name] = MatchSpec(s, optional=False) elif explicit_pool[s.name] & self._get_package_pool(ssc, [s])[s.name]: ssc.specs_map[s.name] = MatchSpec(s, optional=False) pin_overrides.add(s.name) @@ -505,7 +538,13 @@ def _add_specs(self, ssc): for prec in ssc.prefix_data.iter_records(): if prec.name not in ssc.specs_map: if (prec.name not in conflict_specs and - (prec.name not in explicit_pool or prec in explicit_pool[prec.name])): + (prec.name not in explicit_pool or + prec in explicit_pool[prec.name]) and + # because it's not just immediate deps, but also + # upstream things that matter, we must ensure + # overlap for dependencies of things that have + # otherwise passed our tests + self._compare_pools(ssc, explicit_pool, prec.to_match_spec())): ssc.specs_map[prec.name] = prec.to_match_spec() else: ssc.specs_map[prec.name] = MatchSpec( @@ -616,13 +655,18 @@ def _run_sat(self, ssc): # track_features_specs or pinned_specs, which we should raise an error on. specs_map_set = set(itervalues(ssc.specs_map)) grouped_specs = groupby(lambda s: s in specs_map_set, conflicting_specs) - conflicting_pinned_specs = groupby(lambda s: s in ssc.pinned_specs, conflicting_specs) + # force optional to true. This is what it is originally in + # pinned_specs, but we override that in _add_specs to make it + # non-optional when there's a name match in the explicit package + # pool + conflicting_pinned_specs = groupby(lambda s: MatchSpec(s, optional=True) + in ssc.pinned_specs, conflicting_specs) if conflicting_pinned_specs.get(True): in_specs_map = grouped_specs.get(True, ()) pinned_conflicts = conflicting_pinned_specs.get(True, ()) in_specs_map_or_specs_to_add = ((set(in_specs_map) | set(self.specs_to_add)) - - set(ssc.pinned_specs)) + - set(pinned_conflicts)) raise SpecsConfigurationConflictError( sorted(s.__str__() for s in in_specs_map_or_specs_to_add), diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -9,12 +9,13 @@ from ._vendor.auxlib.collection import frozendict from ._vendor.auxlib.decorators import memoize, memoizemethod -from ._vendor.toolz import concat, concatv, groupby +from ._vendor.toolz import concat, groupby from .base.constants import ChannelPriority, MAX_CHANNEL_PRIORITY, SatSolverChoice from .base.context import context from .common.compat import iteritems, iterkeys, itervalues, odict, on_win, text_type from .common.io import time_recorder -from .common.logic import Clauses, CryptoMiniSatSolver, PycoSatSolver, PySatSolver +from .common.logic import (Clauses, CryptoMiniSatSolver, PycoSatSolver, PySatSolver, + minimal_unsatisfiable_subset) from .common.toposort import toposort from .exceptions import (CondaDependencyError, InvalidSpec, ResolvePackageNotFound, UnsatisfiableError) @@ -421,8 +422,8 @@ def find_conflicts(self, specs, specs_to_add=None, history_specs=None): sdeps_with_dep = {k: v.get(dep) for k, v in sdeps.items() if dep in v.keys()} if len(sdeps_with_dep) <= 1: continue - intersection = set.intersection(*sdeps_with_dep.values()) - if len(intersection) != 0: + # if the two pools overlap, we're good. Next dep. + if bool(set.intersection(*sdeps_with_dep.values())): continue filter = {} for fkeys in sdeps_with_dep.values(): @@ -586,6 +587,18 @@ def filter_group(_specs): reduced = filter_group([s]) if reduced: slist.append(s) + elif reduced is None: + break + if reduced is None: + # This filter reset means that unsatisfiable indexes leak through. + filter_out = {prec: False if val else "feature not enabled" + for prec, val in iteritems(self.default_filter(features))} + # TODO: raise unsatisfiable exception here + # Messaging to users should be more descriptive. + # 1. Are there no direct matches? + # 2. Are there no matches for first-level dependencies? + # 3. Have the first level dependencies been invalidated? + break # Determine all valid packages in the dependency graph reduced_index2 = {prec: prec for prec in (make_feature_record(fstr) for fstr in features)} @@ -983,31 +996,40 @@ def environment_is_consistent(self, installed): solution = C.sat(constraints) return bool(solution) - def get_conflicting_specs(self, specs, original_specs=None): + def get_conflicting_specs(self, specs): if not specs: return () + reduced_index = self.get_reduced_index(specs) + + # Check if satisfiable + def mysat(specs, add_if=False): + constraints = r2.generate_spec_constraints(C, specs) + return C.sat(constraints, add_if) - reduced_index = self.get_reduced_index(tuple(specs), sort_by_exactness=False) r2 = Resolve(reduced_index, True, channels=self.channels) - scp = context.channel_priority == ChannelPriority.STRICT - unsat_specs = {s for s in specs if not r2.find_matches_with_strict(s, scp)} - if not unsat_specs: + C = r2.gen_clauses() + solution = mysat(specs, True) + if solution: return () - - # This first result is just a single unsatisfiable core. There may be several. - satisfiable_specs = set(specs) - set(unsat_specs) - - # In this loop, we test each unsatisfiable spec individually against the satisfiable - # specs to ensure there are no other unsatisfiable specs in the set. - final_unsat_specs = set() - while unsat_specs: - this_spec = unsat_specs.pop() - final_unsat_specs.add(this_spec) - test_specs = tuple(concatv((this_spec, ), satisfiable_specs)) - r2 = Resolve(self.get_reduced_index(test_specs), True, channels=self.channels) - _unsat_specs = {s for s in specs if not r2.find_matches_with_strict(s, scp)} - unsat_specs.update(_unsat_specs - final_unsat_specs) - satisfiable_specs -= set(unsat_specs) + else: + # This first result is just a single unsatisfiable core. There may be several. + unsat_specs = list(minimal_unsatisfiable_subset(specs, sat=mysat)) + satisfiable_specs = set(specs) - set(unsat_specs) + + # In this loop, we test each unsatisfiable spec individually against the satisfiable + # specs to ensure there are no other unsatisfiable specs in the set. + final_unsat_specs = set() + while unsat_specs: + this_spec = unsat_specs.pop(0) + final_unsat_specs.add(this_spec) + test_specs = satisfiable_specs | {this_spec} + C = r2.gen_clauses() # TODO: wasteful call, but Clauses() needs refactored + solution = mysat(test_specs, True) + if not solution: + these_unsat = minimal_unsatisfiable_subset(test_specs, sat=mysat) + if len(these_unsat) > 1: + unsat_specs.extend(these_unsat) + satisfiable_specs -= set(unsat_specs) return tuple(final_unsat_specs) def bad_installed(self, installed, new_specs):
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -2778,6 +2778,18 @@ def test_legacy_repodata(self): assert exists(join(prefix, PYTHON_BINARY)) assert package_is_installed(prefix, 'moto=1.3.7') + def test_cross_channel_incompatibility(self): + # regression test for https://github.com/conda/conda/issues/8772 + # conda-forge puts a run_constrains on libboost, which they don't have on conda-forge. + # This is a way of forcing libboost to be removed. It's a way that they achieve + # mutual exclusivity with the boost from defaults that works differently. + + # if this test passes, we'll hit the DryRunExit exception, instead of an UnsatisfiableError + with pytest.raises(DryRunExit): + stdout, stderr, _ = run_command(Commands.CREATE, "dummy_channel_incompat_test", + '--dry-run', '-c', 'conda-forge', 'python', + 'boost==1.70.0', 'boost-cpp==1.70.0') + @pytest.mark.skipif(True, reason="get the rest of Solve API worked out first") @pytest.mark.integration class PrivateEnvIntegrationTests(TestCase):
Can't install Boost 1.70.0 from conda-forge in 4.7.2 (possible regression with `run_constrained`/`constrains`) <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> Conda 4.7.2 fails to create an environment with `python` and `boost 1.70.0`, when trying to create it as is described below. Note that the same command works in conda 4.6.14, but it has a slowdown problem, as described in https://github.com/conda-forge/boost-cpp-feedstock/issues/49. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` λ conda create -n boost_env -c conda-forge python boost==1.70.0 boost-cpp==1.70.0 Collecting package metadata (current_repodata.json): done Solving environment: failed Collecting package metadata (repodata.json): done Solving environment: failed UnsatisfiableError: The following specifications were found to be incompatible with each other: - boost-cpp==1.70.0 -> libboost[version='<0'] - boost==1.70.0 -> boost-cpp=1.70.0 -> libboost[version='<0'] ``` <details open><summary>If `boost` and `boost-cpp` are not pinned, it tries to install an older version (1.68.0):</summary><p> ``` λ conda create -n boost_env -c conda-forge python boost boost-cpp Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: W:\conda-canary\envs\boost_env added / updated specs: - boost - boost-cpp - python The following packages will be downloaded: package | build ---------------------------|----------------- boost-1.68.0 |py37hf75dd32_1001 763 KB conda-forge boost-cpp-1.68.0 | h6a4c333_1000 31.1 MB conda-forge ca-certificates-2019.3.9 | hecc5488_0 184 KB conda-forge certifi-2019.3.9 | py37_0 149 KB conda-forge intel-openmp-2019.4 | 245 1.7 MB libblas-3.8.0 | 8_mkl 3.5 MB conda-forge libcblas-3.8.0 | 8_mkl 3.5 MB conda-forge liblapack-3.8.0 | 8_mkl 3.5 MB conda-forge mkl-2019.4 | 245 157.5 MB numpy-1.15.4 |py37h8078771_1002 3.8 MB conda-forge openssl-1.1.1b | hfa6e2cd_2 4.8 MB conda-forge pip-19.1.1 | py37_0 1.8 MB conda-forge python-3.7.3 | hb12ca83_0 17.8 MB conda-forge setuptools-41.0.1 | py37_0 658 KB conda-forge sqlite-3.28.0 | hfa6e2cd_0 985 KB conda-forge vc-14.1 | h0510ff6_4 6 KB vs2015_runtime-14.15.26706 | h3a45250_4 1.1 MB wheel-0.33.4 | py37_0 52 KB conda-forge wincertstore-0.2 | py37_1002 13 KB conda-forge zlib-1.2.11 | h2fa13f4_1004 236 KB conda-forge ------------------------------------------------------------ Total: 233.3 MB The following NEW packages will be INSTALLED: boost conda-forge/win-64::boost-1.68.0-py37hf75dd32_1001 boost-cpp conda-forge/win-64::boost-cpp-1.68.0-h6a4c333_1000 ca-certificates conda-forge/win-64::ca-certificates-2019.3.9-hecc5488_0 certifi conda-forge/win-64::certifi-2019.3.9-py37_0 intel-openmp pkgs/main/win-64::intel-openmp-2019.4-245 libblas conda-forge/win-64::libblas-3.8.0-8_mkl libcblas conda-forge/win-64::libcblas-3.8.0-8_mkl liblapack conda-forge/win-64::liblapack-3.8.0-8_mkl mkl pkgs/main/win-64::mkl-2019.4-245 numpy conda-forge/win-64::numpy-1.15.4-py37h8078771_1002 openssl conda-forge/win-64::openssl-1.1.1b-hfa6e2cd_2 pip conda-forge/win-64::pip-19.1.1-py37_0 python conda-forge/win-64::python-3.7.3-hb12ca83_0 setuptools conda-forge/win-64::setuptools-41.0.1-py37_0 sqlite conda-forge/win-64::sqlite-3.28.0-hfa6e2cd_0 vc pkgs/main/win-64::vc-14.1-h0510ff6_4 vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.15.26706-h3a45250_4 wheel conda-forge/win-64::wheel-0.33.4-py37_0 wincertstore conda-forge/win-64::wincertstore-0.2-py37_1002 zlib conda-forge/win-64::zlib-1.2.11-h2fa13f4_1004 ``` </p></details> ## Expected Behavior It should create an env with `python`, `boost 1.70.0` and some dependencies. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : None user config file : C:\Users\tadeu\.condarc populated config files : conda version : 4.7.2 conda-build version : not installed python version : 3.7.3.final.0 virtual packages : __cuda=9.2 base environment : W:\conda-canary (writable) channel URLs : https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : W:\conda-canary\pkgs C:\Users\tadeu\.conda\pkgs C:\Users\tadeu\AppData\Local\conda\conda\pkgs envs directories : W:\conda-canary\envs C:\Users\tadeu\.conda\envs C:\Users\tadeu\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.7.2 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.17763 administrator : True netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> (empty) </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` λ conda list --show-channel-urls # packages in environment at W:\conda-canary: # # Name Version Build Channel asn1crypto 0.24.0 py37_0 defaults bzip2 1.0.6 hfa6e2cd_5 defaults ca-certificates 2019.5.15 0 defaults certifi 2019.3.9 py37_0 defaults cffi 1.12.2 py37h7a1dbc1_1 defaults chardet 3.0.4 py37_1 defaults conda 4.7.2 py37_0 conda-canary conda-package-handling 1.3.0 py37_0 defaults console_shortcut 0.1.1 3 defaults cryptography 2.6.1 py37h7a1dbc1_0 defaults idna 2.8 py37_0 defaults libarchive 3.3.3 h0643e63_5 defaults libiconv 1.15 h1df5818_7 defaults libxml2 2.9.9 h464c3ec_0 defaults lz4-c 1.8.1.2 h2fa13f4_0 defaults lzo 2.10 h6df0209_2 defaults menuinst 1.4.16 py37he774522_0 defaults openssl 1.1.1c he774522_1 defaults pip 19.0.3 py37_0 defaults powershell_shortcut 0.0.1 2 defaults pycosat 0.6.3 py37hfa6e2cd_0 defaults pycparser 2.19 py37_0 defaults pyopenssl 19.0.0 py37_0 defaults pysocks 1.6.8 py37_0 defaults python 3.7.3 h8c8aaf0_0 defaults python-libarchive-c 2.8 py37_6 defaults pywin32 223 py37hfa6e2cd_1 defaults requests 2.21.0 py37_0 defaults ruamel_yaml 0.15.46 py37hfa6e2cd_0 defaults setuptools 41.0.0 py37_0 defaults six 1.12.0 py37_0 defaults sqlite 3.27.2 he774522_0 defaults tqdm 4.32.1 py_0 defaults urllib3 1.24.1 py37_0 defaults vc 14.1 h0510ff6_4 defaults vs2015_runtime 14.15.26706 h3a45250_0 defaults wheel 0.33.1 py37_0 defaults win_inet_pton 1.1.0 py37_0 defaults wincertstore 0.2 py37_0 defaults xz 5.2.4 h2fa13f4_4 defaults yaml 0.1.7 hc54c509_2 defaults zlib 1.2.11 h62dcd97_3 defaults zstd 1.3.7 h508b16e_0 defaults ``` </p></details>
Note that this was also reported here: https://github.com/conda-forge/boost-cpp-feedstock/issues/51 (in case there's a particular fix for the package, although this looks more like a conda problem)
2019-06-12T22:03:21Z
[]
[]
conda/conda
8,834
conda__conda-8834
[ "8828" ]
ee6701bab40411afa35a935044b95d769d59216b
diff --git a/conda/common/decorators.py b/conda/common/decorators.py --- a/conda/common/decorators.py +++ b/conda/common/decorators.py @@ -10,6 +10,7 @@ def env_override(envvar_name, convert_empty_to_none=False): def decorator(func): def wrapper(*args, **kwargs): value = os.environ.get(envvar_name, None) + if value is not None: if value == '' and convert_empty_to_none: return None diff --git a/conda/core/index.py b/conda/core/index.py --- a/conda/core/index.py +++ b/conda/core/index.py @@ -144,7 +144,7 @@ def _supplement_index_with_system(index): cuda_version = context.cuda_version if cuda_version is not None: rec = _make_virtual_package('__cuda', cuda_version) - index[rec.name] = rec + index[rec] = rec def calculate_channel_urls(channel_urls=(), prepend=True, platform=None, use_local=False): diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -388,17 +388,6 @@ def _find_inconsistent_packages(self, ssc): if prec not in inconsistent_precs) return ssc - def _get_package_pool(self, ssc, specs): - specs = frozenset(specs) - if specs in self._pool_cache: - pool = self._pool_cache[specs] - else: - pool = ssc.r.get_reduced_index(specs) - grouped_pool = groupby(lambda x: x.name, pool) - pool = {k: set(v) for k, v in iteritems(grouped_pool)} - self._pool_cache[specs] = pool - return pool - def _package_has_updates(self, ssc, spec, installed_pool): installed_prec = installed_pool.get(spec.name) has_update = installed_prec and any(_.version > installed_prec[0].version @@ -424,14 +413,14 @@ def _should_freeze(self, ssc, target_prec, conflict_specs, explicit_pool, instal # overlaps with the explicit package pool (by name), but they don't share any # actual records, then this target_prec conflicts and should not be pinned if update_added: - spec_package_pool = self._get_package_pool(ssc, (target_prec.to_match_spec(), )) + spec_package_pool = ssc.r._get_package_pool((target_prec.to_match_spec(), )) for spec in self.specs_to_add_names: new_explicit_pool = explicit_pool ms = MatchSpec(spec) updated_spec = self._package_has_updates(ssc, ms, installed_pool) if updated_spec: try: - new_explicit_pool = self._get_package_pool(ssc, (updated_spec, )) + new_explicit_pool = ssc.r._get_package_pool((updated_spec, )) except ResolvePackageNotFound: update_added = False break @@ -451,7 +440,7 @@ def _should_freeze(self, ssc, target_prec, conflict_specs, explicit_pool, instal return no_conflict def _compare_pools(self, ssc, explicit_pool, ms): - other_pool = self._get_package_pool(ssc, (ms, )) + other_pool = ssc.r._get_package_pool((ms, )) match = True for k in set(other_pool.keys()) & set(explicit_pool.keys()): if not bool(other_pool[k] & explicit_pool[k]): @@ -474,7 +463,7 @@ def _add_specs(self, ssc): # the only things we should consider freezing are things that don't conflict with the new # specs being added. - explicit_pool = self._get_package_pool(ssc, self.specs_to_add) + explicit_pool = ssc.r._get_package_pool(self.specs_to_add) conflict_specs = ssc.r.get_conflicting_specs(list(concatv( self.specs_to_add, (_.to_match_spec() for _ in ssc.prefix_data.iter_records())))) or [] @@ -512,7 +501,7 @@ def _add_specs(self, ssc): if s.name in explicit_pool: if s.name not in self.specs_to_add_names and not ssc.ignore_pinned: ssc.specs_map[s.name] = MatchSpec(s, optional=False) - elif explicit_pool[s.name] & self._get_package_pool(ssc, [s])[s.name]: + elif explicit_pool[s.name] & ssc.r._get_package_pool([s])[s.name]: ssc.specs_map[s.name] = MatchSpec(s, optional=False) pin_overrides.add(s.name) else: @@ -569,17 +558,23 @@ def _add_specs(self, ssc): if (any(_.name == 'python' for _ in ssc.solution_precs) and not any(s.name == 'python' for s in self.specs_to_add)): - # will our prefix record conflict with any explict spec? If so, don't add - # anything here - let python float when it hasn't been explicitly specified python_prefix_rec = ssc.prefix_data.get('python') if ('python' not in conflict_specs and ssc.update_modifier == UpdateModifier.FREEZE_INSTALLED): ssc.specs_map['python'] = python_prefix_rec.to_match_spec() else: + # will our prefix record conflict with any explict spec? If so, don't add + # anything here - let python float when it hasn't been explicitly specified python_spec = ssc.specs_map.get('python', MatchSpec('python')) if not python_spec.get('version'): pinned_version = get_major_minor_version(python_prefix_rec.version) + '.*' - ssc.specs_map['python'] = MatchSpec(python_spec, version=pinned_version) + python_spec = MatchSpec(python_spec, version=pinned_version) + + spec_set = (python_spec, ) + tuple(self.specs_to_add) + if ssc.r.get_conflicting_specs(spec_set): + # raises a hopefully helpful error message + ssc.r.find_conflicts(spec_set) + ssc.specs_map['python'] = python_spec # For the aggressive_update_packages configuration parameter, we strip any target # that's been set. @@ -877,6 +872,7 @@ def _prepare(self, prepared_specs): reduced_index = get_reduced_index(self.prefix, self.channels, self.subdirs, prepared_specs, self._repodata_fn) _supplement_index_with_system(reduced_index) + self._prepared_specs = prepared_specs self._index = reduced_index self._r = Resolve(reduced_index, channels=self.channels) diff --git a/conda/exceptions.py b/conda/exceptions.py --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -656,8 +656,9 @@ def __init__(self, bad_deps, chains=True, strict=False): If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow -not available for the python version you've asked for. -Your current python version is ({ref}). +not available for the python version you are constrained to. Your current python version +is ({ref}). Note that conda will not change your python version to a different minor version +unless you explicitly specify that. '''), 'request_conflict_with_history': dals(''' @@ -670,6 +671,12 @@ def __init__(self, bad_deps, chains=True, strict=False): The following specifications were found to be incompatible with each other:\n{specs} + '''), + 'cuda': dals(''' + +The following specifications were found to be incompatible with your CUDA driver:\n{specs} + +Your installed CUDA driver is: {ref} ''')} msg = "" @@ -678,7 +685,6 @@ def __init__(self, bad_deps, chains=True, strict=False): _chains = [] for dep_chain, installed_blocker in dep_class: # Remove any target values from the MatchSpecs, convert to strings - installed_blocker = str(MatchSpec(installed_blocker, target=None)) dep_chain = [str(MatchSpec(dep, target=None)) for dep in dep_chain] _chains.append(dep_chain) diff --git a/conda/models/match_spec.py b/conda/models/match_spec.py --- a/conda/models/match_spec.py +++ b/conda/models/match_spec.py @@ -449,7 +449,7 @@ def fn(self): @classmethod def merge(cls, match_specs): - match_specs = tuple(cls(s) for s in match_specs if s) + match_specs = sorted(tuple(cls(s) for s in match_specs if s), key=str) name_groups = groupby(attrgetter('name'), match_specs) unmergeable = name_groups.pop('*', []) + name_groups.pop(None, []) diff --git a/conda/models/prefix_graph.py b/conda/models/prefix_graph.py --- a/conda/models/prefix_graph.py +++ b/conda/models/prefix_graph.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import, division, print_function, unicode_literals +from collections import defaultdict, OrderedDict from logging import getLogger from .enums import NoarchType @@ -32,18 +33,19 @@ class PrefixGraph(object): def __init__(self, records, specs=()): records = tuple(records) specs = set(specs) - graph = {} # Dict[PrefixRecord, Set[PrefixRecord]] + self.graph = graph = {} # Dict[PrefixRecord, Set[PrefixRecord]] self.spec_matches = spec_matches = {} # Dict[PrefixRecord, Set[MatchSpec]] for node in records: parent_match_specs = tuple(MatchSpec(d) for d in node.depends) parent_nodes = set( - rec for rec in records if any(m.match(rec) for m in parent_match_specs) + rec for rec in records + if any(m.match(rec) for m in parent_match_specs) ) graph[node] = parent_nodes matching_specs = IndexedSet(s for s in specs if s.match(node)) if matching_specs: spec_matches[node] = matching_specs - self.graph = graph + self._toposort() def remove_spec(self, spec): @@ -271,7 +273,7 @@ def _toposort_pop_key(graph): In the case of a tie, use the node with the alphabetically-first package name. """ node_with_fewest_parents = sorted( - (len(parents), node.name, node) for node, parents in iteritems(graph) + (len(parents), node.dist_str(), node) for node, parents in iteritems(graph) )[0][2] graph.pop(node_with_fewest_parents) @@ -322,7 +324,6 @@ def _toposort_prepare_graph(graph): and node not in conda_parents): parents.add(conda_node) - # def dot_repr(self, title=None): # pragma: no cover # # graphviz DOT graph description language # @@ -380,6 +381,84 @@ def _toposort_prepare_graph(graph): # browser = webbrowser.get() # browser.open_new_tab(path_to_url(location)) +class GeneralGraph(PrefixGraph): + """ + Compared with PrefixGraph, this class takes in more than one record of a given name, + and operates on that graph from the higher view across any matching dependencies. It is + not a Prefix thing, but more like a "graph of all possible candidates" thing, and is used + for unsatisfiability analysis + """ + + def __init__(self, records, specs=()): + records = tuple(records) + super(GeneralGraph, self).__init__(records, specs) + self.specs_by_name = defaultdict(dict) + for node in records: + parent_dict = self.specs_by_name.get(node.name, OrderedDict()) + for dep in tuple(MatchSpec(d) for d in node.depends): + deps = parent_dict.get(dep.name, set()) + deps.add(dep) + parent_dict[dep.name] = deps + self.specs_by_name[node.name] = parent_dict + + consolidated_graph = OrderedDict() + # graph is toposorted, so looping over it is in dependency order + for node, parent_nodes in reversed(self.graph.items()): + cg = consolidated_graph.get(node.name, set()) + cg.update(_.name for _ in parent_nodes) + consolidated_graph[node.name] = cg + self.graph_by_name = consolidated_graph + + def depth_first_search_by_name(self, root_spec, spec_name, allowed_specs): + """Return paths from root_spec to spec_name""" + if root_spec.name == spec_name: + return [[root_spec]] + visited = set() + + def try_children(node, spec_name, chains=None): + visited.add(node) + if not chains: + chains = [[node]] + if node == spec_name: + return chains + new_chains = [] + for chain in chains[:]: + children = sorted(self.graph_by_name.get(chain[-1], set()), + key=lambda x: list(self.graph_by_name.keys()).index(x)) + # short circuit because it is the answer we're looking for + if spec_name in children: + children = [spec_name] + for child in children: + if child == chain[0]: + new_chains.append([root_spec]) + continue + new_chains.extend([chain + [child] for chain in chains]) + if child == spec_name: + break + elif child not in visited: + # if we have other children, or if we've found a match + new_chains = try_children(child, spec_name, new_chains)[:] + return new_chains + + chains = try_children(root_spec.name, spec_name) + + final_chains = [] + for chain in sorted(chains, key=len): + if chain[0] == root_spec.name and chain[-1] == spec_name: + # remap to matchspecs + # specs_by_name has two keys: parent, then name of spec + matchspecs_for_chain = [] + for idx, name in enumerate(chain[1:]): + matchspecs_to_merge = [] + matchspecs = self.specs_by_name[chain[idx]][name] + for ms in matchspecs: + if any(ms.match(rec) for rec in allowed_specs[ms.name]): + matchspecs_to_merge.append(ms) + matchspecs_for_chain.append(MatchSpec.merge(matchspecs_to_merge)[0]) + final_chains.append([root_spec] + matchspecs_for_chain) + break + return final_chains + # if __name__ == "__main__": # from ..core.prefix_data import PrefixData diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -19,8 +19,9 @@ from .exceptions import (CondaDependencyError, InvalidSpec, ResolvePackageNotFound, UnsatisfiableError) from .models.channel import Channel, MultiChannel -from .models.enums import NoarchType +from .models.enums import NoarchType, PackageType from .models.match_spec import MatchSpec +from .models.prefix_graph import GeneralGraph from .models.records import PackageRecord from .models.version import VersionOrder @@ -109,8 +110,11 @@ def __init__(self, index, processed=False, channels=()): self._cached_find_matches = {} # Dict[MatchSpec, Set[PackageRecord]] self.ms_depends_ = {} # Dict[PackageRecord, List[MatchSpec]] self._reduced_index_cache = {} + self._pool_cache = {} self._strict_channel_cache = {} + self._system_precs = {_ for _ in index if _.package_type == PackageType.VIRTUAL_SYSTEM} + # sorting these in reverse order is effectively prioritizing # contstraint behavior from newer packages. It is applying broadening # reduction based on the latest packages, which may reduce the space @@ -214,19 +218,15 @@ def invalid_chains(self, spec, filter, optional=True): A dependency chain is a tuple of MatchSpec objects, starting with the requested spec, proceeding down the dependency tree, ending at - a specification that cannot be satisfied. Uses self.valid_ as a - filter, both to prevent chains and to allow other routines to - prune the list of valid packages with additional criteria. + a specification that cannot be satisfied. Args: spec: a package key or MatchSpec filter: a dictionary of (prec, valid) pairs to be used when testing for package validity. - optional: if True (default), do not enforce optional specifications - when considering validity. If False, enforce them. Returns: - A generator of tuples, empty if the MatchSpec is valid. + A tuple of tuples, empty if the MatchSpec is valid. """ def chains_(spec, names): if spec.name in names: @@ -236,31 +236,20 @@ def chains_(spec, names): return precs = self.find_matches(spec) found = False - for prec in precs: - for m2 in self.ms_depends(prec): - for x in chains_(m2, names): - found = True - yield (spec,) + x - if not found: - yield (spec,) - return chains_(spec, set()) - def invalid_chains2(self, spec, filter_out, optional=True): - def chains_(spec, names): - if spec.name in names: - return - names.add(spec.name) - if self.valid2(spec, filter_out, optional): - return - precs = self.find_matches(spec) - found = False + conflict_deps = set() for prec in precs: for m2 in self.ms_depends(prec): for x in chains_(m2, names): found = True yield (spec,) + x + else: + conflict_deps.add(m2) if not found: - yield (spec,) + conflict_groups = groupby(lambda x: x.name, conflict_deps) + for group in conflict_groups.values(): + yield (spec,) + MatchSpec.merge(group) + return chains_(spec, set()) def verify_specs(self, specs): @@ -283,9 +272,8 @@ def verify_specs(self, specs): feature_names.update(_feature_names) else: non_tf_specs.append(ms) - filter = self.default_filter(feature_names) - for ms in non_tf_specs: - bad_deps.extend(self.invalid_chains(ms, filter.copy())) + bad_deps.extend((spec, ) for spec in non_tf_specs if (not spec.optional and + not self.find_matches(spec))) if bad_deps: raise ResolvePackageNotFound(bad_deps) return tuple(non_tf_specs), feature_names @@ -293,31 +281,46 @@ def verify_specs(self, specs): def _classify_bad_deps(self, bad_deps, specs_to_add, history_specs, strict_channel_priority): classes = {'python': set(), 'request_conflict_with_history': set(), - 'direct': set()} + 'direct': set(), + 'cuda': set(), } specs_to_add = set(MatchSpec(_) for _ in specs_to_add or []) history_specs = set(MatchSpec(_) for _ in history_specs or []) for chain in bad_deps: # sometimes chains come in as strings - chain = [MatchSpec(_) for _ in chain] if chain[-1].name == 'python' and len(chain) > 1 and \ + not any(_.name == 'python' for _ in specs_to_add) and \ any(_[0] for _ in bad_deps if _[0].name == 'python'): python_first_specs = [_[0] for _ in bad_deps if _[0].name == 'python'] if python_first_specs: python_spec = python_first_specs[0] if not (set(self.find_matches(python_spec)) & set(self.find_matches(chain[-1]))): - classes['python'].add((tuple(chain), python_spec)) + + classes['python'].add((tuple(chain), + str(MatchSpec(python_spec, target=None)))) + elif chain[-1].name == '__cuda': + cuda_version = [_ for _ in self._system_precs if _.name == '__cuda'] + cuda_version = cuda_version[0].version if cuda_version else "not available" + classes['cuda'].add((tuple(chain), cuda_version)) elif chain[0] in specs_to_add: match = False for spec in history_specs: if spec.name == chain[-1].name: - classes['request_conflict_with_history'].add((tuple(chain), spec)) + classes['request_conflict_with_history'].add(( + tuple(chain), str(MatchSpec(spec, target=None)))) match = True + if not match: classes['direct'].add((tuple(chain), chain[0])) else: - classes['direct'].add((tuple(chain), chain[0])) + if len(chain) > 1 or not any(len(c) > 1 and c[0] == chain[0] for c in bad_deps): + classes['direct'].add((tuple(chain), + str(MatchSpec(chain[0], target=None)))) + if classes['python']: + # filter out plain single-entry python conflicts. The python section explains these. + classes['direct'] = [_ for _ in classes['direct'] + if _[1].startswith('python ') or len(_[0]) > 1] return classes def find_matches_with_strict(self, ms, strict_channel_priority): @@ -364,86 +367,52 @@ def find_conflicts(self, specs, specs_to_add=None, history_specs=None): strict_channel_priority = context.channel_priority == ChannelPriority.STRICT - sdeps = {} + specs = set(specs) | {_.to_match_spec() for _ in self._system_precs} + # For each spec, assemble a dictionary of dependencies, with package # name as key, and all of the matching packages as values. - for top_level_spec in specs: - # find all packages matching a top level specification - top_level_pkgs = self.find_matches_with_strict(top_level_spec, strict_channel_priority) - top_level_sdeps = {top_level_spec.name: set(top_level_pkgs)} - - # find all depends specs for in top level packages - # find the depends names for each top level packages - second_level_specs = set() - top_level_pkg_dep_names = [] - for pkg in top_level_pkgs: - pkg_deps = self.ms_depends(pkg) - second_level_specs.update(pkg_deps) - top_level_pkg_dep_names.append([d.name for d in pkg_deps]) - - # find all second level packages and their specs - slist = [] - for ms in second_level_specs: - deps = top_level_sdeps.setdefault(ms.name, set()) - for fkey in self.find_matches_with_strict(ms, strict_channel_priority): - deps.add(fkey) - slist.extend( - ms2 for ms2 in self.ms_depends(fkey) if ms2.name != top_level_spec.name) - - # dependency names which appear in all top level packages - # have been fully considered and not additions should be make to - # the package list for that name - locked_names = [top_level_spec.name] - if top_level_pkg_dep_names: - for name in top_level_pkg_dep_names[0]: - if all(name in names for names in top_level_pkg_dep_names): - locked_names.append(name) - - # build out the rest of the dependency tree - while slist: - ms2 = slist.pop() - if ms2.name in locked_names: - continue - deps = top_level_sdeps.setdefault(ms2.name, set()) - for fkey in self.find_matches_with_strict(ms2, strict_channel_priority): - if fkey not in deps: - deps.add(fkey) - slist.extend(ms3 for ms3 in self.ms_depends(fkey) - if ms3.name != top_level_spec.name) - sdeps[top_level_spec] = top_level_sdeps + sdeps = {k: self._get_package_pool((k, )) for k in specs} # find deps with zero intersection between specs which include that dep bad_deps = [] - deps = set() - for sdep in sdeps.values(): - deps.update(sdep.keys()) + dep_collections = tuple(set(sdep.keys()) for sdep in sdeps.values()) + deps = set.union(*dep_collections) if dep_collections else [] + # for each possible package being considered, look at how pools interact for dep in deps: - sdeps_with_dep = {k: v.get(dep) for k, v in sdeps.items() if dep in v.keys()} + sdeps_with_dep = {} + for k, v in sdeps.items(): + if dep in v: + sdeps_with_dep[k] = v if len(sdeps_with_dep) <= 1: continue - # if the two pools overlap, we're good. Next dep. - if bool(set.intersection(*sdeps_with_dep.values())): + # if all of the pools overlap, we're good. Next dep. + if bool(set.intersection(*[v[dep] for v in sdeps_with_dep.values()])): continue - filter = {} - for fkeys in sdeps_with_dep.values(): - for fkey in fkeys: - filter[fkey] = False - for spec in sdeps_with_dep.keys(): - ndeps = set(self.invalid_chains(spec, filter, False)) - ndeps = [nd for nd in ndeps if nd[-1].name == dep] - bad_deps.extend(ndeps) - if not bad_deps: - for spec in specs: - filter = {} - for name, valid_pkgs in sdeps[spec].items(): - if name == spec.name: - continue - for fkey in self.find_matches(MatchSpec(name)): - filter[fkey] = fkey in valid_pkgs - bad_deps.extend(self.invalid_chains(spec, filter, False)) + # start out filtering nothing. invalid_chains will tweak this dict to filter more + # as it goes + records = set.union(*tuple(rec for records in sdeps_with_dep.values() + for rec in records.values())) + # determine the invalid chains for each specific spec. Each of these chains + # should start with `spec` and end with the first encountered conflict. A + # conflict is something that is either not available at all, or is present in + # more than one pool, but those pools do not all overlap. + + g = GeneralGraph(records) + spec_order = sorted(sdeps_with_dep.keys(), + key=lambda x: list(g.graph_by_name.keys()).index(x.name)) + for spec in spec_order: + # the DFS approach works well when things are actually in the graph + bad_deps.extend(g.depth_first_search_by_name(spec, dep, sdeps[spec])) + if not bad_deps: # no conflicting nor missing packages found, return the bad specs - bad_deps = [(ms, ) for ms in specs] + bad_deps = [] + + for spec in specs: + precs = self.find_matches(spec) + deps = set.union(*[set(self.ms_depends_.get(prec)) for prec in precs]) + deps = groupby(lambda x: x.name, deps) + bad_deps.extend([[spec, MatchSpec.merge(_)[0]] for _ in deps.values()]) bad_deps = self._classify_bad_deps(bad_deps, specs_to_add, history_specs, strict_channel_priority) raise UnsatisfiableError(bad_deps, strict=strict_channel_priority) @@ -467,6 +436,17 @@ def _broader(self, ms, specs_by_name): return False return ms.strictness < specs_by_name[0].strictness + def _get_package_pool(self, specs): + specs = frozenset(specs) + if specs in self._pool_cache: + pool = self._pool_cache[specs] + else: + pool = self.get_reduced_index(specs) + grouped_pool = groupby(lambda x: x.name, pool) + pool = {k: set(v) for k, v in iteritems(grouped_pool)} + self._pool_cache[specs] = pool + return pool + @time_recorder(module_name=__name__) def get_reduced_index(self, explicit_specs, sort_by_exactness=True): # TODO: fix this import; this is bad @@ -1094,7 +1074,9 @@ def install_specs(self, specs, installed, update_deps=True): def install(self, specs, installed=None, update_deps=True, returnall=False): specs, preserve = self.install_specs(specs, installed or [], update_deps) - pkgs = self.solve(specs, returnall=returnall, _remove=False) + pkgs = [] + if specs: + pkgs = self.solve(specs, returnall=returnall, _remove=False) self.restore_bad(pkgs, preserve) return pkgs @@ -1146,15 +1128,29 @@ def solve(self, specs, returnall=False, _remove=False, specs_to_add=None, histor specs = tuple(MatchSpec(_) for _ in specs) specs = set(specs) + if not specs: + return tuple() + # Find the compliant packages log.debug("Solve: Getting reduced index of compliant packages") len0 = len(specs) reduced_index = self.get_reduced_index(specs) if not reduced_index: - if len(specs) == 1 or any(self.get_reduced_index((s,)) for s in specs): - self.find_conflicts(specs, specs_to_add, history_specs) - return False if reduced_index is None else ([[]] if returnall else []) + # something is intrinsically unsatisfiable - either not found or not the right version + not_found_packages = set() + wrong_version_packages = set() + for s in specs: + if not self.find_matches(s): + if s.name in self.groups: + wrong_version_packages.add(s) + else: + not_found_packages.add(s) + if not_found_packages: + raise ResolvePackageNotFound(not_found_packages) + elif wrong_version_packages: + raise UnsatisfiableError([[d] for d in wrong_version_packages], chains=False) + self.find_conflicts(specs, specs_to_add, history_specs) # Check if satisfiable log.debug("Solve: determining satisfiability") @@ -1185,6 +1181,7 @@ def is_converged(solution): r2 = Resolve(reduced_index, True, channels=self.channels) C = r2.gen_clauses() solution = mysat(specs, True) + if not solution: self.find_conflicts(specs, specs_to_add, history_specs)
diff --git a/tests/core/test_index.py b/tests/core/test_index.py --- a/tests/core/test_index.py +++ b/tests/core/test_index.py @@ -49,7 +49,7 @@ def test_supplement_index_with_system(): with env_vars({'CONDA_OVERRIDE_CUDA': '3.2'}): _supplement_index_with_system(index) - cuda_pkg = index['__cuda'] + cuda_pkg = next(iter(_ for _ in index if _.name == '__cuda')) assert cuda_pkg.version == '3.2' assert cuda_pkg.package_type == PackageType.VIRTUAL_SYSTEM diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -12,6 +12,7 @@ import pytest +from conda._vendor.auxlib.ish import dals from conda.base.context import context, Context, reset_context, conda_tests_ctxt_mgmt_def_pol from conda.common.io import env_var, env_vars, stderr_log_level, captured from conda.core.prefix_data import PrefixData @@ -200,9 +201,16 @@ def test_cuda_fail_1(): # No cudatoolkit in index for CUDA 8.0 with env_var('CONDA_OVERRIDE_CUDA', '8.0'): with get_solver_cuda(specs) as solver: - with pytest.raises(ResolvePackageNotFound): + with pytest.raises(UnsatisfiableError) as exc: final_state = solver.solve_final_state() + assert str(exc.value).strip() == dals("""The following specifications were found to be incompatible with your CUDA driver: + + - cudatoolkit -> __cuda[version='>=10.0,>=9.0'] + +Your installed CUDA driver is: 8.0""") + + def test_cuda_fail_2(): specs = MatchSpec("cudatoolkit"), @@ -210,9 +218,13 @@ def test_cuda_fail_2(): # No CUDA on system with env_var('CONDA_OVERRIDE_CUDA', ''): with get_solver_cuda(specs) as solver: - with pytest.raises(ResolvePackageNotFound): + with pytest.raises(UnsatisfiableError) as exc: final_state = solver.solve_final_state() + assert str(exc.value).strip() == dals("""The following specifications were found to be incompatible with your CUDA driver: + - cudatoolkit -> __cuda[version='>=10.0,>=9.0'] + +Your installed CUDA driver is: not available""") def test_prune_1(): specs = MatchSpec("numpy=1.6"), MatchSpec("python=2.7.3"), MatchSpec("accelerate"), @@ -1993,3 +2005,54 @@ def test_current_repodata_fallback(): checked = True if not checked: raise ValueError("Didn't have expected state in solve (needed zlib record)") + + +def test_downgrade_python_prevented_with_sane_message(): + specs = MatchSpec("python=2.6"), + with get_solver(specs) as solver: + final_state_1 = solver.solve_final_state() + # PrefixDag(final_state_1, specs).open_url() + pprint(convert_to_dist_str(final_state_1)) + order = ( + 'channel-1::openssl-1.0.1c-0', + 'channel-1::readline-6.2-0', + 'channel-1::sqlite-3.7.13-0', + 'channel-1::system-5.8-1', + 'channel-1::tk-8.5.13-0', + 'channel-1::zlib-1.2.7-0', + 'channel-1::python-2.6.8-6', + ) + assert convert_to_dist_str(final_state_1) == order + + # incompatible CLI and configured specs + specs_to_add = MatchSpec("scikit-learn==0.13"), + with get_solver(specs_to_add=specs_to_add, prefix_records=final_state_1, + history_specs=specs) as solver: + with pytest.raises(UnsatisfiableError) as exc: + solver.solve_final_state() + assert str(exc.value).strip() == dals("""The following specifications were found +to be incompatible with the existing python installation in your environment: + + - scikit-learn==0.13 -> python=2.7 + +If python is on the left-most side of the chain, that's the version you've asked for. +When python appears to the right, that indicates that the thing on the left is somehow +not available for the python version you are constrained to. Your current python version +is (python=2.6). Note that conda will not change your python version to a different minor version +unless you explicitly specify that.""") + + specs_to_add = MatchSpec("unsatisfiable-with-py26"), + with get_solver(specs_to_add=specs_to_add, prefix_records=final_state_1, + history_specs=specs) as solver: + with pytest.raises(UnsatisfiableError) as exc: + solver.solve_final_state() + assert str(exc.value).strip() == dals("""The following specifications were found +to be incompatible with the existing python installation in your environment: + + - unsatisfiable-with-py26 -> scikit-learn==0.13 -> python=2.7 + +If python is on the left-most side of the chain, that's the version you've asked for. +When python appears to the right, that indicates that the thing on the left is somehow +not available for the python version you are constrained to. Your current python version +is (python=2.6). Note that conda will not change your python version to a different minor version +unless you explicitly specify that.""") diff --git a/tests/data/index.json b/tests/data/index.json --- a/tests/data/index.json +++ b/tests/data/index.json @@ -20993,5 +20993,16 @@ "name": "cudatoolkit", "pub_date": "2013-01-14", "version": "10.0" + }, + "unsatisfiable-with-py26-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [ + "scikit-learn ==0.13" + ], + "md5": "28a63f84034658e80779e88e70fad7bf", + "name": "unsatisfiable-with-py26", + "pub_date": "2013-01-14", + "version": "1.0" } } diff --git a/tests/models/test_match_spec.py b/tests/models/test_match_spec.py --- a/tests/models/test_match_spec.py +++ b/tests/models/test_match_spec.py @@ -871,7 +871,7 @@ def test_merge_multiple_name(self): bounded_spec = next(s for s in merged_specs if s.name == 'bounded') assert str(exact_spec) == "exact[version='1.2.3,>1.0,<2',build=1]" - assert str(bounded_spec) == "bounded[version='>=1.0,<2.0,>=1.5,<=1.8']" + assert str(bounded_spec) == "bounded[version='<=1.8,>=1.0,<2.0,>=1.5']" assert not bounded_spec.match({ 'name': 'bounded', @@ -930,7 +930,7 @@ def test_build_merge(self): specs = (MatchSpec('python[build=py27_1]'), MatchSpec('python=1.2.3=py27_1'), MatchSpec('conda-forge::python<=8')) merged = MatchSpec.merge(specs) assert len(merged) == 1 - assert str(merged[0]) == "conda-forge::python[version='1.2.3,<=8',build=py27_1]" + assert str(merged[0]) == "conda-forge::python[version='<=8,1.2.3',build=py27_1]" specs = (MatchSpec('python[build=py27_1]'), MatchSpec('python=1.2.3=1'), MatchSpec('conda-forge::python<=8[build=py27_1]')) with pytest.raises(ValueError): @@ -940,7 +940,7 @@ def test_build_number_merge(self): specs = (MatchSpec('python[build_number=1]'), MatchSpec('python=1.2.3=py27_7'), MatchSpec('conda-forge::python<=8[build_number=1]')) merged = MatchSpec.merge(specs) assert len(merged) == 1 - assert str(merged[0]) == "conda-forge::python[version='1.2.3,<=8',build=py27_7,build_number=1]" + assert str(merged[0]) == "conda-forge::python[version='<=8,1.2.3',build=py27_7,build_number=1]" specs = (MatchSpec('python[build_number=2]'), MatchSpec('python=1.2.3=py27_7'), MatchSpec('python<=8[build_number=1]')) with pytest.raises(ValueError): diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -2230,7 +2230,7 @@ def test_use_index_cache(self): SubdirData._cache_.clear() prefix = make_temp_prefix("_" + str(uuid4())[:7]) - with make_temp_env(prefix=prefix): + with make_temp_env(prefix=prefix, no_capture=True): # First, clear the index cache to make sure we start with an empty cache. index_cache_dir = create_cache_dir() run_command(Commands.CLEAN, '', "--index-cache") diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -311,11 +311,11 @@ def test_unsat_from_r1(): with pytest.raises(UnsatisfiableError) as excinfo: r.install(['numpy 1.5*', 'scipy 0.12.0b1']) assert "numpy=1.5" in str(excinfo.value) - assert "scipy==0.12.0b1 -> numpy=1.7" in str(excinfo.value) + assert "scipy==0.12.0b1 -> numpy[version='1.6.*,1.7.*']" in str(excinfo.value) # numpy 1.5 does not have a python 3 package with pytest.raises(UnsatisfiableError) as excinfo: r.install(['numpy 1.5*', 'python 3*']) - assert "numpy=1.5 -> python=2.7" in str(excinfo.value) + assert "numpy=1.5 -> python[version='2.6.*,2.7.*']" in str(excinfo.value) assert "python=3" in str(excinfo.value) with pytest.raises(UnsatisfiableError) as excinfo: r.install(['numpy 1.5*', 'numpy 1.6*']) @@ -404,9 +404,9 @@ def test_unsat_any_two_not_three(): # a, b and c cannot be installed with pytest.raises(UnsatisfiableError) as excinfo: r.install(['a', 'b', 'c']) - assert "a -> d[version='>=2,<3']" in str(excinfo.value) - assert "b -> d[version='>=3,<4']" in str(excinfo.value) - assert "c -> d[version='>=3,<4']" in str(excinfo.value) + assert "a -> d[version='>=1,<2,>=2,<3']" in str(excinfo.value) + assert "b -> d[version='>=1,<2,>=3,<4']" in str(excinfo.value) + assert "c -> d[version='>=2,<3,>=3,<4']" in str(excinfo.value) # TODO would also like to see these #assert "a -> d[version='>=1,<2']" in str(excinfo.value) #assert "b -> d[version='>=1,<2']" in str(excinfo.value) @@ -438,7 +438,7 @@ def test_unsat_missing_dep(): ) r = Resolve(OrderedDict((prec, prec) for prec in index)) # this raises ResolvePackageNotFound not UnsatisfiableError - assert raises(ResolvePackageNotFound, lambda: r.install(['a', 'b'])) + assert raises(UnsatisfiableError, lambda: r.install(['a', 'b'])) def test_unsat_channel_priority():
conda 4.7 throws various version constraint issues on install AFAICT none of the version constraints listed shows why the install could not proceed. However there are a lot of them. So it is completely possible I've overlooked something here. Note: This is happening in staged-recipes when converting recipes to feedstocks. We had to rollback to conda 4.6 for now to bypass this issue. <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> ``` $ conda install --yes --quiet 'conda-forge-ci-setup=2.*' 'conda-smithy=3.*' conda-forge-pinning git=2.12.2 conda-build UnsatisfiableError: The following specifications were found to be incompatible with each other: - certifi -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - conda-build -> beautifulsoup4 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - conda-forge-ci-setup=2 -> anaconda-client -> requests[version='>=2.9.1'] -> urllib3[version='>=1.21.1,<1.25'] -> cryptography[version='>=1.3.4'] -> openssl[version='>=1.1.1a,<1.1.2a'] - conda-forge/linux-64::conda-package-handling==1.3.9=py37_0 -> libarchive[version='>=3.3.3'] -> openssl[version='>=1.1.1a,<1.1.2a'] - conda-forge/linux-64::conda==4.7.4=py37_0 -> conda-package-handling[version='>=1.3.0'] -> libarchive[version='>=3.3.3'] -> openssl[version='>=1.1.1a,<1.1.2a'] - conda-forge/linux-64::python-libarchive-c==2.8=py37_1004 -> libarchive -> openssl[version='>=1.1.1a,<1.1.2a'] - conda-smithy=3 -> conda[version='>=4.2'] -> conda-package-handling[version='>=1.3.0'] -> libarchive[version='>=3.3.3'] -> openssl[version='>=1.1.1a,<1.1.2a'] - cryptography -> cffi[version='>=1.7'] -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - git=2.12.2 -> curl -> krb5[version='>=1.16.3,<1.17.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - libarchive -> openssl[version='>=1.1.1a,<1.1.2a'] - openssl - pkgs/main/linux-64::asn1crypto==0.24.0=py37_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::cffi==1.12.2=py37h2e261b9_1 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::chardet==3.0.4=py37_1 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::idna==2.8=py37_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::pip==19.0.3=py37_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::pycosat==0.6.3=py37h14c3975_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::pycparser==2.19=py37_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::pyopenssl==19.0.0=py37_0 -> cryptography[version='>=2.2.1'] -> cffi[version='>=1.7'] -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::pysocks==1.6.8=py37_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::python==3.7.3=h0371630_0 -> openssl[version='>=1.1.1b,<1.1.2a'] - pkgs/main/linux-64::requests==2.21.0=py37_0 -> certifi[version='>=2017.4.17'] -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::ruamel_yaml==0.15.46=py37h14c3975_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::setuptools==41.0.0=py37_0 -> certifi[version='>=2016.09'] -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::six==1.12.0=py37_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::urllib3==1.24.1=py37_0 -> certifi -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] - pkgs/main/linux-64::wheel==0.33.1=py37_0 -> python[version='>=3.7,<3.8.0a0'] -> openssl[version='>=1.1.1a,<1.1.2a'] ``` https://travis-ci.org/conda-forge/staged-recipes/builds/549908215#L823 ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` # Install Miniconda. echo "" echo "Installing a fresh version of Miniconda." curl -L https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > ~/miniconda.sh bash ~/miniconda.sh -b -p ~/miniconda ( source ~/miniconda/bin/activate root # Configure conda. echo "" echo "Configuring conda." conda config --set show_channel_urls true conda config --set auto_update_conda false conda config --set add_pip_as_python_dependency false conda config --add channels conda-forge unset conda conda update -n root --yes --quiet conda ) source ~/miniconda/bin/activate root conda install --yes --quiet conda-forge-ci-setup=2.* conda-smithy=3.* conda-forge-pinning git=2.12.2 conda-build>=3.16 ``` ref: https://github.com/conda-forge/staged-recipes/blob/4334174c35fd0052955e0ad94ecb4558516dd990/.travis_scripts/create_feedstocks#L17-L38 ## Expected Behavior <!-- What do you think should happen? --> The installation occurs without errors. ## Environment Information Unfortunately this is run on the following line. So we don't get that far. However as we starting from a fresh Miniconda install. This should be irrelevant for reproducing. Note this is Miniconda 4.6.14 with Python 3 for 64-bit Linux.
I think https://github.com/regro/cf-scripts/issues/526 is a near-duplicate of this, with simpler triggering conditions. In that case it was a single package (frozendict) that at the time didn't have a build available for python 3.7, but the conda 4.7 error message was mentioning pip which didn't make sense. I went looking for some other not-recently-updated package as a test case, and `conda config --prepend channels conda-forge && conda update -y --all && conda install -y pywps` also errors in a way that mentions pip inside a pristine docker container of `continuumio/miniconda3:latest` Don't mind moving this comment to a separate issue if it's a different underlying cause. @tkelman I think you're right. I'm trying to improve the error messaging. I can't reproduce this with the script above, unfortunately. I'm not sure if something about the available packages has changed. I have some tests on improving the messaging, but I'm not sure if it will affect this issue at all.
2019-06-27T02:25:47Z
[]
[]
conda/conda
8,846
conda__conda-8846
[ "8843" ]
0614e8108bf2ac392dcff2143d9b2e028a8623e9
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -501,7 +501,7 @@ def _add_specs(self, ssc): if s.name in explicit_pool: if s.name not in self.specs_to_add_names and not ssc.ignore_pinned: ssc.specs_map[s.name] = MatchSpec(s, optional=False) - elif explicit_pool[s.name] & ssc.r._get_package_pool([s])[s.name]: + elif explicit_pool[s.name] & ssc.r._get_package_pool([s]).get(s.name, set()): ssc.specs_map[s.name] = MatchSpec(s, optional=False) pin_overrides.add(s.name) else:
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -1051,6 +1051,13 @@ def test_update_with_pinned_packages(self): assert package_is_installed(prefix, "python=2.7") assert not package_is_installed(prefix, "python=2.7.12") + def test_pinned_override_with_explicit_spec(self): + with make_temp_env("python=3.6") as prefix: + run_command(Commands.CONFIG, prefix, + "--add", "pinned_packages", "python=3.6.5") + run_command(Commands.INSTALL, prefix, "python=3.7", no_capture=True) + assert package_is_installed(prefix, "python=3.7") + def test_remove_all(self): with make_temp_env("python") as prefix: assert exists(join(prefix, PYTHON_BINARY))
KeyError: 'python' when installing Python package. ## Current Behavior ### Steps to Reproduce Our script does the following; ``` wget --no-verbose --continue https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh chmod a+x Miniconda3-latest-Linux-x86_64.sh # -p to specify the install location # -b to enable batch mode (no prompts) # -f to not return an error if the location specified by -p already exists ( export HOME=$CONDA_DIR ./Miniconda3-latest-Linux-x86_64.sh -p $CONDA_DIR -b -f || exit 1 ) conda config --system --set always_yes yes conda config --system --set changeps1 no conda config --system --add envs_dirs $CONDA_DIR/envs conda config --system --add pkgs_dirs $CONDA_DIR/pkgs conda update -q conda conda config --system --add channels timvideos conda info echo "python ==${PYTHON_VERSION}" > $CONDA_DIR/conda-meta/pinned # Make sure it stays at given version conda install -y python=3.7 ``` ## Expected Behavior conda installs Python 3.7 ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : None user config file : /home/travis/.condarc populated config files : /home/travis/build/mithro/litex-buildenv/build/conda/.condarc conda version : 4.7.5 conda-build version : not installed python version : 3.7.3.final.0 virtual packages : base environment : /home/travis/build/mithro/litex-buildenv/build/conda (writable) channel URLs : https://conda.anaconda.org/timvideos/linux-64 https://conda.anaconda.org/timvideos/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/travis/build/mithro/litex-buildenv/build/conda/pkgs envs directories : /home/travis/build/mithro/litex-buildenv/build/conda/envs /home/travis/build/mithro/litex-buildenv/build/conda/.conda/envs platform : linux-64 user-agent : conda/4.7.5 requests/2.21.0 CPython/3.7.3 Linux/4.4.0-101-generic ubuntu/14.04.5 glibc/2.19 UID:GID : 2000:2000 netrc file : None offline mode : False Platform: arty Target: net (default: net) CPU: lm32 (default: lm32) Installing python3.7 Collecting package metadata (current_repodata.json): done Solving environment: failed # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/exceptions.py", line 1043, in __call__ return func(*args, **kwargs) File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main exit_code = do_call(args, p) File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call exit_code = getattr(module, func_name)(args, parser) File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/cli/main_install.py", line 20, in execute install(args, parser, 'install') File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/cli/install.py", line 280, in install force_reinstall=context.force_reinstall or context.force, File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/core/solve.py", line 112, in solve_for_transaction force_remove, force_reinstall) File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/core/solve.py", line 150, in solve_for_diff force_remove) File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/core/solve.py", line 245, in solve_final_state ssc = self._add_specs(ssc) File "/home/travis/build/mithro/litex-buildenv/build/conda/lib/python3.7/site-packages/conda/core/solve.py", line 515, in _add_specs elif explicit_pool[s.name] & self._get_package_pool(ssc, [s])[s.name]: KeyError: 'python' `$ /home/travis/build/mithro/litex-buildenv/build/conda/bin/conda install -y python=3.7` environment variables: CIO_TEST=<not set> CONDA_ROOT=/home/travis/build/mithro/litex-buildenv/build/conda GEM_PATH=/home/travis/.rvm/gems/ruby-2.4.1:/home/travis/.rvm/gems/ruby-2.4.1@gl obal GOPATH=/home/travis/gopath MANPATH=/home/travis/.nvm/versions/node/v8.9.1/share/man:/home/travis/.kiex/el ixirs/elixir-1.4.5/man:/home/travis/.rvm/rubies/ruby-2.4.1/share/man:/ usr/local/man:/usr/local/cmake-3.9.2/man:/usr/local/clang-5.0.0/share/ man:/usr/local/share/man:/usr/share/man:/home/travis/.rvm/man PATH=/home/travis/build/mithro/litex-buildenv/build/conda/bin:/home/travis/ bin:/home/travis/.local/bin:/opt/pyenv/shims:/home/travis/.phpenv/shim s:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.9 .1/bin:/home/travis/.kiex/elixirs/elixir-1.4.5/bin:/home/travis/.kiex/ bin:/home/travis/.rvm/gems/ruby-2.4.1/bin:/home/travis/.rvm/gems/ruby- 2.4.1@global/bin:/home/travis/.rvm/rubies/ruby-2.4.1/bin:/home/travis/ gopath/bin:/home/travis/.gimme/versions/go1.7.4.linux.amd64/bin:/usr/l ocal/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/us r/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5. 0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/tra vis/.yarn/bin:/sbin PYTHONHASHSEED=0 PYTHON_CFLAGS=-g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs4 --with-wide-unicode --enable-shared --enable- ipv6 --enable-loadable-sqlite-extensions --with-computed-gotos REQUESTS_CA_BUNDLE=<not set> SSL_CERT_FILE=<not set> TRAVIS_APT_PROXY=<set> rvm_bin_path=/home/travis/.rvm/bin rvm_path=/home/travis/.rvm active environment : None user config file : /home/travis/.condarc populated config files : /home/travis/build/mithro/litex-buildenv/build/conda/.condarc conda version : 4.7.5 conda-build version : not installed python version : 3.7.3.final.0 virtual packages : base environment : /home/travis/build/mithro/litex-buildenv/build/conda (writable) channel URLs : https://conda.anaconda.org/timvideos/linux-64 https://conda.anaconda.org/timvideos/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/travis/build/mithro/litex-buildenv/build/conda/pkgs envs directories : /home/travis/build/mithro/litex-buildenv/build/conda/envs /home/travis/build/mithro/litex-buildenv/build/conda/.conda/envs platform : linux-64 user-agent : conda/4.7.5 requests/2.21.0 CPython/3.7.3 Linux/4.4.0-101-generic ubuntu/14.04.5 glibc/2.19 UID:GID : 2000:2000 netrc file : None offline mode : False An unexpected error has occurred. Conda has prepared the above report. ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` ``` </p></details>
Example log output can be found at https://travis-ci.com/mithro/litex-buildenv/jobs/211878372
2019-06-29T00:41:57Z
[]
[]
conda/conda
8,892
conda__conda-8892
[ "8824" ]
a0762bdd302e3a3bfb9a03ac23cf5d5035b1f9cf
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -556,12 +556,13 @@ def _add_specs(self, ssc): # As a business rule, we never want to update python beyond the current minor version, # unless that's requested explicitly by the user (which we actively discourage). - if (any(_.name == 'python' for _ in ssc.solution_precs) - and not any(s.name == 'python' for s in self.specs_to_add)): + py_in_prefix = any(_.name == 'python' for _ in ssc.solution_precs) + py_requested_explicitly = any(s.name == 'python' for s in self.specs_to_add) + if py_in_prefix and not py_requested_explicitly: python_prefix_rec = ssc.prefix_data.get('python') - if ('python' not in conflict_specs and - ssc.update_modifier == UpdateModifier.FREEZE_INSTALLED): + freeze_installed = ssc.update_modifier == UpdateModifier.FREEZE_INSTALLED + if 'python' not in conflict_specs and freeze_installed: ssc.specs_map['python'] = python_prefix_rec.to_match_spec() else: # will our prefix record conflict with any explict spec? If so, don't add @@ -593,13 +594,14 @@ def _add_specs(self, ssc): if 'conda' in ssc.specs_map and paths_equal(self.prefix, context.conda_prefix): conda_prefix_rec = ssc.prefix_data.get('conda') if conda_prefix_rec: + version_req = ">=%s" % conda_prefix_rec.version + conda_requested_explicitly = any(s.name == 'conda' for s in self.specs_to_add) conda_spec = ssc.specs_map['conda'] - conda_in_specs_to_add_version = ssc.specs_map.get('conda', {}).get('version') if not conda_in_specs_to_add_version: - conda_spec = MatchSpec(conda_spec, version=">=%s" % conda_prefix_rec.version) - if context.auto_update_conda: - conda_spec = MatchSpec('conda', target=None) + conda_spec = MatchSpec(conda_spec, version=version_req) + if context.auto_update_conda and not conda_requested_explicitly: + conda_spec = MatchSpec('conda', version=version_req, target=None) ssc.specs_map['conda'] = conda_spec return ssc
diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -903,6 +903,92 @@ def test_auto_update_conda(): sys.prefix = saved_sys_prefix +def test_explicit_conda_downgrade(): + specs = MatchSpec("conda=1.5"), + with get_solver(specs) as solver: + final_state_1 = solver.solve_final_state() + # PrefixDag(final_state_1, specs).open_url() + print(convert_to_dist_str(final_state_1)) + order = ( + 'channel-1::openssl-1.0.1c-0', + 'channel-1::readline-6.2-0', + 'channel-1::sqlite-3.7.13-0', + 'channel-1::system-5.8-1', + 'channel-1::tk-8.5.13-0', + 'channel-1::yaml-0.1.4-0', + 'channel-1::zlib-1.2.7-0', + 'channel-1::python-2.7.5-0', + 'channel-1::pyyaml-3.10-py27_0', + 'channel-1::conda-1.5.2-py27_0', + ) + assert convert_to_dist_str(final_state_1) == order + + with env_vars({"CONDA_AUTO_UPDATE_CONDA": "yes"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): + specs_to_add = MatchSpec("conda=1.3"), + with get_solver(specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver: + final_state_2 = solver.solve_final_state() + # PrefixDag(final_state_2, specs).open_url() + print(convert_to_dist_str(final_state_2)) + order = ( + 'channel-1::openssl-1.0.1c-0', + 'channel-1::readline-6.2-0', + 'channel-1::sqlite-3.7.13-0', + 'channel-1::system-5.8-1', + 'channel-1::tk-8.5.13-0', + 'channel-1::yaml-0.1.4-0', + 'channel-1::zlib-1.2.7-0', + 'channel-1::python-2.7.5-0', + 'channel-1::pyyaml-3.10-py27_0', + 'channel-1::conda-1.3.5-py27_0', + ) + assert convert_to_dist_str(final_state_2) == order + + saved_sys_prefix = sys.prefix + try: + sys.prefix = TEST_PREFIX + with env_vars({"CONDA_AUTO_UPDATE_CONDA": "yes"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): + specs_to_add = MatchSpec("conda=1.3"), + with get_solver(specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver: + final_state_2 = solver.solve_final_state() + # PrefixDag(final_state_2, specs).open_url() + print(convert_to_dist_str(final_state_2)) + order = ( + 'channel-1::openssl-1.0.1c-0', + 'channel-1::readline-6.2-0', + 'channel-1::sqlite-3.7.13-0', + 'channel-1::system-5.8-1', + 'channel-1::tk-8.5.13-0', + 'channel-1::yaml-0.1.4-0', + 'channel-1::zlib-1.2.7-0', + 'channel-1::python-2.7.5-0', + 'channel-1::pyyaml-3.10-py27_0', + 'channel-1::conda-1.3.5-py27_0', + ) + assert convert_to_dist_str(final_state_2) == order + + with env_vars({"CONDA_AUTO_UPDATE_CONDA": "no"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): + specs_to_add = MatchSpec("conda=1.3"), + with get_solver(specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver: + final_state_2 = solver.solve_final_state() + # PrefixDag(final_state_2, specs).open_url() + print(convert_to_dist_str(final_state_2)) + order = ( + 'channel-1::openssl-1.0.1c-0', + 'channel-1::readline-6.2-0', + 'channel-1::sqlite-3.7.13-0', + 'channel-1::system-5.8-1', + 'channel-1::tk-8.5.13-0', + 'channel-1::yaml-0.1.4-0', + 'channel-1::zlib-1.2.7-0', + 'channel-1::python-2.7.5-0', + 'channel-1::pyyaml-3.10-py27_0', + 'channel-1::conda-1.3.5-py27_0', + ) + assert convert_to_dist_str(final_state_2) == order + finally: + sys.prefix = saved_sys_prefix + + def test_aggressive_update_packages(): def solve(prev_state, specs_to_add, order): final_state_1, specs = prev_state
Cannot downgrade conda from 4.7 ## Current Behavior After updating conda to 4.7.5, conda can no longer be downgraded to a previous version using a version spec such as `conda install conda=4.6`. This behavior can be changed if the `auto_update_conda` configuration parameter is set to false. ### Steps to Reproduce ``` [root@chi9 build_scripts]# conda --version conda 4.6.14 [root@chi9 build_scripts]# conda update -y -q conda conda-build Collecting package metadata: ...working... done Solving environment: ...working... done ## Package Plan ## environment location: /opt/conda added / updated specs: - conda - conda-build The following packages will be downloaded: package | build ---------------------------|----------------- certifi-2019.6.16 | py37_0 154 KB defaults conda-4.7.5 | py37_0 3.0 MB defaults conda-build-3.18.5 | py37_0 517 KB defaults conda-package-handling-1.3.10| py37_0 259 KB defaults ------------------------------------------------------------ Total: 3.9 MB The following NEW packages will be INSTALLED: conda-package-han~ pkgs/main/linux-64::conda-package-handling-1.3.10-py37_0 The following packages will be UPDATED: certifi 2019.3.9-py37_0 --> 2019.6.16-py37_0 conda 4.6.14-py37_0 --> 4.7.5-py37_0 conda-build 3.17.8-py37_0 --> 3.18.5-py37_0 Preparing transaction: ...working... done Verifying transaction: ...working... done Executing transaction: ...working... done [root@chi9 build_scripts]# conda --version conda 4.7.5 [root@chi9 build_scripts]# conda install conda=4.6 Collecting package metadata (current_repodata.json): done Solving environment: failed Collecting package metadata (repodata.json): done Solving environment: done # All requested packages already installed. ``` Changing `auto_update_conda`: ``` root@chi9 build_scripts]# CONDA_AUTO_UPDATE_CONDA=0 conda install conda=4.6 Collecting package metadata (current_repodata.json): done Solving environment: failed Collecting package metadata (repodata.json): done Solving environment: done ## Package Plan ## environment location: /opt/conda added / updated specs: - conda=4.6 The following packages will be DOWNGRADED: conda 4.7.5-py37_0 --> 4.6.14-py37_0 Proceed ([y]/n)? ``` ## Expected Behavior Conda should allow the installation of a specific version when it is provided explicitly on the command line. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` [root@chi9 build_scripts]# conda inf CommandNotFoundError: No command 'conda inf'. Did you mean 'conda info'? [root@chi9 build_scripts]# conda info active environment : None user config file : /root/.condarc populated config files : /root/.condarc conda version : 4.7.5 conda-build version : 3.18.5 python version : 3.7.3.final.0 virtual packages : base environment : /opt/conda (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /opt/conda/pkgs /root/.conda/pkgs envs directories : /opt/conda/envs /root/.conda/envs platform : linux-64 user-agent : conda/4.7.5 requests/2.22.0 CPython/3.7.3 Linux/4.15.0-51-generic centos/6.9 glibc/2.12 UID:GID : 0:0 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` [root@chi9 build_scripts]# conda config --show-sources ==> /root/.condarc <== add_pip_as_python_dependency: False show_channel_urls: True ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` [root@chi9 build_scripts]# conda list --show-channel-urls # packages in environment at /opt/conda: # # Name Version Build Channel anaconda-client 1.7.2 py37_0 defaults asn1crypto 0.24.0 py37_0 defaults attrs 19.1.0 py37_1 defaults beautifulsoup4 4.7.1 py37_1 defaults binutils_impl_linux-64 2.31.1 h6176602_1 defaults binutils_linux-64 2.31.1 h6176602_7 defaults bzip2 1.0.6 h14c3975_5 defaults ca-certificates 2019.5.15 0 defaults certifi 2019.6.16 py37_0 defaults cffi 1.12.3 py37h2e261b9_0 defaults chardet 3.0.4 py37_1 defaults clyent 1.2.2 py37_1 defaults conda 4.7.5 py37_0 defaults conda-build 3.18.5 py37_0 defaults conda-concourse-ci 0.1.0 pypi_0 pypi conda-package-handling 1.3.10 py37_0 defaults cryptography 2.7 py37h1ba5d50_0 defaults curl 7.64.1 hbc83047_0 defaults decorator 4.4.0 py37_1 defaults expat 2.2.6 he6710b0_0 defaults filelock 3.0.10 py37_0 defaults gcc_impl_linux-64 7.3.0 habb00fd_1 defaults gcc_linux-64 7.3.0 h553295d_7 defaults git 2.20.1 pl526hacde149_0 defaults glob2 0.6 py37_1 defaults gxx_impl_linux-64 7.3.0 hdf63c60_1 defaults gxx_linux-64 7.3.0 h553295d_7 defaults icu 58.2 h9c2bf20_1 defaults idna 2.8 py37_0 defaults ipython_genutils 0.2.0 py37_0 defaults jinja2 2.10.1 py37_0 defaults jsonschema 3.0.1 py37_0 defaults jupyter_core 4.4.0 py37_0 defaults krb5 1.16.1 h173b8e3_7 defaults libarchive 3.3.3 h5d8350f_5 defaults libcurl 7.64.1 h20c2e04_0 defaults libedit 3.1.20181209 hc058e9b_0 defaults libffi 3.2.1 hd88cf55_4 defaults libgcc-ng 8.2.0 hdf63c60_1 defaults liblief 0.9.0 h7725739_2 defaults libssh2 1.8.2 h1ba5d50_0 defaults libstdcxx-ng 8.2.0 hdf63c60_1 defaults libxml2 2.9.9 he19cac6_0 defaults lz4-c 1.8.1.2 h14c3975_0 defaults lzo 2.10 h49e0be7_2 defaults markupsafe 1.1.1 py37h7b6447c_0 defaults nbformat 4.4.0 py37_0 defaults ncurses 6.1 he6710b0_1 defaults openssl 1.1.1c h7b6447c_1 defaults patchelf 0.9 he6710b0_3 defaults perl 5.26.2 h14c3975_0 defaults pip 19.1.1 py37_0 defaults pkginfo 1.5.0.1 py37_0 defaults psutil 5.6.2 py37h7b6447c_0 defaults py-lief 0.9.0 py37h7725739_2 defaults pycosat 0.6.3 py37h14c3975_0 defaults pycparser 2.19 py37_0 defaults pyopenssl 19.0.0 py37_0 defaults pyrsistent 0.14.11 py37h7b6447c_0 defaults pysocks 1.7.0 py37_0 defaults python 3.7.3 h0371630_0 defaults python-dateutil 2.8.0 py37_0 defaults python-libarchive-c 2.8 py37_6 defaults pytz 2019.1 py_0 defaults pyyaml 5.1 py37h7b6447c_0 defaults readline 7.0 h7b6447c_5 defaults requests 2.22.0 py37_0 defaults ruamel_yaml 0.15.46 py37h14c3975_0 defaults setuptools 41.0.1 py37_0 defaults six 1.12.0 py37_0 defaults soupsieve 1.8 py37_0 defaults sqlite 3.28.0 h7b6447c_0 defaults tk 8.6.8 hbc83047_0 defaults tqdm 4.31.1 py37_1 defaults traitlets 4.3.2 py37_0 defaults urllib3 1.24.2 py37_0 defaults wheel 0.33.4 py37_0 defaults xz 5.2.4 h14c3975_4 defaults yaml 0.1.7 had09818_2 defaults zlib 1.2.11 h7b6447c_3 defaults zstd 1.3.7 h0b5b093_0 defaults ``` </p></details>
@ocefpaf I believe you mentioned this bug on the conda-forge gitter channel. A workaround if you need to downgrade conda from 4.7 is to use `CONDA_AUTO_UPDATE_CONDA=0` or set the corresponding configuration value in .condarc. Thanks! That worked nicely. I just hit this problem as well (a "problem" because conda 4.7.5 seems several other bugs that required me to roll back). Another workaround (if you didn't start with 4.7.5) is to use `conda list --revisions` and `conda install --revision <rev>` to roll back to the environment just before you upgraded to 4.7.5.
2019-07-09T18:46:53Z
[]
[]
conda/conda
8,912
conda__conda-8912
[ "8858" ]
25745cc9b7e3133074d4df1d149bf04001d766f5
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py --- a/conda/cli/conda_argparse.py +++ b/conda/cli/conda_argparse.py @@ -1542,6 +1542,14 @@ def add_parser_update_modifiers(solver_mode_options): help="Update all installed packages in the environment.", default=NULL, ) + update_modifiers.add_argument( + "--update-specs", + action="store_const", + const=UpdateModifier.UPDATE_SPECS, + dest="update_modifier", + help="Update based on provided specifications.", + default=NULL, + ) def add_parser_prune(p): diff --git a/conda/cli/install.py b/conda/cli/install.py --- a/conda/cli/install.py +++ b/conda/cli/install.py @@ -295,12 +295,27 @@ def install(args, parser, command='install'): raise PackagesNotFoundError(e._formatted_chains, channels_urls) except (UnsatisfiableError, SystemExit, SpecsConfigurationConflictError) as e: - # end of the line. Raise the exception - if repodata_fn == repodata_fns[-1]: - # Unsatisfiable package specifications/no such revision/import error - if e.args and 'could not import' in e.args[0]: - raise CondaImportError(text_type(e)) - raise + # Quick solve with frozen env failed. Try again without that. + if isinstall and args.update_modifier == NULL: + try: + log.info("Initial quick solve with frozen env failed. " + "Unfreezing env and trying again.") + unlink_link_transaction = solver.solve_for_transaction( + deps_modifier=deps_modifier, + update_modifier=UpdateModifier.UPDATE_SPECS, + force_reinstall=context.force_reinstall or context.force, + ) + except (UnsatisfiableError, SystemExit, SpecsConfigurationConflictError) as e: + # Unsatisfiable package specifications/no such revision/import error + if e.args and 'could not import' in e.args[0]: + raise CondaImportError(text_type(e)) + else: + # end of the line. Raise the exception + if repodata_fn == repodata_fns[-1]: + # Unsatisfiable package specifications/no such revision/import error + if e.args and 'could not import' in e.args[0]: + raise CondaImportError(text_type(e)) + raise handle_txn(unlink_link_transaction, prefix, args, newenv) diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -25,8 +25,7 @@ from ..common.constants import NULL from ..common.io import Spinner, dashlist, time_recorder from ..common.path import get_major_minor_version, paths_equal -from ..exceptions import (PackagesNotFoundError, SpecsConfigurationConflictError, - ResolvePackageNotFound) +from ..exceptions import PackagesNotFoundError, SpecsConfigurationConflictError from ..history import History from ..models.channel import Channel from ..models.enums import NoarchType @@ -400,41 +399,13 @@ def _should_freeze(self, ssc, target_prec, conflict_specs, explicit_pool, instal # never, ever freeze anything if we have no history. if not ssc.specs_from_history_map: return False - - pkg_name = target_prec.name - # if we are FREEZE_INSTALLED (first pass for install) - freeze = ssc.update_modifier == UpdateModifier.FREEZE_INSTALLED - - if not freeze: - # we are UPDATE_SPECS (solve_for_diff or update specs), - # AND the spec is not an explicit spec - update_added = (ssc.update_modifier == UpdateModifier.UPDATE_SPECS and - pkg_name not in self.specs_to_add_names) - # more expensive, but better check. If anything in the package pool for this spec - # overlaps with the explicit package pool (by name), but they don't share any - # actual records, then this target_prec conflicts and should not be pinned - if update_added: - spec_package_pool = ssc.r._get_package_pool((target_prec.to_match_spec(), )) - for spec in self.specs_to_add_names: - new_explicit_pool = explicit_pool - ms = MatchSpec(spec) - updated_spec = self._package_has_updates(ssc, ms, installed_pool) - if updated_spec: - try: - new_explicit_pool = ssc.r._get_package_pool((updated_spec, )) - except ResolvePackageNotFound: - update_added = False - break - - if ms.name in spec_package_pool: - update_added &= bool(spec_package_pool[ms.name] & - new_explicit_pool[ms.name]) - if not update_added: - break + # never freeze if not in FREEZE_INSTALLED mode + if ssc.update_modifier != UpdateModifier.FREEZE_INSTALLED: + return False # if all package specs have overlapping package choices (satisfiable in at least one way) - no_conflict = ((freeze or update_added) and - pkg_name not in conflict_specs and + pkg_name = target_prec.name + no_conflict = (pkg_name not in conflict_specs and (pkg_name not in explicit_pool or target_prec in explicit_pool[pkg_name]) and self._compare_pools(ssc, explicit_pool, target_prec.to_match_spec()))
diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -23,7 +23,7 @@ from conda.models.records import PrefixRecord from conda.resolve import MatchSpec from ..helpers import get_index_r_1, get_index_r_2, get_index_r_4, \ - get_index_r_5, get_index_cuda + get_index_r_5, get_index_cuda, get_index_must_unfreeze from conda.common.compat import iteritems @@ -116,6 +116,19 @@ def get_solver_aggregate_2(specs_to_add=(), specs_to_remove=(), prefix_records=( yield solver +@contextmanager +def get_solver_must_unfreeze(specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=()): + PrefixData._cache_.clear() + pd = PrefixData(TEST_PREFIX) + pd._PrefixData__prefix_records = {rec.name: PrefixRecord.from_objects(rec) for rec in prefix_records} + spec_map = {spec.name: spec for spec in history_specs} + get_index_must_unfreeze(context.subdir) + with patch.object(History, 'get_requested_specs_map', return_value=spec_map): + solver = Solver(TEST_PREFIX, (Channel('channel-freeze'),), (context.subdir,), + specs_to_add=specs_to_add, specs_to_remove=specs_to_remove) + yield solver + + @contextmanager def get_solver_cuda(specs_to_add=(), specs_to_remove=(), prefix_records=(), history_specs=()): PrefixData._cache_.clear() @@ -266,15 +279,24 @@ def test_prune_1(): pprint(convert_to_dist_str(link_precs)) unlink_order = ( 'channel-1::accelerate-1.1.0-np16py27_p0', + 'channel-1::mkl-11.0-np16py27_p0', + 'channel-1::scikit-learn-0.13.1-np16py27_p0', 'channel-1::numbapro-0.11.0-np16py27_p0', + 'channel-1::scipy-0.12.0-np16py27_p0', + 'channel-1::numexpr-2.1-np16py27_p0', 'channel-1::numba-0.8.1-np16py27_0', + 'channel-1::numpy-1.6.2-py27_p4', + 'channel-1::mkl-service-1.0.0-py27_p0', 'channel-1::meta-0.4.2.dev-py27_0', 'channel-1::llvmpy-0.11.2-py27_0', 'channel-1::bitarray-0.8.1-py27_0', 'channel-1::llvm-3.2-0', + 'channel-1::mkl-rt-11.0-p0', 'channel-1::libnvvm-1.0-p0', ) - link_order = tuple() + link_order = ( + 'channel-1::numpy-1.6.2-py27_4', + ) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -814,6 +836,62 @@ def test_conda_downgrade(): sys.prefix = saved_sys_prefix +def test_unfreeze_when_required(): + # The available packages are: + # libfoo 1.0, 2.0 + # libbar 1.0, 2.0 + # foobar 1.0 : depends on libfoo 1.0, libbar 2.0 + # foobar 2.0 : depends on libfoo 2.0, libbar 2.0 + # qux 1.0: depends on libfoo 1.0, libbar 2.0 + # qux 2.0: depends on libfoo 2.0, libbar 1.0 + # + # qux 1.0 and foobar 1.0 can be installed at the same time but + # if foobar is installed first it must be downgraded from 2.0. + # If foobar is frozen then no solution exists. + + specs = [MatchSpec("foobar"), MatchSpec('qux')] + with get_solver_must_unfreeze(specs) as solver: + final_state_1 = solver.solve_final_state() + print(convert_to_dist_str(final_state_1)) + order = ( + 'channel-freeze::libbar-2.0-0', + 'channel-freeze::libfoo-1.0-0', + 'channel-freeze::foobar-1.0-0', + 'channel-freeze::qux-1.0-0', + ) + assert convert_to_dist_str(final_state_1) == order + + specs = MatchSpec("foobar"), + with get_solver_must_unfreeze(specs) as solver: + final_state_1 = solver.solve_final_state() + print(convert_to_dist_str(final_state_1)) + order = ( + 'channel-freeze::libbar-2.0-0', + 'channel-freeze::libfoo-2.0-0', + 'channel-freeze::foobar-2.0-0', + ) + assert convert_to_dist_str(final_state_1) == order + + # When frozen there is no solution + specs_to_add = MatchSpec("qux"), + with get_solver_must_unfreeze(specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver: + with pytest.raises(UnsatisfiableError): + solver.solve_final_state(update_modifier=UpdateModifier.FREEZE_INSTALLED) + + specs_to_add = MatchSpec("qux"), + with get_solver_must_unfreeze(specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver: + final_state_2 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_SPECS) + # PrefixDag(final_state_2, specs).open_url() + print(convert_to_dist_str(final_state_2)) + order = ( + 'channel-freeze::libbar-2.0-0', + 'channel-freeze::libfoo-1.0-0', + 'channel-freeze::foobar-1.0-0', + 'channel-freeze::qux-1.0-0', + ) + assert convert_to_dist_str(final_state_2) == order + + def test_auto_update_conda(): specs = MatchSpec("conda=1.3"), with get_solver(specs) as solver: @@ -1346,12 +1424,18 @@ def test_fast_update_with_update_modifier_not_set(): pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) unlink_order = ( + 'channel-4::python-2.7.14-h89e7a4a_22', 'channel-4::sqlite-3.21.0-h1bed415_2', + 'channel-4::libedit-3.1-heed3624_0', 'channel-4::openssl-1.0.2l-h077ae2c_5', + 'channel-4::ncurses-6.0-h9df7e31_2', ) link_order = ( + 'channel-4::ncurses-6.1-hf484d3e_0', 'channel-4::openssl-1.0.2p-h14c3975_0', - 'channel-4::sqlite-3.23.1-he433501_0', + 'channel-4::libedit-3.1.20170329-h6b74fdf_2', + 'channel-4::sqlite-3.24.0-h84994c4_0', # sqlite is upgraded + 'channel-4::python-2.7.15-h1571d57_0', # python is not upgraded ) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order diff --git a/tests/helpers.py b/tests/helpers.py --- a/tests/helpers.py +++ b/tests/helpers.py @@ -259,6 +259,116 @@ def get_index_r_5(subdir=context.subdir): return index, r +@memoize +def get_index_must_unfreeze(subdir=context.subdir): + repodata = { + "info": { + "subdir": subdir, + "arch": context.arch_name, + "platform": context.platform, + }, + "packages": { + "foobar-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [ + "libbar 2.0.*", + "libfoo 1.0.*" + ], + "md5": "11ec1194bcc56b9a53c127142a272772", + "name": "foobar", + "timestamp": 1562861325613, + "version": "1.0" + }, + "foobar-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [ + "libbar 2.0.*", + "libfoo 2.0.*" + ], + "md5": "f8eb5a7fa1ff6dead4e360631a6cd048", + "name": "foobar", + "version": "2.0" + }, + + "libbar-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "f51f4d48a541b7105b5e343704114f0f", + "name": "libbar", + "timestamp": 1562858881022, + "version": "1.0" + }, + "libbar-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "27f4e717ed263f909074f64d9cbf935d", + "name": "libbar", + "timestamp": 1562858881748, + "version": "2.0" + }, + + "libfoo-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "ad7c088566ffe2389958daedf8ff312c", + "name": "libfoo", + "timestamp": 1562858763881, + "version": "1.0" + }, + "libfoo-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [], + "md5": "daf7af7086d8f22be49ae11bdc41f332", + "name": "libfoo", + "timestamp": 1562858836924, + "version": "2.0" + }, + + "qux-1.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [ + "libbar 2.0.*", + "libfoo 1.0.*" + ], + "md5": "18604cbe4f789fe853232eef4babd4f9", + "name": "qux", + "timestamp": 1562861393808, + "version": "1.0" + }, + "qux-2.0-0.tar.bz2": { + "build": "0", + "build_number": 0, + "depends": [ + "libbar 1.0.*", + "libfoo 2.0.*" + ], + "md5": "892aa4b9ec64b67045a46866ef1ea488", + "name": "qux", + "timestamp": 1562861394828, + "version": "2.0" + } + } + } + channel = Channel('https://conda.anaconda.org/channel-freeze/%s' % subdir) + sd = SubdirData(channel) + with env_var("CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY", "false", stack_callback=conda_tests_ctxt_mgmt_def_pol): + sd._process_raw_repodata_str(json.dumps(repodata)) + sd._loaded = True + SubdirData._cache_[channel.url(with_credentials=True)] = sd + + index = {prec: prec for prec in sd._package_records} + r = Resolve(index, channels=(channel,)) + + return index, r + + # Do not memoize this get_index to allow different CUDA versions to be detected def get_index_cuda(subdir=context.subdir): with open(join(dirname(__file__), 'data', 'index.json')) as fi: @@ -283,4 +393,4 @@ def get_index_cuda(subdir=context.subdir): add_feature_records_legacy(index) r = Resolve(index, channels=(channel,)) - return index, r \ No newline at end of file + return index, r
conda 4.7 does not find a solution when installing two packages separately. When creating an environment with `libpysal` and then installing `geopandas`, ```shell conda create --name TEST libpysal --yes conda activate TEST conda install geopandas --yes ``` `conda 4.7` returns `UnsatisfiableError` b/c it refuses to downgrade a `python` build number to get a version with `readline 7`. This is probably an edge case that will go away once the `readline 8` migration on `conda-forge` is complete. But CIs will be broken every migration that touches a `python` dependency. Note that creating the environment in a single go like: `conda create --name TEST libpysal geopandas --yes`, or downgrading to `conda 4.6` works as expected.
While I understand that `conda 4.7` make it harder to downgrade the `python` version I guess that, b/c we are using build number to provide variants, a smaller build number is not a downgrade. I do not believe the issue here is with the Python dowgrade since the following works: ``` conda create -c conda-forge --name TEST libpysal --yes source activate TEST conda install -c conda-forge readline=7 ``` Odd, the following works as well: ``` conda create -c conda-forge --name TEST libpysal --yes source activate TEST conda install -c conda-forge readline=7 --yes conda install -c conda-forge geopandas --yes ``` Can you confirm that ``` conda create -c conda-forge --name TEST libpysal --yes source activate TEST conda install -c conda-forge geopandas --yes ``` works? I forgot to mention but I'm using `strict`. ``` conda create -c conda-forge --name TEST libpysal --yes source activate TEST conda install -c conda-forge geopandas --yes ``` Does not work, I need to add `conda install -c conda-forge readline=7 --yes` before the install of `geopandas`. This command should not be required, conda should find the solution without it. I'll look into this. The freezing is probably being a little aggressive. A better way to say it is actually "the conflict finding is not working well enough" because conda tries to not freeze anything that has a conflict. conda on master doesn't show this problem anymore. I don't understand why - I'm not sure that we've changed anything. Perhaps the CF readline migration has just gotten far enough that it isn't an issue anymore? > Perhaps the CF readline migration has just gotten far enough that it isn't an issue anymore? Yep. I was unable to reproduce it a few days ago with the current release of conda. The bug is still there, we just don't have an easy way to reproduce it :smile: I think this issue has to do with the change to using `FREEZE_INSTALLED` as the default for the solver's update handling in 4.7. After the environment with `libpysal` is created those packages are frozen unless a conflict is found. If certain packages are frozen the solver is unable to find a solution. Here is an example using some simple packages: ``` (base) ~$ conda --version conda 4.7.5 (base) ~$ conda create -n test -c jjhelmus foobar qux -y --dry-run Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/jhelmus/conda/envs/test added / updated specs: - foobar - qux The following NEW packages will be INSTALLED: foobar jjhelmus/linux-64::foobar-1.0-0 libbar jjhelmus/linux-64::libbar-1.0-0 libfoo jjhelmus/linux-64::libfoo-2.0-0 qux jjhelmus/linux-64::qux-2.0-0 DryRunExit: Dry run. Exiting. (base) ~$ conda create -n test -c jjhelmus foobar -y Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/jhelmus/conda/envs/test added / updated specs: - foobar The following NEW packages will be INSTALLED: foobar jjhelmus/linux-64::foobar-2.0-0 libbar jjhelmus/linux-64::libbar-2.0-0 libfoo jjhelmus/linux-64::libfoo-2.0-0 Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate test # # To deactivate an active environment, use # # $ conda deactivate (base) ~$ conda install qux -c jjhelmus -n test Collecting package metadata (current_repodata.json): done Solving environment: failed Collecting package metadata (repodata.json): done Solving environment: failed UnsatisfiableError: The following specifications were found to be incompatible with each other: - jjhelmus/linux-64::foobar==2.0=0 - jjhelmus/linux-64::libbar==2.0=0 - jjhelmus/linux-64::libfoo==2.0=0 - qux ``` This issue here is that the `foobar` package already installed in the environment is frozen when installing `qux` and therefore cannot be downgraded to version 1.0 which is needed for a solution. Adding a fallback to the solver when satisfiability is not possible with FREEZE_INSTALL will address this problem.
2019-07-11T19:24:10Z
[]
[]
conda/conda
9,261
conda__conda-9261
[ "9116" ]
a0ae1898a00423d504bf204f8cde664ecdfd30d0
diff --git a/conda/models/match_spec.py b/conda/models/match_spec.py --- a/conda/models/match_spec.py +++ b/conda/models/match_spec.py @@ -181,8 +181,16 @@ def from_dist_str(cls, dist_str): if dist_str.endswith(CONDA_PACKAGE_EXTENSION_V1): dist_str = dist_str[:-len(CONDA_PACKAGE_EXTENSION_V1)] if '::' in dist_str: - channel_str, dist_str = dist_str.split("::", 1) - parts['channel'] = channel_str + channel_subdir_str, dist_str = dist_str.split("::", 1) + if '/' in channel_subdir_str: + channel_str, subdir = channel_subdir_str.split('/', 2) + parts.update({ + 'channel': channel_str, + 'subdir': subdir, + }) + else: + parts['channel'] = channel_subdir_str + name, version, build = dist_str.rsplit('-', 2) parts.update({ 'name': name, diff --git a/conda/models/records.py b/conda/models/records.py --- a/conda/models/records.py +++ b/conda/models/records.py @@ -281,7 +281,7 @@ def __eq__(self, other): return self._pkey == other._pkey def dist_str(self): - return "%s::%s-%s-%s" % (self.channel.canonical_name, self.name, self.version, self.build) + return "%s%s::%s-%s-%s" % (self.channel.canonical_name, ("/" + self.subdir) if self.subdir else "", self.name, self.version, self.build) def dist_fields_dump(self): return {
diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -24,7 +24,7 @@ from conda.models.records import PrefixRecord from conda.models.enums import PackageType from conda.resolve import MatchSpec -from ..helpers import get_index_r_1, get_index_r_2, get_index_r_4, \ +from ..helpers import add_subdir_to_iter, get_index_r_1, get_index_r_2, get_index_r_4, \ get_index_r_5, get_index_cuda, get_index_must_unfreeze from conda.common.compat import iteritems @@ -154,7 +154,7 @@ def test_solve_1(): with get_solver(specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -163,7 +163,7 @@ def test_solve_1(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-3.3.2-0', 'channel-1::numpy-1.7.1-py33_0', - ) + )) assert convert_to_dist_str(final_state) == order specs_to_add = MatchSpec("python=2"), @@ -171,7 +171,7 @@ def test_solve_1(): prefix_records=final_state, history_specs=specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -180,7 +180,7 @@ def test_solve_1(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numpy-1.7.1-py27_0', - ) + )) assert convert_to_dist_str(final_state) == order @@ -190,7 +190,7 @@ def test_solve_2(): with get_solver_aggregate_1(specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', @@ -200,7 +200,7 @@ def test_solve_2(): 'channel-2::zlib-1.2.11-0', 'channel-2::python-3.6.2-0', 'channel-2::numpy-1.13.1-py36_0' - ) + )) assert convert_to_dist_str(final_state) == order specs_to_add = MatchSpec("channel-4::numpy"), @@ -242,9 +242,9 @@ def test_cuda_1(): with get_solver_cuda(specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::cudatoolkit-9.0-0', - ) + )) assert convert_to_dist_str(final_state) == order @@ -255,9 +255,9 @@ def test_cuda_2(): with get_solver_cuda(specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::cudatoolkit-10.0-0', - ) + )) assert convert_to_dist_str(final_state) == order @@ -298,7 +298,7 @@ def test_prune_1(): with get_solver(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::libnvvm-1.0-p0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::openssl-1.0.1c-0', @@ -321,7 +321,7 @@ def test_prune_1(): 'channel-1::scikit-learn-0.13.1-np16py27_p0', 'channel-1::mkl-11.0-np16py27_p0', 'channel-1::accelerate-1.1.0-np16py27_p0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_remove = MatchSpec("numbapro"), @@ -330,7 +330,7 @@ def test_prune_1(): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-1::accelerate-1.1.0-np16py27_p0', 'channel-1::mkl-11.0-np16py27_p0', 'channel-1::scikit-learn-0.13.1-np16py27_p0', @@ -346,10 +346,10 @@ def test_prune_1(): 'channel-1::llvm-3.2-0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::libnvvm-1.0-p0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-1::numpy-1.6.2-py27_4', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -360,7 +360,7 @@ def test_force_remove_1(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -369,7 +369,7 @@ def test_force_remove_1(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numpy-1.7.1-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order # without force_remove, taking out python takes out everything that depends on it, too, @@ -382,10 +382,9 @@ def test_force_remove_1(): print(convert_to_dist_str(final_state_2)) # openssl remains because it is in the aggressive_update_packages set, # but everything else gets removed - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', - - ) + )) assert convert_to_dist_str(final_state_2) == order # with force remove, we remove only the explicit specs that we provide @@ -396,7 +395,7 @@ def test_force_remove_1(): final_state_2 = solver.solve_final_state(force_remove=True) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', @@ -404,7 +403,7 @@ def test_force_remove_1(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ) + )) assert convert_to_dist_str(final_state_2) == order # re-solving restores order @@ -412,7 +411,7 @@ def test_force_remove_1(): final_state_3 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -421,7 +420,7 @@ def test_force_remove_1(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numpy-1.7.1-py27_0' - ) + )) assert convert_to_dist_str(final_state_3) == order @@ -431,7 +430,7 @@ def test_no_deps_1(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -439,7 +438,7 @@ def test_no_deps_1(): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("numba"), @@ -447,7 +446,7 @@ def test_no_deps_1(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -460,7 +459,7 @@ def test_no_deps_1(): 'channel-1::meta-0.4.2.dev-py27_0', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::numba-0.8.1-np17py27_0' - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("numba"), @@ -468,7 +467,7 @@ def test_no_deps_1(): final_state_2 = solver.solve_final_state(deps_modifier='NO_DEPS') # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -477,7 +476,7 @@ def test_no_deps_1(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numba-0.8.1-np17py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -487,7 +486,7 @@ def test_only_deps_1(): final_state_1 = solver.solve_final_state(deps_modifier=DepsModifier.ONLY_DEPS) # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -499,7 +498,7 @@ def test_only_deps_1(): 'channel-1::llvmpy-0.11.2-py27_0', 'channel-1::meta-0.4.2.dev-py27_0', 'channel-1::numpy-1.7.1-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order @@ -509,7 +508,7 @@ def test_only_deps_2(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -518,7 +517,7 @@ def test_only_deps_2(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.3-7', 'channel-1::numpy-1.5.1-py27_4', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("numba=0.5"), @@ -526,7 +525,7 @@ def test_only_deps_2(): final_state_2 = solver.solve_final_state(deps_modifier=DepsModifier.ONLY_DEPS) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -540,7 +539,7 @@ def test_only_deps_2(): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # 'channel-1::numba-0.5.0-np17py27_0', # not in the order because only_deps - ) + )) assert convert_to_dist_str(final_state_2) == order # fails because numpy=1.5 is in our history as an explicit spec @@ -554,7 +553,7 @@ def test_only_deps_2(): final_state_2 = solver.solve_final_state(deps_modifier=DepsModifier.ONLY_DEPS) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -568,7 +567,7 @@ def test_only_deps_2(): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # 'channel-1::numba-0.5.0-np17py27_0', # not in the order because only_deps - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -578,7 +577,7 @@ def test_update_all_1(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -587,7 +586,7 @@ def test_update_all_1(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.6.8-6', 'channel-1::numpy-1.5.1-py26_4', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("numba=0.6"), MatchSpec("numpy") @@ -595,7 +594,7 @@ def test_update_all_1(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -608,7 +607,7 @@ def test_update_all_1(): 'channel-1::nose-1.3.0-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.6.0-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("numba=0.6"), @@ -616,7 +615,7 @@ def test_update_all_1(): final_state_2 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_ALL) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -629,7 +628,7 @@ def test_update_all_1(): 'channel-1::nose-1.3.0-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.6.0-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -639,7 +638,7 @@ def test_broken_install(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order_original = ( + order_original = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -653,7 +652,7 @@ def test_broken_install(): 'channel-1::dateutil-2.1-py27_1', 'channel-1::scipy-0.12.0-np16py27_0', 'channel-1::pandas-0.11.0-np16py27_1', - ) + )) assert convert_to_dist_str(final_state_1) == order_original assert solver._r.environment_is_consistent(final_state_1) @@ -669,7 +668,7 @@ def test_broken_install(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( "channel-1::numpy-1.7.1-py33_p0", 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', @@ -686,7 +685,7 @@ def test_broken_install(): 'channel-1::dateutil-2.1-py27_1', 'channel-1::flask-0.9-py27_0', 'channel-1::pandas-0.11.0-np16py27_1' - ) + )) assert convert_to_dist_str(final_state_2) == order assert not solver._r.environment_is_consistent(final_state_2) @@ -696,7 +695,7 @@ def test_broken_install(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -713,7 +712,7 @@ def test_broken_install(): 'channel-1::flask-0.9-py27_0', 'channel-1::scipy-0.12.0-np16py27_0', 'channel-1::pandas-0.11.0-np16py27_1', - ) + )) assert convert_to_dist_str(final_state_2) == order assert solver._r.environment_is_consistent(final_state_2) @@ -731,7 +730,7 @@ def test_conda_downgrade(): with get_solver_aggregate_1(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-2::conda-env-2.6.0-0', 'channel-2::libffi-3.2.1-1', @@ -774,7 +773,7 @@ def test_conda_downgrade(): 'channel-4::requests-2.19.1-py37_0', 'channel-4::conda-4.5.10-py37_0', 'channel-4::conda-build-3.12.1-py37_0' - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("itsdangerous"), # MatchSpec("conda"), @@ -789,9 +788,9 @@ def test_conda_downgrade(): unlink_order = ( # no conda downgrade ) - link_order = ( + link_order = add_subdir_to_iter(( 'channel-2::itsdangerous-0.24-py_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -810,7 +809,7 @@ def test_conda_downgrade(): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( # now conda gets downgraded 'channel-4::conda-build-3.12.1-py37_0', 'channel-4::conda-4.5.10-py37_0', @@ -847,8 +846,8 @@ def test_conda_downgrade(): 'channel-4::tk-8.6.7-hc745277_3', 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::ncurses-6.1-hf484d3e_0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', 'channel-2::sqlite-3.13.0-0', @@ -882,7 +881,7 @@ def test_conda_downgrade(): 'channel-2::pyopenssl-17.0.0-py36_0', 'channel-2::conda-4.3.30-py36h5d9f9f4_0', 'channel-4::conda-build-3.12.1-py36_0' - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order finally: @@ -906,23 +905,23 @@ def test_unfreeze_when_required(): with get_solver_must_unfreeze(specs) as solver: final_state_1 = solver.solve_final_state() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-freeze::libbar-2.0-0', 'channel-freeze::libfoo-1.0-0', 'channel-freeze::foobar-1.0-0', 'channel-freeze::qux-1.0-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs = MatchSpec("foobar"), with get_solver_must_unfreeze(specs) as solver: final_state_1 = solver.solve_final_state() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-freeze::libbar-2.0-0', 'channel-freeze::libfoo-2.0-0', 'channel-freeze::foobar-2.0-0', - ) + )) assert convert_to_dist_str(final_state_1) == order # When frozen there is no solution - but conda tries really hard to not freeze things that conflict @@ -937,12 +936,12 @@ def test_unfreeze_when_required(): final_state_2 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_SPECS) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-freeze::libbar-2.0-0', 'channel-freeze::libfoo-1.0-0', 'channel-freeze::foobar-1.0-0', 'channel-freeze::qux-1.0-0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -952,7 +951,7 @@ def test_auto_update_conda(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -963,7 +962,7 @@ def test_auto_update_conda(): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "yes"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -972,7 +971,7 @@ def test_auto_update_conda(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -984,7 +983,7 @@ def test_auto_update_conda(): 'channel-1::pytz-2013b-py27_0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order saved_sys_prefix = sys.prefix @@ -996,7 +995,7 @@ def test_auto_update_conda(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1008,7 +1007,7 @@ def test_auto_update_conda(): 'channel-1::pytz-2013b-py27_0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.5.2-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "no"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1017,7 +1016,7 @@ def test_auto_update_conda(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1029,7 +1028,7 @@ def test_auto_update_conda(): 'channel-1::pytz-2013b-py27_0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order finally: sys.prefix = saved_sys_prefix @@ -1041,7 +1040,7 @@ def test_explicit_conda_downgrade(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1052,7 +1051,7 @@ def test_explicit_conda_downgrade(): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.5.2-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "yes"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1061,7 +1060,7 @@ def test_explicit_conda_downgrade(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1072,7 +1071,7 @@ def test_explicit_conda_downgrade(): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order saved_sys_prefix = sys.prefix @@ -1084,7 +1083,7 @@ def test_explicit_conda_downgrade(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1095,7 +1094,7 @@ def test_explicit_conda_downgrade(): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "no"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1104,7 +1103,7 @@ def test_explicit_conda_downgrade(): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1115,7 +1114,7 @@ def test_explicit_conda_downgrade(): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order finally: sys.prefix = saved_sys_prefix @@ -1137,9 +1136,9 @@ def solve(prev_state, specs_to_add, order): with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": ""}, stack_callback=conda_tests_ctxt_mgmt_def_pol): base_state = solve( empty_state, ["libpng=1.2"], - ( + add_subdir_to_iter(( 'channel-1::libpng-1.2.50-0', - )) + ))) # # ~~has "libpng" restricted to "=1.2" by history_specs~~ NOPE! # In conda 4.6 making aggressive_update *more* aggressive, making it override history specs. @@ -1147,48 +1146,48 @@ def solve(prev_state, specs_to_add, order): with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_1, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.5.13-1', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": ""}, stack_callback=conda_tests_ctxt_mgmt_def_pol): state_1_2 = solve( state_1, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.2.50-0', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_1_2, ["cmake>2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.10.2-0', 'channel-1::libpng-1.5.13-1', - )) + ))) # use new history_specs to remove "libpng" version restriction state_2 = (base_state[0], (MatchSpec("libpng"),)) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_2, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.5.13-1', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": ""}, stack_callback=conda_tests_ctxt_mgmt_def_pol): state_2_2 = solve( state_2, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.2.50-0', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_2_2, ["cmake>2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.10.2-0', 'channel-1::libpng-1.5.13-1', - )) + ))) def test_python2_update(): @@ -1198,7 +1197,7 @@ def test_python2_update(): with get_solver_4(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order1 = ( + order1 = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::conda-env-2.6.0-1', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', @@ -1232,14 +1231,14 @@ def test_python2_update(): 'channel-4::urllib3-1.23-py27_0', 'channel-4::requests-2.19.1-py27_0', 'channel-4::conda-4.5.10-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order1 specs_to_add = MatchSpec("python=3"), with get_solver_4(specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver: final_state_2 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::conda-env-2.6.0-1', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', @@ -1271,7 +1270,7 @@ def test_python2_update(): 'channel-4::urllib3-1.23-py37_0', 'channel-4::requests-2.19.1-py37_0', 'channel-4::conda-4.5.10-py37_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -1281,7 +1280,7 @@ def test_update_deps_1(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() # print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1289,14 +1288,14 @@ def test_update_deps_1(): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs2 = MatchSpec("numpy=1.7.0"), MatchSpec("python=2.7.3") with get_solver(specs2, prefix_records=final_state_1, history_specs=specs) as solver: final_state_2 = solver.solve_final_state() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1306,14 +1305,14 @@ def test_update_deps_1(): 'channel-1::python-2.7.3-7', 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.0-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("iopro"), with get_solver(specs_to_add, prefix_records=final_state_2, history_specs=specs2) as solver: final_state_3a = solver.solve_final_state() print(convert_to_dist_str(final_state_3a)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1325,14 +1324,14 @@ def test_update_deps_1(): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.0-py27_0', 'channel-1::iopro-1.5.0-np17py27_p0', - ) + )) assert convert_to_dist_str(final_state_3a) == order specs_to_add = MatchSpec("iopro"), with get_solver(specs_to_add, prefix_records=final_state_2, history_specs=specs2) as solver: final_state_3 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_DEPS) pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1344,7 +1343,7 @@ def test_update_deps_1(): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # with update_deps, numpy should switch from 1.7.0 to 1.7.1 'channel-1::iopro-1.5.0-np17py27_p0', - ) + )) assert convert_to_dist_str(final_state_3) == order specs_to_add = MatchSpec("iopro"), @@ -1352,7 +1351,7 @@ def test_update_deps_1(): final_state_3 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_DEPS, deps_modifier=DepsModifier.ONLY_DEPS) pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::unixodbc-2.3.1-0', 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', @@ -1364,7 +1363,7 @@ def test_update_deps_1(): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # with update_deps, numpy should switch from 1.7.0 to 1.7.1 # 'channel-1::iopro-1.5.0-np17py27_p0', - ) + )) assert convert_to_dist_str(final_state_3) == order @@ -1373,7 +1372,7 @@ def test_update_deps_2(): with get_solver_aggregate_2(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order1 = ( + order1 = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', 'channel-4::libstdcxx-ng-8.2.0-hdf63c60_0', @@ -1395,7 +1394,7 @@ def test_update_deps_2(): 'channel-4::setuptools-40.0.0-py36_0', 'channel-2::jinja2-2.8-py36_1', 'channel-2::flask-0.12-py36_0', - ) + )) assert convert_to_dist_str(final_state_1) == order1 # The "conda update flask" case is held back by the jinja2==2.8 user-requested spec. @@ -1404,12 +1403,12 @@ def test_update_deps_2(): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-2::flask-0.12-py36_0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::flask-0.12.2-py36hb24657c_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1419,14 +1418,14 @@ def test_update_deps_2(): unlink_precs, link_precs = solver.solve_for_diff(update_modifier=UpdateModifier.UPDATE_DEPS) pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-2::flask-0.12-py36_0', 'channel-2::jinja2-2.8-py36_1', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::jinja2-2.10-py36_0', 'channel-4::flask-1.0.2-py36_1', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1436,7 +1435,7 @@ def test_fast_update_with_update_modifier_not_set(): with get_solver_4(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order1 = ( + order1 = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', 'channel-4::libstdcxx-ng-8.2.0-hdf63c60_0', @@ -1449,7 +1448,7 @@ def test_fast_update_with_update_modifier_not_set(): 'channel-4::readline-7.0-ha6073c6_4', 'channel-4::sqlite-3.21.0-h1bed415_2', 'channel-4::python-2.7.14-h89e7a4a_22', - ) + )) assert convert_to_dist_str(final_state_1) == order1 specs_to_add = MatchSpec("python"), @@ -1457,19 +1456,19 @@ def test_fast_update_with_update_modifier_not_set(): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-4::python-2.7.14-h89e7a4a_22', 'channel-4::libedit-3.1-heed3624_0', 'channel-4::openssl-1.0.2l-h077ae2c_5', 'channel-4::ncurses-6.0-h9df7e31_2' - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::ncurses-6.1-hf484d3e_0', 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::xz-5.2.4-h14c3975_4', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::python-3.6.4-hc3d631a_1', # python is upgraded - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1478,20 +1477,20 @@ def test_fast_update_with_update_modifier_not_set(): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-4::python-2.7.14-h89e7a4a_22', 'channel-4::sqlite-3.21.0-h1bed415_2', 'channel-4::libedit-3.1-heed3624_0', 'channel-4::openssl-1.0.2l-h077ae2c_5', 'channel-4::ncurses-6.0-h9df7e31_2', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::ncurses-6.1-hf484d3e_0', 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::sqlite-3.24.0-h84994c4_0', # sqlite is upgraded 'channel-4::python-2.7.15-h1571d57_0', # python is not upgraded - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1509,7 +1508,7 @@ def test_pinned_1(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1518,7 +1517,7 @@ def test_pinned_1(): 'channel-1::zlib-1.2.7-0', 'channel-1::python-3.3.2-0', 'channel-1::numpy-1.7.1-py33_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_var("CONDA_PINNED_PACKAGES", "python=2.6&iopro<=1.4.2", stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1527,9 +1526,9 @@ def test_pinned_1(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::system-5.8-0', - ) + )) assert convert_to_dist_str(final_state_1) == order # ignore_pinned=True @@ -1539,7 +1538,7 @@ def test_pinned_1(): final_state_2 = solver.solve_final_state(ignore_pinned=True) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1547,7 +1546,7 @@ def test_pinned_1(): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-3.3.2-0', - ) + )) assert convert_to_dist_str(final_state_2) == order # ignore_pinned=False @@ -1557,7 +1556,7 @@ def test_pinned_1(): final_state_2 = solver.solve_final_state(ignore_pinned=False) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1565,7 +1564,7 @@ def test_pinned_1(): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.6.8-6', - ) + )) assert convert_to_dist_str(final_state_2) == order # incompatible CLI and configured specs @@ -1585,7 +1584,7 @@ def test_pinned_1(): final_state_3 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1598,7 +1597,7 @@ def test_pinned_1(): 'channel-1::llvmpy-0.11.2-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.8.1-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_3) == order specs_to_add = MatchSpec("python"), @@ -1608,7 +1607,7 @@ def test_pinned_1(): final_state_4 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_DEPS) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_4)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1621,7 +1620,7 @@ def test_pinned_1(): 'channel-1::llvmpy-0.11.2-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.8.1-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_4) == order specs_to_add = MatchSpec("python"), @@ -1631,7 +1630,7 @@ def test_pinned_1(): final_state_5 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_ALL) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_5)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1644,7 +1643,7 @@ def test_pinned_1(): 'channel-1::llvmpy-0.11.2-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.8.1-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_5) == order # now update without pinning @@ -1655,7 +1654,7 @@ def test_pinned_1(): final_state_5 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_ALL) # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_5)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1667,7 +1666,7 @@ def test_pinned_1(): 'channel-1::llvmpy-0.11.2-py33_0', 'channel-1::numpy-1.7.1-py33_0', 'channel-1::numba-0.8.1-np17py33_0', - ) + )) assert convert_to_dist_str(final_state_5) == order @@ -1680,7 +1679,7 @@ def test_no_update_deps_1(): # i.e. FREEZE_DEPS final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1688,7 +1687,7 @@ def test_no_update_deps_1(): # i.e. FREEZE_DEPS 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("zope.interface"), @@ -1696,7 +1695,7 @@ def test_no_update_deps_1(): # i.e. FREEZE_DEPS final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1706,7 +1705,7 @@ def test_no_update_deps_1(): # i.e. FREEZE_DEPS 'channel-1::python-2.7.5-0', 'channel-1::nose-1.3.0-py27_0', 'channel-1::zope.interface-4.0.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("zope.interface>4.1"), @@ -1720,7 +1719,7 @@ def test_no_update_deps_1(): # i.e. FREEZE_DEPS final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1730,7 +1729,7 @@ def test_no_update_deps_1(): # i.e. FREEZE_DEPS 'channel-1::python-3.3.2-0', 'channel-1::nose-1.3.0-py33_0', 'channel-1::zope.interface-4.1.1.1-py33_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -1740,7 +1739,7 @@ def test_force_reinstall_1(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1748,7 +1747,7 @@ def test_force_reinstall_1(): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = specs @@ -1773,7 +1772,7 @@ def test_force_reinstall_2(): assert not unlink_dists # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(link_dists)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1781,7 +1780,7 @@ def test_force_reinstall_2(): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(link_dists) == order @@ -1791,7 +1790,7 @@ def test_timestamps_1(): unlink_dists, link_dists = solver.solve_for_diff(force_reinstall=True) assert not unlink_dists pprint(convert_to_dist_str(link_dists)) - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', 'channel-4::libstdcxx-ng-8.2.0-hdf63c60_0', @@ -1806,7 +1805,7 @@ def test_timestamps_1(): 'channel-4::sqlite-3.23.1-he433501_0', 'channel-4::python-3.6.2-hca45abc_19', # this package has a later timestamp but lower hash value # than the alternate 'channel-4::python-3.6.2-hda45abc_19' - ) + )) assert convert_to_dist_str(link_dists) == order def test_channel_priority_churn_minimized(): @@ -1836,7 +1835,7 @@ def test_remove_with_constrained_dependencies(): assert not unlink_dists_1 pprint(convert_to_dist_str(link_dists_1)) assert not unlink_dists_1 - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::conda-env-2.6.0-1', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', @@ -1879,7 +1878,7 @@ def test_remove_with_constrained_dependencies(): 'channel-4::requests-2.19.1-py37_0', 'channel-4::conda-4.5.10-py37_0', 'channel-4::conda-build-3.12.1-py37_0', - ) + )) assert convert_to_dist_str(link_dists_1) == order specs_to_remove = MatchSpec("pycosat"), @@ -1887,11 +1886,11 @@ def test_remove_with_constrained_dependencies(): unlink_dists_2, link_dists_2 = solver.solve_for_diff() assert not link_dists_2 pprint(convert_to_dist_str(unlink_dists_2)) - order = ( + order = add_subdir_to_iter(( 'channel-4::conda-build-3.12.1-py37_0', 'channel-4::conda-4.5.10-py37_0', 'channel-4::pycosat-0.6.3-py37h14c3975_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(unlink_dists_2) @@ -1903,7 +1902,7 @@ def test_priority_1(): with get_solver_aggregate_1(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', @@ -1916,7 +1915,7 @@ def test_priority_1(): 'channel-2::six-1.10.0-py27_0', 'channel-2::python-dateutil-2.6.1-py27_0', 'channel-2::pandas-0.20.3-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_var("CONDA_CHANNEL_PRIORITY", "False", stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1926,10 +1925,10 @@ def test_priority_1(): pprint(convert_to_dist_str(final_state_2)) # python and pandas will be updated as they are explicit specs. Other stuff may or may not, # as required to satisfy python and pandas - order = ( + order = add_subdir_to_iter(( 'channel-4::python-2.7.15-h1571d57_0', 'channel-4::pandas-0.23.4-py27h04863e7_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(final_state_2) @@ -1940,10 +1939,10 @@ def test_priority_1(): history_specs=specs) as solver: final_state_3 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-2::python-2.7.13-0', 'channel-2::pandas-0.20.3-py27_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(final_state_3) @@ -1953,10 +1952,10 @@ def test_priority_1(): prefix_records=final_state_3, history_specs=specs) as solver: final_state_4 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_4)) - order = ( + order = add_subdir_to_iter(( 'channel-2::python-2.7.13-0', 'channel-2::six-1.9.0-py27_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(final_state_4) assert 'pandas' not in convert_to_dist_str(final_state_4) @@ -1971,7 +1970,7 @@ def test_features_solve_1(): with get_solver_aggregate_1(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-2::nomkl-1.0-0', 'channel-2::libgfortran-3.0.0-1', 'channel-2::openssl-1.0.2l-0', @@ -1982,14 +1981,14 @@ def test_features_solve_1(): 'channel-2::openblas-0.2.19-0', 'channel-2::python-2.7.13-0', 'channel-2::numpy-1.13.1-py27_nomkl_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_var("CONDA_CHANNEL_PRIORITY", "False", stack_callback=conda_tests_ctxt_mgmt_def_pol): with get_solver_aggregate_1(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-4::blas-1.0-openblas', 'channel-4::ca-certificates-2018.03.07-0', 'channel-2::libffi-3.2.1-1', @@ -2008,7 +2007,7 @@ def test_features_solve_1(): 'channel-4::python-2.7.15-h1571d57_0', 'channel-4::numpy-base-1.15.0-py27h7cdd4dd_0', 'channel-4::numpy-1.15.0-py27h2aefc1b_0', - ) + )) assert convert_to_dist_str(final_state_1) == order @@ -2018,7 +2017,7 @@ def test_freeze_deps_1(): with get_solver_2(specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', 'channel-2::sqlite-3.13.0-0', @@ -2027,7 +2026,7 @@ def test_freeze_deps_1(): 'channel-2::zlib-1.2.11-0', 'channel-2::python-3.4.5-0', 'channel-2::six-1.7.3-py34_0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("bokeh"), @@ -2036,7 +2035,7 @@ def test_freeze_deps_1(): pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) unlink_order = () - link_order = ( + link_order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::yaml-0.1.6-0', 'channel-2::backports_abc-0.5-py34_0', @@ -2049,7 +2048,7 @@ def test_freeze_deps_1(): 'channel-2::python-dateutil-2.6.1-py34_0', 'channel-2::tornado-4.4.2-py34_0', 'channel-2::bokeh-0.12.4-py34_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -2061,7 +2060,7 @@ def test_freeze_deps_1(): pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) unlink_order = () - link_order = ( + link_order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::yaml-0.1.6-0', 'channel-2::backports_abc-0.5-py34_0', @@ -2074,7 +2073,7 @@ def test_freeze_deps_1(): 'channel-2::python-dateutil-2.6.1-py34_0', 'channel-2::tornado-4.4.2-py34_0', 'channel-2::bokeh-0.12.4-py34_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -2095,12 +2094,12 @@ def test_freeze_deps_1(): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-2::six-1.7.3-py34_0', 'channel-2::python-3.4.5-0', 'channel-2::xz-5.2.3-0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::yaml-0.1.6-0', 'channel-2::python-2.7.13-0', @@ -2120,7 +2119,7 @@ def test_freeze_deps_1(): 'channel-2::jinja2-2.9.6-py27_0', 'channel-2::tornado-4.5.2-py27_0', 'channel-2::bokeh-0.12.5-py27_1', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -2243,7 +2242,7 @@ def test_downgrade_python_prevented_with_sane_message(): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -2251,7 +2250,7 @@ def test_downgrade_python_prevented_with_sane_message(): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.6.8-6', - ) + )) assert convert_to_dist_str(final_state_1) == order # incompatible CLI and configured specs diff --git a/tests/helpers.py b/tests/helpers.py --- a/tests/helpers.py +++ b/tests/helpers.py @@ -111,6 +111,25 @@ def run_inprocess_conda_command(command, disallow_stderr=True): return c.stdout, c.stderr, exit_code +def add_subdir(dist_string): + channel_str, package_str = dist_string.split('::') + channel_str = channel_str + '/' + context.subdir + return '::'.join([channel_str, package_str]) + + +def add_subdir_to_iter(iterable): + if isinstance(iterable, dict): + return {add_subdir(k) : v for k, v in iterable.items()} + elif isinstance(iterable, list): + return list(map(add_subdir, iterable)) + elif isinstance(iterable, set): + return set(map(add_subdir, iterable)) + elif isinstance(iterable, tuple): + return tuple(map(add_subdir, iterable)) + else: + raise Exception("Unable to add subdir to object of unknown type.") + + @contextmanager def tempdir(): tempdirdir = gettempdir() diff --git a/tests/models/test_prefix_graph.py b/tests/models/test_prefix_graph.py --- a/tests/models/test_prefix_graph.py +++ b/tests/models/test_prefix_graph.py @@ -13,6 +13,7 @@ from conda.models.records import PackageRecord import pytest from tests.core.test_solve import get_solver_4, get_solver_5 +from tests.helpers import add_subdir_to_iter try: from unittest.mock import Mock, patch @@ -218,17 +219,17 @@ def test_prefix_graph_1(): ) assert nodes == order - spec_matches = { + spec_matches = add_subdir_to_iter({ 'channel-4::intel-openmp-2018.0.3-0': {'intel-openmp'}, - } + }) assert {node.dist_str(): set(str(ms) for ms in specs) for node, specs in graph.spec_matches.items()} == spec_matches removed_nodes = graph.prune() nodes = tuple(rec.dist_str() for rec in graph.records) pprint(nodes) - order = ( + order = add_subdir_to_iter(( 'channel-4::intel-openmp-2018.0.3-0', - ) + )) assert nodes == order removed_nodes = tuple(rec.name for rec in removed_nodes) diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -16,7 +16,7 @@ from conda.models.enums import PackageType from conda.models.records import PackageRecord from conda.resolve import MatchSpec, Resolve, ResolvePackageNotFound -from .helpers import TEST_DATA_DIR, get_index_r_1, get_index_r_4, raises +from .helpers import TEST_DATA_DIR, add_subdir, add_subdir_to_iter, get_index_r_1, get_index_r_4, raises index, r, = get_index_r_1() f_mkl = set(['mkl']) @@ -66,7 +66,7 @@ def test_empty(self): def test_iopro_nomkl(self): installed = r.install(['iopro 1.4*', 'python 2.7*', 'numpy 1.7*'], returnall=True) installed = [rec.dist_str() for rec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np17py27_p0', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -77,12 +77,12 @@ def test_iopro_nomkl(self): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_iopro_mkl(self): installed = r.install(['iopro 1.4*', 'python 2.7*', 'numpy 1.7*', MatchSpec(track_features='mkl')], returnall=True) installed = [prec.dist_str() for prec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np17py27_p0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::numpy-1.7.1-py27_p0', @@ -94,7 +94,7 @@ def test_iopro_mkl(self): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_mkl(self): a = r.install(['mkl 11*', MatchSpec(track_features='mkl')]) @@ -110,13 +110,13 @@ def test_scipy_mkl(self): precs = r.install(['scipy', 'python 2.7*', 'numpy 1.7*', MatchSpec(track_features='mkl')]) self.assert_have_mkl(precs, ('numpy', 'scipy')) dist_strs = [prec.dist_str() for prec in precs] - assert 'channel-1::scipy-0.12.0-np17py27_p0' in dist_strs + assert add_subdir('channel-1::scipy-0.12.0-np17py27_p0') in dist_strs def test_anaconda_nomkl(self): precs = r.install(['anaconda 1.5.0', 'python 2.7*', 'numpy 1.7*']) assert len(precs) == 107 dist_strs = [prec.dist_str() for prec in precs] - assert 'channel-1::scipy-0.12.0-np17py27_0' in dist_strs + assert add_subdir('channel-1::scipy-0.12.0-np17py27_0') in dist_strs def test_generate_eq_1(): @@ -140,7 +140,7 @@ def test_generate_eq_1(): eqb = {key: value for key, value in iteritems(eqb)} eqt = {key: value for key, value in iteritems(eqt)} assert eqc == {} - assert eqv == { + assert eqv == add_subdir_to_iter({ 'channel-1::anaconda-1.4.0-np15py27_0': 1, 'channel-1::anaconda-1.4.0-np16py27_0': 1, 'channel-1::anaconda-1.4.0-np17py27_0': 1, @@ -215,8 +215,8 @@ def test_generate_eq_1(): 'channel-1::xlrd-0.9.0-py27_0': 1, 'channel-1::xlrd-0.9.0-py33_0': 1, 'channel-1::xlwt-0.7.4-py27_0': 1 - } - assert eqb == { + }) + assert eqb == add_subdir_to_iter({ 'channel-1::cubes-0.10.2-py27_0': 1, 'channel-1::dateutil-2.1-py27_0': 1, 'channel-1::dateutil-2.1-py33_0': 1, @@ -244,7 +244,7 @@ def test_generate_eq_1(): 'channel-1::theano-0.5.0-np16py27_0': 1, 'channel-1::theano-0.5.0-np17py27_0': 1, 'channel-1::zeromq-2.2.0-0': 1 - } + }) # No timestamps in the current data set assert eqt == {} @@ -254,7 +254,7 @@ def test_pseudo_boolean(): # The latest version of iopro, 1.5.0, was not built against numpy 1.5 installed = r.install(['iopro', 'python 2.7*', 'numpy 1.5*'], returnall=True) installed = [rec.dist_str() for rec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np15py27_p0', 'channel-1::numpy-1.5.1-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -265,11 +265,11 @@ def test_pseudo_boolean(): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) installed = r.install(['iopro', 'python 2.7*', 'numpy 1.5*', MatchSpec(track_features='mkl')], returnall=True) installed = [rec.dist_str() for rec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np15py27_p0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::numpy-1.5.1-py27_p4', @@ -281,14 +281,14 @@ def test_pseudo_boolean(): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_get_dists(): reduced_index = r.get_reduced_index((MatchSpec("anaconda 1.4.0"), )) dist_strs = [prec.dist_str() for prec in reduced_index] - assert 'channel-1::anaconda-1.4.0-np17py27_0' in dist_strs - assert 'channel-1::freetype-2.4.10-0' in dist_strs + assert add_subdir('channel-1::anaconda-1.4.0-np17py27_0') in dist_strs + assert add_subdir('channel-1::freetype-2.4.10-0') in dist_strs def test_get_reduced_index_unmanageable(): @@ -643,11 +643,11 @@ def test_nonexistent_deps(): index2 = {key: value for key, value in iteritems(index2)} r = Resolve(index2) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == add_subdir_to_iter({ 'defaults::mypackage-1.0-py33_0', 'defaults::mypackage-1.1-py33_0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), ))) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), ))) == add_subdir_to_iter({ 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.1.2-py33_0', 'channel-1::nose-1.2.1-py33_0', @@ -666,12 +666,12 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - } + }) target_result = r.install(['mypackage']) assert target_result == r.install(['mypackage 1.1']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.3.0-py33_0', 'channel-1::openssl-1.0.1c-0', @@ -681,13 +681,13 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) assert raises(ResolvePackageNotFound, lambda: r.install(['mypackage 1.0'])) assert raises(ResolvePackageNotFound, lambda: r.install(['mypackage 1.0', 'burgertime 1.0'])) target_result = r.install(['anotherpackage 1.0']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-1.0-py33_0', 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -698,11 +698,11 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) target_result = r.install(['anotherpackage']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-2.0-py33_0', 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -713,7 +713,7 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # This time, the latest version is messed up index3 = index.copy() @@ -769,11 +769,12 @@ def test_nonexistent_deps(): index3 = {key: value for key, value in iteritems(index3)} r = Resolve(index3) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == add_subdir_to_iter({ 'defaults::mypackage-1.0-py33_0', 'defaults::mypackage-1.1-py33_0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), )).keys()) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), )).keys()) ==\ + add_subdir_to_iter({ 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.1.2-py33_0', 'channel-1::nose-1.2.1-py33_0', @@ -792,11 +793,11 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - } + }) target_result = r.install(['mypackage']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.3.0-py33_0', 'channel-1::openssl-1.0.1c-0', @@ -806,12 +807,12 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) assert raises(ResolvePackageNotFound, lambda: r.install(['mypackage 1.1'])) target_result = r.install(['anotherpackage 1.0']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-1.0-py33_0', 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -822,13 +823,13 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # If recursive checking is working correctly, this will give # anotherpackage 2.0, not anotherpackage 1.0 target_result = r.install(['anotherpackage']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-2.0-py33_0', 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -839,7 +840,7 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_install_package_with_feature(): @@ -929,20 +930,20 @@ def test_circular_dependencies(): index2 = {key: value for key, value in iteritems(index2)} r = Resolve(index2) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == add_subdir_to_iter({ 'defaults::package1-1.0-0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == add_subdir_to_iter({ 'defaults::package1-1.0-0', 'defaults::package2-1.0-0', - } + }) result = r.install(['package1', 'package2']) assert r.install(['package1']) == r.install(['package2']) == result result = [r.dist_str() for r in result] - assert result == [ + assert result == add_subdir_to_iter([ 'defaults::package1-1.0-0', 'defaults::package2-1.0-0', - ] + ]) def test_optional_dependencies(): @@ -987,25 +988,25 @@ def test_optional_dependencies(): index2 = {key: value for key, value in iteritems(index2)} r = Resolve(index2) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == add_subdir_to_iter({ 'defaults::package1-1.0-0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == add_subdir_to_iter({ 'defaults::package1-1.0-0', 'defaults::package2-2.0-0', - } + }) result = r.install(['package1']) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'defaults::package1-1.0-0', - ] + ]) result = r.install(['package1', 'package2']) assert result == r.install(['package1', 'package2 >1.0']) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'defaults::package1-1.0-0', 'defaults::package2-2.0-0', - ] + ]) assert raises(UnsatisfiableError, lambda: r.install(['package1', 'package2 <2.0'])) assert raises(UnsatisfiableError, lambda: r.install(['package1', 'package2 1.0'])) @@ -1013,7 +1014,7 @@ def test_optional_dependencies(): def test_irrational_version(): result = r.install(['pytz 2012d', 'python 3*'], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::openssl-1.0.1c-0', 'channel-1::python-3.3.2-0', 'channel-1::pytz-2012d-py33_0', @@ -1022,14 +1023,14 @@ def test_irrational_version(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_no_features(): # Without this, there would be another solution including 'scipy-0.11.0-np16py26_p3.tar.bz2'. result = r.install(['python 2.6*', 'numpy 1.6*', 'scipy 0.11*'], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::numpy-1.6.2-py26_4', 'channel-1::openssl-1.0.1c-0', 'channel-1::python-2.6.8-6', @@ -1039,11 +1040,11 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) result = r.install(['python 2.6*', 'numpy 1.6*', 'scipy 0.11*', MatchSpec(track_features='mkl')], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::mkl-rt-11.0-p0', # This, 'channel-1::numpy-1.6.2-py26_p4', # this, 'channel-1::openssl-1.0.1c-0', @@ -1054,7 +1055,7 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) index2 = index.copy() pandas = PackageRecord(**{ @@ -1110,7 +1111,7 @@ def test_no_features(): # of the specs directly have mkl versions) result = r2.solve(['pandas 0.12.0 np16py27_0', 'python 2.7*'], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1123,11 +1124,11 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) result = r2.solve(['pandas 0.12.0 np16py27_0', 'python 2.7*', MatchSpec(track_features='mkl')], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::mkl-rt-11.0-p0', # This 'channel-1::numpy-1.6.2-py27_p5', # and this are different. @@ -1141,13 +1142,13 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_broken_install(): installed = r.install(['pandas', 'python 2.7*', 'numpy 1.6*']) _installed = [rec.dist_str() for rec in installed] - assert _installed == [ + assert _installed == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1161,7 +1162,7 @@ def test_broken_install(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # Add an incompatible numpy; installation should be untouched installed1 = list(installed) @@ -1210,7 +1211,7 @@ def test_pip_depends_removed_on_inconsistent_env(): def test_remove(): installed = r.install(['pandas', 'python 2.7*']) _installed = [rec.dist_str() for rec in installed] - assert _installed == [ + assert _installed == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1224,11 +1225,11 @@ def test_remove(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) result = r.remove(['pandas'], installed=installed) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1241,12 +1242,12 @@ def test_remove(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # Pandas requires numpy result = r.remove(['numpy'], installed=installed) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::openssl-1.0.1c-0', 'channel-1::python-2.7.5-0', @@ -1257,7 +1258,7 @@ def test_remove(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_channel_priority_1(): @@ -1327,7 +1328,7 @@ def test_channel_priority_2(): eqc, eqv, eqb, eqa, eqt = r2.generate_version_metrics(C, list(r2.groups.keys())) eqc = {key: value for key, value in iteritems(eqc)} pprint(eqc) - assert eqc == { + assert eqc == add_subdir_to_iter({ 'channel-4::mkl-2017.0.4-h4c4d0af_0': 1, 'channel-4::mkl-2018.0.0-hb491cac_4': 1, 'channel-4::mkl-2018.0.1-h19d6760_4': 1, @@ -1451,10 +1452,10 @@ def test_channel_priority_2(): 'channel-4::tk-8.6.7-hc745277_3': 1, 'channel-4::zlib-1.2.11-ha838bed_2': 1, 'channel-4::zlib-1.2.11-hfbfcf68_1': 1, - } + }) installed_w_priority = [prec.dist_str() for prec in this_r.install(spec)] pprint(installed_w_priority) - assert installed_w_priority == [ + assert installed_w_priority == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1468,7 +1469,7 @@ def test_channel_priority_2(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # setting strict actually doesn't do anything here; just ensures it's not 'disabled' with env_var("CONDA_CHANNEL_PRIORITY", "strict", stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1480,7 +1481,7 @@ def test_channel_priority_2(): eqc = {key: value for key, value in iteritems(eqc)} assert eqc == {}, eqc installed_w_strict = [prec.dist_str() for prec in this_r.install(spec)] - assert installed_w_strict == [ + assert installed_w_strict == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1494,7 +1495,7 @@ def test_channel_priority_2(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ], installed_w_strict + ]), installed_w_strict with env_var("CONDA_CHANNEL_PRIORITY", "False", stack_callback=conda_tests_ctxt_mgmt_def_pol): dists = this_r.get_reduced_index(spec) @@ -1503,7 +1504,7 @@ def test_channel_priority_2(): eqc, eqv, eqb, eqa, eqt = r2.generate_version_metrics(C, list(r2.groups.keys())) eqc = {key: value for key, value in iteritems(eqc)} pprint(eqc) - assert eqc == { + assert eqc == add_subdir_to_iter({ 'channel-1::dateutil-1.5-py27_0': 1, 'channel-1::mkl-10.3-0': 6, 'channel-1::mkl-10.3-p1': 6, @@ -1757,10 +1758,10 @@ def test_channel_priority_2(): 'channel-4::sqlite-3.21.0-h1bed415_2': 3, 'channel-4::sqlite-3.22.0-h1bed415_0': 2, 'channel-4::sqlite-3.23.1-he433501_0': 1, - } + }) installed_wo_priority = set([prec.dist_str() for prec in this_r.install(spec)]) pprint(installed_wo_priority) - assert installed_wo_priority == { + assert installed_wo_priority == add_subdir_to_iter({ 'channel-4::blas-1.0-mkl', 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::intel-openmp-2018.0.3-0', @@ -1785,7 +1786,7 @@ def test_channel_priority_2(): 'channel-4::sqlite-3.24.0-h84994c4_0', 'channel-4::tk-8.6.7-hc745277_3', 'channel-4::zlib-1.2.11-ha838bed_2', - } + }) def test_dependency_sort(): @@ -1794,7 +1795,7 @@ def test_dependency_sort(): must_have = {prec.name: prec for prec in installed} installed = r.dependency_sort(must_have) - results_should_be = [ + results_should_be = add_subdir_to_iter([ 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1808,7 +1809,7 @@ def test_dependency_sort(): 'channel-1::dateutil-2.1-py27_1', 'channel-1::scipy-0.12.0-np16py27_0', 'channel-1::pandas-0.11.0-np16py27_1' - ] + ]) assert len(installed) == len(results_should_be) assert [prec.dist_str() for prec in installed] == results_should_be @@ -1816,7 +1817,7 @@ def test_dependency_sort(): def test_update_deps(): installed = r.install(['python 2.7*', 'numpy 1.6*', 'pandas 0.10.1']) result = [rec.dist_str() for rec in installed] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1829,14 +1830,14 @@ def test_update_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # scipy, and pandas should all be updated here. pytz is a new # dependency of pandas. But numpy does not _need_ to be updated # to get the latest version of pandas, so it stays put. result = r.install(['pandas', 'python 2.7*'], installed=installed, update_deps=True, returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1850,13 +1851,13 @@ def test_update_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # pandas should be updated here. However, it's going to try to not update # scipy, so it won't be updated to the latest version (0.11.0). result = r.install(['pandas', 'python 2.7*'], installed=installed, update_deps=False, returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1869,7 +1870,7 @@ def test_update_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_surplus_features_1(): @@ -2048,6 +2049,51 @@ def test_get_reduced_index_broadening_preferred_solution(): assert d.version == '2.5', "bottom version should be 2.5, but is {}".format(d.version) +def test_arch_preferred_when_otherwise_identical_dependencies(): + index2 = index.copy() + package1_noarch = PackageRecord(**{ + "channel": "defaults", + "subdir": "noarch", + "md5": "0123456789", + "fn": "doesnt-matter-here", + 'build': '0', + 'build_number': 0, + 'depends': [], + 'name': 'package1', + 'requires': [], + 'version': '1.0', + }) + index2[package1_noarch] = package1_noarch + package1_linux64 = PackageRecord(**{ + "channel": "defaults", + "subdir": context.subdir, + "md5": "0123456789", + "fn": "doesnt-matter-here", + 'build': '0', + 'build_number': 0, + 'depends': [], + 'name': 'package1', + 'requires': [], + 'version': '1.0', + }) + index2[package1_linux64] = package1_linux64 + index2 = {key: value for key, value in iteritems(index2)} + r = Resolve(index2) + + matches = r.find_matches(MatchSpec('package1')) + assert len(matches) == 2 + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == { + 'defaults/noarch::package1-1.0-0', + add_subdir('defaults::package1-1.0-0') + } + + result = r.install(['package1']) + result = [rec.dist_str() for rec in result] + assert result == [ + add_subdir('defaults::package1-1.0-0'), + ] + + def test_arch_preferred_over_noarch_when_otherwise_equal(): index = ( PackageRecord(**{
conda 4.6.x and conda 4.7.x not able to resolve identical package in different subdirectories Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> The following happens: ``` [root@596ad8f0842a /]# conda create -n conda-env --dry-run -- test-package Collecting package metadata (current_repodata.json): done Solving environment: failed with current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed UnsatisfiableError: The following specifications were found to be incompatible with each other: Package pandas conflicts for: test-package -> pandas Package typing conflicts for: test-package -> typing Package libffi conflicts for: test-package -> libffi[version='>=3.2.1,<4.0a0'] Package pyyaml conflicts for: test-package -> pyyaml Package six conflicts for: test-package -> six[version='>=1.12.0'] Package py4j conflicts for: test-package -> py4j Package icu conflicts for: test-package -> icu Package wrapt conflicts for: test-package -> wrapt Package pytz conflicts for: test-package -> pytz Package python conflicts for: test-package -> python[version='>=2.7.14'] Package pyarrow conflicts for: test-package -> pyarrow Package matplotlib conflicts for: test-package -> matplotlib[version='>=2.0.2,<2.3.0'] ``` Also observed on conda 4.6.14 ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> 1. Create a conda repository `test-channel` with the following set up 2. In /linux-64/repodata.json ``` { "info": { "subdir": "linux-64" }, "packages": { "test-package-4.2.1-py_0.tar.bz2": { "build": "py_0", "build_number": 0, "depends": [ "icu", "libffi >=3.2.1,<4.0a0", "matplotlib >=2.0.2,<2.3.0", "pandas", "py4j", "pyarrow", "python >=2.7.14", "pytz", "pyyaml", "six >=1.12.0", "typing", "wrapt" ], "md5": "1512a7e9a56ecb8523475c891bfa6657", "name": "test-package", "noarch": "python", "sha256": "3c02f947500c13ceb8e8aa38db2af43e9017c4948905d0cbd1610185318fe7d9", "size": 30098, "subdir": "noarch", "timestamp": 1565634321434, "version": "4.2.1" } }, "removed": [], "repodata_version": 1 } ``` 3. In /noarch/repodata.json ``` { "info": { "subdir": "noarch" }, "packages": { "test-package-4.2.1-py_0.tar.bz2": { "build": "py_0", "build_number": 0, "depends": [ "icu", "libffi >=3.2.1,<4.0a0", "matplotlib >=2.0.2,<2.3.0", "pandas", "py4j", "pyarrow", "python >=2.7.14", "pytz", "pyyaml", "six >=1.12.0", "typing", "wrapt" ], "md5": "1512a7e9a56ecb8523475c891bfa6657", "name": "test-package", "noarch": "python", "sha256": "3c02f947500c13ceb8e8aa38db2af43e9017c4948905d0cbd1610185318fe7d9", "size": 30098, "subdir": "noarch", "timestamp": 1565634321434, "version": "4.2.1" } }, "removed": [], "repodata_version": 1 } ``` 3. Set up conda to only point to the test-channel, note I see this error on `--dry-run` so I did not populate the test-channel with the actual packages. 4. Run `conda create -n conda-env --dry-run -- test-package` ## Expected Behavior <!-- What do you think should happen? --> Previously, in conda 4.5.x, there was no issue with resolving packages like this. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` [root@596ad8f0842a /]# conda info active environment : None user config file : /root/.condarc populated config files : /root/.condarc /condarc conda version : 4.7.10 conda-build version : not installed python version : 3.7.3.final.0 virtual packages : base environment : /miniconda (writable) channel URLs : file://test-channel/asset/conda/linux-64 file://test-channel/asset/conda/noarch package cache : /miniconda/pkgs /root/.conda/pkgs envs directories : /miniconda/envs /root/.conda/envs platform : linux-64 user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Linux/4.9.184-linuxkit centos/6.10 glibc/2.12 UID:GID : 0:0 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` [root@596ad8f0842a /]# conda config --show-sources ==> /root/.condarc <== channel_priority: disabled channels: - file://test-channel/asset/conda/ repodata_fns: - repodata.json use_only_tar_bz2: False ==> /condarc <== channels: [] default_channels: [] ``` </p></details> Note I attempted to remove current_repodata.json from being considered, but this is 4.7.10 before the config value is apparently respected. <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` [root@596ad8f0842a /]# conda list --show-channel-urls # packages in environment at /miniconda: # # Name Version Build Channel _libgcc_mutex 0.1 main https://repo.anaconda.com/pkgs/main asn1crypto 0.24.0 py37_0 https://repo.anaconda.com/pkgs/main bzip2 1.0.8 h7b6447c_0 https://repo.anaconda.com/pkgs/main ca-certificates 2019.5.15 0 https://repo.anaconda.com/pkgs/main certifi 2019.6.16 py37_0 https://repo.anaconda.com/pkgs/main cffi 1.12.3 py37h2e261b9_0 https://repo.anaconda.com/pkgs/main chardet 3.0.4 py37_1 https://repo.anaconda.com/pkgs/main conda 4.7.10 py37_0 https://repo.anaconda.com/pkgs/main conda-package-handling 1.3.11 py37_0 https://repo.anaconda.com/pkgs/main cryptography 2.7 py37h1ba5d50_0 https://repo.anaconda.com/pkgs/main idna 2.8 py37_0 https://repo.anaconda.com/pkgs/main libarchive 3.3.3 h5d8350f_5 https://repo.anaconda.com/pkgs/main libedit 3.1.20181209 hc058e9b_0 https://repo.anaconda.com/pkgs/main libffi 3.2.1 hd88cf55_4 https://repo.anaconda.com/pkgs/main libgcc-ng 9.1.0 hdf63c60_0 https://repo.anaconda.com/pkgs/main libstdcxx-ng 9.1.0 hdf63c60_0 https://repo.anaconda.com/pkgs/main libxml2 2.9.9 hea5a465_1 https://repo.anaconda.com/pkgs/main lz4-c 1.8.1.2 h14c3975_0 https://repo.anaconda.com/pkgs/main lzo 2.10 h49e0be7_2 https://repo.anaconda.com/pkgs/main ncurses 6.1 he6710b0_1 https://repo.anaconda.com/pkgs/main openssl 1.1.1c h7b6447c_1 https://repo.anaconda.com/pkgs/main pip 19.1.1 py37_0 https://repo.anaconda.com/pkgs/main pycosat 0.6.3 py37h14c3975_0 https://repo.anaconda.com/pkgs/main pycparser 2.19 py37_0 https://repo.anaconda.com/pkgs/main pyopenssl 19.0.0 py37_0 https://repo.anaconda.com/pkgs/main pysocks 1.7.0 py37_0 https://repo.anaconda.com/pkgs/main python 3.7.3 h0371630_0 https://repo.anaconda.com/pkgs/main python-libarchive-c 2.8 py37_11 https://repo.anaconda.com/pkgs/main readline 7.0 h7b6447c_5 https://repo.anaconda.com/pkgs/main requests 2.22.0 py37_0 https://repo.anaconda.com/pkgs/main ruamel_yaml 0.15.46 py37h14c3975_0 https://repo.anaconda.com/pkgs/main setuptools 41.0.1 py37_0 https://repo.anaconda.com/pkgs/main six 1.12.0 py37_0 https://repo.anaconda.com/pkgs/main sqlite 3.29.0 h7b6447c_0 https://repo.anaconda.com/pkgs/main tk 8.6.8 hbc83047_0 https://repo.anaconda.com/pkgs/main tqdm 4.32.1 py_0 https://repo.anaconda.com/pkgs/main urllib3 1.24.2 py37_0 https://repo.anaconda.com/pkgs/main wheel 0.33.4 py37_0 https://repo.anaconda.com/pkgs/main xz 5.2.4 h14c3975_4 https://repo.anaconda.com/pkgs/main yaml 0.1.7 had09818_2 https://repo.anaconda.com/pkgs/main zlib 1.2.11 h7b6447c_3 https://repo.anaconda.com/pkgs/main zstd 1.3.7 h0b5b093_0 https://repo.anaconda.com/pkgs/main ``` </p></details>
Key question: is this expected behavior for packages that have an identical noarch and linux-64 builds? Additional note: if I remove the repodata entry for either `linux-64` or `noarch` subdir, but not the other, then the command succeeds This is likely similar to #8302 which was partially fixed in #8938. Packages from different subdirs with the same name will also have the same channel which causes conda to consider than as the same package. For the time being it is best to not have packages with identical names in `noarch` and another subdir. This is not the intended behavior, the solver should treat these are two separate packages. To add a data point, I'm seeing this on another `conda create` but this time it doesn't seem to be an issue with any packages that I can control, but somewhere in public channels. Is there a suggested way to narrow down where this is coming from? @jjhelmus do you have any initial thoughts on how to fix the issue within conda? Happy to take a stab at contributing and testing a patch for this edge case.
2019-09-19T18:10:39Z
[]
[]
conda/conda
9,385
conda__conda-9385
[ "8028" ]
216b1c126b0f460694f9f97edc4fafcd4ecf472b
diff --git a/conda/core/subdir_data.py b/conda/core/subdir_data.py --- a/conda/core/subdir_data.py +++ b/conda/core/subdir_data.py @@ -22,12 +22,13 @@ from .. import CondaError from .._vendor.auxlib.ish import dals from .._vendor.auxlib.logz import stringify -from .._vendor.toolz import concat, take +from .._vendor.boltons.setutils import IndexedSet +from .._vendor.toolz import concat, take, groupby from ..base.constants import CONDA_HOMEPAGE_URL, CONDA_PACKAGE_EXTENSION_V1, REPODATA_FN from ..base.context import context from ..common.compat import (ensure_binary, ensure_text_type, ensure_unicode, iteritems, iterkeys, string_types, text_type, with_metaclass) -from ..common.io import ThreadLimitedThreadPoolExecutor, DummyExecutor +from ..common.io import ThreadLimitedThreadPoolExecutor, DummyExecutor, dashlist from ..common.url import join_url, maybe_unquote from ..core.package_cache_data import PackageCacheData from ..exceptions import (CondaDependencyError, CondaHTTPError, CondaUpgradeError, @@ -85,6 +86,13 @@ def query_all(package_ref_or_match_spec, channels=None, subdirs=None, if subdirs is None: subdirs = context.subdirs channel_urls = all_channel_urls(channels, subdirs=subdirs) + if context.offline: + grouped_urls = groupby(lambda url: url.startswith('file://'), channel_urls) + ignored_urls = grouped_urls.get(False, ()) + if ignored_urls: + log.info("Ignoring the following channel urls because mode is offline.%s", + dashlist(ignored_urls)) + channel_urls = IndexedSet(grouped_urls.get(True, ())) check_whitelist(channel_urls) subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query( package_ref_or_match_spec))
diff --git a/tests/core/test_subdir_data.py b/tests/core/test_subdir_data.py --- a/tests/core/test_subdir_data.py +++ b/tests/core/test_subdir_data.py @@ -66,6 +66,14 @@ def test_get_index_no_platform_with_offline_cache(self): assert all(index3.get(k) == rec for k, rec in iteritems(index)) assert unknown or len(index) == len(index3) + def test_subdir_data_context_offline(self): + with env_var('CONDA_OFFLINE', 'yes', stack_callback=conda_tests_ctxt_mgmt_def_pol): + local_channel = Channel(join(dirname(__file__), "..", "data", "conda_format_repo", context.subdir)) + sd = SubdirData(channel=local_channel) + assert len(sd.query_all('zlib', channels=[local_channel])) > 0 + assert len(sd.query_all('zlib')) == 0 + assert len(sd.query_all('zlib')) > 1 + class StaticFunctionTests(TestCase):
conda install --offline still need net connection <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` Dear all, I want update anaconda in a offline mechine, I rsync /pkgs files and use commend, conda update --all --offline returns some errors: CondaError: RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/linux-64/blas-1.0-mkl.tar.bz2\nThis command is using a remote connection in offline mode.\n',) CondaError: RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/linux-64/blas-1.0-mkl.tar.bz2\nThis command is using a remote connection in offline mode.\n',) CondaError: RuntimeError('EnforceUnusedAdapter called with url https://repo.continuum.io/pkgs/free/linux-64/blas-1.0-mkl.tar.bz2\nThis command is using a remote connection in offline mode.\n',) here is detail log [log.txt](https://github.com/conda/conda/files/2665227/log.txt) Thanks. ``` ## Expected Behavior <!-- What do you think should happen? --> ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` Current conda install: platform : linux-64 conda version : 4.3.22 conda is private : False conda-env version : 4.3.22 conda-build version : 3.0.3 python version : 3.5.3.final.0 requests version : 2.14.2 root environment : /home/zhangji/python/anaconda3 (writable) default environment : /home/zhangji/python/anaconda3 envs directories : /home/zhangji/python/anaconda3/envs /home/zhangji/.conda/envs package cache : /home/zhangji/python/anaconda3/pkgs /home/zhangji/.conda/pkgs channel URLs : https://repo.continuum.io/pkgs/free/linux-64 https://repo.continuum.io/pkgs/free/noarch https://repo.continuum.io/pkgs/r/linux-64 https://repo.continuum.io/pkgs/r/noarch https://repo.continuum.io/pkgs/pro/linux-64 https://repo.continuum.io/pkgs/pro/noarch config file : None netrc file : None offline mode : False user-agent : conda/4.3.22 requests/2.14.2 CPython/3.5.3 Linux/2.6.32-504.el6.x86_64 CentOS/6.6 glibc/2.12 UID:GID : 526:507 ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at /home/zhangji/python/anaconda3: # _license 1.1 py35_1 defaults alabaster 0.7.10 py35_0 defaults anaconda custom py35_0 defaults anaconda-client 1.6.3 py35_0 defaults anaconda-navigator 1.6.3 py35_0 defaults anaconda-project 0.6.0 py35_0 defaults argcomplete 1.0.0 py35_1 defaults asn1crypto 0.22.0 py35_0 defaults astroid 1.4.9 py35_0 defaults astropy 2.0 np112py35_0 defaults babel 2.4.0 py35_0 defaults backports 1.0 py35_0 defaults beautifulsoup4 4.6.0 py35_0 defaults bitarray 0.8.1 py35_0 defaults bkcharts 0.2 py35_0 defaults blaze 0.10.1 py35_0 defaults bleach 1.5.0 py35_0 defaults bokeh 0.12.6 py35_0 defaults boto 2.47.0 py35_0 defaults bottleneck 1.2.1 np112py35_0 defaults Bratu3D 0.0.0 <pip> cairo 1.14.8 0 defaults cffi 1.10.0 py35_0 defaults chardet 3.0.4 py35_0 defaults chest 0.2.3 py35_0 defaults click 6.7 py35_0 defaults cloudpickle 0.2.2 py35_0 defaults clyent 1.2.2 py35_0 defaults colorama 0.3.9 py35_0 defaults conda 4.3.22 py35_0 defaults conda-build 3.0.3 py35_0 defaults conda-env 2.6.0 0 defaults conda-manager 0.4.0 py35_0 defaults conda-verify 2.0.0 py35_0 defaults configobj 5.0.6 py35_0 defaults contextlib2 0.5.5 py35_0 defaults cryptography 1.8.1 py35_0 defaults curl 7.52.1 0 defaults cycler 0.10.0 py35_0 defaults cython 0.25.2 py35_0 defaults cytoolz 0.8.2 py35_0 defaults dask 0.15.0 py35_0 defaults datashape 0.5.4 py35_0 defaults dbus 1.10.20 0 defaults decorator 4.0.11 py35_0 defaults dill 0.2.6 py35_0 defaults distributed 1.17.1 py35_0 defaults docutils 0.13.1 py35_0 defaults dynd-python 0.7.2 py35_0 defaults entrypoints 0.2.3 py35_0 defaults et_xmlfile 1.0.1 py35_0 defaults evtk 1.0.0 <pip> expat 2.1.0 0 defaults fastcache 1.0.2 py35_1 defaults filelock 2.0.7 py35_0 defaults flask 0.12.2 py35_0 defaults flask-cors 3.0.2 py35_0 defaults fontconfig 2.12.1 3 defaults freetype 2.5.5 2 defaults get_terminal_size 1.0.0 py35_0 defaults gevent 1.2.2 py35_0 defaults glib 2.50.2 1 defaults glob2 0.5 py35_0 defaults greenlet 0.4.12 py35_0 defaults gst-plugins-base 1.8.0 0 defaults gstreamer 1.8.0 0 defaults h5py 2.7.0 np112py35_0 defaults harfbuzz 0.9.39 2 defaults hdf5 1.8.17 2 defaults heapdict 1.0.0 py35_1 defaults html5lib 0.999 py35_0 defaults icu 54.1 0 defaults idna 2.5 py35_0 defaults imagesize 0.7.1 py35_0 defaults ipykernel 4.6.1 py35_0 defaults ipython 6.1.0 py35_0 defaults ipython_genutils 0.2.0 py35_0 defaults ipywidgets 6.0.0 py35_0 defaults isort 4.2.15 py35_0 defaults itsdangerous 0.24 py35_0 defaults jbig 2.1 0 defaults jdcal 1.3 py35_0 defaults jedi 0.10.2 py35_2 defaults jinja2 2.9.6 py35_0 defaults joblib 0.11 <pip> jpeg 9b 0 defaults jsonschema 2.6.0 py35_0 defaults jupyter 1.0.0 py35_3 defaults jupyter_client 5.1.0 py35_0 defaults jupyter_console 5.1.0 py35_0 defaults jupyter_core 4.3.0 py35_0 defaults lazy-object-proxy 1.3.1 py35_0 defaults libdynd 0.7.2 0 defaults libffi 3.2.1 1 defaults libgcc 5.2.0 0 defaults libgfortran 3.0.0 1 defaults libiconv 1.14 0 defaults libpng 1.6.27 0 defaults libprotobuf 3.2.0 0 defaults libsodium 1.0.10 0 defaults libtiff 4.0.6 3 defaults libtool 2.4.2 0 defaults libxcb 1.12 1 defaults libxml2 2.9.4 0 defaults libxslt 1.1.29 0 defaults llvmlite 0.18.0 py35_0 defaults locket 0.2.0 py35_1 defaults lxml 3.8.0 py35_0 defaults markupsafe 0.23 py35_2 defaults matplotlib 2.0.2 np112py35_0 defaults mistune 0.7.4 py35_0 defaults mkl 2017.0.3 0 defaults mkl-service 1.1.2 py35_3 defaults mpi4py 2.0.0 <pip> mpmath 0.19 py35_1 defaults msgpack-python 0.4.8 py35_0 defaults multipledispatch 0.4.9 py35_0 defaults navigator-updater 0.1.0 py35_0 defaults nbconvert 5.2.1 py35_0 defaults nbformat 4.3.0 py35_0 defaults networkx 1.11 py35_0 defaults nltk 3.2.4 py35_0 defaults nose 1.3.7 py35_1 defaults notebook 5.0.0 py35_0 defaults numba 0.33.0 np112py35_0 defaults numexpr 2.6.2 np112py35_0 defaults numpy 1.12.1 py35_0 defaults numpydoc 0.6.0 py35_0 defaults odo 0.5.0 py35_1 defaults olefile 0.44 py35_0 defaults openpyxl 2.4.7 py35_0 defaults openssl 1.0.2l 0 defaults packaging 16.8 py35_0 defaults pandas 0.20.2 np112py35_0 defaults pandocfilters 1.4.1 py35_0 defaults pango 1.40.3 1 defaults partd 0.3.8 py35_0 defaults patchelf 0.9 0 defaults path.py 10.3.1 py35_0 defaults pathlib2 2.2.1 py35_0 defaults patsy 0.4.1 py35_0 defaults pcre 8.39 1 defaults pep8 1.7.0 py35_0 defaults petsc4py 3.7.0 <pip> pexpect 4.2.1 py35_0 defaults pickleshare 0.7.4 py35_0 defaults pillow 4.2.1 py35_0 defaults pip 9.0.1 py35_1 defaults pixman 0.34.0 0 defaults pkginfo 1.4.1 py35_0 defaults ply 3.10 py35_0 defaults prompt_toolkit 1.0.14 py35_0 defaults protobuf 3.2.0 py35_0 defaults psutil 5.2.2 py35_0 defaults ptyprocess 0.5.1 py35_0 defaults py 1.4.34 py35_0 defaults pyasn1 0.2.3 py35_0 defaults pycosat 0.6.2 py35_0 defaults pycparser 2.17 py35_0 defaults pycrypto 2.6.1 py35_6 defaults pycurl 7.43.0 py35_2 defaults pyflakes 1.5.0 py35_0 defaults pygments 2.2.0 py35_0 defaults pylint 1.6.4 py35_1 defaults pyodbc 4.0.17 py35_0 defaults pyopenssl 17.0.0 py35_0 defaults pyparsing 2.1.4 py35_0 defaults pyqt 5.6.0 py35_2 defaults pytables 3.3.0 np112py35_0 defaults pytest 3.1.2 py35_0 defaults python 3.5.3 1 defaults python-dateutil 2.6.0 py35_0 defaults pytz 2017.2 py35_0 defaults PyVTK 0.5.18 <pip> pywavelets 0.5.2 np112py35_0 defaults pyyaml 3.12 py35_0 defaults pyzmq 16.0.2 py35_0 defaults qt 5.6.2 4 defaults qtawesome 0.4.4 py35_0 defaults qtconsole 4.3.0 py35_0 defaults qtpy 1.2.1 py35_0 defaults readline 6.2 2 defaults redis 3.2.0 0 defaults redis-py 2.10.5 py35_0 defaults requests 2.14.2 py35_0 defaults rope 0.9.4 py35_1 defaults ruamel_yaml 0.11.14 py35_1 defaults scikit-image 0.13.0 np112py35_0 defaults scikit-learn 0.18.2 np112py35_0 defaults scipy 0.19.1 np112py35_0 defaults seaborn 0.7.1 py35_0 defaults setuptools 27.2.0 py35_0 defaults simplegeneric 0.8.1 py35_1 defaults singledispatch 3.4.0.3 py35_0 defaults sip 4.18 py35_0 defaults six 1.10.0 py35_0 defaults snowballstemmer 1.2.1 py35_0 defaults sockjs-tornado 1.0.3 py35_0 defaults sortedcollections 0.5.3 py35_0 defaults sortedcontainers 1.5.7 py35_0 defaults sphinx 1.6.2 py35_0 defaults sphinx_rtd_theme 0.2.4 py35_0 defaults sphinxcontrib 1.0 py35_0 defaults sphinxcontrib-websupport 1.0.1 py35_0 defaults spyder 3.1.4 py35_0 defaults sqlalchemy 1.1.11 py35_0 defaults sqlite 3.13.0 0 defaults statsmodels 0.8.0 np112py35_0 defaults sympy 1.1 py35_0 defaults tblib 1.3.2 py35_0 defaults tensorflow 1.1.0 np112py35_0 defaults terminado 0.6 py35_0 defaults testpath 0.3.1 py35_0 defaults tk 8.5.18 0 defaults toolz 0.8.2 py35_0 defaults tornado 4.5.1 py35_0 defaults tqdm 4.14.0 <pip> traitlets 4.3.2 py35_0 defaults unicodecsv 0.14.1 py35_0 defaults unixodbc 2.3.4 0 defaults util-linux 2.21 0 defaults wcwidth 0.1.7 py35_0 defaults werkzeug 0.12.2 py35_0 defaults wheel 0.29.0 py35_0 defaults widgetsnbextension 2.0.0 py35_0 defaults wrapt 1.10.10 py35_0 defaults xlrd 1.0.0 py35_0 defaults xlsxwriter 0.9.6 py35_0 defaults xlwt 1.2.0 py35_0 defaults xz 5.2.2 1 defaults yaml 0.1.6 0 defaults zeromq 4.1.5 0 defaults zict 0.1.2 py35_0 defaults zlib 1.2.8 3 defaults ``` </p></details>
Your problem sounds like https://github.com/conda/conda/issues/5370. Your log indicates that you are using conda 4.3.22. #5370 was fixed in the 4.4 version of conda. This issue still seems to have reappeared in 4.7.11. `conda create --offline -n test numpy` ``` Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/rkeith/anaconda3/envs/test added / updated specs: - numpy The following packages will be downloaded: package | build ---------------------------|----------------- _libgcc_mutex-0.1 | main 3 KB blas-1.0 | mkl 6 KB intel-openmp-2019.4 | 243 729 KB libedit-3.1.20181209 | hc058e9b_0 163 KB libffi-3.2.1 | hd88cf55_4 40 KB libgcc-ng-9.1.0 | hdf63c60_0 5.1 MB libgfortran-ng-7.3.0 | hdf63c60_0 1006 KB libstdcxx-ng-9.1.0 | hdf63c60_0 3.1 MB mkl-2019.4 | 243 131.2 MB mkl-service-2.0.2 | py37h7b6447c_0 65 KB mkl_random-1.0.2 | py37hd81dba3_0 361 KB ncurses-6.1 | he6710b0_1 777 KB numpy-1.16.4 | py37h7e9f1db_0 48 KB numpy-base-1.16.4 | py37hde5b4d6_0 3.5 MB openssl-1.1.1c | h7b6447c_1 2.5 MB readline-7.0 | h7b6447c_5 324 KB setuptools-41.0.1 | py37_0 506 KB six-1.12.0 | py37_0 23 KB tk-8.6.8 | hbc83047_0 2.8 MB wheel-0.33.4 | py37_0 41 KB xz-5.2.4 | h14c3975_4 283 KB zlib-1.2.11 | h7b6447c_3 103 KB ------------------------------------------------------------ Total: 152.6 MB The following NEW packages will be INSTALLED: _libgcc_mutex pkgs/main/linux-64::_libgcc_mutex-0.1-main blas pkgs/main/linux-64::blas-1.0-mkl ca-certificates pkgs/main/linux-64::ca-certificates-2019.5.15-1 certifi pkgs/main/linux-64::certifi-2019.6.16-py37_1 intel-openmp pkgs/main/linux-64::intel-openmp-2019.4-243 libedit pkgs/main/linux-64::libedit-3.1.20181209-hc058e9b_0 libffi pkgs/main/linux-64::libffi-3.2.1-hd88cf55_4 libgcc-ng pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0 libgfortran-ng pkgs/main/linux-64::libgfortran-ng-7.3.0-hdf63c60_0 libstdcxx-ng pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0 mkl pkgs/main/linux-64::mkl-2019.4-243 mkl-service pkgs/main/linux-64::mkl-service-2.0.2-py37h7b6447c_0 mkl_fft pkgs/main/linux-64::mkl_fft-1.0.14-py37ha843d7b_0 mkl_random pkgs/main/linux-64::mkl_random-1.0.2-py37hd81dba3_0 ncurses pkgs/main/linux-64::ncurses-6.1-he6710b0_1 numpy pkgs/main/linux-64::numpy-1.16.4-py37h7e9f1db_0 numpy-base pkgs/main/linux-64::numpy-base-1.16.4-py37hde5b4d6_0 openssl pkgs/main/linux-64::openssl-1.1.1c-h7b6447c_1 pip pkgs/main/linux-64::pip-19.2.2-py37_0 python pkgs/main/linux-64::python-3.7.4-h265db76_1 readline pkgs/main/linux-64::readline-7.0-h7b6447c_5 setuptools pkgs/main/linux-64::setuptools-41.0.1-py37_0 six pkgs/main/linux-64::six-1.12.0-py37_0 sqlite pkgs/main/linux-64::sqlite-3.29.0-h7b6447c_0 tk pkgs/main/linux-64::tk-8.6.8-hbc83047_0 wheel pkgs/main/linux-64::wheel-0.33.4-py37_0 xz pkgs/main/linux-64::xz-5.2.4-h14c3975_4 zlib pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3 Proceed ([y]/n)? y Downloading and Extracting Packages libgcc-ng-9.1.0 | 5.1 MB | | 0% blas-1.0 | 6 KB | | 0% libstdcxx-ng-9.1.0 | 3.1 MB | | 0% libffi-3.2.1 | 40 KB | | 0% wheel-0.33.4 | 41 KB | | 0% mkl-service-2.0.2 | 65 KB | | 0% tk-8.6.8 | 2.8 MB | | 0% intel-openmp-2019.4 | 729 KB | | 0% numpy-base-1.16.4 | 3.5 MB | | 0% six-1.12.0 | 23 KB | | 0% setuptools-41.0.1 | 506 KB | | 0% readline-7.0 | 324 KB | | 0% libedit-3.1.20181209 | 163 KB | | 0% xz-5.2.4 | 283 KB | | 0% mkl_random-1.0.2 | 361 KB | | 0% _libgcc_mutex-0.1 | 3 KB | | 0% mkl-2019.4 | 131.2 MB | | 0% ncurses-6.1 | 777 KB | | 0% openssl-1.1.1c | 2.5 MB | | 0% numpy-1.16.4 | 48 KB | | 0% libgfortran-ng-7.3.0 | 1006 KB | | 0% zlib-1.2.11 | 103 KB | | 0% RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/libgcc-ng-9.1.0-hdf63c60_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/blas-1.0-mkl.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/libstdcxx-ng-9.1.0-hdf63c60_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/libffi-3.2.1-hd88cf55_4.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/wheel-0.33.4-py37_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/mkl-service-2.0.2-py37h7b6447c_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/tk-8.6.8-hbc83047_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/intel-openmp-2019.4-243.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/numpy-base-1.16.4-py37hde5b4d6_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/six-1.12.0-py37_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/setuptools-41.0.1-py37_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/readline-7.0-h7b6447c_5.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/libedit-3.1.20181209-hc058e9b_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/xz-5.2.4-h14c3975_4.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/mkl_random-1.0.2-py37hd81dba3_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/_libgcc_mutex-0.1-main.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/mkl-2019.4-243.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/ncurses-6.1-he6710b0_1.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/openssl-1.1.1c-h7b6447c_1.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/numpy-1.16.4-py37h7e9f1db_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/libgfortran-ng-7.3.0-hdf63c60_0.conda\nThis command is using a remote connection in offline mode.\n') RuntimeError('EnforceUnusedAdapter called with url https://repo.anaconda.com/pkgs/main/linux-64/zlib-1.2.11-h7b6447c_3.conda\nThis command is using a remote connection in offline mode.\n') ``` Here is my conda info: `conda info` ``` active environment : base active env location : /home/rkeith/anaconda3 shell level : 2 conda version : 4.7.11 conda-build version : 3.18.9 python version : 3.7.4.final.0 virtual packages : __cuda=9.1 base environment : /home/rkeith/anaconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/rkeith/anaconda3/pkgs envs directories : /home/rkeith/anaconda3/envs platform : linux-64 user-agent : conda/4.7.11 requests/2.22.0 CPython/3.7.4 Linux/4.15.0-58-generic ubuntu/16.04.6 glibc/2.23 netrc file : None offline mode : False ```
2019-10-29T17:01:41Z
[]
[]
conda/conda
9,418
conda__conda-9418
[ "9116" ]
89d91d639ac661e71af1fdf640c06390cc7df688
diff --git a/conda/models/match_spec.py b/conda/models/match_spec.py --- a/conda/models/match_spec.py +++ b/conda/models/match_spec.py @@ -181,8 +181,16 @@ def from_dist_str(cls, dist_str): if dist_str.endswith(CONDA_PACKAGE_EXTENSION_V1): dist_str = dist_str[:-len(CONDA_PACKAGE_EXTENSION_V1)] if '::' in dist_str: - channel_str, dist_str = dist_str.split("::", 1) - parts['channel'] = channel_str + channel_subdir_str, dist_str = dist_str.split("::", 1) + if '/' in channel_subdir_str: + channel_str, subdir = channel_subdir_str.split('/', 2) + parts.update({ + 'channel': channel_str, + 'subdir': subdir, + }) + else: + parts['channel'] = channel_subdir_str + name, version, build = dist_str.rsplit('-', 2) parts.update({ 'name': name, diff --git a/conda/models/records.py b/conda/models/records.py --- a/conda/models/records.py +++ b/conda/models/records.py @@ -280,7 +280,12 @@ def __eq__(self, other): return self._pkey == other._pkey def dist_str(self): - return "%s::%s-%s-%s" % (self.channel.canonical_name, self.name, self.version, self.build) + return "%s%s::%s-%s-%s" % ( + self.channel.canonical_name, + ("/" + self.subdir) if self.subdir else "", + self.name, + self.version, + self.build) def dist_fields_dump(self): return {
diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -25,7 +25,7 @@ from conda.models.records import PrefixRecord from conda.models.enums import PackageType from conda.resolve import MatchSpec -from ..helpers import get_index_r_1, get_index_r_2, get_index_r_4, \ +from ..helpers import add_subdir_to_iter, get_index_r_1, get_index_r_2, get_index_r_4, \ get_index_r_5, get_index_cuda, get_index_must_unfreeze from conda.common.compat import iteritems, on_win @@ -154,7 +154,7 @@ def test_solve_1(tmpdir): with get_solver(tmpdir, specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -163,7 +163,7 @@ def test_solve_1(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-3.3.2-0', 'channel-1::numpy-1.7.1-py33_0', - ) + )) assert convert_to_dist_str(final_state) == order specs_to_add = MatchSpec("python=2"), @@ -171,7 +171,7 @@ def test_solve_1(tmpdir): prefix_records=final_state, history_specs=specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -180,7 +180,7 @@ def test_solve_1(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numpy-1.7.1-py27_0', - ) + )) assert convert_to_dist_str(final_state) == order @@ -190,7 +190,7 @@ def test_solve_2(tmpdir): with get_solver_aggregate_1(tmpdir, specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', @@ -200,7 +200,7 @@ def test_solve_2(tmpdir): 'channel-2::zlib-1.2.11-0', 'channel-2::python-3.6.2-0', 'channel-2::numpy-1.13.1-py36_0' - ) + )) assert convert_to_dist_str(final_state) == order specs_to_add = MatchSpec("channel-4::numpy"), @@ -242,9 +242,9 @@ def test_cuda_1(tmpdir): with get_solver_cuda(tmpdir, specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::cudatoolkit-9.0-0', - ) + )) assert convert_to_dist_str(final_state) == order @@ -255,9 +255,9 @@ def test_cuda_2(tmpdir): with get_solver_cuda(tmpdir, specs) as solver: final_state = solver.solve_final_state() # print(convert_to_dist_str(final_state)) - order = ( + order = add_subdir_to_iter(( 'channel-1::cudatoolkit-10.0-0', - ) + )) assert convert_to_dist_str(final_state) == order @@ -298,7 +298,7 @@ def test_prune_1(tmpdir): with get_solver(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::libnvvm-1.0-p0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::openssl-1.0.1c-0', @@ -321,7 +321,7 @@ def test_prune_1(tmpdir): 'channel-1::scikit-learn-0.13.1-np16py27_p0', 'channel-1::mkl-11.0-np16py27_p0', 'channel-1::accelerate-1.1.0-np16py27_p0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_remove = MatchSpec("numbapro"), @@ -330,7 +330,7 @@ def test_prune_1(tmpdir): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-1::accelerate-1.1.0-np16py27_p0', 'channel-1::mkl-11.0-np16py27_p0', 'channel-1::scikit-learn-0.13.1-np16py27_p0', @@ -346,10 +346,10 @@ def test_prune_1(tmpdir): 'channel-1::llvm-3.2-0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::libnvvm-1.0-p0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-1::numpy-1.6.2-py27_4', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -360,7 +360,7 @@ def test_force_remove_1(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -369,7 +369,7 @@ def test_force_remove_1(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numpy-1.7.1-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order # without force_remove, taking out python takes out everything that depends on it, too, @@ -382,10 +382,9 @@ def test_force_remove_1(tmpdir): print(convert_to_dist_str(final_state_2)) # openssl remains because it is in the aggressive_update_packages set, # but everything else gets removed - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', - - ) + )) assert convert_to_dist_str(final_state_2) == order # with force remove, we remove only the explicit specs that we provide @@ -396,7 +395,7 @@ def test_force_remove_1(tmpdir): final_state_2 = solver.solve_final_state(force_remove=True) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', @@ -404,7 +403,7 @@ def test_force_remove_1(tmpdir): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ) + )) assert convert_to_dist_str(final_state_2) == order # re-solving restores order @@ -412,7 +411,7 @@ def test_force_remove_1(tmpdir): final_state_3 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -421,7 +420,7 @@ def test_force_remove_1(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numpy-1.7.1-py27_0' - ) + )) assert convert_to_dist_str(final_state_3) == order @@ -431,7 +430,7 @@ def test_no_deps_1(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -439,7 +438,7 @@ def test_no_deps_1(tmpdir): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("numba"), @@ -447,7 +446,7 @@ def test_no_deps_1(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -460,7 +459,7 @@ def test_no_deps_1(tmpdir): 'channel-1::meta-0.4.2.dev-py27_0', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::numba-0.8.1-np17py27_0' - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("numba"), @@ -468,7 +467,7 @@ def test_no_deps_1(tmpdir): final_state_2 = solver.solve_final_state(deps_modifier='NO_DEPS') # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -477,7 +476,7 @@ def test_no_deps_1(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', 'channel-1::numba-0.8.1-np17py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -487,7 +486,7 @@ def test_only_deps_1(tmpdir): final_state_1 = solver.solve_final_state(deps_modifier=DepsModifier.ONLY_DEPS) # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -499,7 +498,7 @@ def test_only_deps_1(tmpdir): 'channel-1::llvmpy-0.11.2-py27_0', 'channel-1::meta-0.4.2.dev-py27_0', 'channel-1::numpy-1.7.1-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order @@ -509,7 +508,7 @@ def test_only_deps_2(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -518,7 +517,7 @@ def test_only_deps_2(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.3-7', 'channel-1::numpy-1.5.1-py27_4', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("numba=0.5"), @@ -526,7 +525,7 @@ def test_only_deps_2(tmpdir): final_state_2 = solver.solve_final_state(deps_modifier=DepsModifier.ONLY_DEPS) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -540,7 +539,7 @@ def test_only_deps_2(tmpdir): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # 'channel-1::numba-0.5.0-np17py27_0', # not in the order because only_deps - ) + )) assert convert_to_dist_str(final_state_2) == order # fails because numpy=1.5 is in our history as an explicit spec @@ -554,7 +553,7 @@ def test_only_deps_2(tmpdir): final_state_2 = solver.solve_final_state(deps_modifier=DepsModifier.ONLY_DEPS) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -568,7 +567,7 @@ def test_only_deps_2(tmpdir): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # 'channel-1::numba-0.5.0-np17py27_0', # not in the order because only_deps - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -578,7 +577,7 @@ def test_update_all_1(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -587,7 +586,7 @@ def test_update_all_1(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.6.8-6', 'channel-1::numpy-1.5.1-py26_4', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("numba=0.6"), MatchSpec("numpy") @@ -595,7 +594,7 @@ def test_update_all_1(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -608,7 +607,7 @@ def test_update_all_1(tmpdir): 'channel-1::nose-1.3.0-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.6.0-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("numba=0.6"), @@ -616,7 +615,7 @@ def test_update_all_1(tmpdir): final_state_2 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_ALL) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -629,7 +628,7 @@ def test_update_all_1(tmpdir): 'channel-1::nose-1.3.0-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.6.0-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -639,7 +638,7 @@ def test_broken_install(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order_original = ( + order_original = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -653,7 +652,7 @@ def test_broken_install(tmpdir): 'channel-1::dateutil-2.1-py27_1', 'channel-1::scipy-0.12.0-np16py27_0', 'channel-1::pandas-0.11.0-np16py27_1', - ) + )) assert convert_to_dist_str(final_state_1) == order_original assert solver._r.environment_is_consistent(final_state_1) @@ -669,7 +668,7 @@ def test_broken_install(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( "channel-1::numpy-1.7.1-py33_p0", 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', @@ -686,7 +685,7 @@ def test_broken_install(tmpdir): 'channel-1::dateutil-2.1-py27_1', 'channel-1::flask-0.9-py27_0', 'channel-1::pandas-0.11.0-np16py27_1' - ) + )) assert convert_to_dist_str(final_state_2) == order assert not solver._r.environment_is_consistent(final_state_2) @@ -696,7 +695,7 @@ def test_broken_install(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -713,7 +712,7 @@ def test_broken_install(tmpdir): 'channel-1::flask-0.9-py27_0', 'channel-1::scipy-0.12.0-np16py27_0', 'channel-1::pandas-0.11.0-np16py27_1', - ) + )) assert convert_to_dist_str(final_state_2) == order assert solver._r.environment_is_consistent(final_state_2) @@ -731,7 +730,7 @@ def test_conda_downgrade(tmpdir): with get_solver_aggregate_1(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-2::conda-env-2.6.0-0', 'channel-2::libffi-3.2.1-1', @@ -774,7 +773,7 @@ def test_conda_downgrade(tmpdir): 'channel-4::requests-2.19.1-py37_0', 'channel-4::conda-4.5.10-py37_0', 'channel-4::conda-build-3.12.1-py37_0' - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("itsdangerous"), # MatchSpec("conda"), @@ -789,9 +788,9 @@ def test_conda_downgrade(tmpdir): unlink_order = ( # no conda downgrade ) - link_order = ( + link_order = add_subdir_to_iter(( 'channel-2::itsdangerous-0.24-py_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -810,7 +809,7 @@ def test_conda_downgrade(tmpdir): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( # now conda gets downgraded 'channel-4::conda-build-3.12.1-py37_0', 'channel-4::conda-4.5.10-py37_0', @@ -847,8 +846,8 @@ def test_conda_downgrade(tmpdir): 'channel-4::tk-8.6.7-hc745277_3', 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::ncurses-6.1-hf484d3e_0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', 'channel-2::sqlite-3.13.0-0', @@ -882,7 +881,7 @@ def test_conda_downgrade(tmpdir): 'channel-2::pyopenssl-17.0.0-py36_0', 'channel-2::conda-4.3.30-py36h5d9f9f4_0', 'channel-4::conda-build-3.12.1-py36_0' - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order finally: @@ -906,23 +905,23 @@ def test_unfreeze_when_required(tmpdir): with get_solver_must_unfreeze(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-freeze::libbar-2.0-0', 'channel-freeze::libfoo-1.0-0', 'channel-freeze::foobar-1.0-0', 'channel-freeze::qux-1.0-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs = MatchSpec("foobar"), with get_solver_must_unfreeze(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-freeze::libbar-2.0-0', 'channel-freeze::libfoo-2.0-0', 'channel-freeze::foobar-2.0-0', - ) + )) assert convert_to_dist_str(final_state_1) == order # When frozen there is no solution - but conda tries really hard to not freeze things that conflict @@ -937,12 +936,12 @@ def test_unfreeze_when_required(tmpdir): final_state_2 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_SPECS) # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-freeze::libbar-2.0-0', 'channel-freeze::libfoo-1.0-0', 'channel-freeze::foobar-1.0-0', 'channel-freeze::qux-1.0-0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -952,7 +951,7 @@ def test_auto_update_conda(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -963,7 +962,7 @@ def test_auto_update_conda(tmpdir): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "yes"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -972,7 +971,7 @@ def test_auto_update_conda(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -984,7 +983,7 @@ def test_auto_update_conda(tmpdir): 'channel-1::pytz-2013b-py27_0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order saved_sys_prefix = sys.prefix @@ -996,7 +995,7 @@ def test_auto_update_conda(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1008,7 +1007,7 @@ def test_auto_update_conda(tmpdir): 'channel-1::pytz-2013b-py27_0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.5.2-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "no"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1017,7 +1016,7 @@ def test_auto_update_conda(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1029,7 +1028,7 @@ def test_auto_update_conda(tmpdir): 'channel-1::pytz-2013b-py27_0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order finally: sys.prefix = saved_sys_prefix @@ -1041,7 +1040,7 @@ def test_explicit_conda_downgrade(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1052,7 +1051,7 @@ def test_explicit_conda_downgrade(tmpdir): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.5.2-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "yes"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1061,7 +1060,7 @@ def test_explicit_conda_downgrade(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1072,7 +1071,7 @@ def test_explicit_conda_downgrade(tmpdir): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order saved_sys_prefix = sys.prefix @@ -1084,7 +1083,7 @@ def test_explicit_conda_downgrade(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1095,7 +1094,7 @@ def test_explicit_conda_downgrade(tmpdir): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order with env_vars({"CONDA_AUTO_UPDATE_CONDA": "no"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1104,7 +1103,7 @@ def test_explicit_conda_downgrade(tmpdir): final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1115,7 +1114,7 @@ def test_explicit_conda_downgrade(tmpdir): 'channel-1::python-2.7.5-0', 'channel-1::pyyaml-3.10-py27_0', 'channel-1::conda-1.3.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order finally: sys.prefix = saved_sys_prefix @@ -1137,9 +1136,9 @@ def solve(prev_state, specs_to_add, order): with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": ""}, stack_callback=conda_tests_ctxt_mgmt_def_pol): base_state = solve( empty_state, ["libpng=1.2"], - ( + add_subdir_to_iter(( 'channel-1::libpng-1.2.50-0', - )) + ))) # # ~~has "libpng" restricted to "=1.2" by history_specs~~ NOPE! # In conda 4.6 making aggressive_update *more* aggressive, making it override history specs. @@ -1147,48 +1146,48 @@ def solve(prev_state, specs_to_add, order): with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_1, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.5.13-1', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": ""}, stack_callback=conda_tests_ctxt_mgmt_def_pol): state_1_2 = solve( state_1, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.2.50-0', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_1_2, ["cmake>2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.10.2-0', 'channel-1::libpng-1.5.13-1', - )) + ))) # use new history_specs to remove "libpng" version restriction state_2 = (base_state[0], (MatchSpec("libpng"),)) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_2, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.5.13-1', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": ""}, stack_callback=conda_tests_ctxt_mgmt_def_pol): state_2_2 = solve( state_2, ["cmake=2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.9-0', 'channel-1::libpng-1.2.50-0', - )) + ))) with env_vars({"CONDA_AGGRESSIVE_UPDATE_PACKAGES": "libpng"}, stack_callback=conda_tests_ctxt_mgmt_def_pol): solve( state_2_2, ["cmake>2.8.9"], - ( + add_subdir_to_iter(( 'channel-1::cmake-2.8.10.2-0', 'channel-1::libpng-1.5.13-1', - )) + ))) def test_python2_update(tmpdir): # Here we're actually testing that a user-request will uninstall incompatible packages @@ -1197,7 +1196,7 @@ def test_python2_update(tmpdir): with get_solver_4(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order1 = ( + order1 = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::conda-env-2.6.0-1', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', @@ -1231,14 +1230,14 @@ def test_python2_update(tmpdir): 'channel-4::urllib3-1.23-py27_0', 'channel-4::requests-2.19.1-py27_0', 'channel-4::conda-4.5.10-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order1 specs_to_add = MatchSpec("python=3"), with get_solver_4(tmpdir, specs_to_add, prefix_records=final_state_1, history_specs=specs) as solver: final_state_2 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::conda-env-2.6.0-1', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', @@ -1269,7 +1268,7 @@ def test_python2_update(tmpdir): 'channel-4::urllib3-1.23-py37_0', 'channel-4::requests-2.19.1-py37_0', 'channel-4::conda-4.5.10-py37_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -1279,7 +1278,7 @@ def test_update_deps_1(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() # print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1287,14 +1286,14 @@ def test_update_deps_1(tmpdir): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs2 = MatchSpec("numpy=1.7.0"), MatchSpec("python=2.7.3") with get_solver(tmpdir, specs2, prefix_records=final_state_1, history_specs=specs) as solver: final_state_2 = solver.solve_final_state() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1304,14 +1303,14 @@ def test_update_deps_1(tmpdir): 'channel-1::python-2.7.3-7', 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.0-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("iopro"), with get_solver(tmpdir, specs_to_add, prefix_records=final_state_2, history_specs=specs2) as solver: final_state_3a = solver.solve_final_state() print(convert_to_dist_str(final_state_3a)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1323,14 +1322,14 @@ def test_update_deps_1(tmpdir): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.0-py27_0', 'channel-1::iopro-1.5.0-np17py27_p0', - ) + )) assert convert_to_dist_str(final_state_3a) == order specs_to_add = MatchSpec("iopro"), with get_solver(tmpdir, specs_to_add, prefix_records=final_state_2, history_specs=specs2) as solver: final_state_3 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_DEPS) pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1342,7 +1341,7 @@ def test_update_deps_1(tmpdir): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # with update_deps, numpy should switch from 1.7.0 to 1.7.1 'channel-1::iopro-1.5.0-np17py27_p0', - ) + )) assert convert_to_dist_str(final_state_3) == order specs_to_add = MatchSpec("iopro"), @@ -1350,7 +1349,7 @@ def test_update_deps_1(tmpdir): final_state_3 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_DEPS, deps_modifier=DepsModifier.ONLY_DEPS) pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::unixodbc-2.3.1-0', 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', @@ -1362,7 +1361,7 @@ def test_update_deps_1(tmpdir): 'channel-1::nose-1.3.0-py27_0', 'channel-1::numpy-1.7.1-py27_0', # with update_deps, numpy should switch from 1.7.0 to 1.7.1 # 'channel-1::iopro-1.5.0-np17py27_p0', - ) + )) assert convert_to_dist_str(final_state_3) == order @@ -1371,7 +1370,7 @@ def test_update_deps_2(tmpdir): with get_solver_aggregate_2(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order1 = ( + order1 = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', 'channel-4::libstdcxx-ng-8.2.0-hdf63c60_0', @@ -1393,7 +1392,7 @@ def test_update_deps_2(tmpdir): 'channel-4::setuptools-40.0.0-py36_0', 'channel-2::jinja2-2.8-py36_1', 'channel-2::flask-0.12-py36_0', - ) + )) assert convert_to_dist_str(final_state_1) == order1 # The "conda update flask" case is held back by the jinja2==2.8 user-requested spec. @@ -1402,12 +1401,12 @@ def test_update_deps_2(tmpdir): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-2::flask-0.12-py36_0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::flask-0.12.2-py36hb24657c_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1417,14 +1416,14 @@ def test_update_deps_2(tmpdir): unlink_precs, link_precs = solver.solve_for_diff(update_modifier=UpdateModifier.UPDATE_DEPS) pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-2::flask-0.12-py36_0', 'channel-2::jinja2-2.8-py36_1', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::jinja2-2.10-py36_0', 'channel-4::flask-1.0.2-py36_1', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1434,7 +1433,7 @@ def test_fast_update_with_update_modifier_not_set(tmpdir): with get_solver_4(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order1 = ( + order1 = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', 'channel-4::libstdcxx-ng-8.2.0-hdf63c60_0', @@ -1447,7 +1446,7 @@ def test_fast_update_with_update_modifier_not_set(tmpdir): 'channel-4::readline-7.0-ha6073c6_4', 'channel-4::sqlite-3.21.0-h1bed415_2', 'channel-4::python-2.7.14-h89e7a4a_22', - ) + )) assert convert_to_dist_str(final_state_1) == order1 specs_to_add = MatchSpec("python"), @@ -1455,19 +1454,19 @@ def test_fast_update_with_update_modifier_not_set(tmpdir): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-4::python-2.7.14-h89e7a4a_22', 'channel-4::libedit-3.1-heed3624_0', 'channel-4::openssl-1.0.2l-h077ae2c_5', 'channel-4::ncurses-6.0-h9df7e31_2' - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::ncurses-6.1-hf484d3e_0', 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::xz-5.2.4-h14c3975_4', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::python-3.6.4-hc3d631a_1', # python is upgraded - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1476,20 +1475,20 @@ def test_fast_update_with_update_modifier_not_set(tmpdir): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-4::python-2.7.14-h89e7a4a_22', 'channel-4::sqlite-3.21.0-h1bed415_2', 'channel-4::libedit-3.1-heed3624_0', 'channel-4::openssl-1.0.2l-h077ae2c_5', 'channel-4::ncurses-6.0-h9df7e31_2', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-4::ncurses-6.1-hf484d3e_0', 'channel-4::openssl-1.0.2p-h14c3975_0', 'channel-4::libedit-3.1.20170329-h6b74fdf_2', 'channel-4::sqlite-3.24.0-h84994c4_0', # sqlite is upgraded 'channel-4::python-2.7.15-h1571d57_0', # python is not upgraded - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -1507,7 +1506,7 @@ def test_pinned_1(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1516,7 +1515,7 @@ def test_pinned_1(tmpdir): 'channel-1::zlib-1.2.7-0', 'channel-1::python-3.3.2-0', 'channel-1::numpy-1.7.1-py33_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_var("CONDA_PINNED_PACKAGES", "python=2.6&iopro<=1.4.2", stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1525,9 +1524,9 @@ def test_pinned_1(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::system-5.8-0', - ) + )) assert convert_to_dist_str(final_state_1) == order # ignore_pinned=True @@ -1537,7 +1536,7 @@ def test_pinned_1(tmpdir): final_state_2 = solver.solve_final_state(ignore_pinned=True) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1545,7 +1544,7 @@ def test_pinned_1(tmpdir): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-3.3.2-0', - ) + )) assert convert_to_dist_str(final_state_2) == order # ignore_pinned=False @@ -1555,7 +1554,7 @@ def test_pinned_1(tmpdir): final_state_2 = solver.solve_final_state(ignore_pinned=False) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1563,7 +1562,7 @@ def test_pinned_1(tmpdir): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.6.8-6', - ) + )) assert convert_to_dist_str(final_state_2) == order # incompatible CLI and configured specs @@ -1583,7 +1582,7 @@ def test_pinned_1(tmpdir): final_state_3 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1596,7 +1595,7 @@ def test_pinned_1(tmpdir): 'channel-1::llvmpy-0.11.2-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.8.1-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_3) == order specs_to_add = MatchSpec("python"), @@ -1606,7 +1605,7 @@ def test_pinned_1(tmpdir): final_state_4 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_DEPS) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_4)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1619,7 +1618,7 @@ def test_pinned_1(tmpdir): 'channel-1::llvmpy-0.11.2-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.8.1-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_4) == order specs_to_add = MatchSpec("python"), @@ -1629,7 +1628,7 @@ def test_pinned_1(tmpdir): final_state_5 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_ALL) # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_5)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1642,7 +1641,7 @@ def test_pinned_1(tmpdir): 'channel-1::llvmpy-0.11.2-py26_0', 'channel-1::numpy-1.7.1-py26_0', 'channel-1::numba-0.8.1-np17py26_0', - ) + )) assert convert_to_dist_str(final_state_5) == order # now update without pinning @@ -1653,7 +1652,7 @@ def test_pinned_1(tmpdir): final_state_5 = solver.solve_final_state(update_modifier=UpdateModifier.UPDATE_ALL) # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_5)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1665,7 +1664,7 @@ def test_pinned_1(tmpdir): 'channel-1::llvmpy-0.11.2-py33_0', 'channel-1::numpy-1.7.1-py33_0', 'channel-1::numba-0.8.1-np17py33_0', - ) + )) assert convert_to_dist_str(final_state_5) == order @@ -1678,7 +1677,7 @@ def test_no_update_deps_1(tmpdir): # i.e. FREEZE_DEPS final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1686,7 +1685,7 @@ def test_no_update_deps_1(tmpdir): # i.e. FREEZE_DEPS 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("zope.interface"), @@ -1694,7 +1693,7 @@ def test_no_update_deps_1(tmpdir): # i.e. FREEZE_DEPS final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1704,7 +1703,7 @@ def test_no_update_deps_1(tmpdir): # i.e. FREEZE_DEPS 'channel-1::python-2.7.5-0', 'channel-1::nose-1.3.0-py27_0', 'channel-1::zope.interface-4.0.5-py27_0', - ) + )) assert convert_to_dist_str(final_state_2) == order specs_to_add = MatchSpec("zope.interface>4.1"), @@ -1718,7 +1717,7 @@ def test_no_update_deps_1(tmpdir): # i.e. FREEZE_DEPS final_state_2 = solver.solve_final_state() # PrefixDag(final_state_2, specs).open_url() print(convert_to_dist_str(final_state_2)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1728,7 +1727,7 @@ def test_no_update_deps_1(tmpdir): # i.e. FREEZE_DEPS 'channel-1::python-3.3.2-0', 'channel-1::nose-1.3.0-py33_0', 'channel-1::zope.interface-4.1.1.1-py33_0', - ) + )) assert convert_to_dist_str(final_state_2) == order @@ -1738,7 +1737,7 @@ def test_force_reinstall_1(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1746,7 +1745,7 @@ def test_force_reinstall_1(tmpdir): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = specs @@ -1771,7 +1770,7 @@ def test_force_reinstall_2(tmpdir): assert not unlink_dists # PrefixDag(final_state_1, specs).open_url() print(convert_to_dist_str(link_dists)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1779,7 +1778,7 @@ def test_force_reinstall_2(tmpdir): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.7.5-0', - ) + )) assert convert_to_dist_str(link_dists) == order @@ -1789,7 +1788,7 @@ def test_timestamps_1(tmpdir): unlink_dists, link_dists = solver.solve_for_diff(force_reinstall=True) assert not unlink_dists pprint(convert_to_dist_str(link_dists)) - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', 'channel-4::libstdcxx-ng-8.2.0-hdf63c60_0', @@ -1804,7 +1803,7 @@ def test_timestamps_1(tmpdir): 'channel-4::sqlite-3.23.1-he433501_0', 'channel-4::python-3.6.2-hca45abc_19', # this package has a later timestamp but lower hash value # than the alternate 'channel-4::python-3.6.2-hda45abc_19' - ) + )) assert convert_to_dist_str(link_dists) == order def test_channel_priority_churn_minimized(tmpdir): @@ -1834,7 +1833,7 @@ def test_remove_with_constrained_dependencies(tmpdir): assert not unlink_dists_1 pprint(convert_to_dist_str(link_dists_1)) assert not unlink_dists_1 - order = ( + order = add_subdir_to_iter(( 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::conda-env-2.6.0-1', 'channel-4::libgcc-ng-8.2.0-hdf63c60_0', @@ -1877,7 +1876,7 @@ def test_remove_with_constrained_dependencies(tmpdir): 'channel-4::requests-2.19.1-py37_0', 'channel-4::conda-4.5.10-py37_0', 'channel-4::conda-build-3.12.1-py37_0', - ) + )) assert convert_to_dist_str(link_dists_1) == order specs_to_remove = MatchSpec("pycosat"), @@ -1885,11 +1884,11 @@ def test_remove_with_constrained_dependencies(tmpdir): unlink_dists_2, link_dists_2 = solver.solve_for_diff() assert not link_dists_2 pprint(convert_to_dist_str(unlink_dists_2)) - order = ( + order = add_subdir_to_iter(( 'channel-4::conda-build-3.12.1-py37_0', 'channel-4::conda-4.5.10-py37_0', 'channel-4::pycosat-0.6.3-py37h14c3975_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(unlink_dists_2) @@ -1901,7 +1900,7 @@ def test_priority_1(tmpdir): with get_solver_aggregate_1(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', @@ -1914,7 +1913,7 @@ def test_priority_1(tmpdir): 'channel-2::six-1.10.0-py27_0', 'channel-2::python-dateutil-2.6.1-py27_0', 'channel-2::pandas-0.20.3-py27_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_var("CONDA_CHANNEL_PRIORITY", "False", stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1924,10 +1923,10 @@ def test_priority_1(tmpdir): pprint(convert_to_dist_str(final_state_2)) # python and pandas will be updated as they are explicit specs. Other stuff may or may not, # as required to satisfy python and pandas - order = ( + order = add_subdir_to_iter(( 'channel-4::python-2.7.15-h1571d57_0', 'channel-4::pandas-0.23.4-py27h04863e7_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(final_state_2) @@ -1938,10 +1937,10 @@ def test_priority_1(tmpdir): history_specs=specs) as solver: final_state_3 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_3)) - order = ( + order = add_subdir_to_iter(( 'channel-2::python-2.7.13-0', 'channel-2::pandas-0.20.3-py27_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(final_state_3) @@ -1951,10 +1950,10 @@ def test_priority_1(tmpdir): prefix_records=final_state_3, history_specs=specs) as solver: final_state_4 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_4)) - order = ( + order = add_subdir_to_iter(( 'channel-2::python-2.7.13-0', 'channel-2::six-1.9.0-py27_0', - ) + )) for spec in order: assert spec in convert_to_dist_str(final_state_4) assert 'pandas' not in convert_to_dist_str(final_state_4) @@ -1969,7 +1968,7 @@ def test_features_solve_1(tmpdir): with get_solver_aggregate_1(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-2::nomkl-1.0-0', 'channel-2::libgfortran-3.0.0-1', 'channel-2::openssl-1.0.2l-0', @@ -1980,14 +1979,14 @@ def test_features_solve_1(tmpdir): 'channel-2::openblas-0.2.19-0', 'channel-2::python-2.7.13-0', 'channel-2::numpy-1.13.1-py27_nomkl_0', - ) + )) assert convert_to_dist_str(final_state_1) == order with env_var("CONDA_CHANNEL_PRIORITY", "False", stack_callback=conda_tests_ctxt_mgmt_def_pol): with get_solver_aggregate_1(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-4::blas-1.0-openblas', 'channel-4::ca-certificates-2018.03.07-0', 'channel-2::libffi-3.2.1-1', @@ -2006,7 +2005,7 @@ def test_features_solve_1(tmpdir): 'channel-4::python-2.7.15-h1571d57_0', 'channel-4::numpy-base-1.15.0-py27h7cdd4dd_0', 'channel-4::numpy-1.15.0-py27h2aefc1b_0', - ) + )) assert convert_to_dist_str(final_state_1) == order @@ -2016,7 +2015,7 @@ def test_freeze_deps_1(tmpdir): with get_solver_2(tmpdir, specs) as solver: final_state_1 = solver.solve_final_state() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-2::openssl-1.0.2l-0', 'channel-2::readline-6.2-2', 'channel-2::sqlite-3.13.0-0', @@ -2025,7 +2024,7 @@ def test_freeze_deps_1(tmpdir): 'channel-2::zlib-1.2.11-0', 'channel-2::python-3.4.5-0', 'channel-2::six-1.7.3-py34_0', - ) + )) assert convert_to_dist_str(final_state_1) == order specs_to_add = MatchSpec("bokeh"), @@ -2034,7 +2033,7 @@ def test_freeze_deps_1(tmpdir): pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) unlink_order = () - link_order = ( + link_order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::yaml-0.1.6-0', 'channel-2::backports_abc-0.5-py34_0', @@ -2047,7 +2046,7 @@ def test_freeze_deps_1(tmpdir): 'channel-2::python-dateutil-2.6.1-py34_0', 'channel-2::tornado-4.4.2-py34_0', 'channel-2::bokeh-0.12.4-py34_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -2059,7 +2058,7 @@ def test_freeze_deps_1(tmpdir): pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) unlink_order = () - link_order = ( + link_order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::yaml-0.1.6-0', 'channel-2::backports_abc-0.5-py34_0', @@ -2072,7 +2071,7 @@ def test_freeze_deps_1(tmpdir): 'channel-2::python-dateutil-2.6.1-py34_0', 'channel-2::tornado-4.4.2-py34_0', 'channel-2::bokeh-0.12.4-py34_0', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -2093,12 +2092,12 @@ def test_freeze_deps_1(tmpdir): unlink_precs, link_precs = solver.solve_for_diff() pprint(convert_to_dist_str(unlink_precs)) pprint(convert_to_dist_str(link_precs)) - unlink_order = ( + unlink_order = add_subdir_to_iter(( 'channel-2::six-1.7.3-py34_0', 'channel-2::python-3.4.5-0', 'channel-2::xz-5.2.3-0', - ) - link_order = ( + )) + link_order = add_subdir_to_iter(( 'channel-2::mkl-2017.0.3-0', 'channel-2::yaml-0.1.6-0', 'channel-2::python-2.7.13-0', @@ -2118,7 +2117,7 @@ def test_freeze_deps_1(tmpdir): 'channel-2::jinja2-2.9.6-py27_0', 'channel-2::tornado-4.5.2-py27_0', 'channel-2::bokeh-0.12.5-py27_1', - ) + )) assert convert_to_dist_str(unlink_precs) == unlink_order assert convert_to_dist_str(link_precs) == link_order @@ -2241,7 +2240,7 @@ def test_downgrade_python_prevented_with_sane_message(tmpdir): final_state_1 = solver.solve_final_state() # PrefixDag(final_state_1, specs).open_url() pprint(convert_to_dist_str(final_state_1)) - order = ( + order = add_subdir_to_iter(( 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -2249,7 +2248,7 @@ def test_downgrade_python_prevented_with_sane_message(tmpdir): 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', 'channel-1::python-2.6.8-6', - ) + )) assert convert_to_dist_str(final_state_1) == order # incompatible CLI and configured specs diff --git a/tests/helpers.py b/tests/helpers.py --- a/tests/helpers.py +++ b/tests/helpers.py @@ -111,6 +111,25 @@ def run_inprocess_conda_command(command, disallow_stderr=True): return c.stdout, c.stderr, exit_code +def add_subdir(dist_string): + channel_str, package_str = dist_string.split('::') + channel_str = channel_str + '/' + context.subdir + return '::'.join([channel_str, package_str]) + + +def add_subdir_to_iter(iterable): + if isinstance(iterable, dict): + return {add_subdir(k) : v for k, v in iterable.items()} + elif isinstance(iterable, list): + return list(map(add_subdir, iterable)) + elif isinstance(iterable, set): + return set(map(add_subdir, iterable)) + elif isinstance(iterable, tuple): + return tuple(map(add_subdir, iterable)) + else: + raise Exception("Unable to add subdir to object of unknown type.") + + @contextmanager def tempdir(): tempdirdir = gettempdir() diff --git a/tests/models/test_prefix_graph.py b/tests/models/test_prefix_graph.py --- a/tests/models/test_prefix_graph.py +++ b/tests/models/test_prefix_graph.py @@ -13,6 +13,7 @@ from conda.models.records import PackageRecord import pytest from tests.core.test_solve import get_solver_4, get_solver_5 +from tests.helpers import add_subdir_to_iter try: from unittest.mock import Mock, patch @@ -218,17 +219,17 @@ def test_prefix_graph_1(tmpdir): ) assert nodes == order - spec_matches = { + spec_matches = add_subdir_to_iter({ 'channel-4::intel-openmp-2018.0.3-0': {'intel-openmp'}, - } + }) assert {node.dist_str(): set(str(ms) for ms in specs) for node, specs in graph.spec_matches.items()} == spec_matches removed_nodes = graph.prune() nodes = tuple(rec.dist_str() for rec in graph.records) pprint(nodes) - order = ( + order = add_subdir_to_iter(( 'channel-4::intel-openmp-2018.0.3-0', - ) + )) assert nodes == order removed_nodes = tuple(rec.name for rec in removed_nodes) diff --git a/tests/test_resolve.py b/tests/test_resolve.py --- a/tests/test_resolve.py +++ b/tests/test_resolve.py @@ -16,7 +16,7 @@ from conda.models.enums import PackageType from conda.models.records import PackageRecord from conda.resolve import MatchSpec, Resolve, ResolvePackageNotFound -from .helpers import TEST_DATA_DIR, get_index_r_1, get_index_r_4, raises +from .helpers import TEST_DATA_DIR, add_subdir, add_subdir_to_iter, get_index_r_1, get_index_r_4, raises index, r, = get_index_r_1() f_mkl = set(['mkl']) @@ -66,7 +66,7 @@ def test_empty(self): def test_iopro_nomkl(self): installed = r.install(['iopro 1.4*', 'python 2.7*', 'numpy 1.7*'], returnall=True) installed = [rec.dist_str() for rec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np17py27_p0', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -77,12 +77,12 @@ def test_iopro_nomkl(self): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_iopro_mkl(self): installed = r.install(['iopro 1.4*', 'python 2.7*', 'numpy 1.7*', MatchSpec(track_features='mkl')], returnall=True) installed = [prec.dist_str() for prec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np17py27_p0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::numpy-1.7.1-py27_p0', @@ -94,7 +94,7 @@ def test_iopro_mkl(self): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_mkl(self): a = r.install(['mkl 11*', MatchSpec(track_features='mkl')]) @@ -110,13 +110,13 @@ def test_scipy_mkl(self): precs = r.install(['scipy', 'python 2.7*', 'numpy 1.7*', MatchSpec(track_features='mkl')]) self.assert_have_mkl(precs, ('numpy', 'scipy')) dist_strs = [prec.dist_str() for prec in precs] - assert 'channel-1::scipy-0.12.0-np17py27_p0' in dist_strs + assert add_subdir('channel-1::scipy-0.12.0-np17py27_p0') in dist_strs def test_anaconda_nomkl(self): precs = r.install(['anaconda 1.5.0', 'python 2.7*', 'numpy 1.7*']) assert len(precs) == 107 dist_strs = [prec.dist_str() for prec in precs] - assert 'channel-1::scipy-0.12.0-np17py27_0' in dist_strs + assert add_subdir('channel-1::scipy-0.12.0-np17py27_0') in dist_strs def test_generate_eq_1(): @@ -140,7 +140,7 @@ def test_generate_eq_1(): eqb = {key: value for key, value in iteritems(eqb)} eqt = {key: value for key, value in iteritems(eqt)} assert eqc == {} - assert eqv == { + assert eqv == add_subdir_to_iter({ 'channel-1::anaconda-1.4.0-np15py27_0': 1, 'channel-1::anaconda-1.4.0-np16py27_0': 1, 'channel-1::anaconda-1.4.0-np17py27_0': 1, @@ -215,8 +215,8 @@ def test_generate_eq_1(): 'channel-1::xlrd-0.9.0-py27_0': 1, 'channel-1::xlrd-0.9.0-py33_0': 1, 'channel-1::xlwt-0.7.4-py27_0': 1 - } - assert eqb == { + }) + assert eqb == add_subdir_to_iter({ 'channel-1::cubes-0.10.2-py27_0': 1, 'channel-1::dateutil-2.1-py27_0': 1, 'channel-1::dateutil-2.1-py33_0': 1, @@ -244,7 +244,7 @@ def test_generate_eq_1(): 'channel-1::theano-0.5.0-np16py27_0': 1, 'channel-1::theano-0.5.0-np17py27_0': 1, 'channel-1::zeromq-2.2.0-0': 1 - } + }) # No timestamps in the current data set assert eqt == {} @@ -254,7 +254,7 @@ def test_pseudo_boolean(): # The latest version of iopro, 1.5.0, was not built against numpy 1.5 installed = r.install(['iopro', 'python 2.7*', 'numpy 1.5*'], returnall=True) installed = [rec.dist_str() for rec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np15py27_p0', 'channel-1::numpy-1.5.1-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -265,11 +265,11 @@ def test_pseudo_boolean(): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) installed = r.install(['iopro', 'python 2.7*', 'numpy 1.5*', MatchSpec(track_features='mkl')], returnall=True) installed = [rec.dist_str() for rec in installed] - assert installed == [ + assert installed == add_subdir_to_iter([ 'channel-1::iopro-1.4.3-np15py27_p0', 'channel-1::mkl-rt-11.0-p0', 'channel-1::numpy-1.5.1-py27_p4', @@ -281,14 +281,14 @@ def test_pseudo_boolean(): 'channel-1::tk-8.5.13-0', 'channel-1::unixodbc-2.3.1-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_get_dists(): reduced_index = r.get_reduced_index((MatchSpec("anaconda 1.4.0"), )) dist_strs = [prec.dist_str() for prec in reduced_index] - assert 'channel-1::anaconda-1.4.0-np17py27_0' in dist_strs - assert 'channel-1::freetype-2.4.10-0' in dist_strs + assert add_subdir('channel-1::anaconda-1.4.0-np17py27_0') in dist_strs + assert add_subdir('channel-1::freetype-2.4.10-0') in dist_strs def test_get_reduced_index_unmanageable(): @@ -643,11 +643,11 @@ def test_nonexistent_deps(): index2 = {key: value for key, value in iteritems(index2)} r = Resolve(index2) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == add_subdir_to_iter({ 'defaults::mypackage-1.0-py33_0', 'defaults::mypackage-1.1-py33_0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), ))) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), ))) == add_subdir_to_iter({ 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.1.2-py33_0', 'channel-1::nose-1.2.1-py33_0', @@ -666,12 +666,12 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - } + }) target_result = r.install(['mypackage']) assert target_result == r.install(['mypackage 1.1']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.3.0-py33_0', 'channel-1::openssl-1.0.1c-0', @@ -681,13 +681,13 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) assert raises(ResolvePackageNotFound, lambda: r.install(['mypackage 1.0'])) assert raises(ResolvePackageNotFound, lambda: r.install(['mypackage 1.0', 'burgertime 1.0'])) target_result = r.install(['anotherpackage 1.0']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-1.0-py33_0', 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -698,11 +698,11 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) target_result = r.install(['anotherpackage']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-2.0-py33_0', 'defaults::mypackage-1.1-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -713,7 +713,7 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # This time, the latest version is messed up index3 = index.copy() @@ -769,11 +769,12 @@ def test_nonexistent_deps(): index3 = {key: value for key, value in iteritems(index3)} r = Resolve(index3) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('mypackage'))) == add_subdir_to_iter({ 'defaults::mypackage-1.0-py33_0', 'defaults::mypackage-1.1-py33_0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), )).keys()) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('mypackage'), )).keys()) ==\ + add_subdir_to_iter({ 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.1.2-py33_0', 'channel-1::nose-1.2.1-py33_0', @@ -792,11 +793,11 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - } + }) target_result = r.install(['mypackage']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.3.0-py33_0', 'channel-1::openssl-1.0.1c-0', @@ -806,12 +807,12 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) assert raises(ResolvePackageNotFound, lambda: r.install(['mypackage 1.1'])) target_result = r.install(['anotherpackage 1.0']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-1.0-py33_0', 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -822,13 +823,13 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # If recursive checking is working correctly, this will give # anotherpackage 2.0, not anotherpackage 1.0 target_result = r.install(['anotherpackage']) target_result = [rec.dist_str() for rec in target_result] - assert target_result == [ + assert target_result == add_subdir_to_iter([ 'defaults::anotherpackage-2.0-py33_0', 'defaults::mypackage-1.0-py33_0', 'channel-1::nose-1.3.0-py33_0', @@ -839,7 +840,7 @@ def test_nonexistent_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_install_package_with_feature(): @@ -929,20 +930,20 @@ def test_circular_dependencies(): index2 = {key: value for key, value in iteritems(index2)} r = Resolve(index2) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == add_subdir_to_iter({ 'defaults::package1-1.0-0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == add_subdir_to_iter({ 'defaults::package1-1.0-0', 'defaults::package2-1.0-0', - } + }) result = r.install(['package1', 'package2']) assert r.install(['package1']) == r.install(['package2']) == result result = [r.dist_str() for r in result] - assert result == [ + assert result == add_subdir_to_iter([ 'defaults::package1-1.0-0', 'defaults::package2-1.0-0', - ] + ]) def test_optional_dependencies(): @@ -987,25 +988,25 @@ def test_optional_dependencies(): index2 = {key: value for key, value in iteritems(index2)} r = Resolve(index2) - assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == { + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == add_subdir_to_iter({ 'defaults::package1-1.0-0', - } - assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == { + }) + assert set(prec.dist_str() for prec in r.get_reduced_index((MatchSpec('package1'), )).keys()) == add_subdir_to_iter({ 'defaults::package1-1.0-0', 'defaults::package2-2.0-0', - } + }) result = r.install(['package1']) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'defaults::package1-1.0-0', - ] + ]) result = r.install(['package1', 'package2']) assert result == r.install(['package1', 'package2 >1.0']) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'defaults::package1-1.0-0', 'defaults::package2-2.0-0', - ] + ]) assert raises(UnsatisfiableError, lambda: r.install(['package1', 'package2 <2.0'])) assert raises(UnsatisfiableError, lambda: r.install(['package1', 'package2 1.0'])) @@ -1013,7 +1014,7 @@ def test_optional_dependencies(): def test_irrational_version(): result = r.install(['pytz 2012d', 'python 3*'], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::openssl-1.0.1c-0', 'channel-1::python-3.3.2-0', 'channel-1::pytz-2012d-py33_0', @@ -1022,14 +1023,14 @@ def test_irrational_version(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_no_features(): # Without this, there would be another solution including 'scipy-0.11.0-np16py26_p3.tar.bz2'. result = r.install(['python 2.6*', 'numpy 1.6*', 'scipy 0.11*'], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::numpy-1.6.2-py26_4', 'channel-1::openssl-1.0.1c-0', 'channel-1::python-2.6.8-6', @@ -1039,11 +1040,11 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) result = r.install(['python 2.6*', 'numpy 1.6*', 'scipy 0.11*', MatchSpec(track_features='mkl')], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::mkl-rt-11.0-p0', # This, 'channel-1::numpy-1.6.2-py26_p4', # this, 'channel-1::openssl-1.0.1c-0', @@ -1054,7 +1055,7 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) index2 = index.copy() pandas = PackageRecord(**{ @@ -1110,7 +1111,7 @@ def test_no_features(): # of the specs directly have mkl versions) result = r2.solve(['pandas 0.12.0 np16py27_0', 'python 2.7*'], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1123,11 +1124,11 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) result = r2.solve(['pandas 0.12.0 np16py27_0', 'python 2.7*', MatchSpec(track_features='mkl')], returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::mkl-rt-11.0-p0', # This 'channel-1::numpy-1.6.2-py27_p5', # and this are different. @@ -1141,13 +1142,13 @@ def test_no_features(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_broken_install(): installed = r.install(['pandas', 'python 2.7*', 'numpy 1.6*']) _installed = [rec.dist_str() for rec in installed] - assert _installed == [ + assert _installed == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1161,7 +1162,7 @@ def test_broken_install(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # Add an incompatible numpy; installation should be untouched installed1 = list(installed) @@ -1210,7 +1211,7 @@ def test_pip_depends_removed_on_inconsistent_env(): def test_remove(): installed = r.install(['pandas', 'python 2.7*']) _installed = [rec.dist_str() for rec in installed] - assert _installed == [ + assert _installed == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1224,11 +1225,11 @@ def test_remove(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) result = r.remove(['pandas'], installed=installed) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1241,12 +1242,12 @@ def test_remove(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # Pandas requires numpy result = r.remove(['numpy'], installed=installed) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::openssl-1.0.1c-0', 'channel-1::python-2.7.5-0', @@ -1257,7 +1258,7 @@ def test_remove(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_channel_priority_1(): @@ -1327,7 +1328,7 @@ def test_channel_priority_2(): eqc, eqv, eqb, eqa, eqt = r2.generate_version_metrics(C, list(r2.groups.keys())) eqc = {key: value for key, value in iteritems(eqc)} pprint(eqc) - assert eqc == { + assert eqc == add_subdir_to_iter({ 'channel-4::mkl-2017.0.4-h4c4d0af_0': 1, 'channel-4::mkl-2018.0.0-hb491cac_4': 1, 'channel-4::mkl-2018.0.1-h19d6760_4': 1, @@ -1451,10 +1452,10 @@ def test_channel_priority_2(): 'channel-4::tk-8.6.7-hc745277_3': 1, 'channel-4::zlib-1.2.11-ha838bed_2': 1, 'channel-4::zlib-1.2.11-hfbfcf68_1': 1, - } + }) installed_w_priority = [prec.dist_str() for prec in this_r.install(spec)] pprint(installed_w_priority) - assert installed_w_priority == [ + assert installed_w_priority == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1468,7 +1469,7 @@ def test_channel_priority_2(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # setting strict actually doesn't do anything here; just ensures it's not 'disabled' with env_var("CONDA_CHANNEL_PRIORITY", "strict", stack_callback=conda_tests_ctxt_mgmt_def_pol): @@ -1480,7 +1481,7 @@ def test_channel_priority_2(): eqc = {key: value for key, value in iteritems(eqc)} assert eqc == {}, eqc installed_w_strict = [prec.dist_str() for prec in this_r.install(spec)] - assert installed_w_strict == [ + assert installed_w_strict == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.7.1-py27_0', 'channel-1::openssl-1.0.1c-0', @@ -1494,7 +1495,7 @@ def test_channel_priority_2(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ], installed_w_strict + ]), installed_w_strict with env_var("CONDA_CHANNEL_PRIORITY", "False", stack_callback=conda_tests_ctxt_mgmt_def_pol): dists = this_r.get_reduced_index(spec) @@ -1503,7 +1504,7 @@ def test_channel_priority_2(): eqc, eqv, eqb, eqa, eqt = r2.generate_version_metrics(C, list(r2.groups.keys())) eqc = {key: value for key, value in iteritems(eqc)} pprint(eqc) - assert eqc == { + assert eqc == add_subdir_to_iter({ 'channel-1::dateutil-1.5-py27_0': 1, 'channel-1::mkl-10.3-0': 6, 'channel-1::mkl-10.3-p1': 6, @@ -1757,10 +1758,10 @@ def test_channel_priority_2(): 'channel-4::sqlite-3.21.0-h1bed415_2': 3, 'channel-4::sqlite-3.22.0-h1bed415_0': 2, 'channel-4::sqlite-3.23.1-he433501_0': 1, - } + }) installed_wo_priority = set([prec.dist_str() for prec in this_r.install(spec)]) pprint(installed_wo_priority) - assert installed_wo_priority == { + assert installed_wo_priority == add_subdir_to_iter({ 'channel-4::blas-1.0-mkl', 'channel-4::ca-certificates-2018.03.07-0', 'channel-4::intel-openmp-2018.0.3-0', @@ -1785,7 +1786,7 @@ def test_channel_priority_2(): 'channel-4::sqlite-3.24.0-h84994c4_0', 'channel-4::tk-8.6.7-hc745277_3', 'channel-4::zlib-1.2.11-ha838bed_2', - } + }) def test_dependency_sort(): @@ -1794,7 +1795,7 @@ def test_dependency_sort(): must_have = {prec.name: prec for prec in installed} installed = r.dependency_sort(must_have) - results_should_be = [ + results_should_be = add_subdir_to_iter([ 'channel-1::openssl-1.0.1c-0', 'channel-1::readline-6.2-0', 'channel-1::sqlite-3.7.13-0', @@ -1808,7 +1809,7 @@ def test_dependency_sort(): 'channel-1::dateutil-2.1-py27_1', 'channel-1::scipy-0.12.0-np16py27_0', 'channel-1::pandas-0.11.0-np16py27_1' - ] + ]) assert len(installed) == len(results_should_be) assert [prec.dist_str() for prec in installed] == results_should_be @@ -1816,7 +1817,7 @@ def test_dependency_sort(): def test_update_deps(): installed = r.install(['python 2.7*', 'numpy 1.6*', 'pandas 0.10.1']) result = [rec.dist_str() for rec in installed] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1829,14 +1830,14 @@ def test_update_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # scipy, and pandas should all be updated here. pytz is a new # dependency of pandas. But numpy does not _need_ to be updated # to get the latest version of pandas, so it stays put. result = r.install(['pandas', 'python 2.7*'], installed=installed, update_deps=True, returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1850,13 +1851,13 @@ def test_update_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) # pandas should be updated here. However, it's going to try to not update # scipy, so it won't be updated to the latest version (0.11.0). result = r.install(['pandas', 'python 2.7*'], installed=installed, update_deps=False, returnall=True) result = [rec.dist_str() for rec in result] - assert result == [ + assert result == add_subdir_to_iter([ 'channel-1::dateutil-2.1-py27_1', 'channel-1::numpy-1.6.2-py27_4', 'channel-1::openssl-1.0.1c-0', @@ -1869,7 +1870,7 @@ def test_update_deps(): 'channel-1::system-5.8-1', 'channel-1::tk-8.5.13-0', 'channel-1::zlib-1.2.7-0', - ] + ]) def test_surplus_features_1(): @@ -2048,6 +2049,51 @@ def test_get_reduced_index_broadening_preferred_solution(): assert d.version == '2.5', "bottom version should be 2.5, but is {}".format(d.version) +def test_arch_preferred_when_otherwise_identical_dependencies(): + index2 = index.copy() + package1_noarch = PackageRecord(**{ + "channel": "defaults", + "subdir": "noarch", + "md5": "0123456789", + "fn": "doesnt-matter-here", + 'build': '0', + 'build_number': 0, + 'depends': [], + 'name': 'package1', + 'requires': [], + 'version': '1.0', + }) + index2[package1_noarch] = package1_noarch + package1_linux64 = PackageRecord(**{ + "channel": "defaults", + "subdir": context.subdir, + "md5": "0123456789", + "fn": "doesnt-matter-here", + 'build': '0', + 'build_number': 0, + 'depends': [], + 'name': 'package1', + 'requires': [], + 'version': '1.0', + }) + index2[package1_linux64] = package1_linux64 + index2 = {key: value for key, value in iteritems(index2)} + r = Resolve(index2) + + matches = r.find_matches(MatchSpec('package1')) + assert len(matches) == 2 + assert set(prec.dist_str() for prec in r.find_matches(MatchSpec('package1'))) == { + 'defaults/noarch::package1-1.0-0', + add_subdir('defaults::package1-1.0-0') + } + + result = r.install(['package1']) + result = [rec.dist_str() for rec in result] + assert result == [ + add_subdir('defaults::package1-1.0-0'), + ] + + def test_arch_preferred_over_noarch_when_otherwise_equal(): index = ( PackageRecord(**{
conda 4.6.x and conda 4.7.x not able to resolve identical package in different subdirectories Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> The following happens: ``` [root@596ad8f0842a /]# conda create -n conda-env --dry-run -- test-package Collecting package metadata (current_repodata.json): done Solving environment: failed with current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed UnsatisfiableError: The following specifications were found to be incompatible with each other: Package pandas conflicts for: test-package -> pandas Package typing conflicts for: test-package -> typing Package libffi conflicts for: test-package -> libffi[version='>=3.2.1,<4.0a0'] Package pyyaml conflicts for: test-package -> pyyaml Package six conflicts for: test-package -> six[version='>=1.12.0'] Package py4j conflicts for: test-package -> py4j Package icu conflicts for: test-package -> icu Package wrapt conflicts for: test-package -> wrapt Package pytz conflicts for: test-package -> pytz Package python conflicts for: test-package -> python[version='>=2.7.14'] Package pyarrow conflicts for: test-package -> pyarrow Package matplotlib conflicts for: test-package -> matplotlib[version='>=2.0.2,<2.3.0'] ``` Also observed on conda 4.6.14 ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> 1. Create a conda repository `test-channel` with the following set up 2. In /linux-64/repodata.json ``` { "info": { "subdir": "linux-64" }, "packages": { "test-package-4.2.1-py_0.tar.bz2": { "build": "py_0", "build_number": 0, "depends": [ "icu", "libffi >=3.2.1,<4.0a0", "matplotlib >=2.0.2,<2.3.0", "pandas", "py4j", "pyarrow", "python >=2.7.14", "pytz", "pyyaml", "six >=1.12.0", "typing", "wrapt" ], "md5": "1512a7e9a56ecb8523475c891bfa6657", "name": "test-package", "noarch": "python", "sha256": "3c02f947500c13ceb8e8aa38db2af43e9017c4948905d0cbd1610185318fe7d9", "size": 30098, "subdir": "noarch", "timestamp": 1565634321434, "version": "4.2.1" } }, "removed": [], "repodata_version": 1 } ``` 3. In /noarch/repodata.json ``` { "info": { "subdir": "noarch" }, "packages": { "test-package-4.2.1-py_0.tar.bz2": { "build": "py_0", "build_number": 0, "depends": [ "icu", "libffi >=3.2.1,<4.0a0", "matplotlib >=2.0.2,<2.3.0", "pandas", "py4j", "pyarrow", "python >=2.7.14", "pytz", "pyyaml", "six >=1.12.0", "typing", "wrapt" ], "md5": "1512a7e9a56ecb8523475c891bfa6657", "name": "test-package", "noarch": "python", "sha256": "3c02f947500c13ceb8e8aa38db2af43e9017c4948905d0cbd1610185318fe7d9", "size": 30098, "subdir": "noarch", "timestamp": 1565634321434, "version": "4.2.1" } }, "removed": [], "repodata_version": 1 } ``` 3. Set up conda to only point to the test-channel, note I see this error on `--dry-run` so I did not populate the test-channel with the actual packages. 4. Run `conda create -n conda-env --dry-run -- test-package` ## Expected Behavior <!-- What do you think should happen? --> Previously, in conda 4.5.x, there was no issue with resolving packages like this. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` [root@596ad8f0842a /]# conda info active environment : None user config file : /root/.condarc populated config files : /root/.condarc /condarc conda version : 4.7.10 conda-build version : not installed python version : 3.7.3.final.0 virtual packages : base environment : /miniconda (writable) channel URLs : file://test-channel/asset/conda/linux-64 file://test-channel/asset/conda/noarch package cache : /miniconda/pkgs /root/.conda/pkgs envs directories : /miniconda/envs /root/.conda/envs platform : linux-64 user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Linux/4.9.184-linuxkit centos/6.10 glibc/2.12 UID:GID : 0:0 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` [root@596ad8f0842a /]# conda config --show-sources ==> /root/.condarc <== channel_priority: disabled channels: - file://test-channel/asset/conda/ repodata_fns: - repodata.json use_only_tar_bz2: False ==> /condarc <== channels: [] default_channels: [] ``` </p></details> Note I attempted to remove current_repodata.json from being considered, but this is 4.7.10 before the config value is apparently respected. <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` [root@596ad8f0842a /]# conda list --show-channel-urls # packages in environment at /miniconda: # # Name Version Build Channel _libgcc_mutex 0.1 main https://repo.anaconda.com/pkgs/main asn1crypto 0.24.0 py37_0 https://repo.anaconda.com/pkgs/main bzip2 1.0.8 h7b6447c_0 https://repo.anaconda.com/pkgs/main ca-certificates 2019.5.15 0 https://repo.anaconda.com/pkgs/main certifi 2019.6.16 py37_0 https://repo.anaconda.com/pkgs/main cffi 1.12.3 py37h2e261b9_0 https://repo.anaconda.com/pkgs/main chardet 3.0.4 py37_1 https://repo.anaconda.com/pkgs/main conda 4.7.10 py37_0 https://repo.anaconda.com/pkgs/main conda-package-handling 1.3.11 py37_0 https://repo.anaconda.com/pkgs/main cryptography 2.7 py37h1ba5d50_0 https://repo.anaconda.com/pkgs/main idna 2.8 py37_0 https://repo.anaconda.com/pkgs/main libarchive 3.3.3 h5d8350f_5 https://repo.anaconda.com/pkgs/main libedit 3.1.20181209 hc058e9b_0 https://repo.anaconda.com/pkgs/main libffi 3.2.1 hd88cf55_4 https://repo.anaconda.com/pkgs/main libgcc-ng 9.1.0 hdf63c60_0 https://repo.anaconda.com/pkgs/main libstdcxx-ng 9.1.0 hdf63c60_0 https://repo.anaconda.com/pkgs/main libxml2 2.9.9 hea5a465_1 https://repo.anaconda.com/pkgs/main lz4-c 1.8.1.2 h14c3975_0 https://repo.anaconda.com/pkgs/main lzo 2.10 h49e0be7_2 https://repo.anaconda.com/pkgs/main ncurses 6.1 he6710b0_1 https://repo.anaconda.com/pkgs/main openssl 1.1.1c h7b6447c_1 https://repo.anaconda.com/pkgs/main pip 19.1.1 py37_0 https://repo.anaconda.com/pkgs/main pycosat 0.6.3 py37h14c3975_0 https://repo.anaconda.com/pkgs/main pycparser 2.19 py37_0 https://repo.anaconda.com/pkgs/main pyopenssl 19.0.0 py37_0 https://repo.anaconda.com/pkgs/main pysocks 1.7.0 py37_0 https://repo.anaconda.com/pkgs/main python 3.7.3 h0371630_0 https://repo.anaconda.com/pkgs/main python-libarchive-c 2.8 py37_11 https://repo.anaconda.com/pkgs/main readline 7.0 h7b6447c_5 https://repo.anaconda.com/pkgs/main requests 2.22.0 py37_0 https://repo.anaconda.com/pkgs/main ruamel_yaml 0.15.46 py37h14c3975_0 https://repo.anaconda.com/pkgs/main setuptools 41.0.1 py37_0 https://repo.anaconda.com/pkgs/main six 1.12.0 py37_0 https://repo.anaconda.com/pkgs/main sqlite 3.29.0 h7b6447c_0 https://repo.anaconda.com/pkgs/main tk 8.6.8 hbc83047_0 https://repo.anaconda.com/pkgs/main tqdm 4.32.1 py_0 https://repo.anaconda.com/pkgs/main urllib3 1.24.2 py37_0 https://repo.anaconda.com/pkgs/main wheel 0.33.4 py37_0 https://repo.anaconda.com/pkgs/main xz 5.2.4 h14c3975_4 https://repo.anaconda.com/pkgs/main yaml 0.1.7 had09818_2 https://repo.anaconda.com/pkgs/main zlib 1.2.11 h7b6447c_3 https://repo.anaconda.com/pkgs/main zstd 1.3.7 h0b5b093_0 https://repo.anaconda.com/pkgs/main ``` </p></details>
Key question: is this expected behavior for packages that have an identical noarch and linux-64 builds? Additional note: if I remove the repodata entry for either `linux-64` or `noarch` subdir, but not the other, then the command succeeds This is likely similar to #8302 which was partially fixed in #8938. Packages from different subdirs with the same name will also have the same channel which causes conda to consider than as the same package. For the time being it is best to not have packages with identical names in `noarch` and another subdir. This is not the intended behavior, the solver should treat these are two separate packages. To add a data point, I'm seeing this on another `conda create` but this time it doesn't seem to be an issue with any packages that I can control, but somewhere in public channels. Is there a suggested way to narrow down where this is coming from? @jjhelmus do you have any initial thoughts on how to fix the issue within conda? Happy to take a stab at contributing and testing a patch for this edge case.
2019-11-07T22:40:30Z
[]
[]
conda/conda
9,614
conda__conda-9614
[ "7279" ]
d527576f8033731cac9196494b9a1061b29091ba
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -281,6 +281,8 @@ def solve_final_state( the solved state of the environment. """ + if prune and update_modifier == UpdateModifier.FREEZE_INSTALLED: + update_modifier = NULL if update_modifier is NULL: update_modifier = context.update_modifier else: @@ -520,54 +522,60 @@ def empty_package_list(pkg): @time_recorder(module_name=__name__) def _collect_all_metadata(self, ssc): - # add in historically-requested specs - ssc.specs_map.update(ssc.specs_from_history_map) - - # these are things that we want to keep even if they're not explicitly specified. This - # is to compensate for older installers not recording these appropriately for them - # to be preserved. - for pkg_name in ( - "anaconda", - "conda", - "conda-build", - "python.app", - "console_shortcut", - "powershell_shortcut", - ): - if pkg_name not in ssc.specs_map and ssc.prefix_data.get(pkg_name, None): - ssc.specs_map[pkg_name] = MatchSpec(pkg_name) - - # Add virtual packages so they are taken into account by the solver - virtual_pkg_index = {} - _supplement_index_with_system(virtual_pkg_index) - virtual_pkgs = [p.name for p in virtual_pkg_index.keys()] - for virtual_pkgs_name in virtual_pkgs: - if virtual_pkgs_name not in ssc.specs_map: - ssc.specs_map[virtual_pkgs_name] = MatchSpec(virtual_pkgs_name) - - for prec in ssc.prefix_data.iter_records(): - # first check: add everything if we have no history to work with. - # This happens with "update --all", for example. - # - # second check: add in aggressively updated packages - # - # third check: add in foreign stuff (e.g. from pip) into the specs - # map. We add it so that it can be left alone more. This is a - # declaration that it is manually installed, much like the - # history map. It may still be replaced if it is in conflict, - # but it is not just an indirect dep that can be pruned. - if ( - not ssc.specs_from_history_map - or MatchSpec(prec.name) in context.aggressive_update_packages - or prec.subdir == "pypi" + if ssc.prune: + # When pruning DO NOT consider history of already installed packages when solving. + prepared_specs = {*self.specs_to_remove, *self.specs_to_add} + else: + # add in historically-requested specs + ssc.specs_map.update(ssc.specs_from_history_map) + + # these are things that we want to keep even if they're not explicitly specified. This + # is to compensate for older installers not recording these appropriately for them + # to be preserved. + for pkg_name in ( + "anaconda", + "conda", + "conda-build", + "python.app", + "console_shortcut", + "powershell_shortcut", ): - ssc.specs_map.update({prec.name: MatchSpec(prec.name)}) + if pkg_name not in ssc.specs_map and ssc.prefix_data.get( + pkg_name, None + ): + ssc.specs_map[pkg_name] = MatchSpec(pkg_name) + + # Add virtual packages so they are taken into account by the solver + virtual_pkg_index = {} + _supplement_index_with_system(virtual_pkg_index) + virtual_pkgs = [p.name for p in virtual_pkg_index.keys()] + for virtual_pkgs_name in virtual_pkgs: + if virtual_pkgs_name not in ssc.specs_map: + ssc.specs_map[virtual_pkgs_name] = MatchSpec(virtual_pkgs_name) + + for prec in ssc.prefix_data.iter_records(): + # first check: add everything if we have no history to work with. + # This happens with "update --all", for example. + # + # second check: add in aggressively updated packages + # + # third check: add in foreign stuff (e.g. from pip) into the specs + # map. We add it so that it can be left alone more. This is a + # declaration that it is manually installed, much like the + # history map. It may still be replaced if it is in conflict, + # but it is not just an indirect dep that can be pruned. + if ( + not ssc.specs_from_history_map + or MatchSpec(prec.name) in context.aggressive_update_packages + or prec.subdir == "pypi" + ): + ssc.specs_map.update({prec.name: MatchSpec(prec.name)}) - prepared_specs = { - *self.specs_to_remove, - *self.specs_to_add, - *ssc.specs_from_history_map.values(), - } + prepared_specs = { + *self.specs_to_remove, + *self.specs_to_add, + *ssc.specs_from_history_map.values(), + } index, r = self._prepare(prepared_specs) ssc.set_repository_metadata(index, r) @@ -731,17 +739,18 @@ def _add_specs(self, ssc): # the only things we should consider freezing are things that don't conflict with the new # specs being added. explicit_pool = ssc.r._get_package_pool(self.specs_to_add) + if ssc.prune: + # Ignore installed specs on prune. + installed_specs = () + else: + installed_specs = [ + record.to_match_spec() for record in ssc.prefix_data.iter_records() + ] conflict_specs = ( - ssc.r.get_conflicting_specs( - tuple( - record.to_match_spec() for record in ssc.prefix_data.iter_records() - ), - self.specs_to_add, - ) - or () + ssc.r.get_conflicting_specs(installed_specs, self.specs_to_add) or tuple() ) - conflict_specs = {_.name for _ in conflict_specs} + conflict_specs = {spec.name for spec in conflict_specs} for pkg_name, spec in ssc.specs_map.items(): matches_for_spec = tuple( @@ -1342,7 +1351,8 @@ def __init__( # Group 4. Mutable working containers self.specs_map = {} - self.solution_precs = tuple(self.prefix_data.iter_records()) + self.solution_precs = None + self._init_solution_precs() self.add_back_map = {} # name: (prec, spec) self.final_environment_specs = None @@ -1365,9 +1375,16 @@ def pinned_specs(self): def set_repository_metadata(self, index, r): self.index, self.r = index, r + def _init_solution_precs(self): + if self.prune: + # DO NOT add existing prefix data to solution on prune + self.solution_precs = tuple() + else: + self.solution_precs = tuple(self.prefix_data.iter_records()) + def working_state_reset(self): self.specs_map = {} - self.solution_precs = tuple(self.prefix_data.iter_records()) + self._init_solution_precs() self.add_back_map = {} # name: (prec, spec) self.final_environment_specs = None
diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -429,6 +429,297 @@ def test_prune_1(tmpdir): assert convert_to_dist_str(link_precs) == link_order +def test_update_prune_1(tmpdir): + """Regression test: Ensure that update with prune is not taking the history + into account, since that stops it from removing packages that were removed + from the environment specs. + """ + specs = ( + MatchSpec("numpy"), + MatchSpec("python=2.7.3"), + ) + + with get_solver(tmpdir, specs) as solver: + final_state_1 = solver.solve_final_state() + pprint(convert_to_dist_str(final_state_1)) + order = add_subdir_to_iter( + ( + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::python-2.7.3-7", + "channel-1::numpy-1.7.1-py27_0", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + # Here numpy is removed from the specs (but the old specs are kept as + # history). + new_environment_specs = (MatchSpec("python=2.7.3"),) + + with get_solver( + tmpdir, + new_environment_specs, + prefix_records=final_state_1, + history_specs=specs, + ) as solver: + final_state_1 = solver.solve_final_state(prune=True) + pprint(convert_to_dist_str(final_state_1)) + + # Numpy should now be absent from the solved packages. + order = add_subdir_to_iter( + ( + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::python-2.7.3-7", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + +def test_update_prune_2(tmpdir): + """Regression test: Ensure that update with prune is pruning dependencies + of packages that are removed from environment as well. + """ + specs = ( + MatchSpec("python=2.7.3"), + MatchSpec("accelerate"), + ) + + with get_solver(tmpdir, specs) as solver: + final_state_1 = solver.solve_final_state() + pprint(convert_to_dist_str(final_state_1)) + order = add_subdir_to_iter( + ( + "channel-1::libnvvm-1.0-p0", + "channel-1::mkl-rt-11.0-p0", + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::llvm-3.2-0", + "channel-1::python-2.7.3-7", + "channel-1::bitarray-0.8.1-py27_0", + "channel-1::llvmpy-0.11.2-py27_0", + "channel-1::meta-0.4.2.dev-py27_0", + "channel-1::mkl-service-1.0.0-py27_p0", + "channel-1::numpy-1.7.1-py27_p0", + "channel-1::numba-0.8.1-np17py27_0", + "channel-1::numexpr-2.1-np17py27_p0", + "channel-1::scipy-0.12.0-np17py27_p0", + "channel-1::numbapro-0.11.0-np17py27_p0", + "channel-1::scikit-learn-0.13.1-np17py27_p0", + "channel-1::mkl-11.0-np17py27_p0", + "channel-1::accelerate-1.1.0-np17py27_p0", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + # Here accelerate is removed from the specs (but the old specs are kept as + # history). This should cause every dependency of accelerate to disappear + # from the pruned package list. + new_environment_specs = (MatchSpec("python=2.7.3"),) + + with get_solver( + tmpdir, + new_environment_specs, + prefix_records=final_state_1, + history_specs=specs, + ) as solver: + final_state_1 = solver.solve_final_state(prune=True) + pprint(convert_to_dist_str(final_state_1)) + + # Every dependecy of accelerate should now be absent from the solved + # packages. + order = add_subdir_to_iter( + ( + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::python-2.7.3-7", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + +def test_update_prune_3(tmpdir): + """Ensure that update with prune is not removing packages that are still + needed by remaining specs. + """ + specs = ( + MatchSpec("numpy"), + MatchSpec("python=2.7.3"), + MatchSpec("accelerate"), + ) + + with get_solver(tmpdir, specs) as solver: + final_state_1 = solver.solve_final_state() + pprint(convert_to_dist_str(final_state_1)) + order = add_subdir_to_iter( + ( + "channel-1::libnvvm-1.0-p0", + "channel-1::mkl-rt-11.0-p0", + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::llvm-3.2-0", + "channel-1::python-2.7.3-7", + "channel-1::bitarray-0.8.1-py27_0", + "channel-1::llvmpy-0.11.2-py27_0", + "channel-1::meta-0.4.2.dev-py27_0", + "channel-1::mkl-service-1.0.0-py27_p0", + "channel-1::numpy-1.7.1-py27_p0", + "channel-1::numba-0.8.1-np17py27_0", + "channel-1::numexpr-2.1-np17py27_p0", + "channel-1::scipy-0.12.0-np17py27_p0", + "channel-1::numbapro-0.11.0-np17py27_p0", + "channel-1::scikit-learn-0.13.1-np17py27_p0", + "channel-1::mkl-11.0-np17py27_p0", + "channel-1::accelerate-1.1.0-np17py27_p0", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + # Here accelerate is removed from the specs (but the old specs are kept as + # history). This should cause every dependency of accelerate to disappear + # from the pruned package list, but numpy should be kept, because it is still + # in the specs. + new_environment_specs = ( + MatchSpec("numpy"), + MatchSpec("python=2.7.3"), + ) + + with get_solver( + tmpdir, + new_environment_specs, + prefix_records=final_state_1, + history_specs=specs, + ) as solver: + final_state_1 = solver.solve_final_state(prune=True) + pprint(convert_to_dist_str(final_state_1)) + + # Every dependecy of accelerate should now be absent from the solved packages, + # but numpy should remain. + order = add_subdir_to_iter( + ( + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::python-2.7.3-7", + "channel-1::numpy-1.7.1-py27_0", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + +def test_update_prune_4(tmpdir): + """Regression test: Ensure that update with prune is not taking the history + into account, since that stops it from removing packages that were removed + from the environment specs. + """ + specs = ( + MatchSpec("numpy"), + MatchSpec("python=2.7.3"), + ) + + with get_solver(tmpdir, specs) as solver: + final_state_1 = solver.solve_final_state() + pprint(convert_to_dist_str(final_state_1)) + order = add_subdir_to_iter( + ( + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::python-2.7.3-7", + "channel-1::numpy-1.7.1-py27_0", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + # Here numpy is removed from the specs (but the old specs are kept as + # history). + new_environment_specs = (MatchSpec("python=2.7.3"),) + + with get_solver( + tmpdir, + new_environment_specs, + prefix_records=final_state_1, + history_specs=specs, + ) as solver: + final_state_1 = solver.solve_final_state( + prune=True, + update_modifier=UpdateModifier.FREEZE_INSTALLED, + ) + pprint(convert_to_dist_str(final_state_1)) + + # Numpy should now be absent from the solved packages. + order = add_subdir_to_iter( + ( + "channel-1::openssl-1.0.1c-0", + "channel-1::readline-6.2-0", + "channel-1::sqlite-3.7.13-0", + "channel-1::system-5.8-1", + "channel-1::tk-8.5.13-0", + "channel-1::zlib-1.2.7-0", + "channel-1::python-2.7.3-7", + ) + ) + assert convert_to_dist_str(final_state_1) == order + + [email protected]("prune", [True, False]) +def test_update_prune_5(tmpdir, prune, capsys): + """Regression test: Check that prefix data is not taken into account when solving on prune.""" + # "Create" a conda env with specs that "pin" dependencies. + specs = ( + MatchSpec("python=2.7"), + MatchSpec("numexpr==2.0.1=np17py27_p3"), + ) + with get_solver(tmpdir, specs) as solver: + final_state_1 = solver.solve_final_state() + + out, _ = capsys.readouterr() + assert "Updating numexpr is constricted by" not in out + + # If prefix data is evaluated it will conflict with "pinned" dependencies of new specs. + new_environment_specs = ( + MatchSpec("python=2.7"), + MatchSpec("numexpr==2.0.1=np17py27_p2"), + ) + with get_solver( + tmpdir, + new_environment_specs, + prefix_records=final_state_1, + history_specs=specs, + ) as solver: + solver.solve_final_state(prune=prune) + + out, _ = capsys.readouterr() + solve_using_prefix_data = not prune + assert ("Updating numexpr is constricted by" in out) is solve_using_prefix_data + + def test_force_remove_1(tmpdir): specs = (MatchSpec("numpy[version=*,build=*py27*]"),) with get_solver(tmpdir, specs) as solver:
conda env update --prune does not remove installed packages not defined in environment.yml **I'm submitting a...** - [x] bug report - [ ] feature request ## Current Behavior `conda env update --prune` does not remove packages no longer referenced in the `environment.yml` file. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> Define an `environment.yml` file in a project directory as follows: name: new-project-env dependencies: - python=3 - numpy In the project directory run the following commands: conda env create conda activate new-project-env python import numpy exit() This succeeds as expected. Update the `environment.yml` file as follows, **removing numpy**, name: new-project-env dependencies: - python=3 Run the following commands in the project directory: conda deactivate conda env update --prune conda activate new-project-env python import numpy exit() **This numpy import succeeds and seems like a bug**. ## Expected Behavior Per [the docs](https://conda.io/docs/commands/env/conda-env-update.html) (--prune means "remove installed packages not defined in environment.yml") I expect that after installing a package (numpy in the example above) and subsquently removing it from `environment.yml` the package should be removed from the relevant conda environment. ## Current Workaround I've found that we can use `conda env create --force` to overwrite the existing environment and thus ensure that the environment accurately reflects the `environment.yml` file. But this requires recreating the environment from scratch. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : new-project-env active env location : /home/mikhailgolubitsky/anaconda3/envs/new-project-env shell level : 2 user config file : /home/mikhailgolubitsky/.condarc populated config files : /home/mikhailgolubitsky/.condarc conda version : 4.5.3 conda-build version : 3.0.27 python version : 3.6.3.final.0 base environment : /home/mikhailgolubitsky/anaconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/pro/linux-64 https://repo.anaconda.com/pkgs/pro/noarch package cache : /home/mikhailgolubitsky/anaconda3/pkgs /home/mikhailgolubitsky/.conda/pkgs envs directories : /home/mikhailgolubitsky/anaconda3/envs /home/mikhailgolubitsky/.conda/envs platform : linux-64 user-agent : conda/4.5.3 requests/2.18.4 CPython/3.6.3 Linux/4.13.0-39-generic ubuntu/17.10 glibc/2.26 UID:GID : 1000:1000 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ==> /home/mikhailgolubitsky/.condarc <== channels: - conda-forge - defaults ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at /home/mikhailgolubitsky/anaconda3/envs/new-project-env: # # Name Version Build Channel ca-certificates 2018.4.16 0 conda-forge certifi 2018.4.16 py36_0 conda-forge intel-openmp 2018.0.0 8 defaults libgcc-ng 7.2.0 hdf63c60_3 defaults libgfortran-ng 7.2.0 hdf63c60_3 defaults mkl 2018.0.2 1 defaults mkl_fft 1.0.2 py36_0 conda-forge mkl_random 1.0.1 py36_0 conda-forge ncurses 5.9 10 conda-forge numpy 1.14.3 py36h14a74c5_0 defaults numpy-base 1.14.3 py36hdbf6ddf_0 defaults openssl 1.0.2o 0 conda-forge pip 9.0.3 py36_0 conda-forge python 3.6.5 1 conda-forge readline 7.0 0 conda-forge setuptools 39.1.0 py36_0 conda-forge sqlite 3.20.1 2 conda-forge tk 8.6.7 0 conda-forge wheel 0.31.0 py36_0 conda-forge xz 5.2.3 0 conda-forge zlib 1.2.11 0 conda-forge ``` </p></details>
This has the same root cause as #6809, but is a better summary of the issue. The problem is that conda looks through its history file and thinks that you've requested those specs in the past, so it adds them back. So, the behaviour of `--prune` since 4.4.0 has been that only dependencies, rather than explicitly requested packages, have been pruned. In my opinion, the fix would either be for `conda env update` to not take specs from the history at all, or for `conda env` operations to not populate the history at all, or both. If you'd like a workaround that is faster than `conda env create --force` you can truncate the history file located at `<env>/conda-meta/history` (the file needs to be present but can be empty). This confused me a lot also. The ```truncate the history file located at `<env>/conda-meta/history` ``` hack does not work any longer for me. I was testing conda 4.7.5 (windows and linux) when stumbled upon this. > In my opinion, the fix would either be for conda env update to not take specs from the history at all, or for conda env operations to not populate the history at all, or both. Seems like the correct approach, IMHO. Any comments from the team? We are willing to work on this and provide a PR, as we dearly depend on this and is preventing us from upgrading. I'm not sure I fully understand the desired behavior, but yes, absolutely, a PR to implement better behavior is welcome. The party I don't understand is why basing it on the history is bad. It seems like the history of explicit specs would be there best source of minimal information for env specs, but I must be missing the reasons why that doesn't work in practice. Perhaps the reason is that the removal part of the update is not factored in correctly? > I'm not sure I fully understand the desired behavior, but yes, absolutely, a PR to implement better behavior is welcome. Sure, let me explain with an example. ## conda <4.4 Suppose we have this `environment.yaml` file: ```yaml name: env-app dependencies: - python - pytest-mock ``` When running `conda env update` for the 1st time, conda creates an environment with `python`, `pytest-mock`, and their dependencies, including `pytest`, which `pytest-mock` depends on. If we change the `environment.yaml` to: ```yaml name: env-app dependencies: - python ``` and execute `conda env update` again, nothing happens, because by default it will only add to the environment, never remove. When we implemented `--prune` originally, its purpose was to remove every package and dependency not listed in the `environment.yaml` file. So adding `--prune` to the 2nd run, conda would uninstall `pytest-mock` and `pytest`, as they are no longer listed. ## conda 4.4+ This has changed since version 4.4 with the introduction of the history feature: conda keeps track of what was installed previously, so users typing `conda install` multiple times would get a consistent environment (that's my understanding of the feature). But this has also affected `conda env update --prune`, most likely unintentionally (I suspect the reason is that it uses `conda install` behind the scenes). So what happens in the 2nd run now, using `--prune`, is that `pytest-mock` and `pytest` are kept in the environment. So effectively `--prune` has been broken since 4.4, as it no longer removes previous packages. > The party I don't understand is why basing it on the history is bad. The main use case is to get the exact environment described in the yaml file, exactly what you would get with `conda create --force`, but much quicker as you don't have to delete/re-link everything. @msarahan are you OK with a PR fixing the behavior of `--prune` as I describe above? I see, thanks for the explanation. Yes, any PR that fixes this is welcome. It's not immediately obvious to me how to do it. Perhaps a flag like --replace-specs that ignores the history and only keeps the specs that are passed explicitly. The implementation of history specs being added in is in conda/core/solve.py in the _add_specs method. Let me know if you have any questions. Thanks for the pointers! Can we raise a warning or `NotImplementedError` for the update `--prune` option until it is fixed? It seems that the Conda project has relatively frequent releases, vs the expected time for this to get fixed. I am having trouble with the workaround as well (truncating the history file). Step to reproduce (conda 4.8.2): 1. conda create --clone base -n update-test 2. conda activate update-test 3. conda env export > orig.yml 4. conda install ipython 5. truncate --size 0 ~/miniconda3/envs/update-test/conda-meta/history 6. conda env update --prune -f orig.yml after those steps ipython is still installed.
2020-01-17T21:07:06Z
[]
[]
conda/conda
9,665
conda__conda-9665
[ "9599" ]
2cdd7ab052c2b96c088137f52dc40c613e99ce33
diff --git a/conda/cli/main.py b/conda/cli/main.py --- a/conda/cli/main.py +++ b/conda/cli/main.py @@ -84,6 +84,8 @@ def _main(*args, **kwargs): exit_code = do_call(args, p) if isinstance(exit_code, int): return exit_code + elif hasattr(exit_code, 'rc'): + return exit_code.rc if sys.platform == 'win32' and sys.version_info[0] == 2:
diff --git a/tests/test_cli.py b/tests/test_cli.py --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -162,3 +162,34 @@ def test_search_4(self): @pytest.mark.integration def test_search_5(self): self.assertIsInstance(capture_json_with_argv('conda search --platform win-32 --json'), dict) + +class TestRun(unittest.TestCase): + def test_run_returns_int(self): + from tests.test_create import make_temp_env + from tests.test_create import make_temp_prefix + + prefix = make_temp_prefix(name='test') + with make_temp_env(prefix=prefix): + stdout, stderr, result = run_inprocess_conda_command('conda run -p {} echo hi'.format(prefix)) + + assert isinstance(result, int) + + def test_run_returns_zero_errorlevel(self): + from tests.test_create import make_temp_env + from tests.test_create import make_temp_prefix + + prefix = make_temp_prefix(name='test') + with make_temp_env(prefix=prefix): + stdout, stderr, result = run_inprocess_conda_command('conda run -p {} exit 0'.format(prefix)) + + assert result == 0 + + def test_run_returns_nonzero_errorlevel(self): + from tests.test_create import make_temp_env + from tests.test_create import make_temp_prefix + + prefix = make_temp_prefix(name='test') + with make_temp_env(prefix=prefix) as prefix: + stdout, stderr, result = run_inprocess_conda_command('conda run -p "{}" exit 5'.format(prefix)) + + assert result == 5
conda run is not preserving exit code ## Current Behavior `conda run` used to return the correct exit status of the target process, but it doesn't anymore. This was apparently working correctly in conda 4.8.0 but it seems broken since version 4.8.1. `conda run` now erroneously always return the exit status of 0. This is a serious problem as jobs fail silently now. ### Steps to Reproduce ``` $ conda -V conda 4.8.1 $ conda run -n myenv /usr/bin/true; echo $? 0 $ conda run -n myenv /usr/bin/false; echo $? ERROR conda.cli.main_run:execute(30): Subprocess for 'conda run ['/usr/bin/false']' command failed. (See above for error) 0 ``` ## Expected Behavior `conda run` should preserve the exit status of the target process, whether the target is `python` or otherwise. It worked correctly with the previous version: ``` $ conda -V conda 4.8.0 $ conda run -n base /usr/bin/true; echo $? 0 $ conda run -n base /usr/bin/false; echo $? ERROR conda.cli.main_run:execute(39): Subprocess for 'conda run ['/usr/bin/false']' command failed. Stderr was: 1 ``` ## Environment Information This issue really is independent of the environment as it happens both in various dockerfiles and on MacOS too. --- @msarahan Please fix this bug considering I see a commit from 25 days that may have introduced it! Adding unit tests would also be wise.
Our team have many things to work on. PRs that try to fix this would be welcome if you are interested. Conda run is still not ready for prime time usage unfortunately. We are not churning out new conda features. It appears commit https://github.com/conda/conda/commit/c7d5ada5d0a6038e81f9ab10380e5e69c7d65d1c introduced the error. Returning a namedtuple (Response) instead of an int breaks this logic https://github.com/conda/conda/blob/e9a50561880696e57ba80472dce332e08e58ee0b/conda/cli/main.py#L84-L86 I can create a pull request to fix. Thoughts on reverting the return value to an int vs expanding the logic at the call site in main.py? I can't find rationale for changing the return value.
2020-02-06T03:55:50Z
[]
[]
conda/conda
9,730
conda__conda-9730
[ "9661" ]
901afcffb77b9a1132bfdb8381b2ce8afdc28c69
diff --git a/conda/core/subdir_data.py b/conda/core/subdir_data.py --- a/conda/core/subdir_data.py +++ b/conda/core/subdir_data.py @@ -14,7 +14,7 @@ import json from logging import DEBUG, getLogger from mmap import ACCESS_READ, mmap -from os.path import dirname, isdir, join, splitext +from os.path import dirname, isdir, join, splitext, exists import re from time import time import warnings @@ -29,6 +29,7 @@ from ..common.compat import (ensure_binary, ensure_text_type, ensure_unicode, iteritems, iterkeys, string_types, text_type, with_metaclass) from ..common.io import ThreadLimitedThreadPoolExecutor, DummyExecutor, dashlist +from ..common.path import url_to_path from ..common.url import join_url, maybe_unquote from ..core.package_cache_data import PackageCacheData from ..exceptions import (CondaDependencyError, CondaHTTPError, CondaUpgradeError, @@ -62,11 +63,19 @@ def __call__(cls, channel, repodata_fn=REPODATA_FN): assert channel.subdir assert not channel.package_filename assert type(channel) is Channel + now = time() cache_key = channel.url(with_credentials=True), repodata_fn - if not cache_key[0].startswith('file://') and cache_key in SubdirData._cache_: - return SubdirData._cache_[cache_key] - + if cache_key in SubdirData._cache_: + cache_entry = SubdirData._cache_[cache_key] + if cache_key[0].startswith('file://'): + file_path = url_to_path(channel.url() + '/' + repodata_fn) + if exists(file_path): + if cache_entry._mtime > getmtime(file_path): + return cache_entry + else: + return cache_entry subdir_data_instance = super(SubdirDataType, cls).__call__(channel, repodata_fn) + subdir_data_instance._mtime = now SubdirData._cache_[cache_key] = subdir_data_instance return subdir_data_instance @@ -75,6 +84,12 @@ def __call__(cls, channel, repodata_fn=REPODATA_FN): class SubdirData(object): _cache_ = {} + @classmethod + def clear_cached_local_channel_data(cls): + # This should only ever be needed during unit tests, when + # CONDA_USE_ONLY_TAR_BZ2 may change during process lifetime. + cls._cache_ = {k: v for k, v in cls._cache_.items() if not k[0].startswith('file://')} + @staticmethod def query_all(package_ref_or_match_spec, channels=None, subdirs=None, repodata_fn=REPODATA_FN): diff --git a/conftest.py b/conftest.py --- a/conftest.py +++ b/conftest.py @@ -8,6 +8,7 @@ from conda.common.compat import PY3 from conda.gateways.disk.create import TemporaryDirectory +from conda.core.subdir_data import SubdirData win_default_shells = ["cmd.exe", "powershell", "git_bash", "cygwin"] shells = ["bash", "zsh"] @@ -65,6 +66,11 @@ def set_tmpdir(tmpdir): tmpdir_in_use = td [email protected](autouse=True) +def clear_subdir_cache(tmpdir): + SubdirData.clear_cached_local_channel_data() + + # From: https://hackebrot.github.io/pytest-tricks/fixtures_as_class_attributes/ # This allows using pytest fixtures in unittest subclasses, here is how to use it: #
diff --git a/tests/core/test_subdir_data.py b/tests/core/test_subdir_data.py --- a/tests/core/test_subdir_data.py +++ b/tests/core/test_subdir_data.py @@ -4,6 +4,7 @@ from logging import getLogger from os.path import dirname, join from unittest import TestCase +from time import sleep import pytest @@ -201,16 +202,59 @@ def test_subdir_data_prefers_conda_to_tar_bz2(): def test_use_only_tar_bz2(): channel = Channel(join(dirname(__file__), "..", "data", "conda_format_repo", context.subdir)) + SubdirData.clear_cached_local_channel_data() with env_var('CONDA_USE_ONLY_TAR_BZ2', True, stack_callback=conda_tests_ctxt_mgmt_def_pol): sd = SubdirData(channel) precs = tuple(sd.query("zlib")) assert precs[0].fn.endswith(".tar.bz2") + SubdirData.clear_cached_local_channel_data() with env_var('CONDA_USE_ONLY_TAR_BZ2', False, stack_callback=conda_tests_ctxt_mgmt_def_pol): sd = SubdirData(channel) precs = tuple(sd.query("zlib")) assert precs[0].fn.endswith(".conda") +def test_metadata_cache_works(): + channel = Channel(join(dirname(__file__), "..", "data", "conda_format_repo", context.subdir)) + SubdirData.clear_cached_local_channel_data() + + # Sadly, on Windows, st_mtime resolution is limited to 2 seconds. (See note in Python docs + # on os.stat_result.) To ensure that the timestamp on the existing JSON file is safely + # in the past before this test starts, we need to wait for more than 2 seconds... + + sleep(3) + + with patch('conda.core.subdir_data.fetch_repodata_remote_request', + wraps=fetch_repodata_remote_request) as fetcher: + sd_a = SubdirData(channel) + precs_a = tuple(sd_a.query("zlib")) + assert fetcher.call_count == 1 + + sd_b = SubdirData(channel) + assert sd_b is sd_a + precs_b = tuple(sd_b.query("zlib")) + assert fetcher.call_count == 1 + + +def test_metadata_cache_clearing(): + channel = Channel(join(dirname(__file__), "..", "data", "conda_format_repo", context.subdir)) + SubdirData.clear_cached_local_channel_data() + + with patch('conda.core.subdir_data.fetch_repodata_remote_request', + wraps=fetch_repodata_remote_request) as fetcher: + sd_a = SubdirData(channel) + precs_a = tuple(sd_a.query("zlib")) + assert fetcher.call_count == 1 + + SubdirData.clear_cached_local_channel_data() + + sd_b = SubdirData(channel) + assert sd_b is not sd_a + precs_b = tuple(sd_b.query("zlib")) + assert fetcher.call_count == 2 + assert precs_b == precs_a + + # @pytest.mark.integration # class SubdirDataTests(TestCase): #
Conda 4.7+ extremely slow "Collecting package metadata (repodata.json)" with local (file:///) channels When installing or updating packages, conda gets stuck for an incredibly long time at the "Collecting package metadata (repodata.json)" step. This appears to be a regression caused by conda 4.7 (and remains in 4.8) as this operation was quite fast in conda 4.6. The slowdown only appears to occur when using (file:///) channels on a local or network filesystem. To test this I ran `python -m http.server 8000` in the channel parent directory and renamed channel URLs in `.condarc` from `file:///<DRIVE>:/<PATH>` to `http://localhost:8000/`. Commands then run in around the same time as they did in conda 4.6. <!-- Hi! Read this; it's important. Anaconda Community Code of Conduct: https://www.anaconda.com/community-code-of-conduct/ We get a lot of reports on the conda issue tracker about speed. These are mostly not very helpful, because they only very generally complain about the total time conda is taking. They often don’t even say what conda is taking so long to do - just that it’s slow. If you want to file an issue report about conda’s speed, we ask that you take the time to isolate exactly what part is slow, and what you think is a reasonable amount of time for that operation to take (preferably by comparison with another tool that is performing a similar task). Please see some tips below on how to collect useful information for a bug report. Complaints that include no useful information will be ignored and closed. --> ## Steps to Reproduce `conda update conda` or any other conda update/install command <!-- Show us some debugging output. Here we generate conda_debug_output.txt - please upload it with your report. * On unix (bash shells): CONDA_INSTRUMENTATION_ENABLED=1 <your conda command> -vv | tee conda_debug_output.txt * On Windows: set CONDA_INSTRUMENTATION_ENABLED=1 powershell "<your conda command> -vv | tee conda_debug_output.txt" --> [conda-debug.txt](https://github.com/conda/conda/files/4156708/conda-debug.txt) (note I exited (Ctrl+c) the command after a few minutes, normally it would run for an hour or more) ``` DEBUG conda.gateways.logging:set_verbosity(231): verbosity set to 2 DEBUG conda.core.solve:solve_final_state(223): solving prefix C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3 specs_to_remove: frozenset() specs_to_add: frozenset({MatchSpec("conda")}) prune: <auxlib._Null object at 0x0000024AA6792148> DEBUG conda.core.package_cache_data:_check_writable(259): package cache directory 'C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs' writable: True DEBUG conda.core.subdir_data:_load(241): Local cache timed out for file:///X:/<LOCAL-MIRROR-PATH>/msys2/noarch/repodata.json at C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs\cache\e8bdfbda.json DEBUG conda.core.subdir_data:_load(241): Local cache timed out for file:///X:/<LOCAL-MIRROR-PATH>/msys2/win-64/repodata.json at C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs\cache\270cd9d6.json DEBUG conda.core.subdir_data:_load(241): Local cache timed out for file:///X:/<LOCAL-MIRROR-PATH>/main/win-64/repodata.json at C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs\cache\a83aae50.json DEBUG conda.core.subdir_data:_load(241): Local cache timed out for file:///X:/<LOCAL-MIRROR-PATH>/main/noarch/repodata.json at C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs\cache\ce3ccb3a.json INFO conda._vendor.auxlib.logz:stringify(144): request is 'None' for Response object with url file:///X:/<LOCAL-MIRROR-PATH>/msys2/noarch/repodata.json DEBUG conda.core.subdir_data:fetch_repodata_remote_request(487): <<FILE 200 None < Content-Type: application/json < Last-Modified: Tue, 13 Nov 2018 03:00:11 GMT < Content-Length: 103 < Elapsed: 00:00.840189 { 'info': {'subdir': 'noarch'}, 'packages': {}, 'removed': [], 'repodata_version': 1} DEBUG conda.core.subdir_data:_pickle_me(284): Saving pickled state for file:///X:/<LOCAL-MIRROR-PATH>/msys2/noarch/repodata.json at C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs\cache\e8bdfbda.json INFO conda._vendor.auxlib.logz:stringify(144): request is 'None' for Response object with url file:///X:/<LOCAL-MIRROR-PATH>/msys2/win-64/repodata.json DEBUG conda.core.subdir_data:fetch_repodata_remote_request(487): <<FILE 200 None < Content-Type: application/json < Last-Modified: Thu, 30 Jan 2020 00:18:12 GMT < Content-Length: 227211 < Elapsed: 00:00.843118 { 'info': {'subdir': 'win-64'}, 'packages': { 'm2-autoconf-2.69-3.tar.bz2': { 'build': '3', 'build_number': 3, 'depends': [ 'm2-bash', INFO conda._vendor.auxlib.logz:stringify(144): request is 'None' for Response object with url file:///X:/<LOCAL-MIRROR-PATH>/main/noarch/repodata.json DEBUG conda.core.subdir_data:_pickle_me(284): Saving pickled state for file:///X:/<LOCAL-MIRROR-PATH>/msys2/win-64/repodata.json at C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs\cache\270cd9d6.json DEBUG conda.core.subdir_data:fetch_repodata_remote_request(487): <<FILE 200 None < Content-Type: application/json < Last-Modified: Thu, 30 Jan 2020 00:17:55 GMT < Content-Length: 704400 < Elapsed: 00:00.841911 { 'info': {'subdir': 'noarch'}, 'packages': { 'affine-2.1.0-pyh128a3a6_1.tar.bz2': { 'build': 'pyh128a3a6_1', 'build_number': 1, 'depends': ['py ``` ``` conda.core.prefix_data.PrefixData.load,0.565156 conda.core.solve.Solver._collect_all_metadata,119.613876 conda.core.prefix_data.PrefixData.load,0.163001 conda.core.solve.Solver._collect_all_metadata,9.134097 conda.core.prefix_data.PrefixData.load,0.161001 conda.core.solve.Solver._collect_all_metadata,84.478895 ``` ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : None shell level : 0 user config file : C:\Users\<USERNAME>\.condarc populated config files : C:\Users\<USERNAME>\.condarc conda version : 4.8.1 conda-build version : 3.18.11 python version : 3.7.6.final.0 virtual packages : base environment : C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3 (writable) channel URLs : file:///X:/<LOCAL-MIRROR-PATH>/main/win-64 file:///X:/<LOCAL-MIRROR-PATH>/main/noarch file:///X:/<LOCAL-MIRROR-PATH>/msys2/win-64 file:///X:/<LOCAL-MIRROR-PATH>/msys2/noarch package cache : C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\pkgs C:\Users\<USERNAME>\.conda\pkgs C:\Users\<USERNAME>\AppData\Local\conda\conda\pkgs envs directories : C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3\envs C:\Users\<USERNAME>\.conda\envs C:\Users\<USERNAME>\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.8.1 requests/2.22.0 CPython/3.7.6 Windows/10 Windows/10.0.17763 administrator : False netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ==> C:\Users\<USERNAME>\.condarc <== auto_update_conda: False auto_activate_base: False channel_alias: file:///X:/<LOCAL-MIRROR-PATH> channel_priority: disabled channels: - defaults default_channels: - main - msys2 show_channel_urls: True use_only_tar_bz2: True report_errors: False ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at C:\Users\<USERNAME>\AppData\Local\Programs\Miniconda3: # # Name Version Build Channel asn1crypto 1.3.0 py37_0 defaults backports 1.0 py_2 defaults backports.functools_lru_cache 1.6.1 py_0 defaults backports.tempfile 1.0 py_1 defaults backports.weakref 1.0.post1 py_1 defaults beautifulsoup4 4.8.2 py37_0 defaults bzip2 1.0.8 he774522_0 defaults ca-certificates 2019.11.27 0 defaults certifi 2019.11.28 py37_0 defaults cffi 1.13.2 py37h7a1dbc1_0 defaults chardet 3.0.4 py37_1003 defaults click 7.0 py_0 defaults conda 4.8.1 py37_0 defaults conda-build 3.18.11 py37_0 defaults conda-package-handling 1.6.0 py37h62dcd97_0 defaults conda-verify 3.4.2 py_1 defaults console_shortcut 0.1.1 3 https://repo.anaconda.com/pkgs/main constructor 3.0.0 py37_0 defaults cryptography 2.8 py37h7a1dbc1_0 defaults filelock 3.0.12 py_0 defaults freetype 2.9.1 ha9979f8_1 defaults future 0.18.2 py37_0 defaults glob2 0.7 py_0 defaults idna 2.8 py37_0 https://repo.anaconda.com/pkgs/main jinja2 2.10.3 py_0 defaults jpeg 9b hb83a4c4_2 defaults libarchive 3.3.3 h0643e63_5 defaults libiconv 1.15 h1df5818_7 defaults liblief 0.9.0 ha925a31_2 defaults libpng 1.6.37 h2a8f88b_0 defaults libtiff 4.1.0 h56a325e_0 defaults libxml2 2.9.9 h464c3ec_0 defaults lz4-c 1.8.1.2 h2fa13f4_0 defaults lzo 2.10 h6df0209_2 defaults m2-msys2-runtime 2.5.0.17080.65c939c 3 defaults m2-patch 2.7.5 2 defaults markupsafe 1.1.1 py37he774522_0 defaults menuinst 1.4.16 py37he774522_0 https://repo.anaconda.com/pkgs/main msys2-conda-epoch 20160418 1 defaults nsis 3.01 8 defaults olefile 0.46 py37_0 defaults openssl 1.1.1d he774522_3 defaults pillow 7.0.0 py37hcc1f983_0 defaults pip 20.0.2 py37_0 defaults pkginfo 1.5.0.1 py37_0 defaults powershell_shortcut 0.0.1 2 https://repo.anaconda.com/pkgs/main psutil 5.6.7 py37he774522_0 defaults py-lief 0.9.0 py37ha925a31_2 defaults pycosat 0.6.3 py37he774522_0 defaults pycparser 2.19 py_0 defaults pyopenssl 19.1.0 py37_0 defaults pysocks 1.7.1 py37_0 defaults python 3.7.6 h60c2a47_2 defaults python-dateutil 2.8.1 py_0 defaults python-libarchive-c 2.8 py37_13 defaults pytz 2019.3 py_0 defaults pywin32 227 py37he774522_1 defaults pyyaml 5.2 py37he774522_0 defaults requests 2.22.0 py37_1 defaults ruamel_yaml 0.15.87 py37he774522_0 defaults setuptools 45.1.0 py37_0 defaults six 1.14.0 py37_0 defaults soupsieve 1.9.5 py37_0 defaults sqlite 3.30.1 he774522_0 defaults tk 8.6.8 hfa6e2cd_0 defaults tqdm 4.42.0 py_0 defaults urllib3 1.25.8 py37_0 defaults vc 14.1 h0510ff6_4 https://repo.anaconda.com/pkgs/main vs2015_runtime 14.16.27012 hf0eaf9b_1 defaults wheel 0.33.6 py37_0 defaults win_inet_pton 1.1.0 py37_0 https://repo.anaconda.com/pkgs/main wincertstore 0.2 py37_0 https://repo.anaconda.com/pkgs/main xz 5.2.4 h2fa13f4_4 defaults yaml 0.1.7 hc54c509_2 https://repo.anaconda.com/pkgs/main zlib 1.2.11 h62dcd97_3 defaults zstd 1.3.7 h508b16e_0 defaults ``` </p></details>
I've seen the same thing, a dramatic slow-down in performance when using file-based channels, especially on slow NFS shares. I think I've found a solution and hope to submit a proper pull request in a day or two, but for now, this information might be useful... The new solver seems (under some circumstances) to create many instances of the SubDirData class for the same channel, when the old solver only produced one. That should be okay, as the class is loaded using a metaclass that implements a cache. So we should only create at most two instances per channel., one for "current_repodata.json" and (perhaps) one for "repodata.json". The problem is that this cache is explicitly disabled for file-based channels. That didn't matter much when we were only requesting each object once, but that's no longer the case. Each instance has to read the file, parse it, and write a copy back to a disk-based cache. That takes time on slow NFS drives. My proposed fix will be to change the if statement [here](https://github.com/conda/conda/blob/c154d2e3c68841a82376633f2ebc9ffc916dbf1c/conda/core/subdir_data.py#L66) so that it doesn't check for urls starting with "file:///". In my test case, I could add certain packages to an environment in 5.6 seconds using conda 4.6.8. When I upgraded to conda 4.8.2 that suddenly took 93 seconds. Hacking that if statement to allow caching for file-based urls brought it back down to 6.5 seconds. As I said, I hope to submit a proper pull request soon. If anyone else wants to do so, feel free. :)
2020-03-03T19:28:16Z
[]
[]
conda/conda
9,738
conda__conda-9738
[ "9737" ]
901afcffb77b9a1132bfdb8381b2ce8afdc28c69
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -485,8 +485,8 @@ def _find_inconsistent_packages(self, ssc): if inconsistent_precs: print(dedent(""" The environment is inconsistent, please check the package plan carefully - The following packages are causing the inconsistency:""")) - print(dashlist(inconsistent_precs)) + The following packages are causing the inconsistency:"""), file=sys.stderr) + print(dashlist(inconsistent_precs), file=sys.stderr) for prec in inconsistent_precs: # pop and save matching spec in specs_map spec = ssc.specs_map.pop(prec.name, None)
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -2138,8 +2138,10 @@ def test_conda_recovery_of_pip_inconsistent_env(self): rc = p.returncode assert int(rc) == 0 - stdout, stderr, _ = run_command(Commands.INSTALL, prefix, 'imagesize') - assert not stderr + stdout, stderr, _ = run_command(Commands.INSTALL, prefix, 'imagesize', '--json') + assert json.loads(stdout)['success'] + assert "The environment is inconsistent" in stderr + stdout, stderr, _ = run_command(Commands.LIST, prefix, '--json') pkgs = json.loads(stdout) for entry in pkgs:
inconsistent environment warning breaks --json <!-- Anaconda Community Code of Conduct: https://www.anaconda.com/community-code-of-conduct/ --> ## Current Behavior The ["environment is inconsistent"](https://github.com/conda/conda/blob/e9a50561880696e57ba80472dce332e08e58ee0b/conda/core/solve.py#L486-L489) warning goes to STDOUT and breaks `--json --dry-run` output. Observed with an environment which works perfectly fine and also `conda install` (without `--dry-run`) succeeds without issues. ### Steps to Reproduce ```bash conda create -y -n test python conda activate test # remove a non-essential package conda uninstall -y --force readline conda install --json --dry-run requests | json_verify ``` Output: ``` lexical error: invalid char in json text. The environment is inconsisten (right here) ------^ JSON is invalid ``` ## Expected Behavior Valid JSON. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : test active env location : /home/thomas/miniconda3/envs/test shell level : 2 user config file : /home/thomas/.condarc populated config files : /home/thomas/.condarc conda version : 4.7.12 conda-build version : 3.18.11 python version : 3.7.1.final.0 virtual packages : __cuda=10.2 base environment : /home/thomas/miniconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch package cache : /home/thomas/miniconda3/pkgs /home/thomas/.conda/pkgs envs directories : /home/thomas/miniconda3/envs /home/thomas/.conda/envs platform : linux-64 user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.1 Linux/5.5.4-arch1-1 arch/rolling glibc/2.31 UID:GID : 1000:100 netrc file : /home/thomas/.netrc offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ==> /home/thomas/.condarc <== auto_update_conda: False ssl_verify: True default_channels: - https://repo.anaconda.com/pkgs/main anaconda_upload: False ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at /home/thomas/miniconda3/envs/test: # # Name Version Build Channel _libgcc_mutex 0.1 main defaults ca-certificates 2020.1.1 0 defaults certifi 2019.11.28 py38_0 defaults ld_impl_linux-64 2.33.1 h53a641e_7 defaults libedit 3.1.20181209 hc058e9b_0 defaults libffi 3.2.1 hd88cf55_4 defaults libgcc-ng 9.1.0 hdf63c60_0 defaults libstdcxx-ng 9.1.0 hdf63c60_0 defaults ncurses 6.2 he6710b0_0 defaults openssl 1.1.1d h7b6447c_4 defaults pip 20.0.2 py38_1 defaults python 3.8.1 h0371630_1 defaults setuptools 45.2.0 py38_0 defaults sqlite 3.31.1 h7b6447c_0 defaults tk 8.6.8 hbc83047_0 defaults wheel 0.34.2 py38_0 defaults xz 5.2.4 h14c3975_4 defaults zlib 1.2.11 h7b6447c_3 defaults ``` </p></details>
2020-03-06T10:19:34Z
[]
[]
conda/conda
9,835
conda__conda-9835
[ "5562" ]
88670f35bd034fc0abe832d9e2a58ed211e87279
diff --git a/conda/gateways/connection/download.py b/conda/gateways/connection/download.py --- a/conda/gateways/connection/download.py +++ b/conda/gateways/connection/download.py @@ -186,6 +186,53 @@ def download( caused_by=e) +def download_text(url): + if sys.platform == 'win32': + preload_openssl() + if not context.ssl_verify: + disable_ssl_verify_warning() + try: + timeout = context.remote_connect_timeout_secs, context.remote_read_timeout_secs + session = CondaSession() + response = session.get(url, stream=True, proxies=session.proxies, timeout=timeout) + if log.isEnabledFor(DEBUG): + log.debug(stringify(response, content_max_len=256)) + response.raise_for_status() + except RequestsProxyError: + raise ProxyError() # see #3962 + except InvalidSchema as e: + if 'SOCKS' in text_type(e): + message = dals(""" + Requests has identified that your current working environment is configured + to use a SOCKS proxy, but pysocks is not installed. To proceed, remove your + proxy configuration, run `conda install pysocks`, and then you can re-enable + your proxy configuration. + """) + raise CondaDependencyError(message) + else: + raise + except (ConnectionError, HTTPError, SSLError) as e: + status_code = getattr(e.response, 'status_code', None) + if status_code == 404: + help_message = dals(""" + An HTTP error occurred when trying to retrieve this URL. + The URL does not exist. + """) + else: + help_message = dals(""" + An HTTP error occurred when trying to retrieve this URL. + HTTP errors are often intermittent, and a simple retry will get you on your way. + """) + raise CondaHTTPError(help_message, + url, + status_code, + getattr(e.response, 'reason', None), + getattr(e.response, 'elapsed', None), + e.response, + caused_by=e) + return response.text + + class TmpDownload(object): """ Context manager to handle downloads to a tempfile diff --git a/conda/gateways/connection/session.py b/conda/gateways/connection/session.py --- a/conda/gateways/connection/session.py +++ b/conda/gateways/connection/session.py @@ -24,6 +24,14 @@ RETRIES = 3 +CONDA_SESSION_SCHEMES = frozenset(( + "http", + "https", + "ftp", + "s3", + "file", +)) + class EnforceUnusedAdapter(BaseAdapter): def send(self, request, *args, **kwargs): diff --git a/conda_env/cli/main_create.py b/conda_env/cli/main_create.py --- a/conda_env/cli/main_create.py +++ b/conda_env/cli/main_create.py @@ -11,6 +11,7 @@ from conda._vendor.auxlib.path import expand from conda.cli import install as cli_install from conda.cli.conda_argparse import add_parser_json, add_parser_prefix, add_parser_networking +from conda.gateways.connection.session import CONDA_SESSION_SCHEMES from conda.gateways.disk.delete import rm_rf from conda.misc import touch_nonadmin from .common import get_prefix, print_result @@ -76,8 +77,13 @@ def execute(args, parser): name = args.remote_definition or args.name try: - spec = specs.detect(name=name, filename=expand(args.file), - directory=os.getcwd()) + url_scheme = args.file.split("://", 1)[0] + if url_scheme in CONDA_SESSION_SCHEMES: + filename = args.file + else: + filename = expand(args.file) + + spec = specs.detect(name=name, filename=filename, directory=os.getcwd()) env = spec.environment # FIXME conda code currently requires args to have a name or prefix diff --git a/conda_env/env.py b/conda_env/env.py --- a/conda_env/env.py +++ b/conda_env/env.py @@ -13,6 +13,8 @@ from conda.cli import common # TODO: this should never have to import form conda.cli from conda.common.serialize import yaml_load_standard from conda.core.prefix_data import PrefixData +from conda.gateways.connection.download import download_text +from conda.gateways.connection.session import CONDA_SESSION_SCHEMES from conda.models.enums import PackageType from conda.models.match_spec import MatchSpec from conda.models.prefix_graph import PrefixGraph @@ -144,11 +146,15 @@ def from_yaml(yamlstr, **kwargs): def from_file(filename): - if not os.path.exists(filename): + url_scheme = filename.split("://", 1)[0] + if url_scheme in CONDA_SESSION_SCHEMES: + yamlstr = download_text(filename) + elif not os.path.exists(filename): raise exceptions.EnvironmentFileNotFound(filename) - with open(filename, 'r') as fp: - yamlstr = fp.read() - return from_yaml(yamlstr, filename=filename) + else: + with open(filename, 'r') as fp: + yamlstr = fp.read() + return from_yaml(yamlstr, filename=filename) # TODO test explicitly diff --git a/conda_env/installers/pip.py b/conda_env/installers/pip.py --- a/conda_env/installers/pip.py +++ b/conda_env/installers/pip.py @@ -6,6 +6,7 @@ import os import os.path as op from conda._vendor.auxlib.compat import Utf8NamedTemporaryFile +from conda.gateways.connection.session import CONDA_SESSION_SCHEMES from conda_env.pip_util import pip_subprocess, get_pip_installed_packages from logging import getLogger @@ -27,10 +28,14 @@ def _pip_install_via_requirements(prefix, specs, args, *_, **kwargs): See: https://pip.pypa.io/en/stable/user_guide/#requirements-files https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format """ - try: - pip_workdir = op.dirname(op.abspath(args.file)) - except AttributeError: + url_scheme = args.file.split("://", 1)[0] + if url_scheme in CONDA_SESSION_SCHEMES: pip_workdir = None + else: + try: + pip_workdir = op.dirname(op.abspath(args.file)) + except AttributeError: + pip_workdir = None requirements = None try: # Generate the temporary requirements file diff --git a/conda_env/specs/__init__.py b/conda_env/specs/__init__.py --- a/conda_env/specs/__init__.py +++ b/conda_env/specs/__init__.py @@ -4,6 +4,7 @@ import os +from conda.gateways.connection.session import CONDA_SESSION_SCHEMES from .binstar import BinstarSpec from .notebook import NotebookSpec from .requirements import RequirementsSpec @@ -13,7 +14,7 @@ def detect(**kwargs): - filename = kwargs.get('filename') + filename = kwargs.get('filename', '') remote_definition = kwargs.get('name') # Check extensions @@ -21,10 +22,12 @@ def detect(**kwargs): fname, ext = os.path.splitext(filename) # First check if file exists and test the known valid extension for specs - file_exists = filename and os.path.isfile(filename) + file_exists = ( + os.path.isfile(filename) or filename.split("://", 1)[0] in CONDA_SESSION_SCHEMES + ) if file_exists: if ext == '' or ext not in all_valid_exts: - raise EnvironmentFileExtensionNotValid(filename) + raise EnvironmentFileExtensionNotValid(filename or None) elif ext in YamlFileSpec.extensions: specs = [YamlFileSpec] elif ext in RequirementsSpec.extensions: @@ -41,7 +44,7 @@ def detect(**kwargs): return spec if not file_exists and remote_definition is None: - raise EnvironmentFileNotFound(filename=filename) + raise EnvironmentFileNotFound(filename=filename or None) else: raise SpecNotFound(build_message(spec_instances))
diff --git a/tests/conda_env/test_cli.py b/tests/conda_env/test_cli.py --- a/tests/conda_env/test_cli.py +++ b/tests/conda_env/test_cli.py @@ -244,6 +244,22 @@ def test_create_valid_env(self): len([env for env in parsed['envs'] if env.endswith(test_env_name_1)]), 0 ) + @pytest.mark.integration + def test_conda_env_create_http(self): + ''' + Test `conda env create --file=https://some-website.com/environment.yml` + ''' + run_env_command( + Commands.ENV_CREATE, + None, + '--file', + 'https://raw.githubusercontent.com/conda/conda/master/tests/conda_env/support/simple.yml', + ) + try: + self.assertTrue(env_is_created("nlp")) + finally: + run_env_command(Commands.ENV_REMOVE, "nlp") + def test_update(self): create_env(environment_1) run_env_command(Commands.ENV_CREATE, None) diff --git a/tests/conda_env/test_env.py b/tests/conda_env/test_env.py --- a/tests/conda_env/test_env.py +++ b/tests/conda_env/test_env.py @@ -7,6 +7,7 @@ from conda.core.prefix_data import PrefixData from conda.base.context import conda_tests_ctxt_mgmt_def_pol +from conda.exceptions import CondaHTTPError from conda.models.match_spec import MatchSpec from conda.common.io import env_vars from conda.common.serialize import yaml_load @@ -77,6 +78,18 @@ def test_with_pip(self): assert 'foo' in e.dependencies['pip'] assert 'baz' in e.dependencies['pip'] + @pytest.mark.integration + def test_http(self): + e = get_simple_environment() + f = env.from_file("https://raw.githubusercontent.com/conda/conda/master/tests/conda_env/support/simple.yml") + self.assertEqual(e.dependencies, f.dependencies) + assert e.dependencies == f.dependencies + + @pytest.mark.integration + def test_http_raises(self): + with self.assertRaises(CondaHTTPError): + env.from_file("https://raw.githubusercontent.com/conda/conda/master/tests/conda_env/support/does-not-exist.yml") + class EnvironmentTestCase(unittest.TestCase): def test_has_empty_filename_by_default(self):
conda env create --url https://raw.githubusercontent.com/.../environment.yml I'm the maintainer for the datashader package, and I'm trying to streamline the process by which our users can set up an environment containing a bunch of libraries so that they can run our example scripts and notebooks. These libraries aren't dependencies of the main library, and so they aren't installed with the main `datashader` conda install, but we do want people to be able to get them all easily. For that reason, we provide an [environment file](https://raw.githubusercontent.com/bokeh/datashader/master/examples/environment.yml), but telling people to use that is complicated -- we either have to tell them to install datashader, then find the environment file wherever it ended up on their platform, or to go to the URL and download it using some platform-specific command or procedure, name it appropriately, then call it from the commandline. It would be vastly simpler for us our users if they could simply do the same command on all platforms to get the current environment: ``` conda env create --url https://raw.githubusercontent.com/bokeh/datashader/master/examples/environment.yml ``` Would that be feasible?
2020-04-12T17:25:06Z
[]
[]
conda/conda
10,022
conda__conda-10022
[ "3781" ]
45ad4a4b8e38aaa9299e971f69c630b4fcfd93b2
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py --- a/conda/cli/conda_argparse.py +++ b/conda/cli/conda_argparse.py @@ -55,6 +55,7 @@ def generate_parser(): sub_parsers.required = True configure_parser_clean(sub_parsers) + configure_parser_compare(sub_parsers) configure_parser_config(sub_parsers) configure_parser_create(sub_parsers) configure_parser_help(sub_parsers) @@ -860,6 +861,39 @@ def configure_parser_list(sub_parsers): ) p.set_defaults(func='.main_list.execute') +def configure_parser_compare(sub_parsers): + descr = "Compare packages between conda environments." + + # Note, the formatting of this is designed to work well with help2man + examples = dedent(""" + Examples: + + Compare packages in the current environment with respect to 'environment.yml': + + conda compare environment.yml + + Compare packages installed into the environment 'myenv' with respect to 'environment.yml': + + conda compare -n myenv environment.yml + + """) + p = sub_parsers.add_parser( + 'compare', + description=descr, + help=descr, + formatter_class=RawDescriptionHelpFormatter, + epilog=examples, + add_help=False, + ) + add_parser_help(p) + add_parser_json(p) + add_parser_prefix(p) + p.add_argument( + 'file', + action="store", + help="Path to the environment file that is to be compared against", + ) + p.set_defaults(func='.main_compare.execute') def configure_parser_package(sub_parsers): descr = "Low-level conda package utility. (EXPERIMENTAL)" diff --git a/conda/cli/main_compare.py b/conda/cli/main_compare.py new file mode 100644 --- /dev/null +++ b/conda/cli/main_compare.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from __future__ import absolute_import, division, print_function, unicode_literals + +import logging +import os + +from .common import stdout_json +from ..base.context import context +from ..common.compat import text_type +from ..core.prefix_data import PrefixData +from ..gateways.connection.session import CONDA_SESSION_SCHEMES +from ..gateways.disk.test import is_conda_environment +from .._vendor.auxlib.path import expand +from conda_env import exceptions, specs +from ..models.match_spec import MatchSpec + +log = logging.getLogger(__name__) + +def get_packages(prefix): + if not os.path.isdir(prefix): + from ..exceptions import EnvironmentLocationNotFound + raise EnvironmentLocationNotFound(prefix) + + return sorted(PrefixData(prefix, pip_interop_enabled=True).iter_records(), + key=lambda x: x.name) + +def _get_name_tuple(pkg): + return pkg.name, pkg + +def _to_str(pkg): + return "%s==%s=%s" % (pkg.name, pkg.version, pkg.build) + +def compare_packages(active_pkgs, specification_pkgs): + output = [] + res = 0 + ok = True + for pkg in specification_pkgs: + pkg_spec = MatchSpec(pkg) + name = pkg_spec.name + if name in active_pkgs: + if not pkg_spec.match(active_pkgs[name]): + ok = False + output.append("{} found but mismatch. Specification pkg: {}, Running pkg: {}" + .format(name, pkg, _to_str(active_pkgs[name]))) + else: + ok = False + output.append("{} not found".format(name)) + if ok: + output.append("Success. All the packages in the \ +specification file are present in the environment \ +with matching version and build string.") + else: + res = 1 + return res, output + +def execute(args, parser): + prefix = context.target_prefix + if not is_conda_environment(prefix): + from ..exceptions import EnvironmentLocationNotFound + raise EnvironmentLocationNotFound(prefix) + + try: + url_scheme = args.file.split("://", 1)[0] + if url_scheme in CONDA_SESSION_SCHEMES: + filename = args.file + else: + filename = expand(args.file) + + spec = specs.detect(name=args.name, filename=filename, directory=os.getcwd()) + env = spec.environment + + if args.prefix is None and args.name is None: + args.name = env.name + except exceptions.SpecNotFound: + raise + + active_pkgs = dict(map(_get_name_tuple, get_packages(prefix))) + specification_pkgs = [] + if 'conda' in env.dependencies: + specification_pkgs = specification_pkgs + env.dependencies['conda'] + if 'pip' in env.dependencies: + specification_pkgs = specification_pkgs + env.dependencies['pip'] + + exitcode, output = compare_packages(active_pkgs, specification_pkgs) + + if context.json: + stdout_json(output) + else: + print('\n'.join(map(text_type, output))) + + return exitcode
diff --git a/tests/test_cli.py b/tests/test_cli.py --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -112,6 +112,16 @@ def test_list(self, mockable_context_envs_dirs): assert mockable_context_envs_dirs.call_count > 0 + @pytest.mark.usefixtures("empty_env_tmpdir") + @patch("conda.base.context.mockable_context_envs_dirs") + def test_compare(self, mockable_context_envs_dirs): + mockable_context_envs_dirs.return_value = (self.tmpdir,) + stdout, stderr, rc = run_inprocess_conda_command('conda compare --name nonexistent tempfile.rc --json') + assert json.loads(stdout.strip())['exception_name'] == 'EnvironmentLocationNotFound' + assert stderr == '' + assert rc > 0 + assert mockable_context_envs_dirs.call_count > 0 + @pytest.mark.integration def test_search_0(self): with captured(): diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -196,6 +196,7 @@ def FORCE_temp_prefix(name=None, use_restricted_unicode=False): class Commands: + COMPARE = "compare" CONFIG = "config" CLEAN = "clean" CREATE = "create" @@ -246,7 +247,7 @@ def run_command(command, prefix, *arguments, **kwargs): if command is Commands.CONFIG: arguments.append('--file') arguments.append(join(prefix, 'condarc')) - if command in (Commands.LIST, Commands.CREATE, Commands.INSTALL, + if command in (Commands.LIST, Commands.COMPARE, Commands.CREATE, Commands.INSTALL, Commands.REMOVE, Commands.UPDATE, Commands.RUN): arguments.insert(0, '-p') arguments.insert(1, prefix) @@ -913,6 +914,39 @@ def test_list_with_pip_wheel(self): assert not isdir(prefix) assert prefix not in PrefixData._cache_ + def test_compare_success(self): + with make_temp_env("python=3.6", "flask=1.0.2", "bzip2=1.0.8") as prefix: + env_file = join(prefix, 'env.yml') + touch(env_file) + with open(env_file, "w") as f: + f.write( +"""name: dummy +channels: + - defaults +dependencies: + - bzip2=1.0.8 + - flask>=1.0.1,<=1.0.4""") + output, _, _ = run_command(Commands.COMPARE, prefix, env_file, "--json") + assert "Success" in output + rmtree(prefix, ignore_errors=True) + + def test_compare_fail(self): + with make_temp_env("python=3.6", "flask=1.0.2", "bzip2=1.0.8") as prefix: + env_file = join(prefix, 'env.yml') + touch(env_file) + with open(env_file, "w") as f: + f.write( +"""name: dummy +channels: + - defaults +dependencies: + - yaml + - flask=1.0.3""") + output, _, _ = run_command(Commands.COMPARE, prefix, env_file, "--json") + assert "yaml not found" in output + assert "flask found but mismatch. Specification pkg: flask=1.0.3, Running pkg: flask==1.0.2=py36_1" in output + rmtree(prefix, ignore_errors=True) + def test_install_tarball_from_local_channel(self): # Regression test for #2812 # install from local channel
[ENH] Compare environments I find I am often in a situation where I want to know if my current Conda environment matches the environment specification of an `environment.yml` file or a `requirements.txt` file or some other specification of Conda packages. Why? Because as much as I love Conda environments, sometimes I'd like to know: *"Can I just run this in my current environment without changing anything? Because if so, then I know others can also run this thing in this same environment that I know they have access to, rather than having to complicate my life and theirs with instructions on how to augment their current environment appropriately."* So off the top of my head this would mean the ability to do something like: ``` conda compare environment.yml # report on delta between current environment and environment.yml conda compare foo bar # where foo and bar are two named environments ``` But as it stands I end up writing some complicated `conda list -e | grep` statements by hand, after doing `cat environment.yml`.
This would be really great. I often encounter problems with parallelization where some commands are executed on a Jupyterhub server and some on a cluster that it is connected to via ssh. In order to run everything successfully, I need to ensure that the environments on both machines are the same. Right now I do it by just comparing the outputs of `conda list --export`. I agree this would be nice to have - I came across a bug in pytest/py and it took me a while to figure out where the problem was - a side by side comparison like this would be really helpful - ``` > conda compare root fooenv # installed packages root fooenv alabaster 0.7.10 anaconda 5.0.1 anaconda-client 1.6.5 anaconda-navigator 1.6.9 anaconda-project 0.8.0 asn1crypto 0.22.0 0.22.0 astroid 1.5.3 astropy 2.0.2 attrs 17.3.0 babel 2.5.0 ``` I find it quite comfortable to use a diff tool of my choice, i.e., ```bash $diffTool <(conda list -n env1) <(conda list -n env2) ``` or for environment files ```bash $diffTool env1.yml <(conda list -en env2) ``` with `$diffTool` being any of `diff`, `diff -y`, `sdiff`, `meld`, ... That way use can even use a tool to do 3-way compares, like ```bash meld base.yml <(conda list -en env1) <(conda list -en env2) ``` IMHO, a `conda compare` (if needed at all) could just be simple wrapper around a diff tool (e.g., given by a parameter `--diff-tool=sdiff`). So the only own functionality would just have to be parsing its arguments to determine whether they are YAML files or environment names/paths. I was just using `diff` on the output of `conda list`-- and it was actually pretty unhelpful. I guess the problem is that the two environments are too different -- one had a bunch of extra packages, as well as maybe some different versions of the same package -- so the diff was pretty ugly. I;d live a tool that gave a me a clean difference: - these packages are in a and not b - these packages are in b and not a - these packages are in both but different versions OK -- off to write that ---- -CHB DONE. Here is a hacked-together python script that compares two conda environments: https://gist.github.com/ChrisBarker-NOAA/00106a2af2029259ba7496f865c39086 It would be great if similar functionality could be built in to conda. PR for conda welcome Chris! On Wed, Sep 19, 2018, 9:15 AM Chris Barker <[email protected]> wrote: > DONE. > > Here is a hacked-together python script that compares two conda > environments: > > https://gist.github.com/ChrisBarker-NOAA/00106a2af2029259ba7496f865c39086 > > IT would be great if similar functionality could be built in to conda. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/conda/conda/issues/3781#issuecomment-422703511>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AA_pdBt1j6UX6MuJ1GwP9b78LIXMy9Bbks5ucf0ogaJpZM4KmHBb> > . > @mingwandroid: yeah, that would be nice. But would require familiarizing myself with the conda code first -- hopefully I'll have time some day, but don't hold your breath :-( But nice to know you're open to the idea -- if anyone else has the rountoits, feel free to get ideas from my code -- I was pleasantly surprised how easy it was to use a sets to get out what I wanted -- I'd hardly ever used sets for anything meaningful before ... I had an issue on this topic. When I typed `conda info --envs`, I was given a list that included two different environments with the same name, except one was capitalized. I don't know how I got myself into this predicament. I ran @ChrisBarker-NOAA's tool on these two envs, and they were identical. Here's my stupid part: I tried to delete one, and it deleted both. This was on a Mac. The Mac is weird. It has a case insensitive, but case preserving file system. This behaves oddly with *nix tools that are case sensitive. I’m not sure conda can prevent these oddities. I would like to work on this issue. I encountered a similar issue to what the OP did and have written this script: https://github.com/sidhant007/DiffConda to compare between the current conda env and a particular yml config file. OP's motivation was to be able to check if a condo environment is capable of running what is mentioned in an environment specification (a .yml file) I think the use-case that @ChrisBarker-NOAA highlighted, i.e to be able to compare two different conda envs is less-interesting because if the user already has the two conda environments created then they will just switch to the one required, on the contrary the OP's aim was to avoid creating the second environment if the .yml file showed that is a subset of the current environment. So for the first iteration (a basic version of conda compare), I would like to propose this: 1. `conda compare environment.yml` - Reports packages lacking in the current environment required by `environment.yml` and if there are any version mismatches. 2. `conda compare -n myenv environment.yml` - Same as above except in this we consider the environment as `myenv` Implementation wise: It will be similar to how `conda list` is written, since this is also a command that won't change anything on the backend. We use [package match specifications](https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications) to define whether a package in the current environment "matches" with the one mentioned in the `environment.yml`. Are they are any suggestions/objections to such a feature? Well, what you find interesting depends on what you need to do :-) -- in my case, I knew that one of the environments I had didn't work, but I did't know why. The problem is that if you build two environments from the same spec at different times, you get a different result if some packages have been updated and aren't pinned. or if you had an environment and added packages one by one. Anyway, what people find interesting aside, the ability to compare environments is useful, and it would be good if it could be done from a environment file OR a live environment with the same code. But what is being asked for now is another step: testing whether a given application can run in a given environment, which would require, as stated, using package match specifications, which means checking against a requirements file, not an environemnt.yaml. checking: "does anything need to be changed in this environment to fit this spec" has got to be in conda already. I'm pretty that in the general case, there is no robust way to say whether an application that can run in one environment will run in another one without knowing its requirements (unless the environments are identical) -- there's no way to know what particular version it might need otherwise. So: > OP's motivation was to be able to check if a condo environment is capable of running what is mentioned in an environment specification (a .yml file) that depends on the environment specification -- is in in "match" form, which could work, or a full, everything pinned version, which would not work in the general case. -CHB
2020-06-22T11:08:06Z
[]
[]
conda/conda
10,057
conda__conda-10057
[ "9896" ]
45ad4a4b8e38aaa9299e971f69c630b4fcfd93b2
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -390,6 +390,14 @@ def _collect_all_metadata(self, ssc): if pkg_name not in ssc.specs_map and ssc.prefix_data.get(pkg_name, None): ssc.specs_map[pkg_name] = MatchSpec(pkg_name) + # Add virtual packages so they are taken into account by the solver + virtual_pkg_index = {} + _supplement_index_with_system(virtual_pkg_index) + virtual_pkgs = [p.name for p in virtual_pkg_index.keys()] + for virtual_pkgs_name in (virtual_pkgs): + if virtual_pkgs_name not in ssc.specs_map: + ssc.specs_map[virtual_pkgs_name] = MatchSpec(virtual_pkgs_name) + for prec in ssc.prefix_data.iter_records(): # first check: add everything if we have no history to work with. # This happens with "update --all", for example. diff --git a/conda/exceptions.py b/conda/exceptions.py --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -679,11 +679,11 @@ def __init__(self, bad_deps, chains=True, strict=False): The following specifications were found to be incompatible with each other: '''), - 'cuda': dals(''' + 'virtual_package': dals(''' -The following specifications were found to be incompatible with your CUDA driver:\n{specs} +The following specifications were found to be incompatible with your system:\n{specs} -Your installed CUDA driver is: {ref} +Your installed version is: {ref} ''')} msg = "" diff --git a/conda/resolve.py b/conda/resolve.py --- a/conda/resolve.py +++ b/conda/resolve.py @@ -292,7 +292,8 @@ def _classify_bad_deps(self, bad_deps, specs_to_add, history_specs, strict_chann classes = {'python': set(), 'request_conflict_with_history': set(), 'direct': set(), - 'cuda': set(), } + 'virtual_package': set(), + } specs_to_add = set(MatchSpec(_) for _ in specs_to_add or []) history_specs = set(MatchSpec(_) for _ in history_specs or []) for chain in bad_deps: @@ -307,10 +308,10 @@ def _classify_bad_deps(self, bad_deps, specs_to_add, history_specs, strict_chann set(self.find_matches(chain[-1]))): classes['python'].add((tuple([chain[0], chain[-1]]), str(MatchSpec(python_spec, target=None)))) - elif chain[-1].name == '__cuda': - cuda_version = [_ for _ in self._system_precs if _.name == '__cuda'] - cuda_version = cuda_version[0].version if cuda_version else "not available" - classes['cuda'].add((tuple(chain), cuda_version)) + elif chain[-1].name.startswith('__'): + version = [_ for _ in self._system_precs if _.name == chain[-1].name] + virtual_package_version = version[0].version if version else "not available" + classes['virtual_package'].add((tuple(chain), virtual_package_version)) elif chain[0] in specs_to_add: match = False for spec in history_specs: @@ -444,6 +445,8 @@ def build_conflict_map(self, specs, specs_to_add=None, history_specs=None): strict_channel_priority = context.channel_priority == ChannelPriority.STRICT specs = set(specs) | (specs_to_add or set()) + # Remove virtual packages + specs = set([spec for spec in specs if not spec.name.startswith('__')]) if len(specs) == 1: matches = self.find_matches(next(iter(specs))) if len(matches) == 1:
diff --git a/tests/core/test_solve.py b/tests/core/test_solve.py --- a/tests/core/test_solve.py +++ b/tests/core/test_solve.py @@ -236,6 +236,16 @@ def test_solve_2(tmpdir): assert len(prec_names) == len(set(prec_names)) +def test_virtual_package_solver(tmpdir): + specs = MatchSpec("cudatoolkit"), + + with env_var('CONDA_OVERRIDE_CUDA', '10.0'): + with get_solver_cuda(tmpdir, specs) as solver: + final_state = solver.solve_final_state() + # Check the cuda virtual package is included in the solver + assert '__cuda' in solver.ssc.specs_map.keys() + + def test_cuda_1(tmpdir): specs = MatchSpec("cudatoolkit"), @@ -282,12 +292,13 @@ def test_cuda_fail_1(tmpdir): plat = "win-64" else: plat = "linux-64" - assert str(exc.value).strip() == dals("""The following specifications were found to be incompatible with your CUDA driver: + + assert str(exc.value).strip() == dals("""The following specifications were found to be incompatible with your system: - feature:/{}::__cuda==8.0=0 - cudatoolkit -> __cuda[version='>=10.0|>=9.0'] -Your installed CUDA driver is: 8.0""".format(plat)) +Your installed version is: 8.0""".format(plat)) @@ -299,11 +310,12 @@ def test_cuda_fail_2(tmpdir): with get_solver_cuda(tmpdir, specs) as solver: with pytest.raises(UnsatisfiableError) as exc: final_state = solver.solve_final_state() - assert str(exc.value).strip() == dals("""The following specifications were found to be incompatible with your CUDA driver: + + assert str(exc.value).strip() == dals("""The following specifications were found to be incompatible with your system: - cudatoolkit -> __cuda[version='>=10.0|>=9.0'] -Your installed CUDA driver is: not available""") +Your installed version is: not available""") def test_prune_1(tmpdir): specs = MatchSpec("numpy=1.6"), MatchSpec("python=2.7.3"), MatchSpec("accelerate"), diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -2112,34 +2112,23 @@ def test_install_freezes_env_by_default(self): # create an initial env with make_temp_env("python=2", use_restricted_unicode=on_win, no_capture=True) as prefix: assert package_is_installed(prefix, "python=2.7.*") + # Install a version older than the last one + run_command(Commands.INSTALL, prefix, "setuptools=40.*") + stdout, stderr, _ = run_command(Commands.LIST, prefix, '--json') + pkgs = json.loads(stdout) - specs = set() - for entry in pkgs: - if entry['name'] in DEFAULT_AGGRESSIVE_UPDATE_PACKAGES: - specs.add(MatchSpec(entry['name'])) - else: - specs.add(MatchSpec(entry['name'], - version=entry['version'], - channel=entry['channel'], - subdir=entry['platform'], - build=entry['build_string'])) - ms = MatchSpec('imagesize') - specs.add(ms) - - import conda.core.solve - r = conda.core.solve.Resolve(get_index()) - reduced_index = r.get_reduced_index([ms]) - - # now add imagesize to that env. The call to get_reduced_index should include our exact specs - # for the existing env. doing so will greatly reduce the search space for the initial solve - with patch.object(conda.core.solve.Resolve, 'get_reduced_index', - return_value=reduced_index) as mock_method: - run_command(Commands.INSTALL, prefix, "imagesize") - # TODO: this should match the specs above. It does, at least as far as I can tell from text - # comparison. Unfortunately, it doesn't evaluate as a match, even though the text all matches. - # I suspect some strange equality of objects issue. - mock_method.assert_called_with(specs, exit_on_conflict=False) + + run_command(Commands.INSTALL, prefix, "imagesize", "--freeze-installed") + + stdout, _, _ = run_command(Commands.LIST, prefix, '--json') + pkgs_after_install = json.loads(stdout) + + # Compare before and after installing package + for pkg in pkgs: + for pkg_after in pkgs_after_install: + if pkg["name"] == pkg_after["name"]: + assert pkg["version"] == pkg_after["version"] @pytest.mark.skipif(on_win, reason="gawk is a windows only package") def test_search_gawk_not_win_filter(self):
cudatoolkit run constrain on __cuda not used for solve <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. Anaconda Community Code of Conduct: https://www.anaconda.com/community-code-of-conduct/ If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior Recently we added a repodata patch to `cudatoolkit` to constrain its version based on the `__cuda` virtual package's version ( https://github.com/AnacondaRecipes/repodata-hotfixes/pull/81 ) (IOW the max version of CUDA the GPU driver will support). However it seems this isn't respected when installing `cudatoolkit`. Instead one needs to prod `conda` a bit to get it to consider `__cuda`. ### Steps to Reproduce Running the following does not take into account the `__cuda` version supported. <details> <summary> ``` conda create -d -n test_cuda cudatoolkit ``` </summary> ``` Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/ubuntu/miniforge/envs/test_cuda added / updated specs: - cudatoolkit The following packages will be downloaded: package | build ---------------------------|----------------- _libgcc_mutex-0.1 | main 3 KB cudatoolkit-10.2.89 | hfd86e86_0 539.3 MB libgcc-ng-9.1.0 | hdf63c60_0 8.1 MB libstdcxx-ng-9.1.0 | hdf63c60_0 4.0 MB ------------------------------------------------------------ Total: 551.5 MB The following NEW packages will be INSTALLED: _libgcc_mutex pkgs/main/linux-64::_libgcc_mutex-0.1-main cudatoolkit pkgs/main/linux-64::cudatoolkit-10.2.89-hfd86e86_0 libgcc-ng pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0 libstdcxx-ng pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0 DryRunExit: Dry run. Exiting. ``` </details> However adding `__cuda` to the install spec does work. <details> <summary> ``` conda create -d -n test_cuda __cuda cudatoolkit ``` </summary> ``` Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/ubuntu/miniforge/envs/test_cuda added / updated specs: - __cuda - cudatoolkit The following packages will be downloaded: package | build ---------------------------|----------------- cudatoolkit-10.1.243 | h6bb024c_0 513.2 MB ------------------------------------------------------------ Total: 513.2 MB The following NEW packages will be INSTALLED: cudatoolkit pkgs/main/linux-64::cudatoolkit-10.1.243-h6bb024c_0 DryRunExit: Dry run. Exiting. ``` </details> Interestingly we also observe compiler runtime packages installed in the first case, but not in the second. Unclear on why that happens, but may also be related to the same issue. ## Expected Behavior When installing `cudatoolkit` or really anything that depends on `cudatoolkit`, `__cuda` should be factored into the solve. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : base active env location : /datasets/jkirkham/miniconda shell level : 1 user config file : /home/nfs/jkirkham/.condarc populated config files : /home/nfs/jkirkham/.condarc conda version : 4.8.3 conda-build version : 3.19.2 python version : 3.7.6.final.0 virtual packages : __cuda=10.1 __glibc=2.27 base environment : /datasets/jkirkham/miniconda (writable) channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://conda.anaconda.org/nvidia/linux-64 https://conda.anaconda.org/nvidia/noarch package cache : /datasets/jkirkham/miniconda/pkgs /home/nfs/jkirkham/.conda/pkgs envs directories : /datasets/jkirkham/miniconda/envs /home/nfs/jkirkham/.conda/envs platform : linux-64 user-agent : conda/4.8.3 requests/2.23.0 CPython/3.7.6 Linux/4.15.0-76-generic ubuntu/18.04.4 glibc/2.27 UID:GID : 10124:10004 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ==> /home/nfs/jkirkham/.condarc <== channels: - conda-forge - defaults - nvidia show_channel_urls: True ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at /datasets/jkirkham/miniconda: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 0_gnu conda-forge beautifulsoup4 4.9.0 py37hc8dfbb8_0 conda-forge brotlipy 0.7.0 py37h8f50634_1000 conda-forge bzip2 1.0.8 h516909a_2 conda-forge ca-certificates 2020.4.5.1 hecc5488_0 conda-forge certifi 2020.4.5.1 py37hc8dfbb8_0 conda-forge cffi 1.14.0 py37hd463f26_0 conda-forge chardet 3.0.4 py37hc8dfbb8_1006 conda-forge conda 4.8.3 py37hc8dfbb8_1 conda-forge conda-build 3.19.2 py37hc8dfbb8_0 conda-forge conda-package-handling 1.6.0 py37h8f50634_2 conda-forge cryptography 2.9.2 py37hb09aad4_0 conda-forge filelock 3.0.10 py_0 conda-forge glob2 0.7 py_0 conda-forge icu 64.2 he1b5a44_1 conda-forge idna 2.9 py_1 conda-forge jinja2 2.11.2 pyh9f0ad1d_0 conda-forge ld_impl_linux-64 2.34 h53a641e_0 conda-forge libarchive 3.3.3 h3a8160c_1008 conda-forge libffi 3.2.1 he1b5a44_1007 conda-forge libgcc-ng 9.2.0 h24d8f2e_2 conda-forge libgomp 9.2.0 h24d8f2e_2 conda-forge libiconv 1.15 h516909a_1006 conda-forge liblief 0.9.0 hf8a498c_1 conda-forge libstdcxx-ng 9.2.0 hdf63c60_2 conda-forge libxml2 2.9.10 hee79883_0 conda-forge lz4-c 1.9.2 he1b5a44_0 conda-forge lzo 2.10 h14c3975_1000 conda-forge markupsafe 1.1.1 py37h8f50634_1 conda-forge ncurses 6.1 hf484d3e_1002 conda-forge openssl 1.1.1g h516909a_0 conda-forge patchelf 0.10 he1b5a44_0 conda-forge pip 20.0.2 py_2 conda-forge pkginfo 1.5.0.1 py_0 conda-forge psutil 5.7.0 py37h8f50634_1 conda-forge py-lief 0.9.0 py37he1b5a44_1 conda-forge pycosat 0.6.3 py37h8f50634_1004 conda-forge pycparser 2.20 py_0 conda-forge pyopenssl 19.1.0 py_1 conda-forge pysocks 1.7.1 py37hc8dfbb8_1 conda-forge python 3.7.6 h8356626_5_cpython conda-forge python-libarchive-c 2.9 py37_0 conda-forge python_abi 3.7 1_cp37m conda-forge pytz 2020.1 pyh9f0ad1d_0 conda-forge pyyaml 5.3.1 py37h8f50634_0 conda-forge readline 8.0 hf8c457e_0 conda-forge requests 2.23.0 pyh8c360ce_2 conda-forge ripgrep 12.0.1 h516909a_1 conda-forge ruamel_yaml 0.15.80 py37h8f50634_1001 conda-forge setuptools 46.1.3 py37hc8dfbb8_0 conda-forge six 1.14.0 py_1 conda-forge soupsieve 1.9.4 py37hc8dfbb8_1 conda-forge sqlite 3.30.1 hcee41ef_0 conda-forge tk 8.6.10 hed695b0_0 conda-forge tqdm 4.45.0 pyh9f0ad1d_1 conda-forge urllib3 1.25.9 py_0 conda-forge wheel 0.34.2 py_1 conda-forge xz 5.2.5 h516909a_0 conda-forge yaml 0.2.4 h516909a_0 conda-forge zlib 1.2.11 h516909a_1006 conda-forge zstd 1.4.4 h6597ccf_3 conda-forge ``` </p></details>
2020-07-08T15:53:13Z
[]
[]
conda/conda
10,086
conda__conda-10086
[ "9755" ]
63204e684c8a6ea609c789bb83da4fc111ebd1f5
diff --git a/conda/cli/main_remove.py b/conda/cli/main_remove.py --- a/conda/cli/main_remove.py +++ b/conda/cli/main_remove.py @@ -4,6 +4,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals import logging +from os.path import isfile, join import sys from .common import check_non_admin, specs_from_args @@ -13,7 +14,7 @@ from ..core.link import PrefixSetup, UnlinkLinkTransaction from ..core.prefix_data import PrefixData from ..core.solve import Solver -from ..exceptions import CondaEnvironmentError, CondaValueError +from ..exceptions import CondaEnvironmentError, CondaValueError, DirectoryNotACondaEnvironmentError from ..gateways.disk.delete import rm_rf, path_is_clean from ..models.match_spec import MatchSpec from ..exceptions import PackagesNotFoundError @@ -54,6 +55,8 @@ def execute(args, parser): if prefix == context.root_prefix: raise CondaEnvironmentError('cannot remove root environment,\n' ' add -n NAME or -p PREFIX option') + if not isfile(join(prefix, 'conda-meta', 'history')): + raise DirectoryNotACondaEnvironmentError(prefix) print("\nRemove all packages in environment %s:\n" % prefix, file=sys.stderr) if 'package_names' in args:
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -2878,6 +2878,22 @@ def test_remove_empty_env(self): run_command(Commands.CREATE, prefix) run_command(Commands.REMOVE, prefix, '--all') + def test_remove_ignore_nonenv(self): + with tempdir() as test_root: + prefix = join(test_root, "not-an-env") + filename = join(prefix, "file.dat") + + os.mkdir(prefix) + with open(filename, "wb") as empty: + pass + + with pytest.raises(DirectoryNotACondaEnvironmentError): + run_command(Commands.REMOVE, prefix, "--all") + + assert(exists(filename)) + assert(exists(prefix)) + + @pytest.mark.skipif(True, reason="get the rest of Solve API worked out first") @pytest.mark.integration class PrivateEnvIntegrationTests(TestCase):
conda remove erased directories not from a conda environment <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. Anaconda Community Code of Conduct: https://www.anaconda.com/community-code-of-conduct/ If your issue is a bug report or feature request for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> If you continue on, and especially if you are submitting a bug report, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> **I'm submitting a...** - [x ] bug report ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> `conda remove -p /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy --all` removed all my files and directories even though they were not an environment. The intended command was `conda remove -p /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3 --all` but the environment name was not added by mistake. Result: **2.5Tb** of data are gone... ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> Use of `conda remove` with a PATH that is not an environment. ``` conda remove -p /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy --all ``` ## Expected Behavior <!-- What do you think should happen? --> Conda should be able to know what is a conda env and what not. Erasing all directories and files without checking first (not sure if this is true) is not ideal. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` conda info active environment : None shell level : 0 user config file : /dss/dsshome1/lxc04/di52zuy/.condarc populated config files : /dss/dsshome1/lxc04/di52zuy/.condarc conda version : 4.8.2 conda-build version : 3.18.11 python version : 3.7.6.final.0 virtual packages : __glibc=2.22 base environment : /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/bioconda/linux-64 https://conda.anaconda.org/bioconda/noarch https://conda.anaconda.org/ursky/linux-64 https://conda.anaconda.org/ursky/noarch package cache : /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3/.conda/pkgs envs directories : /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3/.conda/envs /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3/envs /dss/dsshome1/lxc04/di52zuy/.conda/envs platform : linux-64 user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.6 Linux/4.12.14-95.32-default sles/12.4 glibc/2.22 UID:GID : 3907198:3891457 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` conda config --show-sources ==> /dss/dsshome1/lxc04/di52zuy/.condarc <== auto_activate_base: False root_prefix: /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3 envs_dirs: - /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3/.conda/envs pkgs_dirs: - /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3/.conda/pkgs channel_priority: flexible channels: - defaults - conda-forge - bioconda - ursky ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` conda list --show-channel-urls # packages in environment at /dss/dssfs02/lwp-dss-0001/pn69xe/pn69xe-dss-0000/di52zuy/ignite_tools_py3: # # Name Version Build Channel _ipyw_jlab_nb_ext_conf 0.1.0 py37_0 defaults _libgcc_mutex 0.1 main defaults alabaster 0.7.12 py37_0 defaults anaconda 2020.02 py37_0 defaults anaconda-client 1.7.2 py37_0 defaults anaconda-navigator 1.9.12 py37_0 defaults anaconda-project 0.8.4 py_0 defaults argh 0.26.2 py37_0 defaults asn1crypto 1.3.0 py37_0 defaults astroid 2.3.3 py37_0 defaults astropy 4.0 py37h7b6447c_0 defaults atomicwrites 1.3.0 py37_1 defaults attrs 19.3.0 py_0 defaults autopep8 1.4.4 py_0 defaults babel 2.8.0 py_0 defaults backcall 0.1.0 py37_0 defaults backports 1.0 py_2 defaults backports.functools_lru_cache 1.6.1 py_0 defaults backports.shutil_get_terminal_size 1.0.0 py37_2 defaults backports.tempfile 1.0 py_1 defaults backports.weakref 1.0.post1 py_1 defaults beautifulsoup4 4.8.2 py37_0 defaults bitarray 1.2.1 py37h7b6447c_0 defaults bkcharts 0.2 py37_0 defaults blas 1.0 mkl defaults bleach 3.1.0 py37_0 defaults blosc 1.16.3 hd408876_0 defaults bokeh 1.4.0 py37_0 defaults boost-cpp 1.70.0 ha2d47e9_1 conda-forge boto 2.49.0 py37_0 defaults bottleneck 1.3.2 py37heb32a55_0 defaults bzip2 1.0.8 h7b6447c_0 defaults ca-certificates 2020.1.1 0 defaults cairo 1.14.12 h8948797_3 defaults certifi 2019.11.28 py37_0 defaults cffi 1.14.0 py37h2e261b9_0 defaults chardet 3.0.4 py37_1003 defaults click 7.0 py37_0 defaults cloudpickle 1.3.0 py_0 defaults clyent 1.2.2 py37_1 defaults colorama 0.4.3 py_0 defaults conda 4.8.2 py37_0 defaults conda-build 3.18.11 py37_0 defaults conda-env 2.6.0 1 defaults conda-package-handling 1.6.0 py37h7b6447c_0 defaults conda-verify 3.4.2 py_1 defaults contextlib2 0.6.0.post1 py_0 defaults cryptography 2.8 py37h1ba5d50_0 defaults curl 7.68.0 hbc83047_0 defaults cycler 0.10.0 py37_0 defaults cython 0.29.15 py37he6710b0_0 defaults cytoolz 0.10.1 py37h7b6447c_0 defaults dask 2.11.0 py_0 defaults dask-core 2.11.0 py_0 defaults dbus 1.13.12 h746ee38_0 defaults decorator 4.4.1 py_0 defaults defusedxml 0.6.0 py_0 defaults diff-match-patch 20181111 py_0 defaults distributed 2.11.0 py37_0 defaults docutils 0.16 py37_0 defaults entrypoints 0.3 py37_0 defaults et_xmlfile 1.0.1 py37_0 defaults expat 2.2.6 he6710b0_0 defaults fastcache 1.1.0 py37h7b6447c_0 defaults filelock 3.0.12 py_0 defaults flake8 3.7.9 py37_0 defaults flask 1.1.1 py_0 defaults fontconfig 2.13.0 h9420a91_0 defaults freetype 2.9.1 h8a8886c_1 defaults fribidi 1.0.5 h7b6447c_0 defaults fsspec 0.6.2 py_0 defaults future 0.18.2 py37_0 defaults get_terminal_size 1.0.0 haa9412d_0 defaults gevent 1.4.0 py37h7b6447c_0 defaults glib 2.63.1 h5a9c865_0 defaults glob2 0.7 py_0 defaults gmp 6.1.2 h6c8ec71_1 defaults gmpy2 2.0.8 py37h10f8cd9_2 defaults graphite2 1.3.13 h23475e2_0 defaults greenlet 0.4.15 py37h7b6447c_0 defaults gst-plugins-base 1.14.0 hbbd80ab_1 defaults gstreamer 1.14.0 hb453b48_1 defaults h5py 2.10.0 py37h7918eee_0 defaults harfbuzz 1.8.8 hffaf4a1_0 defaults hdf5 1.10.4 hb1b8bf9_0 defaults heapdict 1.0.1 py_0 defaults html5lib 1.0.1 py37_0 defaults hypothesis 5.5.4 py_0 defaults icu 58.2 h9c2bf20_1 defaults idna 2.8 py37_0 defaults imageio 2.6.1 py37_0 defaults imagesize 1.2.0 py_0 defaults importlib_metadata 1.5.0 py37_0 defaults intel-openmp 2020.0 166 defaults intervaltree 3.0.2 py_0 defaults ipykernel 5.1.4 py37h39e3cac_0 defaults ipython 7.12.0 py37h5ca1d4c_0 defaults ipython_genutils 0.2.0 py37_0 defaults ipywidgets 7.5.1 py_0 defaults isort 4.3.21 py37_0 defaults itsdangerous 1.1.0 py37_0 defaults jbig 2.1 hdba287a_0 defaults jdcal 1.4.1 py_0 defaults jedi 0.14.1 py37_0 defaults jeepney 0.4.2 py_0 defaults jinja2 2.11.1 py_0 defaults joblib 0.14.1 py_0 defaults jpeg 9b h024ee3a_2 defaults json5 0.9.1 py_0 defaults jsonschema 3.2.0 py37_0 defaults jupyter 1.0.0 py37_7 defaults jupyter_client 5.3.4 py37_0 defaults jupyter_console 6.1.0 py_0 defaults jupyter_core 4.6.1 py37_0 defaults jupyterlab 1.2.6 pyhf63ae98_0 defaults jupyterlab_server 1.0.6 py_0 defaults kat 2.4.2 py37he1b856b_0 bioconda keyring 21.1.0 py37_0 defaults kiwisolver 1.1.0 py37he6710b0_0 defaults krb5 1.17.1 h173b8e3_0 defaults lazy-object-proxy 1.4.3 py37h7b6447c_0 defaults ld_impl_linux-64 2.33.1 h53a641e_7 defaults libarchive 3.3.3 h5d8350f_5 defaults libcurl 7.68.0 h20c2e04_0 defaults libedit 3.1.20181209 hc058e9b_0 defaults libffi 3.2.1 hd88cf55_4 defaults libgcc 7.2.0 h69d50b8_2 defaults libgcc-ng 9.1.0 hdf63c60_0 defaults libgfortran-ng 7.3.0 hdf63c60_0 defaults liblief 0.9.0 h7725739_2 defaults libpng 1.6.37 hbc83047_0 defaults libsodium 1.0.16 h1bed415_0 defaults libspatialindex 1.9.3 he6710b0_0 defaults libssh2 1.8.2 h1ba5d50_0 defaults libstdcxx-ng 9.1.0 hdf63c60_0 defaults libtiff 4.1.0 h2733197_0 defaults libtool 2.4.6 h7b6447c_5 defaults libuuid 1.0.3 h1bed415_2 defaults libxcb 1.13 h1bed415_1 defaults libxml2 2.9.9 hea5a465_1 defaults libxslt 1.1.33 h7d1a2b0_0 defaults llvmlite 0.31.0 py37hd408876_0 defaults locket 0.2.0 py37_1 defaults lxml 4.5.0 py37hefd8a0e_0 defaults lz4-c 1.8.1.2 h14c3975_0 defaults lzo 2.10 h49e0be7_2 defaults markupsafe 1.1.1 py37h7b6447c_0 defaults matplotlib 3.1.3 py37_0 defaults matplotlib-base 3.1.3 py37hef1b27d_0 defaults mccabe 0.6.1 py37_1 defaults mistune 0.8.4 py37h7b6447c_0 defaults mkl 2020.0 166 defaults mkl-service 2.3.0 py37he904b0f_0 defaults mkl_fft 1.0.15 py37ha843d7b_0 defaults mkl_random 1.1.0 py37hd6b4f25_0 defaults mock 4.0.1 py_0 defaults more-itertools 8.2.0 py_0 defaults mpc 1.1.0 h10f8cd9_1 defaults mpfr 4.0.1 hdf1c602_3 defaults mpmath 1.1.0 py37_0 defaults msgpack-python 0.6.1 py37hfd86e86_1 defaults multipledispatch 0.6.0 py37_0 defaults navigator-updater 0.2.1 py37_0 defaults nbconvert 5.6.1 py37_0 defaults nbformat 5.0.4 py_0 defaults ncurses 6.2 he6710b0_0 defaults networkx 2.4 py_0 defaults nltk 3.4.5 py37_0 defaults nose 1.3.7 py37_2 defaults notebook 6.0.3 py37_0 defaults numba 0.48.0 py37h0573a6f_0 defaults numexpr 2.7.1 py37h423224d_0 defaults numpy 1.18.1 py37h4f9e942_0 defaults numpy-base 1.18.1 py37hde5b4d6_1 defaults numpydoc 0.9.2 py_0 defaults olefile 0.46 py37_0 defaults openpyxl 3.0.3 py_0 defaults openssl 1.1.1d h7b6447c_4 defaults packaging 20.1 py_0 defaults pandas 1.0.1 py37h0573a6f_0 defaults pandoc 2.2.3.2 0 defaults pandocfilters 1.4.2 py37_1 defaults pango 1.42.4 h049681c_0 defaults parso 0.5.2 py_0 defaults partd 1.1.0 py_0 defaults patchelf 0.10 he6710b0_0 defaults path 13.1.0 py37_0 defaults path.py 12.4.0 0 defaults pathlib2 2.3.5 py37_0 defaults pathtools 0.1.2 py_1 defaults patsy 0.5.1 py37_0 defaults pcre 8.43 he6710b0_0 defaults pep8 1.7.1 py37_0 defaults perl 5.26.2 h14c3975_0 defaults perl-bioperl 1.6.924 4 bioconda perl-threaded 5.26.0 0 bioconda perl-yaml 1.29 pl526_0 bioconda pexpect 4.8.0 py37_0 defaults pickleshare 0.7.5 py37_0 defaults pillow 7.0.0 py37hb39fc2d_0 defaults pip 20.0.2 py37_1 defaults pixman 0.38.0 h7b6447c_0 defaults pkginfo 1.5.0.1 py37_0 defaults pluggy 0.13.1 py37_0 defaults ply 3.11 py37_0 defaults prometheus_client 0.7.1 py_0 defaults prompt_toolkit 3.0.3 py_0 defaults psutil 5.6.7 py37h7b6447c_0 defaults ptyprocess 0.6.0 py37_0 defaults py 1.8.1 py_0 defaults py-lief 0.9.0 py37h7725739_2 defaults pycodestyle 2.5.0 py37_0 defaults pycosat 0.6.3 py37h7b6447c_0 defaults pycparser 2.19 py37_0 defaults pycrypto 2.6.1 py37h14c3975_9 defaults pycurl 7.43.0.5 py37h1ba5d50_0 defaults pydocstyle 4.0.1 py_0 defaults pyflakes 2.1.1 py37_0 defaults pygments 2.5.2 py_0 defaults pylint 2.4.4 py37_0 defaults pyodbc 4.0.30 py37he6710b0_0 defaults pyopenssl 19.1.0 py37_0 defaults pyparsing 2.4.6 py_0 defaults pyqt 5.9.2 py37h05f1152_2 defaults pyrsistent 0.15.7 py37h7b6447c_0 defaults pysocks 1.7.1 py37_0 defaults pytables 3.6.1 py37h71ec239_0 defaults pytest 5.3.5 py37_0 defaults pytest-arraydiff 0.3 py37h39e3cac_0 defaults pytest-astropy 0.8.0 py_0 defaults pytest-astropy-header 0.1.2 py_0 defaults pytest-doctestplus 0.5.0 py_0 defaults pytest-openfiles 0.4.0 py_0 defaults pytest-remotedata 0.3.2 py37_0 defaults python 3.7.6 h0371630_2 defaults python-dateutil 2.8.1 py_0 defaults python-jsonrpc-server 0.3.4 py_0 defaults python-language-server 0.31.7 py37_0 defaults python-libarchive-c 2.8 py37_13 defaults pytz 2019.3 py_0 defaults pywavelets 1.1.1 py37h7b6447c_0 defaults pyxdg 0.26 py_0 defaults pyyaml 5.3 py37h7b6447c_0 defaults pyzmq 18.1.1 py37he6710b0_0 defaults qdarkstyle 2.8 py_0 defaults qt 5.9.7 h5867ecd_1 defaults qtawesome 0.6.1 py_0 defaults qtconsole 4.6.0 py_1 defaults qtpy 1.9.0 py_0 defaults readline 7.0 h7b6447c_5 defaults requests 2.22.0 py37_1 defaults ripgrep 11.0.2 he32d670_0 defaults rope 0.16.0 py_0 defaults rtree 0.9.3 py37_0 defaults ruamel_yaml 0.15.87 py37h7b6447c_0 defaults scikit-image 0.16.2 py37h0573a6f_0 defaults scikit-learn 0.22.1 py37hd81dba3_0 defaults scipy 1.4.1 py37h0b6359f_0 defaults seaborn 0.10.0 py_0 defaults secretstorage 3.1.2 py37_0 defaults send2trash 1.5.0 py37_0 defaults setuptools 45.2.0 py37_0 defaults simplegeneric 0.8.1 py37_2 defaults singledispatch 3.4.0.3 py37_0 defaults sip 4.19.8 py37hf484d3e_0 defaults six 1.14.0 py37_0 defaults snappy 1.1.7 hbae5bb6_3 defaults snowballstemmer 2.0.0 py_0 defaults sortedcollections 1.1.2 py37_0 defaults sortedcontainers 2.1.0 py37_0 defaults soupsieve 1.9.5 py37_0 defaults sphinx 2.4.0 py_0 defaults sphinxcontrib 1.0 py37_1 defaults sphinxcontrib-applehelp 1.0.1 py_0 defaults sphinxcontrib-devhelp 1.0.1 py_0 defaults sphinxcontrib-htmlhelp 1.0.2 py_0 defaults sphinxcontrib-jsmath 1.0.1 py_0 defaults sphinxcontrib-qthelp 1.0.2 py_0 defaults sphinxcontrib-serializinghtml 1.1.3 py_0 defaults sphinxcontrib-websupport 1.2.0 py_0 defaults spyder 4.0.1 py37_0 defaults spyder-kernels 1.8.1 py37_0 defaults sqlalchemy 1.3.13 py37h7b6447c_0 defaults sqlite 3.31.1 h7b6447c_0 defaults statsmodels 0.11.0 py37h7b6447c_0 defaults sympy 1.5.1 py37_0 defaults tabulate 0.8.3 py37_0 defaults tbb 2020.0 hfd86e86_0 defaults tblib 1.6.0 py_0 defaults terminado 0.8.3 py37_0 defaults testpath 0.4.4 py_0 defaults tk 8.6.8 hbc83047_0 defaults toolz 0.10.0 py_0 defaults tornado 6.0.3 py37h7b6447c_3 defaults tqdm 4.42.1 py_0 defaults traitlets 4.3.3 py37_0 defaults ujson 1.35 py37h14c3975_0 defaults unicodecsv 0.14.1 py37_0 defaults unixodbc 2.3.7 h14c3975_0 defaults urllib3 1.25.8 py37_0 defaults watchdog 0.10.2 py37_0 defaults wcwidth 0.1.8 py_0 defaults webencodings 0.5.1 py37_1 defaults werkzeug 1.0.0 py_0 defaults wheel 0.34.2 py37_0 defaults widgetsnbextension 3.5.1 py37_0 defaults wrapt 1.11.2 py37h7b6447c_0 defaults wurlitzer 2.0.0 py37_0 defaults xlrd 1.2.0 py37_0 defaults xlsxwriter 1.2.7 py_0 defaults xlwt 1.3.0 py37_0 defaults xmltodict 0.12.0 py_0 defaults xz 5.2.4 h14c3975_4 defaults yaml 0.1.7 had09818_2 defaults yapf 0.28.0 py_0 defaults zeromq 4.3.1 he6710b0_3 defaults zict 1.0.0 py_0 defaults zipp 2.2.0 py_0 defaults zlib 1.2.11 h7b6447c_3 defaults zstd 1.3.7 h0b5b093_0 defaults ``` </p></details>
Unverified myself, but if accurate this is a sev-1 bug. Confirmed in 4.8.3; basic steps to reproduce: ``` mkdir /tmp/not-an-env touch /tmp/not-an-env conda remove --all -y -p /tmp/not-an-env ```
2020-07-20T21:32:10Z
[]
[]
conda/conda
10,090
conda__conda-10090
[ "9997" ]
ac6487bf6b79dac1d620fb9ddbadb334b613596b
diff --git a/conda/cli/main_create.py b/conda/cli/main_create.py --- a/conda/cli/main_create.py +++ b/conda/cli/main_create.py @@ -21,6 +21,10 @@ def execute(args, parser): if is_conda_environment(context.target_prefix): if paths_equal(context.target_prefix, context.root_prefix): raise CondaValueError("The target prefix is the base prefix. Aborting.") + if context.dry_run: + # Taking the "easy" way out, rather than trying to fake removing + # the existing environment before creating a new one. + raise CondaValueError("Cannot `create --dry-run` with an existing conda environment") confirm_yn("WARNING: A conda environment already exists at '%s'\n" "Remove existing environment" % context.target_prefix, default='no',
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -53,7 +53,8 @@ from conda.core.subdir_data import create_cache_dir from conda.exceptions import CommandArgumentError, DryRunExit, OperationNotAllowed, \ PackagesNotFoundError, RemoveError, conda_exception_handler, PackageNotInstalledError, \ - DisallowedPackageError, DirectoryNotACondaEnvironmentError, EnvironmentLocationNotFound + DisallowedPackageError, DirectoryNotACondaEnvironmentError, EnvironmentLocationNotFound, \ + CondaValueError from conda.gateways.anaconda_client import read_binstar_tokens from conda.gateways.disk.create import mkdir_p, extract_tarball from conda.gateways.disk.delete import rm_rf, path_is_clean @@ -1760,6 +1761,12 @@ def test_create_dry_run_json(self): assert "python" in names assert "flask" in names + def test_create_dry_run_yes_safety(self): + with make_temp_env() as prefix: + with pytest.raises(CondaValueError): + run_command(Commands.CREATE, prefix, "--dry-run", "--yes") + assert exists(prefix) + def test_packages_not_found(self): with make_temp_env() as prefix: with pytest.raises(PackagesNotFoundError) as exc:
'conda create --dry-run --yes' deletes existing environment. ## Current Behavior If `--dry-run` and `--yes` are _both_ passed to `conda create`, and the named environment already exists, the named environment is deleted. ### Steps to Reproduce ``` # create the env conda create -n tmp -y conda env list | grep tmp # --dry-run without --yes leaves env in place conda create -n tmp --dry-run conda env list | grep tmp # --dry-run with --yes deletes the env conda create -n tmp --dry-run --yes conda env list | grep tmp ``` ## Expected Behavior 'conda create --dry-run' should not delete an existing environment. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> ``` active environment : garpy.conda-dev active env location : /Users/aschweit/miniconda3/envs/garpy.conda-dev shell level : 2 user config file : /Users/aschweit/.condarc populated config files : /Users/aschweit/.condarc conda version : 4.8.2 conda-build version : 3.19.2 python version : 3.7.6.final.0 virtual packages : __osx=10.14.6 base environment : /Users/aschweit/miniconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /Users/aschweit/miniconda3/pkgs /Users/aschweit/.conda/pkgs envs directories : /Users/aschweit/miniconda3/envs /Users/aschweit/.conda/envs platform : osx-64 user-agent : conda/4.8.2 requests/2.23.0 CPython/3.7.6 Darwin/18.7.0 OSX/10.14.6 UID:GID : 501:20 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> ``` ==> /Users/aschweit/.condarc <== auto_update_conda: False auto_stack: 1 ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> ``` # packages in environment at /Users/aschweit/miniconda3: # # Name Version Build Channel appdirs 1.4.3 py_1 conda-forge arrow 0.15.6 py37hc8dfbb8_1 conda-forge attrs 19.3.0 py_0 conda-forge beautifulsoup4 4.9.0 py37hc8dfbb8_0 conda-forge binaryornot 0.4.4 py_1 conda-forge black 19.10b0 py37_0 conda-forge bleach 3.1.4 py_0 defaults brotlipy 0.7.0 py37h9bfed18_1000 conda-forge bzip2 1.0.8 h0b31af3_2 conda-forge ca-certificates 2020.4.5.1 hecc5488_0 conda-forge certifi 2020.4.5.1 py37hc8dfbb8_0 conda-forge cffi 1.14.0 py37h356ff06_0 conda-forge chardet 3.0.4 py37hc8dfbb8_1006 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge cmarkgfm 0.4.2 py37h1de35cc_0 defaults conda 4.8.2 py37_0 defaults conda-build 3.19.2 py37hc8dfbb8_2 conda-forge conda-package-handling 1.6.0 py37h9bfed18_2 conda-forge cookiecutter 1.7.2 pyh9f0ad1d_0 conda-forge cryptography 2.9.2 py37he655712_0 conda-forge curl 7.69.1 ha441bb4_0 defaults decorator 4.4.2 py_0 defaults docutils 0.16 py37_0 defaults expat 2.2.9 h4a8c4bd_2 conda-forge filelock 3.0.10 py_0 conda-forge future 0.18.2 py37_0 defaults gettext 0.19.8.1 h46ab8bc_1002 conda-forge git 2.26.2 pl526hcc376a2_0 conda-forge glob2 0.7 py_0 conda-forge icu 67.1 h4a8c4bd_0 conda-forge idna 2.9 py_1 conda-forge importlib-metadata 1.6.0 py37hc8dfbb8_0 conda-forge importlib_metadata 1.6.0 0 conda-forge jinja2 2.11.2 pyh9f0ad1d_0 conda-forge jinja2-time 0.2.0 py_2 conda-forge krb5 1.17.1 hddcf347_0 defaults libarchive 3.3.3 h02796b4_1008 conda-forge libcurl 7.69.1 h051b688_0 defaults libcxx 10.0.0 h1af66ff_2 conda-forge libedit 3.1.20181209 hb402a30_0 defaults libffi 3.2.1 h4a8c4bd_1007 conda-forge libiconv 1.15 h0b31af3_1006 conda-forge liblief 0.9.0 h3e78482_1 conda-forge libssh2 1.9.0 ha12b0ac_1 defaults libxml2 2.9.10 hc06c4ae_1 conda-forge lz4-c 1.9.2 h4a8c4bd_1 conda-forge lzo 2.10 h1de35cc_1000 conda-forge markupsafe 1.1.1 py37h9bfed18_1 conda-forge mypy_extensions 0.4.3 py37hc8dfbb8_1 conda-forge ncurses 6.1 h0a44026_1002 conda-forge networkx 2.4 py_0 defaults openssl 1.1.1g h0b31af3_0 conda-forge packaging 20.1 py_0 conda-forge pathspec 0.8.0 pyh9f0ad1d_0 conda-forge pcre 8.44 h4a8c4bd_0 conda-forge perl 5.26.2 haec8ef5_1006 conda-forge pip 20.1 pyh9f0ad1d_0 conda-forge pkginfo 1.5.0.1 py_0 conda-forge pluggy 0.13.1 py37hc8dfbb8_1 conda-forge poyo 0.5.0 py_0 conda-forge psutil 5.7.0 py37h9bfed18_1 conda-forge py 1.8.1 py_0 conda-forge py-lief 0.9.0 py37h0ceac7d_1 conda-forge pycosat 0.6.3 py37h9bfed18_1004 conda-forge pycparser 2.20 py_0 conda-forge pygments 2.6.1 py_0 defaults pyopenssl 19.1.0 py_1 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pysocks 1.7.1 py37hc8dfbb8_1 conda-forge python 3.7.6 h359304d_2 defaults python-dateutil 2.8.1 py_0 conda-forge python-libarchive-c 2.9 py37_0 conda-forge python-slugify 4.0.0 pyh9f0ad1d_1 conda-forge python.app 2 py37_10 defaults python_abi 3.7 1_cp37m conda-forge pytz 2020.1 pyh9f0ad1d_0 conda-forge pyyaml 5.3.1 py37h9bfed18_0 conda-forge readline 7.0 hcfe32e1_1001 conda-forge readme_renderer 24.0 py37_0 defaults regex 2020.5.14 py37h9bfed18_0 conda-forge requests 2.23.0 pyh8c360ce_2 conda-forge requests-toolbelt 0.9.1 py_0 defaults ripgrep 12.1.0 h0b31af3_0 conda-forge ruamel_yaml 0.15.80 py37h9bfed18_1001 conda-forge setuptools 46.3.0 py37hc8dfbb8_0 conda-forge six 1.14.0 py_1 conda-forge soupsieve 1.9.4 py37hc8dfbb8_1 conda-forge sqlite 3.31.1 ha441bb4_0 defaults text-unidecode 1.3 py_0 conda-forge tk 8.6.10 hbbe82c9_0 conda-forge toml 0.10.0 py_0 conda-forge tox 3.15.0 py37hc8dfbb8_0 conda-forge tox-conda 0.2.1 py_0 conda-forge tqdm 4.46.0 pyh9f0ad1d_0 conda-forge tree 1.8.0 h0b31af3_1 conda-forge twine 2.0.0 py_0 defaults typed-ast 1.4.1 py37h0b31af3_0 conda-forge typing_extensions 3.7.4.2 py_0 conda-forge unidecode 1.1.1 py_0 conda-forge urllib3 1.25.9 py_0 conda-forge virtualenv 16.7.5 py_0 conda-forge webencodings 0.5.1 py37_1 defaults wheel 0.34.2 py_1 conda-forge whichcraft 0.6.1 py_0 conda-forge xz 5.2.5 h0b31af3_0 conda-forge yaml 0.2.4 h0b31af3_0 conda-forge zipp 3.1.0 py_0 conda-forge zlib 1.2.11 h0b31af3_1006 conda-forge zstd 1.4.4 h4b3e974_3 conda-forge ``` </p></details>
2020-07-22T03:50:40Z
[]
[]
conda/conda
10,117
conda__conda-10117
[ "10116" ]
9785db1271ae83d7d44828c04fa01dab7a44af9e
diff --git a/conda/core/solve.py b/conda/core/solve.py --- a/conda/core/solve.py +++ b/conda/core/solve.py @@ -369,6 +369,8 @@ def empty_package_list(pkg): return update_constrained for pkg in self.specs_to_add: + if pkg.name.startswith('__'): # ignore virtual packages + continue current_version = max(i[1] for i in pre_packages[pkg.name]) if current_version == max(i.version for i in index_keys if i.name == pkg.name): continue
diff --git a/tests/test_create.py b/tests/test_create.py --- a/tests/test_create.py +++ b/tests/test_create.py @@ -2881,6 +2881,12 @@ def test_neutering_of_historic_specs(self): # If this command runs successfully (does not raise), then all is well. stdout, stderr, _ = run_command(Commands.INSTALL, prefix, "imagesize") + # https://github.com/conda/conda/issues/10116 + @pytest.mark.skipif(not context.subdir.startswith('linux'), reason="__glibc only available on linux") + def test_install_bound_virtual_package(self): + with make_temp_env("__glibc>0") as prefix: + pass + @pytest.mark.integration def test_remove_empty_env(self): with make_temp_env() as prefix:
conda cannot create an environment with only a constrained virtual package ## Current Behavior Conda fails when asked to create a environment containing only a virtual package with a version constraint. Adding an additional spec to the environment or removing the constraint works. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` $ conda create -n example __glibc --dry-run # works $ conda create -n example "__glibc>=0` openssl --dry-run # works $ conda create -n example "__glibc>=0" --dry-run Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback (most recent call last): File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/exceptions.py", line 1079, in __call__ return func(*args, **kwargs) File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main exit_code = do_call(args, p) File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 82, in do_call return getattr(module, func_name)(args, parser) File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/cli/main_create.py", line 37, in execute install(args, parser, 'create') File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/cli/install.py", line 265, in install should_retry_solve=(_should_retry_unfrozen or repodata_fn != repodata_fns[-1]), File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/core/solve.py", line 117, in solve_for_transaction should_retry_solve) File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/core/solve.py", line 158, in solve_for_diff force_remove, should_retry_solve) File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/core/solve.py", line 289, in solve_final_state self.determine_constricting_specs(spec, ssc.solution_precs) File "/home/jhelmus/conda/lib/python3.7/site-packages/conda/core/solve.py", line 315, in determine_constricting_specs if sp.name == spec.name][0] IndexError: list index out of range `$ /home/jhelmus/conda/bin/conda create -n example __glibc>=0 --dry-run` environment variables: CIO_TEST=<not set> CONDA_BACKUP_JAVA_HOME= CONDA_BACKUP_JAVA_LD_LIBRARY_PATH= CONDA_DEFAULT_ENV=base CONDA_EXE=/home/jhelmus/conda/bin/conda CONDA_PREFIX=/home/jhelmus/conda CONDA_PROMPT_MODIFIER= CONDA_PYTHONBREAKPOINT= CONDA_PYTHON_EXE=/home/jhelmus/conda/bin/python CONDA_ROOT=/home/jhelmus/conda CONDA_SHLVL=1 JAVA_LD_LIBRARY_PATH=/home/jhelmus/conda/jre/lib/amd64/server PATH=/home/jhelmus/conda/bin:/home/jhelmus/bin:/home/jhelmus/conda/bin:/hom e/jhelmus/conda/condabin:/home/jhelmus/bin:/usr/local/sbin:/usr/local/ bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bi n PYTHONBREAKPOINT=ipdb.set_trace REQUESTS_CA_BUNDLE=<not set> SSL_CERT_FILE=<not set> WINDOWPATH=2 active environment : base active env location : /home/jhelmus/conda shell level : 1 user config file : /home/jhelmus/.condarc populated config files : /home/jhelmus/.condarc conda version : 4.8.3 conda-build version : 3.18.11 python version : 3.7.7.final.0 virtual packages : __cuda=10.1 __glibc=2.27 base environment : /home/jhelmus/conda (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/jhelmus/conda/pkgs /home/jhelmus/.conda/pkgs envs directories : /home/jhelmus/conda/envs /home/jhelmus/.conda/envs platform : linux-64 user-agent : conda/4.8.3 requests/2.21.0 CPython/3.7.7 Linux/4.15.0-109-generic ubuntu/18.04.4 glibc/2.27 UID:GID : 1000:1000 netrc file : None offline mode : False ``` ## Expected Behavior Provided that the virtual package spec is valid conda should create an empty environment in the same manner as when an un-restrained virtual package is specified. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` $ conda info active environment : base active env location : /home/jhelmus/conda shell level : 1 user config file : /home/jhelmus/.condarc populated config files : /home/jhelmus/.condarc conda version : 4.8.3 conda-build version : 3.18.11 python version : 3.7.7.final.0 virtual packages : __cuda=10.1 __glibc=2.27 base environment : /home/jhelmus/conda (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/jhelmus/conda/pkgs /home/jhelmus/.conda/pkgs envs directories : /home/jhelmus/conda/envs /home/jhelmus/.conda/envs platform : linux-64 user-agent : conda/4.8.3 requests/2.21.0 CPython/3.7.7 Linux/4.15.0-109-generic ubuntu/18.04.4 glibc/2.27 UID:GID : 1000:1000 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` $ conda config --show-sources ==> /home/jhelmus/.condarc <== add_pip_as_python_dependency: False changeps1: False ssl_verify: True channels: - defaults show_channel_urls: True report_errors: False ``` </p></details>
I'm curious if #10057 changes this behavior #10057 does not change this behavior.
2020-07-29T16:27:53Z
[]
[]
conda/conda
10,261
conda__conda-10261
[ "10231" ]
10953ebc9e06c6f189ed923994b1d4d1bf9edac4
diff --git a/conda/cli/main_remove.py b/conda/cli/main_remove.py --- a/conda/cli/main_remove.py +++ b/conda/cli/main_remove.py @@ -73,8 +73,9 @@ def execute(args, parser): handle_txn(txn, prefix, args, False, True) except PackagesNotFoundError: print("No packages found in %s. Continuing environment removal" % prefix) - rm_rf(prefix, clean_empty_parents=True) - unregister_env(prefix) + if not context.dry_run: + rm_rf(prefix, clean_empty_parents=True) + unregister_env(prefix) return
diff --git a/tests/conda_env/test_cli.py b/tests/conda_env/test_cli.py --- a/tests/conda_env/test_cli.py +++ b/tests/conda_env/test_cli.py @@ -361,6 +361,14 @@ def test_update_env_no_action_json_output(self): output = json.loads(stdout) assert output["message"] == "All requested packages already installed." + def test_remove_dry_run(self): + # Test for GH-10231 + create_env(environment_1) + run_env_command(Commands.ENV_CREATE, None) + env_name = "env-1" + run_env_command(Commands.ENV_REMOVE, env_name, "--dry-run") + self.assertTrue(env_is_created(env_name)) + def test_set_unset_env_vars(self): create_env(environment_1) run_env_command(Commands.ENV_CREATE, None)
`conda env remove --dry-run` actually deletes the env ## Current Behavior Using the `--dry-run` flag doesn't do a dry-run at all. ### Steps to Reproduce ``` $ conda env list # conda environments: # base * /usr $ conda create -n foo Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /home/eric/.conda/envs/foo Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate foo # # To deactivate an active environment, use # # $ conda deactivate $ conda env list # conda environments: # foo /home/eric/.conda/envs/foo base * /usr ~ $ conda env remove --dry-run -n foo Remove all packages in environment /home/eric/.conda/envs/foo: $ conda env list # conda environments: # base * /usr $ ``` ## Expected Behavior `--dry-run` is documented as `Only display what would have been done.`, but clearly that's not true :upside_down_face: The expected behaviour here is obviously that the environment is **not** removed :slightly_smiling_face: ## Environment Information <details open><summary><code>`conda info`</code></summary><p> ``` active environment : None shell level : 0 user config file : /home/eric/.condarc populated config files : /usr/share/conda/condarc.d/defaults.yaml /home/eric/.condarc conda version : 4.8.2 conda-build version : not installed python version : 3.8.5.final.0 virtual packages : __glibc=2.31 base environment : /usr (read only) channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /var/cache/conda/pkgs /home/eric/.conda/pkgs envs directories : /home/eric/.conda/envs /usr/envs platform : linux-64 user-agent : conda/4.8.2 requests/2.22.0 CPython/3.8.5 Linux/5.8.6-201.fc32.x86_64 fedora/32 glibc/2.31 UID:GID : 1000:1000 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> ``` ==> /usr/share/conda/condarc.d/defaults.yaml <== pkgs_dirs: - /var/cache/conda/pkgs - ~/.conda/pkgs ==> /home/eric/.condarc <== channels: - conda-forge - defaults ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` EnvironmentLocationNotFound: Not a conda environment: /usr ``` (I expect that might also be a bug, conda shouldn't crash like that here.) </p></details>
2020-10-01T02:55:30Z
[]
[]
conda/conda
10,530
conda__conda-10530
[ "9580" ]
dc0c8d48cc62a792cf93dfc2aa67914a98a67878
diff --git a/conda/cli/conda_argparse.py b/conda/cli/conda_argparse.py --- a/conda/cli/conda_argparse.py +++ b/conda/cli/conda_argparse.py @@ -536,11 +536,7 @@ def configure_parser_create(sub_parsers): metavar='ENV', ) solver_mode_options, package_install_options = add_parser_create_install_update(p) - solver_mode_options.add_argument( - "--no-default-packages", - action="store_true", - help='Ignore create_default_packages in the .condarc file.', - ) + add_parser_default_packages(solver_mode_options) p.add_argument( '-m', "--mkdir", action="store_true", @@ -1669,3 +1665,10 @@ def add_parser_known(p): dest='unknown', help=SUPPRESS, ) + +def add_parser_default_packages(p): + p.add_argument( + "--no-default-packages", + action="store_true", + help='Ignore create_default_packages in the .condarc file.', + ) diff --git a/conda_env/cli/main_create.py b/conda_env/cli/main_create.py --- a/conda_env/cli/main_create.py +++ b/conda_env/cli/main_create.py @@ -10,7 +10,8 @@ from conda._vendor.auxlib.path import expand from conda.cli import install as cli_install -from conda.cli.conda_argparse import add_parser_json, add_parser_prefix, add_parser_networking +from conda.cli.conda_argparse import add_parser_default_packages, add_parser_json, \ + add_parser_prefix, add_parser_networking from conda.core.prefix_data import PrefixData from conda.gateways.connection.session import CONDA_SESSION_SCHEMES from conda.gateways.disk.delete import rm_rf @@ -69,6 +70,7 @@ def configure_parser(sub_parsers): action='store_true', default=False, ) + add_parser_default_packages(p) add_parser_json(p) p.set_defaults(func='.main_create.execute') @@ -106,6 +108,13 @@ def execute(args, parser): # channel_urls = args.channel or () result = {"conda": None, "pip": None} + + args_packages = context.create_default_packages if not args.no_default_packages else [] + if args_packages: + installer_type = "conda" + installer = get_installer(installer_type) + result[installer_type] = installer.install(prefix, args_packages, args, env) + if len(env.dependencies.items()) == 0: installer_type = "conda" pkg_specs = []
diff --git a/tests/conda_env/support/env_with_dependencies.yml b/tests/conda_env/support/env_with_dependencies.yml new file mode 100644 --- /dev/null +++ b/tests/conda_env/support/env_with_dependencies.yml @@ -0,0 +1,7 @@ +channels: + - conda-forge + - defaults + +dependencies: + - python=2 + - pytz \ No newline at end of file diff --git a/tests/conda_env/test_create.py b/tests/conda_env/test_create.py --- a/tests/conda_env/test_create.py +++ b/tests/conda_env/test_create.py @@ -3,6 +3,7 @@ from logging import Handler, getLogger from os.path import exists, join +from shutil import rmtree from unittest import TestCase from uuid import uuid4 @@ -10,12 +11,15 @@ from conda.base.context import conda_tests_ctxt_mgmt_def_pol from conda.common.io import dashlist, env_var, env_vars +from conda.common.serialize import yaml_round_trip_load from conda.core.prefix_data import PrefixData from conda.install import on_win from conda.models.enums import PackageType from conda.models.match_spec import MatchSpec from . import support_file from .utils import make_temp_envs_dir, Commands, run_command +from ..test_create import run_command as run_conda_command, \ + Commands as CondaCommands PYTHON_BINARY = 'python.exe' if on_win else 'bin/python' from tests.test_utils import is_prefix_activated_PATHwise @@ -134,3 +138,47 @@ def test_create_empty_env(self): run_command(Commands.CREATE, env_name, support_file('empty_env.yml')) assert exists(prefix) + + def test_create_env_default_packages(self): + with make_temp_envs_dir() as envs_dir: + with env_var('CONDA_ENVS_DIRS', envs_dir, stack_callback=conda_tests_ctxt_mgmt_def_pol): + # set packages + run_conda_command(CondaCommands.CONFIG, envs_dir, "--add", "create_default_packages", "pip") + run_conda_command(CondaCommands.CONFIG, envs_dir, "--add", "create_default_packages", "flask") + stdout, stderr, _ = run_conda_command(CondaCommands.CONFIG, envs_dir, "--show") + yml_obj = yaml_round_trip_load(stdout) + assert yml_obj['create_default_packages'] == ['flask', 'pip'] + + assert not package_is_installed(envs_dir, 'python=2') + assert not package_is_installed(envs_dir, 'pytz') + assert not package_is_installed(envs_dir, 'flask') + + env_name = str(uuid4())[:8] + prefix = join(envs_dir, env_name) + run_command(Commands.CREATE, env_name, support_file('env_with_dependencies.yml')) + assert exists(prefix) + assert package_is_installed(prefix, 'python=2') + assert package_is_installed(prefix, 'pytz') + assert package_is_installed(prefix, 'flask') + + def test_create_env_no_default_packages(self): + with make_temp_envs_dir() as envs_dir: + with env_var('CONDA_ENVS_DIRS', envs_dir, stack_callback=conda_tests_ctxt_mgmt_def_pol): + # set packages + run_conda_command(CondaCommands.CONFIG, envs_dir, "--add", "create_default_packages", "pip") + run_conda_command(CondaCommands.CONFIG, envs_dir, "--add", "create_default_packages", "flask") + stdout, stderr, _ = run_conda_command(CondaCommands.CONFIG, envs_dir, "--show") + yml_obj = yaml_round_trip_load(stdout) + assert yml_obj['create_default_packages'] == ['flask', 'pip'] + + assert not package_is_installed(envs_dir, 'python=2') + assert not package_is_installed(envs_dir, 'pytz') + assert not package_is_installed(envs_dir, 'flask') + + env_name = str(uuid4())[:8] + prefix = join(envs_dir, env_name) + run_command(Commands.CREATE, env_name, support_file('env_with_dependencies.yml'), "--no-default-packages") + assert exists(prefix) + assert package_is_installed(prefix, 'python=2') + assert package_is_installed(prefix, 'pytz') + assert not package_is_installed(prefix, 'flask')
conda default packages do not work with conda env <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> The expected behavior for default packages (set in my `.condarc` file) works when I create an environment like `conda create -n testenv <name of package>` but it doesn't work when I create an environment using `conda env create -f <environment file>`. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> .condarc file ``` channels: - conda-forge - bioconda - defaults create_default_packages: - python-language-server - r-languageserver ``` environment.yml ``` name: test-env-file dependencies: - pandas ``` commands ``` conda create -n test-env pandas conda activate test-env conda list # shows python-language-server and r-languageserver conda deactivate conda env create -f environment.yml conda activate test-env-file conda list # does not show python-language-server and r-languageserver ``` ## Expected Behavior <!-- What do you think should happen? --> ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : None shell level : 0 user config file : /Users/robinsonwi/.condarc populated config files : /Users/robinsonwi/.condarc conda version : 4.8.1 conda-build version : not installed python version : 3.7.3.final.0 virtual packages : __osx=10.14.6 base environment : //miniconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/osx-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/bioconda/osx-64 https://conda.anaconda.org/bioconda/noarch https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch package cache : //miniconda3/pkgs /Users/robinsonwi/.conda/pkgs envs directories : //miniconda3/envs /Users/robinsonwi/.conda/envs platform : osx-64 user-agent : conda/4.8.1 requests/2.22.0 CPython/3.7.3 Darwin/18.7.0 OSX/10.14.6 UID:GID : 185593938:1360859114 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> ``` ==> /Users/robinsonwi/.condarc <== create_default_packages: - python-language-server - r-languageserver channels: - conda-forge - bioconda - defaults ``` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at //miniconda3: # # Name Version Build Channel asn1crypto 1.2.0 py37_0 defaults blas 1.0 mkl defaults ca-certificates 2019.11.27 0 defaults certifi 2019.11.28 py37_0 defaults cffi 1.13.2 py37hb5b8e2f_0 defaults chardet 3.0.4 py37_1003 defaults conda 4.8.1 py37_0 defaults conda-package-handling 1.6.0 py37h1de35cc_0 defaults cryptography 2.8 py37ha12b0ac_0 defaults idna 2.8 py37_0 defaults intel-openmp 2019.4 233 defaults libcxx 4.0.1 hcfea43d_1 defaults libcxxabi 4.0.1 hcfea43d_1 defaults libedit 3.1.20181209 hb402a30_0 defaults libffi 3.2.1 h475c297_4 defaults libgfortran 3.0.1 h93005f0_2 defaults mkl 2019.4 233 defaults mkl-service 2.3.0 py37hfbe908c_0 defaults mkl_fft 1.0.15 py37h5e564d8_0 defaults mkl_random 1.1.0 py37ha771720_0 defaults ncurses 6.1 h0a44026_1 defaults numpy 1.17.4 py37h890c691_0 defaults numpy-base 1.17.4 py37h6575580_0 defaults openssl 1.1.1d h1de35cc_3 defaults pandas 0.25.2 py37h0a44026_0 defaults pycosat 0.6.3 py37h1de35cc_0 defaults pycparser 2.19 py37_0 defaults pyopenssl 19.1.0 py37_0 defaults pysocks 1.7.1 py37_0 defaults python 3.7.3 h359304d_0 defaults python-dateutil 2.8.1 py_0 defaults pytz 2019.3 py_0 defaults readline 7.0 h1de35cc_5 defaults requests 2.22.0 py37_1 defaults ruamel_yaml 0.15.87 py37h1de35cc_0 defaults setuptools 44.0.0 py37_0 defaults six 1.13.0 py37_0 defaults sqlite 3.30.1 ha441bb4_0 defaults tk 8.6.8 ha441bb4_0 defaults tqdm 4.40.2 py_0 defaults urllib3 1.25.7 py37_0 defaults xz 5.2.4 h1de35cc_4 defaults yaml 0.1.7 hc338f04_2 defaults zlib 1.2.11 h1de35cc_3 defaults ``` </p></details>
I was also surprised by this behavior. Is there a plan to implement or fix this @soapy1 ? shouldn't that be the default behavior though? If I have a yaml defining my environment, I would want it to be recreated as specified in the yaml, and not depend on other settings hidden in a .condarc Yes, agreed, the expectation that the environment created from an environment file should be the same everywhere is a sane default behaviour. Nevertheless there are situations, where having an extra argument for `env create` that would automatically extend the listed dependencies by what is in the `create_default_packages` setting would be very helpful. For example to enforce adding an `ipython`, `python-languageserver` dependency to environments. I suggest to call this argument `--with-default-packages`. I just got bitten by this, so I'll add another use case that makes this really desirable. When running on an air-gapped network on Windows machines, and using the Windows Certificate Store, the `python-certifi-win32` package must be installed in every environment in order for things wanting to verify SSL certs to use the Windows Certificate Store to be able to do so. Having the ability to automatically enforce that package gets added every time is pretty important when the conda channel server requires SSL verification. @chenghlee If no one started working on this, I'd be happy to
2021-02-28T22:00:57Z
[]
[]
conda/conda
10,638
conda__conda-10638
[ "10614", "10614" ]
b6d32c8d761163cf42099f02ca564f55602b1a11
diff --git a/conda_env/env.py b/conda_env/env.py --- a/conda_env/env.py +++ b/conda_env/env.py @@ -63,6 +63,7 @@ def validate_keys(data, kwargs): "in the wrong place. Please add an explicit pip dependency. I'm adding one" " for you, but still nagging you.") new_data['dependencies'].insert(0, 'pip') + break return new_data
diff --git a/tests/conda_env/support/add-pip.yml b/tests/conda_env/support/add-pip.yml new file mode 100644 --- /dev/null +++ b/tests/conda_env/support/add-pip.yml @@ -0,0 +1,6 @@ +name: pip +dependencies: + - car + - pip: + - foo + - baz diff --git a/tests/conda_env/test_env.py b/tests/conda_env/test_env.py --- a/tests/conda_env/test_env.py +++ b/tests/conda_env/test_env.py @@ -78,6 +78,15 @@ def test_with_pip(self): assert 'foo' in e.dependencies['pip'] assert 'baz' in e.dependencies['pip'] + @pytest.mark.timeout(20) + def test_add_pip(self): + e = env.from_file(support_file('add-pip.yml')) + expected = OrderedDict([ + ('conda', ['pip', 'car']), + ('pip', ['foo', 'baz']) + ]) + self.assertEqual(e.dependencies, expected) + @pytest.mark.integration def test_http(self): e = get_simple_environment()
Conda prints pip warning over and over again <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. Anaconda Community Code of Conduct: https://www.anaconda.com/community-code-of-conduct/ If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> I'm trying to create a conda environment using a yaml file. I just get a warning message about needing to specify pip as a dependency over and over again, but the environment doesn't get created. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` conda env create -f filter.yml ``` The contents of the file `filter.yml` are: ``` name: filter channels: - bioconda - r - defaults - conda-forge dependencies: - python - pip: - numpy ``` I get the output: ``` conda env create -f filter.yml Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. ``` I've truncated the output, but you get the idea... ## Expected Behavior <!-- What do you think should happen? --> This warning message should only appear once, and then the environment should be created. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : base active env location : /home/sco305/miniconda3 shell level : 1 user config file : /home/sco305/.condarc populated config files : conda version : 4.10.0 conda-build version : not installed python version : 3.8.5.final.0 virtual packages : __linux=5.4.0=0 __glibc=2.27=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/sco305/miniconda3 (writable) conda av data dir : /home/sco305/miniconda3/etc/conda conda av metadata url : https://repo.anaconda.com/pkgs/main channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/sco305/miniconda3/pkgs /home/sco305/.conda/pkgs envs directories : /home/sco305/miniconda3/envs /home/sco305/.conda/envs platform : linux-64 user-agent : conda/4.10.0 requests/2.25.1 CPython/3.8.5 Linux/5.4.0-1028-gcp ubuntu/18.04.5 glibc/2.27 UID:GID : 1004:1005 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> I don't get any output after running `conda config --show-sources` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at /home/sco305/miniconda3: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge adal 1.2.7 pyhd3eb1b0_0 defaults aioeasywebdav 2.4.0 py38h578d9bd_1001 conda-forge aiohttp 3.7.4 py38h497a2fe_0 conda-forge amply 0.1.4 py_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge async-timeout 3.0.1 py_1000 conda-forge atk-1.0 2.36.0 h3371d22_4 conda-forge attmap 0.13.0 pyhd8ed1ab_0 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge azure-common 1.1.27 pyhd8ed1ab_0 conda-forge azure-core 1.12.0 pyhd8ed1ab_0 conda-forge azure-storage-blob 12.8.0 pyhd8ed1ab_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bcrypt 3.2.0 py38h497a2fe_1 conda-forge blinker 1.4 py_1 conda-forge boto 2.49.0 py_0 conda-forge boto3 1.17.51 pyhd8ed1ab_0 conda-forge botocore 1.20.51 pyhd8ed1ab_0 conda-forge brotlipy 0.7.0 py38h27cfd23_1003 defaults bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.17.1 h7f98852_1 conda-forge ca-certificates 2021.1.19 h06a4308_1 defaults cachetools 4.2.1 pyhd8ed1ab_0 conda-forge cairo 1.16.0 h6cf1ce9_1008 conda-forge certifi 2020.12.5 py38h06a4308_0 defaults cffi 1.14.5 py38h261ae71_0 defaults chardet 4.0.0 py38h06a4308_1003 defaults coincbc 2.10.5 hcee13e7_1 conda-forge conda 4.10.0 py38h578d9bd_1 conda-forge conda-package-handling 1.7.3 py38h27cfd23_1 defaults configargparse 1.4 pyhd8ed1ab_0 conda-forge cryptography 3.4.7 py38hd23ed53_0 defaults datrie 0.8.2 py38h1e0a361_1 conda-forge decorator 4.4.2 py_0 conda-forge docutils 0.17 py38h578d9bd_0 conda-forge dropbox 11.6.0 pyhd8ed1ab_0 conda-forge expat 2.3.0 h9c3ff4c_0 conda-forge fftw 3.3.9 nompi_hcdd671c_101 conda-forge filechunkio 1.8 py_2 conda-forge filelock 3.0.12 pyh9f0ad1d_0 conda-forge font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 2.001 hab24e00_0 conda-forge font-ttf-source-code-pro 2.030 hab24e00_0 conda-forge font-ttf-ubuntu 0.83 hab24e00_0 conda-forge fontconfig 2.13.1 hba837de_1005 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge freetype 2.10.4 h0708190_1 conda-forge fribidi 1.0.10 h516909a_0 conda-forge ftputil 5.0.1 pyhd8ed1ab_0 conda-forge gdk-pixbuf 2.42.6 h04a7f16_0 conda-forge gettext 0.21.0 hf68c758_0 defaults ghostscript 9.53.3 h58526e2_2 conda-forge giflib 5.2.1 h516909a_2 conda-forge gitdb 4.0.7 pyhd8ed1ab_0 conda-forge gitpython 3.1.14 pyhd8ed1ab_0 conda-forge google-api-core 1.26.2 pyhd8ed1ab_0 conda-forge google-api-python-client 2.2.0 pyhd8ed1ab_0 conda-forge google-auth 1.28.1 pyhd3eb1b0_0 defaults google-auth-httplib2 0.1.0 pyhd8ed1ab_0 conda-forge google-cloud-core 1.6.0 pyhd3eb1b0_0 defaults google-cloud-storage 1.37.1 pyhd3eb1b0_0 defaults google-crc32c 1.1.2 py38h8838a9a_0 conda-forge google-resumable-media 1.2.0 pyhd3deb0d_0 conda-forge googleapis-common-protos 1.53.0 py38h578d9bd_0 conda-forge graphite2 1.3.14 h23475e2_0 defaults graphviz 2.47.0 he056042_1 conda-forge gtk2 2.24.33 hab0c2f8_0 conda-forge gts 0.7.6 h64030ff_2 conda-forge harfbuzz 2.8.0 h83ec7ef_1 conda-forge httplib2 0.19.1 pyhd8ed1ab_0 conda-forge icu 68.1 h58526e2_0 conda-forge idna 2.10 pyhd3eb1b0_0 defaults imagemagick 7.0.11_7 pl5320h0cb4662_0 conda-forge importlib-metadata 3.10.1 py38h578d9bd_0 conda-forge importlib_metadata 3.10.1 hd8ed1ab_0 conda-forge iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge isodate 0.6.0 py_1 conda-forge jbig 2.1 h516909a_2002 conda-forge jinja2 2.11.3 pyh44b312d_0 conda-forge jmespath 0.10.0 pyh9f0ad1d_0 conda-forge jpeg 9d h516909a_0 conda-forge jsonschema 3.2.0 py38h32f6830_1 conda-forge jupyter_core 4.7.1 py38h578d9bd_0 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge ld_impl_linux-64 2.33.1 h53a641e_7 defaults libarchive 3.5.1 h3f442fb_1 conda-forge libblas 3.9.0 8_openblas conda-forge libcblas 3.9.0 8_openblas conda-forge libcrc32c 1.1.1 he1b5a44_2 conda-forge libcurl 7.76.0 hc4aaa36_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libffi 3.3 he6710b0_2 defaults libgcc-ng 9.3.0 h2828fa1_19 conda-forge libgd 2.3.2 h78a0170_0 conda-forge libgfortran-ng 9.3.0 hff62375_19 conda-forge libgfortran5 9.3.0 hff62375_19 conda-forge libglib 2.68.1 h3e27bee_0 conda-forge libgomp 9.3.0 h2828fa1_19 conda-forge libiconv 1.16 h516909a_0 conda-forge liblapack 3.9.0 8_openblas conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libopenblas 0.3.12 pthreads_h4812303_1 conda-forge libpng 1.6.37 hed695b0_2 conda-forge libprotobuf 3.15.8 h780b84a_0 conda-forge librsvg 2.50.3 hfa39831_1 conda-forge libsodium 1.0.18 h516909a_1 conda-forge libsolv 0.7.18 h780b84a_0 conda-forge libssh2 1.9.0 ha56f1ee_6 conda-forge libstdcxx-ng 9.3.0 h6de172a_19 conda-forge libtiff 4.2.0 hdc55705_0 conda-forge libtool 2.4.6 h58526e2_1007 conda-forge libuuid 2.32.1 h14c3975_1000 conda-forge libwebp 1.2.0 h3452ae3_0 conda-forge libwebp-base 1.2.0 h7f98852_2 conda-forge libxcb 1.14 h7b6447c_0 defaults libxml2 2.9.10 h72842e0_4 conda-forge logmuse 0.2.6 pyh8c360ce_0 conda-forge lz4-c 1.9.3 h9c3ff4c_0 conda-forge lzo 2.10 h516909a_1000 conda-forge mamba 0.9.2 py38h2aa5da1_0 conda-forge markupsafe 1.1.1 py38h497a2fe_3 conda-forge more-itertools 8.7.0 pyhd8ed1ab_0 conda-forge msrest 0.6.21 pyh44b312d_0 conda-forge multidict 5.1.0 py38h497a2fe_1 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge ncurses 6.2 he6710b0_1 defaults networkx 2.5.1 pyhd8ed1ab_0 conda-forge numpy 1.20.2 py38h9894fe3_0 conda-forge oauth2client 4.1.3 py_0 conda-forge oauthlib 3.1.0 py_0 defaults openjpeg 2.4.0 hf7af979_0 conda-forge openssl 1.1.1k h27cfd23_0 defaults packaging 20.9 pyh44b312d_0 conda-forge pandas 1.2.4 py38h1abd341_0 conda-forge pango 1.42.4 h80147aa_5 conda-forge paramiko 2.7.2 pyh9f0ad1d_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge peppy 0.31.0 pyh9f0ad1d_0 conda-forge perl 5.32.0 h36c2ea0_0 conda-forge pip 21.0.1 py38h06a4308_0 defaults pixman 0.40.0 h36c2ea0_0 conda-forge pkg-config 0.29.2 h516909a_1008 conda-forge pluggy 0.13.1 py38h578d9bd_4 conda-forge ply 3.11 py_1 conda-forge prettytable 2.1.0 pyhd8ed1ab_0 conda-forge protobuf 3.15.8 py38h709712a_0 conda-forge psutil 5.8.0 py38h497a2fe_1 conda-forge pulp 2.4 py38h578d9bd_0 conda-forge py 1.10.0 pyhd3deb0d_0 conda-forge pyasn1 0.4.8 py_0 conda-forge pyasn1-modules 0.2.8 py_0 defaults pycosat 0.6.3 py38h7b6447c_1 defaults pycparser 2.20 py_2 defaults pygments 2.8.1 pyhd8ed1ab_0 conda-forge pygraphviz 1.7 py38h0d738da_0 conda-forge pyjwt 2.0.1 pyhd8ed1ab_1 conda-forge pynacl 1.4.0 py38h497a2fe_2 conda-forge pyopenssl 20.0.1 pyhd3eb1b0_1 defaults pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyrsistent 0.17.3 py38h497a2fe_2 conda-forge pysftp 0.2.9 py_1 conda-forge pysocks 1.7.1 py38h06a4308_0 defaults pytest 6.2.3 py38h578d9bd_0 conda-forge python 3.8.5 h7579374_1 defaults python-dateutil 2.8.1 py_0 conda-forge python-irodsclient 0.8.6 pyhd8ed1ab_0 conda-forge python-kubernetes 12.0.1 pyhd3eb1b0_0 defaults python_abi 3.8 1_cp38 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pyyaml 5.4.1 py38h497a2fe_0 conda-forge ratelimiter 1.2.0 py38h32f6830_1001 conda-forge readline 8.1 h27cfd23_0 defaults reproc 14.2.1 h36c2ea0_0 conda-forge reproc-cpp 14.2.1 h58526e2_0 conda-forge requests 2.25.1 pyhd3eb1b0_0 defaults requests-oauthlib 1.3.0 pyh9f0ad1d_0 conda-forge rsa 4.7.2 pyh44b312d_0 conda-forge ruamel_yaml 0.15.100 py38h27cfd23_0 defaults s3transfer 0.3.7 pyhd8ed1ab_0 conda-forge setuptools 52.0.0 py38h06a4308_0 defaults simplejson 3.17.2 py38h497a2fe_2 conda-forge six 1.15.0 py38h06a4308_0 defaults slacker 0.14.0 py_0 conda-forge smart_open 5.0.0 pyhd8ed1ab_0 conda-forge smmap 3.0.5 pyh44b312d_0 conda-forge snakemake 6.1.1 hdfd78af_0 bioconda snakemake-minimal 6.1.1 pyhdfd78af_0 bioconda sqlite 3.35.4 hdfb4753_0 defaults stone 3.2.1 pyhd8ed1ab_0 conda-forge tk 8.6.10 hbc83047_0 defaults toml 0.10.2 pyhd8ed1ab_0 conda-forge toposort 1.6 pyhd8ed1ab_0 conda-forge tqdm 4.59.0 pyhd3eb1b0_1 defaults traitlets 5.0.5 py_0 conda-forge typing-extensions 3.7.4.3 0 conda-forge typing_extensions 3.7.4.3 py_0 conda-forge ubiquerg 0.6.1 pyh9f0ad1d_0 conda-forge uritemplate 3.0.1 py_0 conda-forge urllib3 1.26.4 pyhd3eb1b0_0 defaults veracitools 0.1.3 py_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge websocket-client 0.58.0 py38h06a4308_4 defaults wheel 0.36.2 pyhd3eb1b0_0 defaults wrapt 1.12.1 py38h497a2fe_3 conda-forge xmlrunner 1.7.7 py_0 conda-forge xorg-kbproto 1.0.7 h14c3975_1002 conda-forge xorg-libice 1.0.10 h516909a_0 conda-forge xorg-libsm 1.2.3 hd9c2040_1000 conda-forge xorg-libx11 1.7.0 h36c2ea0_0 conda-forge xorg-libxau 1.0.9 h14c3975_0 conda-forge xorg-libxext 1.3.4 h7f98852_1 conda-forge xorg-libxrender 0.9.10 h7f98852_1003 conda-forge xorg-libxt 1.2.1 h7f98852_2 conda-forge xorg-renderproto 0.11.1 h14c3975_1002 conda-forge xorg-xextproto 7.3.0 h14c3975_1002 conda-forge xorg-xproto 7.0.31 h14c3975_1007 conda-forge xz 5.2.5 h7b6447c_0 defaults yaml 0.2.5 h7b6447c_0 defaults yarl 1.5.1 py38h1e0a361_0 conda-forge zipp 3.4.1 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h7b6447c_3 defaults zstd 1.4.9 ha95c52a_0 conda-forge ``` </p></details> Conda prints pip warning over and over again <!-- Hi! Read this; it's important. This is an issue tracker for conda -- the package manager. File feature requests for conda here, as well as bug reports about something conda has messed up. Anaconda Community Code of Conduct: https://www.anaconda.com/community-code-of-conduct/ If your issue is a bug report for: * a specific conda package from Anaconda ('defaults' channel): ==> file at https://github.com/ContinuumIO/anaconda-issues * a specific conda package from conda-forge: ==> file at the corresponding feedstock under https://github.com/conda-forge * repo.anaconda.com access and service: ==> file at https://github.com/ContinuumIO/anaconda-issues * anaconda.org access and service: ==> file at https://anaconda.org/contact/report * commands under 'conda build': ==> file at https://github.com/conda/conda-build * commands under 'conda env': ==> please file it here! * all other conda commands that start with 'conda': ==> please file it here! If you continue on, **please include all requested information below.** If a maintainer determines the information is required to understand your issue, and if it is not provided, your issue may be closed automatically. --> ## Current Behavior <!-- What actually happens? If you want to include console output, please use "Steps to Reproduce" below. --> I'm trying to create a conda environment using a yaml file. I just get a warning message about needing to specify pip as a dependency over and over again, but the environment doesn't get created. ### Steps to Reproduce <!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce. Include the exact conda commands that reproduce the issue and their output between the ticks below. --> ``` conda env create -f filter.yml ``` The contents of the file `filter.yml` are: ``` name: filter channels: - bioconda - r - defaults - conda-forge dependencies: - python - pip: - numpy ``` I get the output: ``` conda env create -f filter.yml Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an explicit pip dependency. I'm adding one for you, but still nagging you. ``` I've truncated the output, but you get the idea... ## Expected Behavior <!-- What do you think should happen? --> This warning message should only appear once, and then the environment should be created. ## Environment Information <details open><summary><code>`conda info`</code></summary><p> <!-- between the ticks below, paste the output of 'conda info' --> ``` active environment : base active env location : /home/sco305/miniconda3 shell level : 1 user config file : /home/sco305/.condarc populated config files : conda version : 4.10.0 conda-build version : not installed python version : 3.8.5.final.0 virtual packages : __linux=5.4.0=0 __glibc=2.27=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/sco305/miniconda3 (writable) conda av data dir : /home/sco305/miniconda3/etc/conda conda av metadata url : https://repo.anaconda.com/pkgs/main channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /home/sco305/miniconda3/pkgs /home/sco305/.conda/pkgs envs directories : /home/sco305/miniconda3/envs /home/sco305/.conda/envs platform : linux-64 user-agent : conda/4.10.0 requests/2.25.1 CPython/3.8.5 Linux/5.4.0-1028-gcp ubuntu/18.04.5 glibc/2.27 UID:GID : 1004:1005 netrc file : None offline mode : False ``` </p></details> <details open><summary><code>`conda config --show-sources`</code></summary><p> <!-- between the ticks below, paste the output of 'conda config --show-sources' --> I don't get any output after running `conda config --show-sources` </p></details> <details><summary><code>`conda list --show-channel-urls`</code></summary><p> <!-- between the ticks below, paste the output of 'conda list --show-channel-urls' --> ``` # packages in environment at /home/sco305/miniconda3: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge adal 1.2.7 pyhd3eb1b0_0 defaults aioeasywebdav 2.4.0 py38h578d9bd_1001 conda-forge aiohttp 3.7.4 py38h497a2fe_0 conda-forge amply 0.1.4 py_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge async-timeout 3.0.1 py_1000 conda-forge atk-1.0 2.36.0 h3371d22_4 conda-forge attmap 0.13.0 pyhd8ed1ab_0 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge azure-common 1.1.27 pyhd8ed1ab_0 conda-forge azure-core 1.12.0 pyhd8ed1ab_0 conda-forge azure-storage-blob 12.8.0 pyhd8ed1ab_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge bcrypt 3.2.0 py38h497a2fe_1 conda-forge blinker 1.4 py_1 conda-forge boto 2.49.0 py_0 conda-forge boto3 1.17.51 pyhd8ed1ab_0 conda-forge botocore 1.20.51 pyhd8ed1ab_0 conda-forge brotlipy 0.7.0 py38h27cfd23_1003 defaults bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.17.1 h7f98852_1 conda-forge ca-certificates 2021.1.19 h06a4308_1 defaults cachetools 4.2.1 pyhd8ed1ab_0 conda-forge cairo 1.16.0 h6cf1ce9_1008 conda-forge certifi 2020.12.5 py38h06a4308_0 defaults cffi 1.14.5 py38h261ae71_0 defaults chardet 4.0.0 py38h06a4308_1003 defaults coincbc 2.10.5 hcee13e7_1 conda-forge conda 4.10.0 py38h578d9bd_1 conda-forge conda-package-handling 1.7.3 py38h27cfd23_1 defaults configargparse 1.4 pyhd8ed1ab_0 conda-forge cryptography 3.4.7 py38hd23ed53_0 defaults datrie 0.8.2 py38h1e0a361_1 conda-forge decorator 4.4.2 py_0 conda-forge docutils 0.17 py38h578d9bd_0 conda-forge dropbox 11.6.0 pyhd8ed1ab_0 conda-forge expat 2.3.0 h9c3ff4c_0 conda-forge fftw 3.3.9 nompi_hcdd671c_101 conda-forge filechunkio 1.8 py_2 conda-forge filelock 3.0.12 pyh9f0ad1d_0 conda-forge font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 2.001 hab24e00_0 conda-forge font-ttf-source-code-pro 2.030 hab24e00_0 conda-forge font-ttf-ubuntu 0.83 hab24e00_0 conda-forge fontconfig 2.13.1 hba837de_1005 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge freetype 2.10.4 h0708190_1 conda-forge fribidi 1.0.10 h516909a_0 conda-forge ftputil 5.0.1 pyhd8ed1ab_0 conda-forge gdk-pixbuf 2.42.6 h04a7f16_0 conda-forge gettext 0.21.0 hf68c758_0 defaults ghostscript 9.53.3 h58526e2_2 conda-forge giflib 5.2.1 h516909a_2 conda-forge gitdb 4.0.7 pyhd8ed1ab_0 conda-forge gitpython 3.1.14 pyhd8ed1ab_0 conda-forge google-api-core 1.26.2 pyhd8ed1ab_0 conda-forge google-api-python-client 2.2.0 pyhd8ed1ab_0 conda-forge google-auth 1.28.1 pyhd3eb1b0_0 defaults google-auth-httplib2 0.1.0 pyhd8ed1ab_0 conda-forge google-cloud-core 1.6.0 pyhd3eb1b0_0 defaults google-cloud-storage 1.37.1 pyhd3eb1b0_0 defaults google-crc32c 1.1.2 py38h8838a9a_0 conda-forge google-resumable-media 1.2.0 pyhd3deb0d_0 conda-forge googleapis-common-protos 1.53.0 py38h578d9bd_0 conda-forge graphite2 1.3.14 h23475e2_0 defaults graphviz 2.47.0 he056042_1 conda-forge gtk2 2.24.33 hab0c2f8_0 conda-forge gts 0.7.6 h64030ff_2 conda-forge harfbuzz 2.8.0 h83ec7ef_1 conda-forge httplib2 0.19.1 pyhd8ed1ab_0 conda-forge icu 68.1 h58526e2_0 conda-forge idna 2.10 pyhd3eb1b0_0 defaults imagemagick 7.0.11_7 pl5320h0cb4662_0 conda-forge importlib-metadata 3.10.1 py38h578d9bd_0 conda-forge importlib_metadata 3.10.1 hd8ed1ab_0 conda-forge iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge isodate 0.6.0 py_1 conda-forge jbig 2.1 h516909a_2002 conda-forge jinja2 2.11.3 pyh44b312d_0 conda-forge jmespath 0.10.0 pyh9f0ad1d_0 conda-forge jpeg 9d h516909a_0 conda-forge jsonschema 3.2.0 py38h32f6830_1 conda-forge jupyter_core 4.7.1 py38h578d9bd_0 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge ld_impl_linux-64 2.33.1 h53a641e_7 defaults libarchive 3.5.1 h3f442fb_1 conda-forge libblas 3.9.0 8_openblas conda-forge libcblas 3.9.0 8_openblas conda-forge libcrc32c 1.1.1 he1b5a44_2 conda-forge libcurl 7.76.0 hc4aaa36_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libffi 3.3 he6710b0_2 defaults libgcc-ng 9.3.0 h2828fa1_19 conda-forge libgd 2.3.2 h78a0170_0 conda-forge libgfortran-ng 9.3.0 hff62375_19 conda-forge libgfortran5 9.3.0 hff62375_19 conda-forge libglib 2.68.1 h3e27bee_0 conda-forge libgomp 9.3.0 h2828fa1_19 conda-forge libiconv 1.16 h516909a_0 conda-forge liblapack 3.9.0 8_openblas conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libopenblas 0.3.12 pthreads_h4812303_1 conda-forge libpng 1.6.37 hed695b0_2 conda-forge libprotobuf 3.15.8 h780b84a_0 conda-forge librsvg 2.50.3 hfa39831_1 conda-forge libsodium 1.0.18 h516909a_1 conda-forge libsolv 0.7.18 h780b84a_0 conda-forge libssh2 1.9.0 ha56f1ee_6 conda-forge libstdcxx-ng 9.3.0 h6de172a_19 conda-forge libtiff 4.2.0 hdc55705_0 conda-forge libtool 2.4.6 h58526e2_1007 conda-forge libuuid 2.32.1 h14c3975_1000 conda-forge libwebp 1.2.0 h3452ae3_0 conda-forge libwebp-base 1.2.0 h7f98852_2 conda-forge libxcb 1.14 h7b6447c_0 defaults libxml2 2.9.10 h72842e0_4 conda-forge logmuse 0.2.6 pyh8c360ce_0 conda-forge lz4-c 1.9.3 h9c3ff4c_0 conda-forge lzo 2.10 h516909a_1000 conda-forge mamba 0.9.2 py38h2aa5da1_0 conda-forge markupsafe 1.1.1 py38h497a2fe_3 conda-forge more-itertools 8.7.0 pyhd8ed1ab_0 conda-forge msrest 0.6.21 pyh44b312d_0 conda-forge multidict 5.1.0 py38h497a2fe_1 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge ncurses 6.2 he6710b0_1 defaults networkx 2.5.1 pyhd8ed1ab_0 conda-forge numpy 1.20.2 py38h9894fe3_0 conda-forge oauth2client 4.1.3 py_0 conda-forge oauthlib 3.1.0 py_0 defaults openjpeg 2.4.0 hf7af979_0 conda-forge openssl 1.1.1k h27cfd23_0 defaults packaging 20.9 pyh44b312d_0 conda-forge pandas 1.2.4 py38h1abd341_0 conda-forge pango 1.42.4 h80147aa_5 conda-forge paramiko 2.7.2 pyh9f0ad1d_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge peppy 0.31.0 pyh9f0ad1d_0 conda-forge perl 5.32.0 h36c2ea0_0 conda-forge pip 21.0.1 py38h06a4308_0 defaults pixman 0.40.0 h36c2ea0_0 conda-forge pkg-config 0.29.2 h516909a_1008 conda-forge pluggy 0.13.1 py38h578d9bd_4 conda-forge ply 3.11 py_1 conda-forge prettytable 2.1.0 pyhd8ed1ab_0 conda-forge protobuf 3.15.8 py38h709712a_0 conda-forge psutil 5.8.0 py38h497a2fe_1 conda-forge pulp 2.4 py38h578d9bd_0 conda-forge py 1.10.0 pyhd3deb0d_0 conda-forge pyasn1 0.4.8 py_0 conda-forge pyasn1-modules 0.2.8 py_0 defaults pycosat 0.6.3 py38h7b6447c_1 defaults pycparser 2.20 py_2 defaults pygments 2.8.1 pyhd8ed1ab_0 conda-forge pygraphviz 1.7 py38h0d738da_0 conda-forge pyjwt 2.0.1 pyhd8ed1ab_1 conda-forge pynacl 1.4.0 py38h497a2fe_2 conda-forge pyopenssl 20.0.1 pyhd3eb1b0_1 defaults pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyrsistent 0.17.3 py38h497a2fe_2 conda-forge pysftp 0.2.9 py_1 conda-forge pysocks 1.7.1 py38h06a4308_0 defaults pytest 6.2.3 py38h578d9bd_0 conda-forge python 3.8.5 h7579374_1 defaults python-dateutil 2.8.1 py_0 conda-forge python-irodsclient 0.8.6 pyhd8ed1ab_0 conda-forge python-kubernetes 12.0.1 pyhd3eb1b0_0 defaults python_abi 3.8 1_cp38 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pyyaml 5.4.1 py38h497a2fe_0 conda-forge ratelimiter 1.2.0 py38h32f6830_1001 conda-forge readline 8.1 h27cfd23_0 defaults reproc 14.2.1 h36c2ea0_0 conda-forge reproc-cpp 14.2.1 h58526e2_0 conda-forge requests 2.25.1 pyhd3eb1b0_0 defaults requests-oauthlib 1.3.0 pyh9f0ad1d_0 conda-forge rsa 4.7.2 pyh44b312d_0 conda-forge ruamel_yaml 0.15.100 py38h27cfd23_0 defaults s3transfer 0.3.7 pyhd8ed1ab_0 conda-forge setuptools 52.0.0 py38h06a4308_0 defaults simplejson 3.17.2 py38h497a2fe_2 conda-forge six 1.15.0 py38h06a4308_0 defaults slacker 0.14.0 py_0 conda-forge smart_open 5.0.0 pyhd8ed1ab_0 conda-forge smmap 3.0.5 pyh44b312d_0 conda-forge snakemake 6.1.1 hdfd78af_0 bioconda snakemake-minimal 6.1.1 pyhdfd78af_0 bioconda sqlite 3.35.4 hdfb4753_0 defaults stone 3.2.1 pyhd8ed1ab_0 conda-forge tk 8.6.10 hbc83047_0 defaults toml 0.10.2 pyhd8ed1ab_0 conda-forge toposort 1.6 pyhd8ed1ab_0 conda-forge tqdm 4.59.0 pyhd3eb1b0_1 defaults traitlets 5.0.5 py_0 conda-forge typing-extensions 3.7.4.3 0 conda-forge typing_extensions 3.7.4.3 py_0 conda-forge ubiquerg 0.6.1 pyh9f0ad1d_0 conda-forge uritemplate 3.0.1 py_0 conda-forge urllib3 1.26.4 pyhd3eb1b0_0 defaults veracitools 0.1.3 py_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge websocket-client 0.58.0 py38h06a4308_4 defaults wheel 0.36.2 pyhd3eb1b0_0 defaults wrapt 1.12.1 py38h497a2fe_3 conda-forge xmlrunner 1.7.7 py_0 conda-forge xorg-kbproto 1.0.7 h14c3975_1002 conda-forge xorg-libice 1.0.10 h516909a_0 conda-forge xorg-libsm 1.2.3 hd9c2040_1000 conda-forge xorg-libx11 1.7.0 h36c2ea0_0 conda-forge xorg-libxau 1.0.9 h14c3975_0 conda-forge xorg-libxext 1.3.4 h7f98852_1 conda-forge xorg-libxrender 0.9.10 h7f98852_1003 conda-forge xorg-libxt 1.2.1 h7f98852_2 conda-forge xorg-renderproto 0.11.1 h14c3975_1002 conda-forge xorg-xextproto 7.3.0 h14c3975_1002 conda-forge xorg-xproto 7.0.31 h14c3975_1007 conda-forge xz 5.2.5 h7b6447c_0 defaults yaml 0.2.5 h7b6447c_0 defaults yarl 1.5.1 py38h1e0a361_0 conda-forge zipp 3.4.1 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h7b6447c_3 defaults zstd 1.4.9 ha95c52a_0 conda-forge ``` </p></details>
2021-04-27T14:16:20Z
[]
[]
vega/altair
167
vega__altair-167
[ "165" ]
4dbb010f87c9bac48a7ffc0c4e7eecd167ba56a8
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -142,6 +142,12 @@ def sanitize_dataframe(df): if isinstance(df.columns, pd.core.index.MultiIndex): raise ValueError('Hierarchical indices not supported') + def to_list_if_array(val): + if isinstance(val, np.ndarray): + return val.tolist() + else: + return val + for col_name, dtype in df.dtypes.iteritems(): if str(dtype) == 'category': # XXXX: work around bug in to_json for categorical types @@ -158,4 +164,9 @@ def sanitize_dataframe(df): # Convert datetimes to strings # astype(str) will choose the appropriate resolution df[col_name] = df[col_name].astype(str).replace('NaT', '') + elif dtype == object: + # Convert numpy arrays saved as objects to lists + # Arrays are not JSON serializable + col = df[col_name].apply(to_list_if_array, convert_dtype=False) + df[col_name] = col.where(col.notnull(), None) return df
diff --git a/altair/utils/tests/test_utils.py b/altair/utils/tests/test_utils.py --- a/altair/utils/tests/test_utils.py +++ b/altair/utils/tests/test_utils.py @@ -85,12 +85,14 @@ def test_sanitize_dataframe(): 'f': np.arange(5, dtype=float), 'i': np.arange(5, dtype=int), 'd': pd.date_range('2012-01-01', periods=5, freq='H'), - 'c': pd.Series(list('ababc'), dtype='category')}) + 'c': pd.Series(list('ababc'), dtype='category'), + 'o': pd.Series([np.array(i) for i in range(5)])}) # add some nulls df.ix[0, 's'] = None df.ix[0, 'f'] = np.nan df.ix[0, 'd'] = pd.NaT + df.ix[0, 'o'] = np.array(np.nan) # JSON serialize. This will fail on non-sanitized dataframes df_clean = sanitize_dataframe(df) @@ -108,4 +110,6 @@ def test_sanitize_dataframe(): else: df2[col] = df2[col].astype(df[col].dtype) + # pandas doesn't properly recognize np.array(np.nan), so change it here + df.ix[0, 'o'] = np.nan assert df.equals(df2)
numpy scalar in Dataframe not JSON serializable Is it possible to allow numpy scalars in a dataframe? The following code is not working, because a np.array is not json serializable: ``` df_numpy = pd.DataFrame([dict( x=np.array(1), y=np.array(2), )]) Chart(df_numpy).encode(x='x', y='y') # TypeError: array(1) is not JSON serializable ``` Full Example: [ https://github.com/boeddeker/ipynb/blob/master/bug_altair_numpy.ipynb](https://github.com/boeddeker/ipynb/blob/master/bug_altair_numpy.ipynb)
Thanks for the report! I think the issue here is that you've created a dataframe containing object-types, rather than a dataframe containing numeric types. This is easier to see if you pass multi-valued arrays to your dataframe: ``` python df_numpy = pd.DataFrame([dict( x=np.array([1, 2, 3]), y=np.array([2, 3, 4, 5]), )]) >>> df_numpy x y 0 [1, 2, 3] [2, 3, 4, 5] ``` It's not entirely clear to me what you might expect Altair to do in this case: at each index, the column contains an array, which cannot be meaningfully serialized either as a numerical value or as a string. Now it's true that the zero-dimensional array is perhaps a corner case in which we could specially convert the array-object-type to a single numerical scalar type, but that is a case we'd have to explicitly handle (and explicitly test _each_ value in a type-object column to see if it's (1) an array and (2) has zero dimensions) I think better would be to have the user give the data in a more standard form, e.g. ``` python df_numpy = pd.DataFrame(dict( x=np.array([1]), y=np.array([2]), )) ``` in which case the chart works as you would expect. I'm curious how you came across this – do you think it's important for Altair to check for and correct such a corner-case for malformed inputs? Thinking about it, one solution might be to preprocess the dataframes with something like this: ``` python for col in df_numpy.columns: try: df_numpy[col] = df_numpy[col].astype(float) except ValueError: pass ``` then you end up with a serializable array in the above case. The problem is, though, that if you use this on an array of strings containing only digits, these digits will be converted to a numeric type (which probably is not what the user wants). In both cases, the dtype of the pandas column is `object`. So before doing this, you'd have to individually check the Python type of each entry in any column with dtype object and make sure it's a zero-dimensional numpy array. That strikes me as the kind of corner case that we should leave to the user to correct – but let me know if you disagree. The problem is, that I use a library, which forces each value to be a numpy array. Because of that, also scalars are numpy array's. I currently try to replace matplotlib with Altair, but in my opinion this error should not appear, since other plotting library's can handle this. Since this example works ``` df_numpy = pd.DataFrame([dict( x=np.array(1).tolist(), y=np.array(2).tolist(), )]) ``` I would implement something like this (maybe slow, because of the iteration over all elements) ``` for index, series in df_numpy.iterrows(): for k, s in series.items(): if isinstance(s, np.ndarray): df_numpy.loc[index][k] = s.tolist() ``` this would not break anything what currently is working. An alternate is to use an JSONEncoder as described in http://stackoverflow.com/a/27050186 . ``` class MyEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, numpy.integer): return int(obj) elif isinstance(obj, numpy.floating): return float(obj) elif isinstance(obj, numpy.ndarray): return obj.tolist() else: return super(MyEncoder, self).default(obj) json.dumps(numpy.float32(1.2), cls=MyEncoder) json.dumps(numpy.arange(12), cls=MyEncoder) json.dumps({'a': numpy.int32(42)}) ``` > I'm curious how you came across this – do you think it's important for Altair to check for and correct such a corner-case for malformed inputs? I know that this is a special case, but the problem here is, that json can not handle numpy arrays and it seems, that the people form json don't want to solve this (http://bugs.python.org/issue18303, https://bugs.python.org/issue24313) I see – yes I think we could add something along these lines to handle it. @ellisonbg – I'm curious about your opinion here: should this be handled via explicit conversion like we already do for some cases, or via a custom JSON encoder?
2016-07-26T20:17:41Z
[]
[]
vega/altair
344
vega__altair-344
[ "281" ]
8940be2c1ab7c1c174db6c0e457c7f551c0c064c
diff --git a/altair/api.py b/altair/api.py --- a/altair/api.py +++ b/altair/api.py @@ -369,6 +369,7 @@ class Chart(schema.ExtendedUnitSpec, TopLevelMixin): help=schema.ExtendedUnitSpec.encoding.help) transform = T.Instance(Transform, allow_none=True, default_value=None, help=schema.ExtendedUnitSpec.transform.help) + mark = schema.Mark(allow_none=True, default_value='point', help="""The mark type.""") @property def data(self): diff --git a/altair/expr/core.py b/altair/expr/core.py --- a/altair/expr/core.py +++ b/altair/expr/core.py @@ -224,6 +224,7 @@ class DataFrame(object): "data": { "url": "url/to/my/data.json" }, + "mark": "point", "transform": { "calculate": [ {
diff --git a/altair/tests/test_api.py b/altair/tests/test_api.py --- a/altair/tests/test_api.py +++ b/altair/tests/test_api.py @@ -20,6 +20,12 @@ def make_chart(): return Chart(data).mark_point().encode(x='x', y='y') +def test_default_mark(): + """Make sure the default mark is a point.""" + c = Chart() + assert c.mark=='point' + + def test_mark_methods(): """Make sure the Chart's mark_*() methods all exist""" from ..schema import Mark
Default Mark Property I came accross a problem with the display of altair plots in Jupyter notebooks. Take the following code, where df is any dataset: from altair import Chart Chart(df).to_dict().get('mark') This would return 'point' in altair 1.0.0. In altair 1.2.0 this returns None, which results in a javascript error of the jupyter-vega extension and no display of the plot. If the latter behavior is anticipated (i.e. the mark property of vega-lite plots may be undefined) the jupyter-vega extension would need a fix. Niels
Thanks! Yes, I'd noticed that changed, but hadn't appreciated the consequences. We'll make sure to fix this in the upcoming 2.0 release. I marked this as 1.3 as it should be easy to fix.
2017-06-29T02:00:51Z
[]
[]
vega/altair
345
vega__altair-345
[ "281" ]
753937246ff727f954782c94499e4abffb8cb8ac
diff --git a/altair/__init__.py b/altair/__init__.py --- a/altair/__init__.py +++ b/altair/__init__.py @@ -40,6 +40,7 @@ EqualFilter, RangeFilter, OneOfFilter, + MaxRowsExceeded ) from .datasets import ( diff --git a/altair/api.py b/altair/api.py --- a/altair/api.py +++ b/altair/api.py @@ -51,6 +51,13 @@ from .schema import UnitEncoding from .schema import VerticalAlign + +class MaxRowsExceeded(Exception): + """Raised if the number of rows in the dataset is too large.""" + pass + +DEFAULT_MAX_ROWS = 5000 + #************************************************************************* # Channel Aliases #************************************************************************* @@ -338,10 +345,27 @@ def serve(self, ip='127.0.0.1', port=8888, n_retries=50, files=None, def _finalize_data(self): """ - This function is called by _finalize() below. It checks whether the - data attribute contains expressions, and if so it extracts the - appropriate data object and generates the appropriate transforms. + This function is called by _finalize() below. + + It performs final checks on the data: + + * If the data has too many rows (more than max_rows). + * Whether the data attribute contains expressions, and if so it extracts + the appropriate data object and generates the appropriate transforms. """ + # Check to see if data has too many rows. + if isinstance(self.data, pd.DataFrame): + if len(self.data) > self.max_rows: + raise MaxRowsExceeded( + "Your dataset has too many rows and could take a long " + "time to send to the frontend or to render. To override the " + "default maximum rows (%s), set the max_rows property of " + "your Chart to an integer larger than the number of rows " + "in your dataset. Alternatively you could perform aggregations " + "or other data reductions before using it with Altair" % DEFAULT_MAX_ROWS + ) + + # Handle expressions. if isinstance(self.data, expr.DataFrame): columns = self.data._cols calculated_cols = self.data._calculated_cols @@ -370,6 +394,11 @@ class Chart(schema.ExtendedUnitSpec, TopLevelMixin): transform = T.Instance(Transform, allow_none=True, default_value=None, help=schema.ExtendedUnitSpec.transform.help) mark = schema.Mark(allow_none=True, default_value='point', help="""The mark type.""") + + max_rows = T.Int( + default_value=DEFAULT_MAX_ROWS, + help="Maximum number of rows in the dataset to accept." + ) @property def data(self): @@ -385,7 +414,7 @@ def data(self, new): else: raise TypeError('Expected DataFrame or altair.Data, got: {0}'.format(new)) - skip = ['data', '_data'] + skip = ['data', '_data', 'max_rows'] def __init__(self, data=None, **kwargs): super(Chart, self).__init__(**kwargs) @@ -513,6 +542,10 @@ class LayeredChart(schema.LayerSpec, TopLevelMixin): help=schema.LayerSpec.layers.help) transform = T.Instance(Transform, allow_none=True, default_value=None, help=schema.LayerSpec.transform.help) + max_rows = T.Int( + default_value=DEFAULT_MAX_ROWS, + help="Maximum number of rows in the dataset to accept." + ) @property def data(self): @@ -528,7 +561,7 @@ def data(self, new): else: raise TypeError('Expected DataFrame or altair.Data, got: {0}'.format(new)) - skip = ['data', '_data'] + skip = ['data', '_data', 'max_rows'] def __init__(self, data=None, **kwargs): super(LayeredChart, self).__init__(**kwargs) @@ -567,6 +600,10 @@ class FacetedChart(schema.FacetSpec, TopLevelMixin): help=schema.FacetSpec.spec.help) transform = T.Instance(Transform, allow_none=True, default_value=None, help=schema.FacetSpec.transform.help) + max_rows = T.Int( + default_value=DEFAULT_MAX_ROWS, + help="Maximum number of rows in the dataset to accept." + ) @property def data(self): @@ -582,7 +619,7 @@ def data(self, new): else: raise TypeError('Expected DataFrame or altair.Data, got: {0}'.format(new)) - skip = ['data', '_data'] + skip = ['data', '_data', 'max_rows'] def __init__(self, data=None, **kwargs): super(FacetedChart, self).__init__(**kwargs)
diff --git a/altair/tests/test_api.py b/altair/tests/test_api.py --- a/altair/tests/test_api.py +++ b/altair/tests/test_api.py @@ -556,3 +556,15 @@ def test_empty_traits(): # regression test for changes in #265 assert Transform().to_dict() == {} # filter not present assert Formula('blah').to_dict() == {'field': 'blah'} # expr not present + + +def test_max_rows(): + chart = make_chart() + assert isinstance(chart.to_dict(), dict) + chart.max_rows = 5 + with pytest.raises(MaxRowsExceeded): + chart.to_dict() + chart.max_rows = 15 + d = chart.to_dict() + assert isinstance(d, dict) + assert 'max_rows' not in d
Default Mark Property I came accross a problem with the display of altair plots in Jupyter notebooks. Take the following code, where df is any dataset: from altair import Chart Chart(df).to_dict().get('mark') This would return 'point' in altair 1.0.0. In altair 1.2.0 this returns None, which results in a javascript error of the jupyter-vega extension and no display of the plot. If the latter behavior is anticipated (i.e. the mark property of vega-lite plots may be undefined) the jupyter-vega extension would need a fix. Niels
Thanks! Yes, I'd noticed that changed, but hadn't appreciated the consequences. We'll make sure to fix this in the upcoming 2.0 release. I marked this as 1.3 as it should be easy to fix.
2017-06-29T16:15:43Z
[]
[]
vega/altair
398
vega__altair-398
[ "392" ]
dfed1d404821e21c25413579f8506b4be05561ad
diff --git a/altair/v1/__init__.py b/altair/v1/__init__.py --- a/altair/v1/__init__.py +++ b/altair/v1/__init__.py @@ -43,6 +43,7 @@ OneOfFilter, MaxRowsExceeded, enable_mime_rendering, + disable_mime_rendering ) from ..datasets import ( diff --git a/altair/v1/api.py b/altair/v1/api.py --- a/altair/v1/api.py +++ b/altair/v1/api.py @@ -64,6 +64,8 @@ class MaxRowsExceeded(Exception): # Rendering configuration #************************************************************************* +_original_ipython_display_ = None + # This is added to TopLevelMixin as a method if MIME rendering is enabled def _repr_mimebundle_(self, include, exclude, **kwargs): """Return a MIME-bundle for rich display in the Jupyter Notebook.""" @@ -75,8 +77,22 @@ def _repr_mimebundle_(self, include, exclude, **kwargs): def enable_mime_rendering(): """Enable MIME bundle based rendering used in JupyterLab/nteract.""" # This is what makes Python fun! - delattr(TopLevelMixin, '_ipython_display_') - TopLevelMixin._repr_mimebundle_ = _repr_mimebundle_ + global _original_ipython_display_ + if _original_ipython_display_ is None: + TopLevelMixin._repr_mimebundle_ = _repr_mimebundle_ + _original_ipython_display_ = TopLevelMixin._ipython_display_ + delattr(TopLevelMixin, '_ipython_display_') + + +def disable_mime_rendering(): + """Disable MIME bundle based rendering used in JupyterLab/nteract.""" + global _original_ipython_display_ + if _original_ipython_display_ is not None: + delattr(TopLevelMixin, '_repr_mimebundle_') + TopLevelMixin._ipython_display_ = _original_ipython_display_ + _original_ipython_display_ = None + + #************************************************************************* # Channel Aliases
diff --git a/altair/expr/tests/test_expr.py b/altair/expr/tests/test_expr.py --- a/altair/expr/tests/test_expr.py +++ b/altair/expr/tests/test_expr.py @@ -112,7 +112,7 @@ def test_getitem_list(data): assert set(dir(df2)) == {'xxx', 'yyy', 'calculated'} # changing df2 shouldn't affect df1 - df2['qqq'] = df2.xxx / df2.yyy + df2['qqq'] = df2.xxx // df2.yyy assert set(dir(df2)) == {'xxx', 'yyy', 'calculated', 'qqq'} assert set(dir(df)) == {'xxx', 'yyy', 'zzz', 'calculated'} diff --git a/altair/v1/tests/test_api.py b/altair/v1/tests/test_api.py --- a/altair/v1/tests/test_api.py +++ b/altair/v1/tests/test_api.py @@ -448,7 +448,7 @@ def test_chart_serve(): def test_formula_expression(): - formula = Formula('blah', expr.log(expr.df.value) / expr.LN10) + formula = Formula('blah', expr.log(expr.df.value) // expr.LN10) assert formula.field == 'blah' assert formula.expr == '(log(datum.value)/LN10)' @@ -579,3 +579,11 @@ def test_schema_url(): # Make sure that $schema chart = Chart.from_dict(dct) + + +def test_enable_mime_rendering(): + # Make sure these functions are safe to call multiple times. + enable_mime_rendering() + enable_mime_rendering() + disable_mime_rendering() + disable_mime_rendering()
Safer enabling of MIME rendering Right now the `enable_mime_rendering()` function is not very safe: * Can't call twice. * Can't disable. Easy to fix, but need to wait for #377 to be merged.
2017-10-02T18:54:28Z
[]
[]
vega/altair
399
vega__altair-399
[ "388" ]
ea129b3b43bc6768a8a66d09830731ed8197c4b8
diff --git a/altair/v1/__init__.py b/altair/v1/__init__.py --- a/altair/v1/__init__.py +++ b/altair/v1/__init__.py @@ -42,6 +42,7 @@ RangeFilter, OneOfFilter, MaxRowsExceeded, + FieldError, enable_mime_rendering, disable_mime_rendering ) diff --git a/altair/v1/api.py b/altair/v1/api.py --- a/altair/v1/api.py +++ b/altair/v1/api.py @@ -58,6 +58,16 @@ class MaxRowsExceeded(Exception): """Raised if the number of rows in the dataset is too large.""" pass +class FieldError(Exception): + """Raised if a channel has a field related error. + + This is raised if a channel has no field name or if the field name is + not found as the column name of the ``DataFrame``. + """ + + + + DEFAULT_MAX_ROWS = 5000 #************************************************************************* @@ -69,7 +79,7 @@ class MaxRowsExceeded(Exception): # This is added to TopLevelMixin as a method if MIME rendering is enabled def _repr_mimebundle_(self, include, exclude, **kwargs): """Return a MIME-bundle for rich display in the Jupyter Notebook.""" - spec = self.to_dict() + spec = self.to_dict(validate_columns=True) bundle = create_vegalite_mime_bundle(spec) return bundle @@ -97,6 +107,7 @@ def disable_mime_rendering(): #************************************************************************* # Channel Aliases #************************************************************************* + from .schema import X, Y, Row, Column, Color, Size, Shape, Text, Label, Detail, Opacity, Order, Path from .schema import Encoding, Facet @@ -120,6 +131,7 @@ def decorate(f): # - makes field a required first argument of initialization # - allows expr trait to be an Expression and processes it properly #************************************************************************* + class Formula(schema.Formula): expr = jst.JSONUnion([jst.JSONString(), jst.JSONInstance(expr.Expression)], @@ -139,6 +151,7 @@ def _finalize(self, **kwargs): # Transform wrapper # - allows filter trait to be an Expression and processes it properly #************************************************************************* + class Transform(schema.Transform): filter = jst.JSONUnion([jst.JSONString(), jst.JSONInstance(expr.Expression), @@ -165,6 +178,7 @@ def _finalize(self, **kwargs): #************************************************************************* # Top-level Objects #************************************************************************* + class TopLevelMixin(object): @staticmethod @@ -253,22 +267,26 @@ def to_html(self, template=None, title=None, **kwargs): including HTML """ from ..utils.html import to_html - return to_html(self.to_dict(), template=template, title=title, **kwargs) + return to_html(self.to_dict(validate_columns=True), template=template, title=title, **kwargs) - def to_dict(self, data=True): + def to_dict(self, data=True, validate_columns=False): """Emit the JSON representation for this object as as dict. Parameters ---------- data : bool If True (default) then include data in the representation. + validate_columns : bool + If True (default is False) raise FieldError if there are missing or misspelled + column names. This only actually raises if self.validate_columns is also set + (it defaults to True). Returns ------- spec : dict The JSON specification of the chart object. """ - dct = super(TopLevelMixin, self.clone()).to_dict(data=data) + dct = super(TopLevelMixin, self.clone()).to_dict(data=data, validate_columns=validate_columns) dct['$schema'] = schema.vegalite_schema_url return dct @@ -424,7 +442,7 @@ def _ipython_display_(self): """Use the vega package to display in the classic Jupyter Notebook.""" from IPython.display import display from vega import VegaLite - display(VegaLite(self.to_dict())) + display(VegaLite(self.to_dict(validate_columns=True))) def display(self): """Display the Chart using the Jupyter Notebook's rich output. @@ -471,6 +489,21 @@ def serve(self, ip='127.0.0.1', port=8888, n_retries=50, files=None, files=files, jupyter_warning=jupyter_warning, open_browser=open_browser, http_server=http_server) + def _finalize(self, **kwargs): + self._finalize_data() + # data comes from wrappers, but self.data overrides this if defined + if self.data is not None: + kwargs['data'] = self.data + super(TopLevelMixin, self)._finalize(**kwargs) + + # Validate columns after the rest of _finalize() has run. This is last as + # field names are not yet filled in from shortcuts until now. + validate_columns = kwargs.get('validate_columns') + # Only do validation if the requested as a keyword arg to `_finalize` + # and the Chart allows it. + if validate_columns and self.validate_columns: + self._validate_columns() + def _finalize_data(self): """ This function is called by _finalize() below. @@ -481,19 +514,10 @@ def _finalize_data(self): * Whether the data attribute contains expressions, and if so it extracts the appropriate data object and generates the appropriate transforms. """ - # Check to see if data has too many rows. - if isinstance(self.data, pd.DataFrame): - if len(self.data) > self.max_rows: - raise MaxRowsExceeded( - "Your dataset has too many rows and could take a long " - "time to send to the frontend or to render. To override the " - "default maximum rows (%s), set the max_rows property of " - "your Chart to an integer larger than the number of rows " - "in your dataset. Alternatively you could perform aggregations " - "or other data reductions before using it with Altair" % DEFAULT_MAX_ROWS - ) - # Handle expressions. + # Handle expressions. This transforms expr.DataFrame object into a set + # of transforms and an actual pd.DataFrame. After this block runs, + # self.data is either a URL or a pd.DataFrame or None. if isinstance(self.data, expr.DataFrame): columns = self.data._cols calculated_cols = self.data._calculated_cols @@ -512,6 +536,68 @@ def _finalize_data(self): else: self.transform_data(filter=filters) + # If self.data is a pd.DataFrame, check to see if data has too many rows. + if isinstance(self.data, pd.DataFrame): + if len(self.data) > self.max_rows: + raise MaxRowsExceeded( + "Your dataset has too many rows and could take a long " + "time to send to the frontend or to render. To override the " + "default maximum rows (%s), set the max_rows property of " + "your Chart to an integer larger than the number of rows " + "in your dataset. Alternatively you could perform aggregations " + "or other data reductions before using it with Altair" % DEFAULT_MAX_ROWS + ) + + + def _validate_columns(self): + """Validate the columns in the encoding, but only if if the data is a ``DataFrame``. + + This has to be called after the rest of the ``_finalize()`` logic, which fills in the + shortcut field names and also processes the expressions for computed fields. + + This validates: + + 1. That each encoding channel has a field (column name). + 2. That the specified field name is present the column names of the ``DataFrame`` or + computed field from transform expressions. + + This logic only runs when the dataset is a ``DataFrame``. + """ + + # Only validate columns if the data is a pd.DataFrame. + if isinstance(self.data, pd.DataFrame): + # Find columns with visual encodings + encoded_columns = set() + encoding = self.encoding + if encoding is not jst.undefined: + for channel_name in encoding.channel_names: + channel = getattr(encoding, channel_name) + if channel is not jst.undefined: + field = channel.field + if field is jst.undefined: + raise FieldError( + "Missing field/column name for channel: {}".format(channel_name) + ) + else: + if field != '*': + encoded_columns.add(field) + # Find columns in the data + data_columns = set(self.data.columns.values) + transform = self.transform + if transform is not jst.undefined: + calculate = transform.calculate + if calculate is not jst.undefined: + for formula in calculate: + field = formula.field + if field is not jst.undefined: + data_columns.add(field) + # Find columns in the visual encoding that are not in the data + missing_columns = encoded_columns - data_columns + if missing_columns: + raise FieldError( + "Fields/columns not found in the data: {}".format(missing_columns) + ) + class Chart(TopLevelMixin, schema.ExtendedUnitSpec): _data = None @@ -522,11 +608,14 @@ class Chart(TopLevelMixin, schema.ExtendedUnitSpec): transform = jst.JSONInstance(Transform, help=schema.ExtendedUnitSpec.transform.help) mark = schema.Mark(default_value='point', help="""The mark type.""") - max_rows = T.Int( default_value=DEFAULT_MAX_ROWS, help="Maximum number of rows in the dataset to accept." ) + validate_columns = T.Bool( + default_value=True, + help="Raise FieldError if the data is a DataFrame and there are missing columns." + ) def clone(self): """ @@ -550,7 +639,7 @@ def data(self, new): else: raise TypeError('Expected DataFrame or altair.Data, got: {0}'.format(new)) - _skip_on_export = ['data', '_data', 'max_rows'] + _skip_on_export = ['data', '_data', 'max_rows', 'validate_columns'] def __init__(self, data=None, **kwargs): super(Chart, self).__init__(**kwargs) @@ -624,13 +713,6 @@ def encode(self, *args, **kwargs): """Define the encoding for the Chart.""" return update_subtraits(self, 'encoding', *args, **kwargs) - def _finalize(self, **kwargs): - self._finalize_data() - # data comes from wrappers, but self.data overrides this if defined - if self.data is not None: - kwargs['data'] = self.data - super(Chart, self)._finalize(**kwargs) - def __add__(self, other): if isinstance(other, Chart): lc = LayeredChart() @@ -682,6 +764,10 @@ class LayeredChart(TopLevelMixin, schema.LayerSpec): default_value=DEFAULT_MAX_ROWS, help="Maximum number of rows in the dataset to accept." ) + validate_columns = T.Bool( + default_value=True, + help="Raise FieldError if the data is a DataFrame and there are missing columns." + ) def clone(self): """ @@ -705,7 +791,7 @@ def data(self, new): else: raise TypeError('Expected DataFrame or altair.Data, got: {0}'.format(new)) - _skip_on_export = ['data', '_data', 'max_rows'] + _skip_on_export = ['data', '_data', 'max_rows', 'validate_columns'] def __init__(self, data=None, **kwargs): super(LayeredChart, self).__init__(**kwargs) @@ -718,13 +804,6 @@ def set_layers(self, *layers): self.layers = list(layers) return self - def _finalize(self, **kwargs): - self._finalize_data() - # data comes from wrappers, but self.data overrides this if defined - if self.data is not None: - kwargs['data'] = self.data - super(LayeredChart, self)._finalize(**kwargs) - def __iadd__(self, layer): if self.layers is jst.undefined: self.layers = [layer] @@ -747,6 +826,10 @@ class FacetedChart(TopLevelMixin, schema.FacetSpec): default_value=DEFAULT_MAX_ROWS, help="Maximum number of rows in the dataset to accept." ) + validate_columns = T.Bool( + default_value=True, + help="Raise FieldError if the data is a DataFrame and there are missing columns." + ) def clone(self): """ @@ -770,7 +853,7 @@ def data(self, new): else: raise TypeError('Expected DataFrame or altair.Data, got: {0}'.format(new)) - _skip_on_export = ['data', '_data', 'max_rows'] + _skip_on_export = ['data', '_data', 'max_rows', 'validate_columns'] def __init__(self, data=None, **kwargs): super(FacetedChart, self).__init__(**kwargs) @@ -783,10 +866,3 @@ def __dir__(self): def set_facet(self, *args, **kwargs): """Define the facet encoding for the Chart.""" return update_subtraits(self, 'facet', *args, **kwargs) - - def _finalize(self, **kwargs): - self._finalize_data() - # data comes from wrappers, but self.data overrides this if defined - if self.data is not None: - kwargs['data'] = self.data - super(FacetedChart, self)._finalize(**kwargs)
diff --git a/altair/v1/examples/tests/test_examples.py b/altair/v1/examples/tests/test_examples.py --- a/altair/v1/examples/tests/test_examples.py +++ b/altair/v1/examples/tests/test_examples.py @@ -19,7 +19,7 @@ def test_json_examples_round_trip(example): filename, json_dict = example v = Chart.from_dict(json_dict) - v_dict = v.to_dict() + v_dict = v.to_dict(validate_columns=True) if '$schema' not in json_dict: v_dict.pop('$schema') assert v_dict == json_dict @@ -27,7 +27,7 @@ def test_json_examples_round_trip(example): # code generation discards empty function calls, and so we # filter these out before comparison v2 = eval(v.to_python()) - v2_dict = v2.to_dict() + v2_dict = v2.to_dict(validate_columns=True) if '$schema' not in json_dict: v2_dict.pop('$schema') assert v2_dict == remove_empty_fields(json_dict) diff --git a/altair/v1/tests/test_api.py b/altair/v1/tests/test_api.py --- a/altair/v1/tests/test_api.py +++ b/altair/v1/tests/test_api.py @@ -587,3 +587,40 @@ def test_enable_mime_rendering(): enable_mime_rendering() disable_mime_rendering() disable_mime_rendering() + + +def test_validate_spec(): + + # Make sure we catch channels with no field specified + c = make_chart() + c.encode(Color()) + assert isinstance(c.to_dict(), dict) + assert isinstance(c.to_dict(validate_columns=False), dict) + with pytest.raises(FieldError): + c.to_dict(validate_columns=True) + c.validate_columns = False + assert isinstance(c.to_dict(validate_columns=True), dict) + + # Make sure we catch encoded fields not in the data + c = make_chart() + c.encode(x='x', y='y', color='z') + c.encode(color='z') + assert isinstance(c.to_dict(), dict) + assert isinstance(c.to_dict(validate_columns=False), dict) + with pytest.raises(FieldError): + c.to_dict(validate_columns=True) + c.validate_columns = False + assert isinstance(c.to_dict(validate_columns=True), dict) + + c = make_chart() + c.encode(x='x', y='count(*)') + assert isinstance(c.to_dict(validate_columns=True), dict) + + # Make sure we can resolve computed fields + c = make_chart() + c.encode(x='x', y='y', color='z') + c.encode(color='z') + c.transform_data( + calculate=[Formula('z', 'sin(((2*PI)*datum.x))')] + ) + assert isinstance(c.to_dict(), dict)
Raise exception when a user specifies a field not in the data or expressions. Right now if a user creates a spec that has column name misspelled, the chart renders with nothing and no error messages are shown. This is probably the most common error we see in teaching with Altair.
2017-10-02T22:01:45Z
[]
[]
vega/altair
518
vega__altair-518
[ "482" ]
e37000c8f54bc5e0e98ea8457b9a3c913cd58ccb
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -3,6 +3,8 @@ """ import re import warnings +import collections +from copy import deepcopy import six import pandas as pd @@ -296,3 +298,42 @@ def update_subtraits(obj, attrs, **kwargs): trait = dct[attr] = {} dct[attr] = update_subtraits(trait, attrs[1:], **kwargs) return obj + + +def update_nested(original, update, copy=False): + """Update nested dictionaries + + Parameters + ---------- + original : dict + the original (nested) dictionary, which will be updated in-place + update : dict + the nested dictionary of updates + copy : bool, default False + if True, then copy the original dictionary rather than modifying it + + Returns + ------- + original : dict + a reference to the (modified) original dict + + Examples + -------- + >>> original = {'x': {'b': 2, 'c': 4}} + >>> update = {'x': {'b': 5, 'd': 6}, 'y': 40} + >>> update_nested(original, update) + >>> original + {'x': {'b': 5, 'c': 2, 'd': 6}, 'y': 40} + """ + if copy: + original = deepcopy(original) + for key, val in update.items(): + if isinstance(val, collections.Mapping): + orig_val = original.get(key, {}) + if isinstance(orig_val, collections.Mapping): + original[key] = update_nested(orig_val, val) + else: + original[key] = val + else: + original[key] = val + return original diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -6,7 +6,8 @@ from .schema import core, channels, Undefined from .data import data_transformers, pipe -from ...utils import infer_vegalite_type, parse_shorthand_plus_data, use_signature +from ...utils import (infer_vegalite_type, parse_shorthand_plus_data, + use_signature, update_nested) from .display import renderers @@ -133,6 +134,8 @@ def condition(predicate, if_true, if_false): # Top-level objects class TopLevelMixin(object): + _default_spec_values = {"config": {"view": {"width": 400, "height": 300}}} + def _prepare_data(self): if isinstance(self.data, (dict, core.Data, core.InlineData, core.UrlData, core.NamedData)): @@ -143,27 +146,31 @@ def _prepare_data(self): self.data = core.UrlData(self.data) def to_dict(self, *args, **kwargs): - # TODO: it's a bit weird that to_dict modifies the object. - # Should we create a copy first? - original_data = getattr(self, 'data', Undefined) - self._prepare_data() + copy = self.copy() + original_data = getattr(copy, 'data', Undefined) + copy._prepare_data() # We make use of two context markers: # - 'data' points to the data that should be referenced for column type # inference. - # - 'toplevel' is a boolean flag that is assumed to be true; if it's + # - 'top_level' is a boolean flag that is assumed to be true; if it's # true then a "$schema" arg is added to the dict. context = kwargs.get('context', {}).copy() + is_top_level = context.get('top_level', True) + + context['top_level'] = False if original_data is not Undefined: context['data'] = original_data - if context.get('top_level', True): - # since this is top-level we add $schema if it's missing - if '$schema' not in self._kwds: - self._kwds['$schema'] = SCHEMA_URL - # subschemas below this one are not top-level - context['top_level'] = False kwargs['context'] = context - return super(TopLevelMixin, self).to_dict(*args, **kwargs) + + dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs) + + if is_top_level: + # since this is top-level we add $schema if it's missing + if '$schema' not in dct: + dct['$schema'] = SCHEMA_URL + dct = update_nested(copy._default_spec_values, dct, copy=True) + return dct # Layering and stacking @@ -185,7 +192,7 @@ def _repr_mimebundle_(self, include, exclude): class Chart(TopLevelMixin, core.TopLevelFacetedUnitSpec): def __init__(self, data=Undefined, encoding=Undefined, mark=Undefined, - width=400, height=300, **kwargs): + width=Undefined, height=Undefined, **kwargs): super(Chart, self).__init__(data=data, encoding=encoding, mark=mark, width=width, height=height, **kwargs)
diff --git a/altair/utils/tests/test_core.py b/altair/utils/tests/test_core.py --- a/altair/utils/tests/test_core.py +++ b/altair/utils/tests/test_core.py @@ -5,7 +5,7 @@ import numpy as np import pandas as pd -from .. import parse_shorthand, parse_shorthand_plus_data +from .. import parse_shorthand, parse_shorthand_plus_data, update_nested def test_parse_shorthand(): @@ -57,3 +57,16 @@ def check(s, data, **kwargs): check('z', data, field='z', type='temporal') check('count(x)', data, field='x', aggregate='count', type='quantitative') check('mean(*)', data, field='*', aggregate='mean') + + +def test_update_nested(): + original = {'x': {'b': {'foo': 2}, 'c': 4}} + update = {'x': {'b': {'foo': 5}, 'd': 6}, 'y': 40} + + output = update_nested(original, update, copy=True) + assert output is not original + assert output == {'x': {'b': {'foo': 5}, 'c': 4, 'd': 6}, 'y': 40} + + output2 = update_nested(original, update) + assert output2 is original + assert output == output2 diff --git a/altair/vegalite/tests/test_common.py b/altair/vegalite/tests/test_common.py --- a/altair/vegalite/tests/test_common.py +++ b/altair/vegalite/tests/test_common.py @@ -4,23 +4,35 @@ from .. import v1, v2 - [email protected] -def basic_spec(): - return { - 'data': {'url': 'data.csv'}, - 'mark': 'line', - 'encoding': { - 'color': {'type': 'nominal', 'field': 'color'}, - 'x': {'type': 'quantitative', 'field': 'xval'}, - 'y': {'type': 'ordinal', 'field': 'yval'} - }, - 'height': 300, - 'width': 400 +v1_defaults = { + 'width': 400, + 'height': 300 +} + +v2_defaults = { + 'config': { + 'view':{ + 'height':300, + 'width':400 + } } +} + +basic_spec = { + 'data': {'url': 'data.csv'}, + 'mark': 'line', + 'encoding': { + 'color': {'type': 'nominal', 'field': 'color'}, + 'x': {'type': 'quantitative', 'field': 'xval'}, + 'y': {'type': 'ordinal', 'field': 'yval'} + }, +} + +spec_v1 = dict(v1_defaults, **basic_spec) +spec_v2 = dict(v2_defaults, **basic_spec) [email protected]('alt', [v1, v2]) [email protected]('alt,basic_spec', [(v1, spec_v1), (v2, spec_v2)]) def test_basic_chart_to_dict(alt, basic_spec): chart = alt.Chart('data.csv').mark_line().encode( alt.X('xval:Q'), @@ -36,7 +48,7 @@ def test_basic_chart_to_dict(alt, basic_spec): assert dct == basic_spec [email protected]('alt', [v1, v2]) [email protected]('alt,basic_spec', [(v1, spec_v1), (v2, spec_v2)]) def test_basic_chart_from_dict(alt, basic_spec): chart = alt.Chart.from_dict(basic_spec) dct = chart.to_dict()
Remove default width/height from Chart? Having defaults causes issues with faceted plots (which become comically large) and with things like ``rangeStep``, which are ignored if ``width`` and ``height`` are set (see #481). I would propose removing these defaults. The disadvantage is that straightforward charts end up being smaller than is perhaps ideal for display in the notebook.
Yeah, I have been thinking about this recently too. May be more pain than it is worth. Another option would be to not set the default, but to provide a simple way of changing the width/height in the actual notebook itself (in the UI, not code). On Sat, Feb 24, 2018 at 1:33 PM, Jake Vanderplas <[email protected]> wrote: > Having defaults causes issues with faceted plots (which become comically > large) and with things like rangeStep, which are ignored if width and > height are set (see #481 <https://github.com/altair-viz/altair/pull/481>). > > I would propose removing these defaults. > > The disadvantage is that straightforward charts end up being smaller than > is perhaps ideal for display in the notebook. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/altair-viz/altair/issues/482>, or mute the thread > <https://github.com/notifications/unsubscribe-auth/AABr0Mqn5I6YvqC6U04g8g2j0dCGNZmGks5tYIAwgaJpZM4SSDd7> > . > -- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub [email protected] and [email protected] See: https://vega.github.io/vega-lite/docs/spec.html#default-view-size
2018-02-27T04:41:13Z
[]
[]
vega/altair
628
vega__altair-628
[ "626", "626" ]
d34844c2e1636298d982cf3690ffa5dae8eb477f
diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -14,11 +14,37 @@ SCHEMA_URL = "https://vega.github.io/schema/vega-lite/v2.json" +#------------------------------------------------------------------------ +# Data Utilities +def _prepare_data(data): + """Convert input data to data for use within schema""" + if data is Undefined: + return data + elif isinstance(data, (dict, core.Data, core.InlineData, + core.UrlData, core.NamedData)): + return data + elif isinstance(data, pd.DataFrame): + return pipe(data, data_transformers.get()) + elif isinstance(data, six.string_types): + return core.UrlData(data) + else: + warnings.warn("data of type {0} not recognized".format(type(data))) + return data + #------------------------------------------------------------------------ -# Aliases +# Aliases & specializations Bin = core.BinParams [email protected]_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']) + copy.data = _prepare_data(copy.data) + return super(LookupData, copy).to_dict(*args, **kwargs) + + #------------------------------------------------------------------------ # Encoding will contain channel objects that aren't valid at instantiation core.EncodingWithFacet._class_is_valid_at_instantiation = False @@ -264,20 +290,11 @@ class TopLevelMixin(mixins.ConfigMethodMixin): _default_spec_values = {"config": {"view": {"width": 400, "height": 300}}} _class_is_valid_at_instantiation = False - def _prepare_data(self): - if isinstance(self.data, (dict, core.Data, core.InlineData, - core.UrlData, core.NamedData)): - pass - elif isinstance(self.data, pd.DataFrame): - self.data = pipe(self.data, data_transformers.get()) - elif isinstance(self.data, six.string_types): - self.data = core.UrlData(self.data) - def to_dict(self, *args, **kwargs): """Convert the chart to a dictionary suitable for JSON export""" copy = self.copy() original_data = getattr(copy, 'data', Undefined) - copy._prepare_data() + copy.data = _prepare_data(original_data) # We make use of two context markers: # - 'data' points to the data that should be referenced for column type
diff --git a/altair/vegalite/v2/tests/test_api.py b/altair/vegalite/v2/tests/test_api.py --- a/altair/vegalite/v2/tests/test_api.py +++ b/altair/vegalite/v2/tests/test_api.py @@ -263,3 +263,13 @@ def test_resolve_methods(): with pytest.raises(ValueError) as err: alt.Chart().resolve_axis(x='shared') assert str(err.value).endswith("object has no attribute 'resolve'") + + +def test_LookupData(): + df = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]}) + lookup = alt.LookupData(data=df, key='x') + dct = lookup.to_dict() + assert dct['key'] == 'x' + assert dct['data'] == {'values': [{'x': 1, 'y': 4}, + {'x': 2, 'y': 5}, + {'x': 3, 'y': 6}]}
LookupData doesn't handle DataFrame A student was trying to do a geographic map with countries mapped to color. He found that he couldn't get this example: https://altair-viz.github.io/gallery/choropleth.html working with a DataFrame rather than a URL. The issue is that our `LookupData` object doesn't use the data transformer pipeline to properly handle a DataFrame argument. The following code did work: ```python countries = alt.topo_feature(data.world_110m.url,'countries') country_ses = pd.read_csv('/data/country_ses.csv') country_values = alt.pipe(country_ses[['id', 'ses']], alt.to_values) chart = alt.Chart(countries).mark_geoshape().properties( projection={'type': 'equirectangular'}, width=500, height=300 ).encode( color='ses:Q' ).transform_lookup( lookup='id', from_=alt.LookupData(country_values, 'id', ['ses']) ) chart ``` Should be an easy fix for `LookupData` to use the data transformers. Are there other parts of the API where we are not fully handling DataFrames? LookupData doesn't handle DataFrame A student was trying to do a geographic map with countries mapped to color. He found that he couldn't get this example: https://altair-viz.github.io/gallery/choropleth.html working with a DataFrame rather than a URL. The issue is that our `LookupData` object doesn't use the data transformer pipeline to properly handle a DataFrame argument. The following code did work: ```python countries = alt.topo_feature(data.world_110m.url,'countries') country_ses = pd.read_csv('/data/country_ses.csv') country_values = alt.pipe(country_ses[['id', 'ses']], alt.to_values) chart = alt.Chart(countries).mark_geoshape().properties( projection={'type': 'equirectangular'}, width=500, height=300 ).encode( color='ses:Q' ).transform_lookup( lookup='id', from_=alt.LookupData(country_values, 'id', ['ses']) ) chart ``` Should be an easy fix for `LookupData` to use the data transformers. Are there other parts of the API where we are not fully handling DataFrames?
Good catch... I think what we need is for ``LookupData()`` to handle data inputs the same way that top-level methods do. I'm not sure if there are other places where this would come up, but I'll take a look through the schema to see if I can find any. It looks like ``LookupData`` is the only other schema definition beyond top-level objects that has a general data property. nice, glad we found it! On Wed, Mar 21, 2018 at 10:55 AM, Jake Vanderplas <[email protected]> wrote: > It looks like LookupData is the only other schema definition beyond > top-level objects that has a general data property. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/altair-viz/altair/issues/626#issuecomment-375038202>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AABr0MPQSBprarn-v9wvJWcqbrSv21R3ks5tgpQIgaJpZM4S0u2d> > . > -- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub [email protected] and [email protected] Good catch... I think what we need is for ``LookupData()`` to handle data inputs the same way that top-level methods do. I'm not sure if there are other places where this would come up, but I'll take a look through the schema to see if I can find any. It looks like ``LookupData`` is the only other schema definition beyond top-level objects that has a general data property. nice, glad we found it! On Wed, Mar 21, 2018 at 10:55 AM, Jake Vanderplas <[email protected]> wrote: > It looks like LookupData is the only other schema definition beyond > top-level objects that has a general data property. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/altair-viz/altair/issues/626#issuecomment-375038202>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AABr0MPQSBprarn-v9wvJWcqbrSv21R3ks5tgpQIgaJpZM4S0u2d> > . > -- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub [email protected] and [email protected]
2018-03-21T18:58:31Z
[]
[]
vega/altair
770
vega__altair-770
[ "441" ]
1e7dce480afb7e816e32d1c4a58469d2ca226ead
diff --git a/altair/utils/headless.py b/altair/utils/headless.py --- a/altair/utils/headless.py +++ b/altair/utils/headless.py @@ -90,52 +90,27 @@ def temporary_filename(**kwargs): .toSVG() .then(done) .catch(function(err) { console.error(err); }); - """} - + """, +'vega': """ + var spec = arguments[0]; + var mode = arguments[1]; + var done = arguments[2]; -def spec_to_image_mimebundle(spec, format, mode, - vega_version, - vegaembed_version, - vegalite_version=None, - driver_timeout=10, - webdriver='chrome'): - """Conver a vega/vega-lite specification to a PNG/SVG image + if(mode === 'vega-lite'){ + // compile vega-lite to vega + const compiled = vl.compile(spec); + spec = compiled.spec; + } - Parameters - ---------- - spec : dict - a dictionary representing a vega-lite plot spec - format : string {'png' | 'svg'} - the file format to be saved. - mode : string {'vega' | 'vega-lite'} - The rendering mode. - vega_version : string - For html output, the version of vega.js to use - vegalite_version : string - For html output, the version of vegalite.js to use - vegaembed_version : string - For html output, the version of vegaembed.js to use - driver_timeout : int (optional) - the number of seconds to wait for page load before raising an - error (default: 10) - webdriver : string {'chrome' | 'firefox'} - Webdriver to use. + done(spec); + """} - Returns - ------- - output : dict - a mime-bundle representing the image - Note - ---- - This requires the pillow and selenium Python modules to be installed. - Additionally it requires either chromedriver (if webdriver=='chrome') or - geckodriver (if webdriver=='firefox') - """ +def compile_spec(spec, format, mode, vega_version, vegaembed_version, vegalite_version, driver_timeout, webdriver): # TODO: allow package versions to be specified # TODO: detect & use local Jupyter caches of JS packages? - if format not in ['png', 'svg']: - raise NotImplementedError("format must be 'svg' and 'png'") + if format not in ['png', 'svg', 'vega']: + raise NotImplementedError("format must be 'svg', 'png' or 'vega'") if mode not in ['vega', 'vega-lite']: raise ValueError("mode must be 'vega' or 'vega-lite'") @@ -180,12 +155,57 @@ def spec_to_image_mimebundle(spec, format, mode, if not online: raise ValueError("Internet connection required for saving " "chart as {0}".format(format)) - render = driver.execute_async_script(EXTRACT_CODE[format], - spec, mode) + return driver.execute_async_script(EXTRACT_CODE[format], + spec, mode) finally: driver.close() + +def spec_to_mimebundle(spec, format, mode, + vega_version, + vegaembed_version, + vegalite_version=None, + driver_timeout=10, + webdriver='chrome'): + """Convert a vega/vega-lite specification to a PNG/SVG image/Vega spec + + Parameters + ---------- + spec : dict + a dictionary representing a vega-lite plot spec + format : string {'png' | 'svg' | 'vega'} + the file format to be saved. + mode : string {'vega' | 'vega-lite'} + The rendering mode. + vega_version : string + For html output, the version of vega.js to use + vegalite_version : string + For html output, the version of vegalite.js to use + vegaembed_version : string + For html output, the version of vegaembed.js to use + driver_timeout : int (optional) + the number of seconds to wait for page load before raising an + error (default: 10) + webdriver : string {'chrome' | 'firefox'} + Webdriver to use. + + Returns + ------- + output : dict + a mime-bundle representing the image + + Note + ---- + This requires the pillow and selenium Python modules to be installed. + Additionally it requires either chromedriver (if webdriver=='chrome') or + geckodriver (if webdriver=='firefox') + """ + + render = compile_spec(spec, format, mode, vega_version, vegaembed_version, vegalite_version, driver_timeout, webdriver) if format == 'png': return {'image/png': base64.decodebytes(render.split(',', 1)[1].encode())} elif format == 'svg': return {'image/svg+xml': render} + elif format == 'vega': + return {'application/vnd.vega.v{}+json'.format(vega_version[0]): render} + raise ValueError("format must be 'png', 'svg', or 'vega'") diff --git a/altair/utils/save.py b/altair/utils/save.py --- a/altair/utils/save.py +++ b/altair/utils/save.py @@ -3,7 +3,7 @@ import six from .core import write_file_or_filename -from .headless import spec_to_image_mimebundle +from .headless import spec_to_mimebundle from .html import spec_to_html_mimebundle @@ -83,11 +83,11 @@ def save(chart, fp, vega_version, vegaembed_version, json_kwds=json_kwds) write_file_or_filename(fp, mimebundle['text/html'], mode='w') elif format in ['png', 'svg']: - mimebundle = spec_to_image_mimebundle(spec=spec, format=format, mode=mode, - vega_version=vega_version, - vegalite_version=vegalite_version, - vegaembed_version=vegaembed_version, - webdriver=webdriver) + mimebundle = spec_to_mimebundle(spec=spec, format=format, mode=mode, + vega_version=vega_version, + vegalite_version=vegalite_version, + vegaembed_version=vegaembed_version, + webdriver=webdriver) if format == 'png': write_file_or_filename(fp, mimebundle['image/png'], mode='wb') else: diff --git a/altair/vegalite/v1/display.py b/altair/vegalite/v1/display.py --- a/altair/vegalite/v1/display.py +++ b/altair/vegalite/v1/display.py @@ -61,19 +61,19 @@ def json_renderer(spec): def png_renderer(spec): - return headless.spec_to_image_mimebundle(spec, format='png', - mode='vega-lite', - vega_version=VEGA_VERSION, - vegaembed_version=VEGAEMBED_VERSION, - vegalite_version=VEGALITE_VERSION) + return headless.spec_to_mimebundle(spec, format='png', + mode='vega-lite', + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION) def svg_renderer(spec): - return headless.spec_to_image_mimebundle(spec, format='svg', - mode='vega-lite', - vega_version=VEGA_VERSION, - vegaembed_version=VEGAEMBED_VERSION, - vegalite_version=VEGALITE_VERSION) + return headless.spec_to_mimebundle(spec, format='svg', + mode='vega-lite', + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION) def colab_renderer(spec): diff --git a/altair/vegalite/v2/display.py b/altair/vegalite/v2/display.py --- a/altair/vegalite/v2/display.py +++ b/altair/vegalite/v2/display.py @@ -62,19 +62,19 @@ def json_renderer(spec): def png_renderer(spec): - return headless.spec_to_image_mimebundle(spec, format='png', - mode='vega-lite', - vega_version=VEGA_VERSION, - vegaembed_version=VEGAEMBED_VERSION, - vegalite_version=VEGALITE_VERSION) + return headless.spec_to_mimebundle(spec, format='png', + mode='vega-lite', + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION) def svg_renderer(spec): - return headless.spec_to_image_mimebundle(spec, format='svg', - mode='vega-lite', - vega_version=VEGA_VERSION, - vegaembed_version=VEGAEMBED_VERSION, - vegalite_version=VEGALITE_VERSION) + return headless.spec_to_mimebundle(spec, format='svg', + mode='vega-lite', + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION) def colab_renderer(spec): return html.spec_to_html_mimebundle(spec, mode='vega-lite',
diff --git a/altair/utils/tests/test_headless.py b/altair/utils/tests/test_headless.py new file mode 100644 --- /dev/null +++ b/altair/utils/tests/test_headless.py @@ -0,0 +1,169 @@ +import pytest +import json + +try: + import selenium +except ImportError: + selenium = None + +from ..headless import spec_to_mimebundle + + +# example from https://vega.github.io/editor/#/examples/vega-lite/bar +VEGA_LITE_SPEC = json.loads( + """ + { + "$schema": "https://vega.github.io/schema/vega-lite/v2.json", + "description": "A simple bar chart with embedded data.", + "data": { + "values": [ + {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43}, + {"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53}, + {"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52} + ] + }, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"} + } + } + """ +) + +VEGA_SPEC = json.loads( + """ + { + "$schema": "https://vega.github.io/schema/vega/v3.0.json", + "description": "A simple bar chart with embedded data.", + "autosize": "pad", + "padding": 5, + "height": 200, + "style": "cell", + "data": [ + { + "name": "source_0", + "values": [ + {"a": "A", "b": 28}, + {"a": "B", "b": 55}, + {"a": "C", "b": 43}, + {"a": "D", "b": 91}, + {"a": "E", "b": 81}, + {"a": "F", "b": 53}, + {"a": "G", "b": 19}, + {"a": "H", "b": 87}, + {"a": "I", "b": 52} + ] + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + {"type": "formula", "expr": "toNumber(datum[\\"b\\"])", "as": "b"}, + { + "type": "filter", + "expr": "datum[\\"b\\"] !== null && !isNaN(datum[\\"b\\"])" + } + ] + } + ], + "signals": [ + {"name": "x_step", "value": 21}, + { + "name": "width", + "update": "bandspace(domain('x').length, 0.1, 0.05) * x_step" + } + ], + "marks": [ + { + "name": "marks", + "type": "rect", + "style": ["bar"], + "from": {"data": "data_0"}, + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "x": {"scale": "x", "field": "a"}, + "width": {"scale": "x", "band": true}, + "y": {"scale": "y", "field": "b"}, + "y2": {"scale": "y", "value": 0} + } + } + } + ], + "scales": [ + { + "name": "x", + "type": "band", + "domain": {"data": "data_0", "field": "a", "sort": true}, + "range": {"step": {"signal": "x_step"}}, + "paddingInner": 0.1, + "paddingOuter": 0.05 + }, + { + "name": "y", + "type": "linear", + "domain": {"data": "data_0", "field": "b"}, + "range": [{"signal": "height"}, 0], + "nice": true, + "zero": true + } + ], + "axes": [ + { + "scale": "x", + "orient": "bottom", + "title": "a", + "labelOverlap": true, + "encode": { + "labels": { + "update": { + "angle": {"value": 270}, + "align": {"value": "right"}, + "baseline": {"value": "middle"} + } + } + }, + "zindex": 1 + }, + { + "scale": "y", + "orient": "left", + "title": "b", + "labelOverlap": true, + "tickCount": {"signal": "ceil(height/40)"}, + "zindex": 1 + }, + { + "scale": "y", + "orient": "left", + "grid": true, + "tickCount": {"signal": "ceil(height/40)"}, + "gridScale": "x", + "domain": false, + "labels": false, + "maxExtent": 0, + "minExtent": 0, + "ticks": false, + "zindex": 0 + } + ], + "config": {"axisY": {"minExtent": 30}} + } + """ +) + +VEGAEMBED_VERSION = '3.7.0' +VEGALITE_VERSION = '2.3.1' +VEGA_VERSION = '3.3.1' + [email protected]('not selenium') +def test_spec_to_mimebundle(): + assert spec_to_mimebundle( + spec=VEGA_LITE_SPEC, + format='vega', + mode='vega-lite', + vega_version=VEGA_VERSION, + vegalite_version=VEGALITE_VERSION, + vegaembed_version=VEGAEMBED_VERSION + ) == {'application/vnd.vega.v3+json': VEGA_SPEC}
convert to VEGA is there any way (preferably, in python) to convert Altair output to vega (not vega-lite) ?
Not in python, you would need to export the vega-lite json and then use the vega-lite command line compiler. We could add this in JupyterLab, but would require more work. Or, I guess you can click on the "Vega Editor" link and go there and grab the compiled vega for now... On Wed, Jan 31, 2018 at 7:13 PM, Philipp Kats <[email protected]> wrote: > is there any way (preferably, in python) to convert Altair output to vega > (not vega-lite) ? > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/altair-viz/altair/issues/441>, or mute the thread > <https://github.com/notifications/unsubscribe-auth/AABr0EkrR5KeAu1WGK8IRQmFgwg21rAvks5tQSvLgaJpZM4R0_dw> > . > -- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub [email protected] and [email protected] Got it, thanks for the quick reply! It's just I saw Vega object in the documentation, so I thought it might be possible. It would be nice to have converter method in the future, though! One up for this This should be possible using the selenium/chrome-headless approach used for saving figures in https://github.com/altair-viz/altair/blob/master/altair/utils/headless.py You'd just have to return something like ``vl.compile(spec).spec`` from the driver call.
2018-04-23T17:24:28Z
[]
[]
vega/altair
830
vega__altair-830
[ "825" ]
e6bdaf4ca09fbc83f121e7b0e835a43f665e8694
diff --git a/altair/vegalite/v1/schema/channels.py b/altair/vegalite/v1/schema/channels.py --- a/altair/vegalite/v1/schema/channels.py +++ b/altair/vegalite/v1/schema/channels.py @@ -15,6 +15,12 @@ def to_dict(self, validate=True, ignore=(), context=None): context = context or {} if self.shorthand is Undefined: kwds = {} + elif isinstance(self.shorthand, (tuple, list)): + # If given a list of shorthands, then transform it to a list of classes + kwds = self._kwds.copy() + kwds.pop('shorthand') + return [self.__class__(shorthand, **kwds).to_dict() + for shorthand in self.shorthand] elif isinstance(self.shorthand, six.string_types): kwds = parse_shorthand(self.shorthand, data=context.get('data', None)) type_defined = self._kwds.get('type', Undefined) is not Undefined diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -860,9 +860,14 @@ class EncodingMixin(object): def encode(self, *args, **kwargs): # First convert args to kwargs by inferring the class from the argument if args: - mapping = _get_channels_mapping() + channels_mapping = _get_channels_mapping() for arg in args: - encoding = mapping.get(type(arg), None) + if isinstance(arg, (list, tuple)) and len(arg) > 0: + type_ = type(arg[0]) + else: + type_ = type(arg) + + encoding = channels_mapping.get(type_, None) if encoding is None: raise NotImplementedError("non-keyword arg of type {0}" "".format(type(arg))) @@ -880,6 +885,9 @@ def _wrap_in_channel_class(obj, prop): if isinstance(obj, six.string_types): obj = {'shorthand': obj} + if isinstance(obj, (list, tuple)): + return [_wrap_in_channel_class(subobj, prop) for subobj in obj] + if 'value' in obj: clsname += 'Value' diff --git a/altair/vegalite/v2/schema/channels.py b/altair/vegalite/v2/schema/channels.py --- a/altair/vegalite/v2/schema/channels.py +++ b/altair/vegalite/v2/schema/channels.py @@ -15,6 +15,12 @@ def to_dict(self, validate=True, ignore=(), context=None): context = context or {} if self.shorthand is Undefined: kwds = {} + elif isinstance(self.shorthand, (tuple, list)): + # If given a list of shorthands, then transform it to a list of classes + kwds = self._kwds.copy() + kwds.pop('shorthand') + return [self.__class__(shorthand, **kwds).to_dict() + for shorthand in self.shorthand] elif isinstance(self.shorthand, six.string_types): kwds = parse_shorthand(self.shorthand, data=context.get('data', None)) type_defined = self._kwds.get('type', Undefined) is not Undefined diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -68,6 +68,12 @@ def to_dict(self, validate=True, ignore=(), context=None): context = context or {} if self.shorthand is Undefined: kwds = {} + elif isinstance(self.shorthand, (tuple, list)): + # If given a list of shorthands, then transform it to a list of classes + kwds = self._kwds.copy() + kwds.pop('shorthand') + return [self.__class__(shorthand, **kwds).to_dict() + for shorthand in self.shorthand] elif isinstance(self.shorthand, six.string_types): kwds = parse_shorthand(self.shorthand, data=context.get('data', None)) type_defined = self._kwds.get('type', Undefined) is not Undefined
diff --git a/altair/vegalite/v2/tests/test_api.py b/altair/vegalite/v2/tests/test_api.py --- a/altair/vegalite/v2/tests/test_api.py +++ b/altair/vegalite/v2/tests/test_api.py @@ -90,6 +90,30 @@ def _check_encodings(chart): assert dct['encoding']['y']['type'] == 'ordinal' +def test_multiple_encodings(): + encoding_dct = [{'field': 'value', 'type': 'quantitative'}, + {'field': 'name', 'type': 'nominal'}] + chart1 = alt.Chart('data.csv').mark_point().encode( + detail=['value:Q', 'name:N'], + tooltip=['value:Q', 'name:N'] + ) + + chart2 = alt.Chart('data.csv').mark_point().encode( + alt.Detail(['value:Q', 'name:N']), + alt.Tooltip(['value:Q', 'name:N']) + ) + + chart3 = alt.Chart('data.csv').mark_point().encode( + [alt.Detail('value:Q'), alt.Detail('name:N')], + [alt.Tooltip('value:Q'), alt.Tooltip('name:N')] + ) + + for chart in [chart1, chart2, chart3]: + dct = chart.to_dict() + assert dct['encoding']['detail'] == encoding_dct + assert dct['encoding']['tooltip'] == encoding_dct + + def test_chart_operations(): data = pd.DataFrame({'x': pd.date_range('2012', periods=10, freq='Y'), 'y': range(10),
ENH: encodings with multiple fields (e.g. tooltip) We need to update the ``encode()`` method so that it will handle multiple encoding fields in cases where it is supported. For example, in the most recent vega-lite release, it is possible to pass multiple fields to the tooltip encoding: ```python from vega_datasets import data cars = data.cars() chart = alt.Chart(cars).mark_point().encode( x='Horsepower', y='Miles_per_Gallon', color='Origin' ) chart.encoding.tooltip = [{'field': 'Name', 'type': 'nominal'}, {'field': 'Origin', 'type': 'nominal'}] chart ``` <img width="534" alt="screen shot 2018-05-08 at 10 37 35 am" src="https://user-images.githubusercontent.com/781659/39773111-e8c2f8dc-52ab-11e8-9d4b-55c7eb4f31b5.png"> Altair should make this available via a more simplified API, such as ```python from vega_datasets import data cars = data.cars() chart = alt.Chart(cars).mark_point().encode( x='Horsepower', y='Miles_per_Gallon', color='Origin', tooltip=['Name', 'Origin'] ) ```
`detail` also support multiple fields (since v1).
2018-05-13T05:16:59Z
[]
[]
vega/altair
832
vega__altair-832
[ "810" ]
e6bdaf4ca09fbc83f121e7b0e835a43f665e8694
diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -466,6 +466,18 @@ def properties(self, **kwargs): setattr(copy, key, val) return copy + def add_selection(self, *selections): + """Add one or more selections to the chart""" + if not selections: + return self + else: + copy = self.copy(deep=True, ignore=['data']) + if copy.selection is Undefined: + copy.selection = SelectionMapping() + for selection in selections: + copy.selection += selection + return copy + def project(self, type='mercator', center=Undefined, clipAngle=Undefined, clipExtent=Undefined, coefficient=Undefined, distance=Undefined, fraction=Undefined, lobes=Undefined, parallel=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, diff --git a/altair/vegalite/v2/examples/dot_dash_plot.py b/altair/vegalite/v2/examples/dot_dash_plot.py --- a/altair/vegalite/v2/examples/dot_dash_plot.py +++ b/altair/vegalite/v2/examples/dot_dash_plot.py @@ -20,24 +20,24 @@ x=alt.X('Miles_per_Gallon', axis=alt.Axis(title='')), y=alt.Y('Horsepower', axis=alt.Axis(title='')), color=alt.condition(brush, 'Origin', alt.value('grey')) -).properties( - selection=brush +).add_selection( + brush ) x_ticks = alt.Chart(cars).mark_tick().encode( alt.X('Miles_per_Gallon', axis=tick_axis), alt.Y('Origin', axis=tick_axis_notitle), color=alt.condition(brush, 'Origin', alt.value('lightgrey')) -).properties( - selection=brush +).add_selection( + brush ) y_ticks = alt.Chart(cars).mark_tick().encode( alt.X('Origin', axis=tick_axis_notitle), alt.Y('Horsepower', axis=tick_axis), color=alt.condition(brush, 'Origin', alt.value('lightgrey')) -).properties( - selection=brush +).add_selection( + brush ) y_ticks | (points & x_ticks) diff --git a/altair/vegalite/v2/examples/interactive_brush.py b/altair/vegalite/v2/examples/interactive_brush.py --- a/altair/vegalite/v2/examples/interactive_brush.py +++ b/altair/vegalite/v2/examples/interactive_brush.py @@ -16,6 +16,6 @@ x='Horsepower:Q', y='Miles_per_Gallon:Q', color=alt.condition(brush, 'Cylinders:O', alt.value('grey')) -).properties( - selection=brush +).add_selection( + brush ) diff --git a/altair/vegalite/v2/examples/interactive_cross_highlight.py b/altair/vegalite/v2/examples/interactive_cross_highlight.py --- a/altair/vegalite/v2/examples/interactive_cross_highlight.py +++ b/altair/vegalite/v2/examples/interactive_cross_highlight.py @@ -26,7 +26,7 @@ legend=alt.Legend(title='Records in Selection') ) ).transform_filter( - pts.ref() + pts ) bar = alt.Chart(data.movies.url).mark_bar().encode( diff --git a/altair/vegalite/v2/examples/interactive_layered_crossfilter.py b/altair/vegalite/v2/examples/interactive_layered_crossfilter.py --- a/altair/vegalite/v2/examples/interactive_layered_crossfilter.py +++ b/altair/vegalite/v2/examples/interactive_layered_crossfilter.py @@ -33,7 +33,7 @@ highlight = base.encode( color=alt.value('goldenrod') ).transform_filter( - brush.ref() + brush ) # layer the two charts & repeat diff --git a/altair/vegalite/v2/examples/interval_selection.py b/altair/vegalite/v2/examples/interval_selection.py --- a/altair/vegalite/v2/examples/interval_selection.py +++ b/altair/vegalite/v2/examples/interval_selection.py @@ -22,8 +22,9 @@ ) lower = upper.properties( - selection=brush, height=60 +).add_selection( + brush ) alt.vconcat(upper, lower, data=sp500) diff --git a/altair/vegalite/v2/examples/multiline_highlight.py b/altair/vegalite/v2/examples/multiline_highlight.py --- a/altair/vegalite/v2/examples/multiline_highlight.py +++ b/altair/vegalite/v2/examples/multiline_highlight.py @@ -23,8 +23,9 @@ points = base.mark_circle().encode( opacity=alt.value(0) +).add_selection( + highlight ).properties( - selection=highlight, width=600 ) diff --git a/altair/vegalite/v2/examples/multiline_tooltip.py b/altair/vegalite/v2/examples/multiline_tooltip.py --- a/altair/vegalite/v2/examples/multiline_tooltip.py +++ b/altair/vegalite/v2/examples/multiline_tooltip.py @@ -34,8 +34,8 @@ selectors = alt.Chart().mark_point().encode( x='x:Q', opacity=alt.value(0), -).properties( - selection=nearest +).add_selection( + nearest ) # Draw points on the line, and highlight based on selection @@ -52,7 +52,7 @@ rules = alt.Chart().mark_rule(color='gray').encode( x='x:Q', ).transform_filter( - nearest.ref() + nearest ) # Put the five layers into a chart and bind the data diff --git a/altair/vegalite/v2/examples/scatter_linked_brush.py b/altair/vegalite/v2/examples/scatter_linked_brush.py --- a/altair/vegalite/v2/examples/scatter_linked_brush.py +++ b/altair/vegalite/v2/examples/scatter_linked_brush.py @@ -15,8 +15,9 @@ base = alt.Chart(cars).mark_point().encode( y='Miles_per_Gallon', color=alt.condition(brush, 'Origin', alt.ColorValue('gray')) +).add_selection( + brush ).properties( - selection=brush, width=250, height=250 ) diff --git a/altair/vegalite/v2/examples/seattle_weather_interactive.py b/altair/vegalite/v2/examples/seattle_weather_interactive.py --- a/altair/vegalite/v2/examples/seattle_weather_interactive.py +++ b/altair/vegalite/v2/examples/seattle_weather_interactive.py @@ -30,10 +30,11 @@ size=alt.Size('precipitation:Q', scale=alt.Scale(range=[5, 200])) ).properties( width=600, - height=300, - selection=brush + height=300 +).add_selection( + brush ).transform_filter( - click.ref() + click ) # Bottom panel is a bar chart of weather type @@ -42,10 +43,11 @@ y='weather:N', color=alt.condition(click, color, alt.value('lightgray')), ).transform_filter( - brush.ref() + brush ).properties( width=600, - selection=click +).add_selection( + click ) alt.vconcat(points, bars, diff --git a/altair/vegalite/v2/examples/select_detail.py b/altair/vegalite/v2/examples/select_detail.py --- a/altair/vegalite/v2/examples/select_detail.py +++ b/altair/vegalite/v2/examples/select_detail.py @@ -42,24 +42,23 @@ selector = alt.selection_single(empty='all', fields=['id']) -points = alt.Chart(data).mark_point(filled=True, size=200).encode( +base = alt.Chart(data).properties( + width=250, + height=250 +).add_selection(selector) + +points = base.mark_point(filled=True, size=200).encode( x='mean(x)', y='mean(y)', color=alt.condition(selector, 'id:O', alt.value('lightgray'), legend=None), -).properties( - selection=selector, - width=250, height=250 ).interactive() -timeseries = alt.Chart(data).mark_line().encode( +timeseries = base.mark_line().encode( x='time', y=alt.Y('value', scale=alt.Scale(domain=(-15, 15))), color=alt.Color('id:O', legend=None) ).transform_filter( selector -).properties( - selection=selector, - width=250, height=250 ) points | timeseries diff --git a/altair/vegalite/v2/examples/selection_histogram.py b/altair/vegalite/v2/examples/selection_histogram.py --- a/altair/vegalite/v2/examples/selection_histogram.py +++ b/altair/vegalite/v2/examples/selection_histogram.py @@ -17,8 +17,8 @@ x='Horsepower:Q', y='Miles_per_Gallon:Q', color=alt.condition(brush, 'Origin:N', alt.value('lightgray')) -).properties( - selection=brush +).add_selection( + brush ) bars = alt.Chart().mark_bar().encode( @@ -26,7 +26,7 @@ color='Origin:N', x='count(Origin):Q' ).transform_filter( - brush.ref() + brush ) alt.vconcat(points, bars, data=cars) diff --git a/altair/vegalite/v2/examples/selection_layer_bar_month.py b/altair/vegalite/v2/examples/selection_layer_bar_month.py --- a/altair/vegalite/v2/examples/selection_layer_bar_month.py +++ b/altair/vegalite/v2/examples/selection_layer_bar_month.py @@ -16,13 +16,15 @@ alt.X('date:O', timeUnit='month'), y='mean(precipitation):Q', opacity=alt.condition(brush, alt.OpacityValue(1), alt.OpacityValue(0.7)) -).properties( - selection=brush +).add_selection( + brush ) line = alt.Chart().mark_rule(color='firebrick').encode( y='mean(precipitation):Q', size=alt.SizeValue(3) -).transform_filter(brush.ref()) +).transform_filter( + brush +) alt.layer(bars, line, data=weather) diff --git a/altair/vegalite/v2/examples/us_population_over_time.py b/altair/vegalite/v2/examples/us_population_over_time.py --- a/altair/vegalite/v2/examples/us_population_over_time.py +++ b/altair/vegalite/v2/examples/us_population_over_time.py @@ -16,7 +16,7 @@ range=["steelblue", "salmon"]) slider = alt.binding_range(min=1900, max=2000, step=10) -year = alt.selection_single(name="year", fields=['year'], bind=slider) +select_year = alt.selection_single(name="year", fields=['year'], bind=slider) alt.Chart(pop).mark_bar().encode( x=alt.X('sex:N', axis=alt.Axis(title=None)), @@ -24,10 +24,11 @@ color=alt.Color('sex:N', scale=pink_blue), column='age:O' ).properties( - width=20, - selection=year, + width=20 +).add_selection( + select_year ).transform_calculate( "sex", if_(datum.sex == 1, "Male", "Female") ).transform_filter( - year.ref() + select_year ) diff --git a/altair/vegalite/v2/examples/us_state_capitals.py b/altair/vegalite/v2/examples/us_state_capitals.py --- a/altair/vegalite/v2/examples/us_state_capitals.py +++ b/altair/vegalite/v2/examples/us_state_capitals.py @@ -38,8 +38,6 @@ points = base.mark_point().encode( color=alt.value('black'), size=alt.condition(~hover, alt.value(30), alt.value(100)) -).properties( - selection=hover -) +).add_selection(hover) background + points + text
diff --git a/altair/vegalite/v2/tests/test_api.py b/altair/vegalite/v2/tests/test_api.py --- a/altair/vegalite/v2/tests/test_api.py +++ b/altair/vegalite/v2/tests/test_api.py @@ -293,6 +293,20 @@ def test_resolve_methods(): assert str(err.value).endswith("object has no attribute 'resolve'") +def test_add_selection(): + selections = [alt.selection_interval(), + alt.selection_single(), + alt.selection_multi()] + chart = alt.Chart().mark_point().add_selection( + selections[0] + ).add_selection( + selections[1], + selections[2] + ) + expected = selections[0] + selections[1] + selections[2] + assert chart.selection.to_dict() == expected.to_dict() + + def test_LookupData(): df = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]}) lookup = alt.LookupData(data=df, key='x')
ENH: add ``add_selection`` method Suggested by @kanitw Instead of doing: ```python alt.Chart().properties(selection=selection) ``` we should let users do ```python alt.Chart().add_selection(selection) ``` This would make it more clear to the user how to add multiple selections to a single chart.
2018-05-13T05:17:57Z
[]
[]
vega/altair
925
vega__altair-925
[ "922" ]
6b9d5eef7dd850388d7f01ce5eed33bda21000be
diff --git a/altair/utils/plugin_registry.py b/altair/utils/plugin_registry.py --- a/altair/utils/plugin_registry.py +++ b/altair/utils/plugin_registry.py @@ -138,7 +138,7 @@ def _enable(self, name, **options): self._active = self._plugins[name] self._options = options - def enable(self, name, **options): + def enable(self, name=None, **options): # type: (str, **Any) -> PluginEnabler """Enable a plugin by name. @@ -146,8 +146,9 @@ def enable(self, name, **options): Parameters ---------- - name : string - The name of the plugin to enable + name : string (optional) + The name of the plugin to enable. If not specified, then use the + current active name. **options : Any additional parameters will be passed to the plugin as keyword arguments @@ -157,7 +158,10 @@ def enable(self, name, **options): PluginEnabler: An object that allows enable() to be used as a context manager """ + if name is None: + name = self.active return PluginEnabler(self, name, **options) + @property def active(self): diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -915,10 +915,42 @@ def _repr_mimebundle_(self, include, exclude): else: return renderers.get()(dct) - def display(self): - """Display chart in Jupyter notebook or JupyterLab""" + def display(self, renderer=Undefined, theme=Undefined, actions=Undefined, + **kwargs): + """Display chart in Jupyter notebook or JupyterLab + + Parameters are passed as options to vega-embed within supported frontends. + See https://github.com/vega/vega-embed#options for details. + + Parameters + ---------- + renderer : string ('canvas' or 'svg') + The renderer to use + theme : string + The Vega theme name to use; see https://github.com/vega/vega-themes + actions : bool or dict + Specify whether action links ("Open In Vega Editor", etc.) are + included in the view. + **kwargs : + Additional parameters are also passed to vega-embed as options. + """ from IPython.display import display - display(self) + + if renderer is not Undefined: + kwargs['renderer'] = renderer + if theme is not Undefined: + kwargs['theme'] = theme + if actions is not Undefined: + kwargs['actions'] = actions + + if kwargs: + options = renderers.options.copy() + options['embed_options']= options.get('embed_options', {}).copy() + options['embed_options'].update(kwargs) + with renderers.enable(**options): + display(self) + else: + display(self) def serve(self, ip='127.0.0.1', port=8888, n_retries=50, files=None, jupyter_warning=True, open_browser=True, http_server=None,
diff --git a/altair/utils/tests/test_plugin_registry.py b/altair/utils/tests/test_plugin_registry.py --- a/altair/utils/tests/test_plugin_registry.py +++ b/altair/utils/tests/test_plugin_registry.py @@ -41,8 +41,14 @@ def test_plugin_registry_extra_options(): assert plugins.get()(3) == 9 plugins.enable('metadata_plugin', p=3) + assert plugins.active == 'metadata_plugin' assert plugins.get()(3) == 27 + # enabling without changing name + plugins.enable(p=2) + assert plugins.active == 'metadata_plugin' + assert plugins.get()(3) == 9 + def test_plugin_registry_context(): plugins = GeneralCallableRegistry() @@ -72,3 +78,13 @@ def test_plugin_registry_context(): assert plugins.active == '' assert plugins.options == {} + + # Enabling without specifying name uses current name + plugins.enable('default', p=2) + + with plugins.enable(p=6): + assert plugins.active == 'default' + assert plugins.options == {'p': 6} + + assert plugins.active == 'default' + assert plugins.options == {'p': 2} diff --git a/altair/vegalite/v2/tests/test_display.py b/altair/vegalite/v2/tests/test_display.py new file mode 100644 --- /dev/null +++ b/altair/vegalite/v2/tests/test_display.py @@ -0,0 +1,63 @@ +from contextlib import contextmanager + +import pytest + +import altair as alt + + +@contextmanager +def check_render_options(**options): + """ + Context manager that will assert that alt.renderers.options are equivalent + to the given options in the IPython.display.display call + """ + import IPython.display + def check_options(obj): + assert alt.renderers.options == options + _display = IPython.display.display + IPython.display.display = check_options + try: + yield + finally: + IPython.display.display = _display + + +def test_check_renderer_options(): + # this test should pass + with check_render_options(): + from IPython.display import display + display(None) + + # check that an error is appropriately raised if the test fails + with pytest.raises(AssertionError): + with check_render_options(foo='bar'): + from IPython.display import display + display(None) + + +def test_display_options(): + chart = alt.Chart('data.csv').mark_point().encode(x='foo:Q') + + # check that there are no options by default + with check_render_options(): + chart.display() + + # check that display options are passed + with check_render_options(embed_options={'tooltip': False, 'renderer': 'canvas'}): + chart.display('canvas', tooltip=False) + + # check that above options do not persist + with check_render_options(): + chart.display() + + # check that display options augment rather than overwrite pre-set options + with alt.renderers.enable(embed_options={'tooltip': True, 'renderer': 'svg'}): + with check_render_options(embed_options={'tooltip': True, 'renderer': 'svg'}): + chart.display() + + with check_render_options(embed_options={'tooltip': True, 'renderer': 'canvas'}): + chart.display('canvas') + + # check that above options do not persist + with check_render_options(): + chart.display()
ENH: allow specification of embed options from chart.display() See https://github.com/altair-viz/altair/issues/688#issuecomment-395523194
2018-06-08T20:44:13Z
[]
[]
vega/altair
928
vega__altair-928
[ "926" ]
6b9d5eef7dd850388d7f01ce5eed33bda21000be
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -114,6 +114,10 @@ def to_list_if_array(val): elif str(dtype) == 'bool': # convert numpy bools to objects; np.bool is not JSON serializable df[col_name] = df[col_name].astype(object) + elif str(dtype).startswith('datetime'): + # Convert datetimes to strings + # astype(str) will choose the appropriate resolution + df[col_name] = df[col_name].astype(str).replace('NaT', '') elif np.issubdtype(dtype, np.integer): # convert integers to objects; np.int is not JSON serializable df[col_name] = df[col_name].astype(object) @@ -123,10 +127,6 @@ def to_list_if_array(val): col = df[col_name] bad_values = col.isnull() | np.isinf(col) df[col_name] = col.astype(object).where(~bad_values, None) - elif str(dtype).startswith('datetime'): - # Convert datetimes to strings - # astype(str) will choose the appropriate resolution - df[col_name] = df[col_name].astype(str).replace('NaT', '') elif dtype == object: # Convert numpy arrays saved as objects to lists # Arrays are not JSON serializable
diff --git a/altair/utils/tests/test_core.py b/altair/utils/tests/test_core.py --- a/altair/utils/tests/test_core.py +++ b/altair/utils/tests/test_core.py @@ -57,14 +57,17 @@ def check(s, data, **kwargs): data = pd.DataFrame({'x': [1, 2, 3, 4, 5], 'y': ['A', 'B', 'C', 'D', 'E'], - 'z': pd.date_range('2018-01-01', periods=5, freq='D')}) + 'z': pd.date_range('2018-01-01', periods=5, freq='D'), + 't': pd.date_range('2018-01-01', periods=5, freq='D').tz_localize('UTC')}) check('x', data, field='x', type='quantitative') check('y', data, field='y', type='nominal') check('z', data, field='z', type='temporal') + check('t', data, field='t', type='temporal') check('count(x)', data, field='x', aggregate='count', type='quantitative') check('count()', data, aggregate='count', type='quantitative') check('month(z)', data, timeUnit='month', field='z', type='temporal') + check('month(t)', data, timeUnit='month', field='t', type='temporal') def test_parse_shorthand_all_aggregates(): diff --git a/altair/utils/tests/test_utils.py b/altair/utils/tests/test_utils.py --- a/altair/utils/tests/test_utils.py +++ b/altair/utils/tests/test_utils.py @@ -40,7 +40,8 @@ def test_sanitize_dataframe(): 'b': np.array([True, False, True, True, False]), 'd': pd.date_range('2012-01-01', periods=5, freq='H'), 'c': pd.Series(list('ababc'), dtype='category'), - 'o': pd.Series([np.array(i) for i in range(5)])}) + 'o': pd.Series([np.array(i) for i in range(5)]), + 'p': pd.date_range('2012-01-01', periods=5, freq='H').tz_localize('UTC')}) # add some nulls df.iloc[0, df.columns.get_loc('s')] = None @@ -63,7 +64,8 @@ def test_sanitize_dataframe(): if str(df[col].dtype).startswith('datetime'): # astype(datetime) introduces time-zone issues: # to_datetime() does not. - df2[col] = pd.to_datetime(df2[col]) + utc = isinstance(df[col].dtype, pd.core.dtypes.dtypes.DatetimeTZDtype) + df2[col] = pd.to_datetime(df2[col], utc = utc) else: df2[col] = df2[col].astype(df[col].dtype)
Can't store pandas.DataFrame with column of datetime that has timezone `sanitize_dataframe` does not understand data type datetime64[ns, UTC] ```python data = pd.DataFrame(pd.date_range('2000-01-01',periods=5).tz_localize('UTC').rename('tz_datetime')) print(data.info()) alt.Chart(data).mark_rule().encode(x='tz_datetime:T') ``` Out: ```python <class 'pandas.core.frame.DataFrame'> RangeIndex: 5 entries, 0 to 4 Data columns (total 1 columns): tz_datetime 5 non-null datetime64[ns, UTC] dtypes: datetime64[ns, UTC](1) memory usage: 120.0 bytes None --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/altair/vegalite/v2/api.py in to_dict(self, *args, **kwargs) 312 copy = self.copy() 313 original_data = getattr(copy, 'data', Undefined) --> 314 copy.data = _prepare_data(original_data) 315 316 # We make use of two context markers: ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/altair/vegalite/v2/api.py in _prepare_data(data) 24 return data 25 elif isinstance(data, pd.DataFrame): ---> 26 return pipe(data, data_transformers.get()) 27 elif isinstance(data, six.string_types): 28 return core.UrlData(data) ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/toolz/functoolz.py in pipe(data, *funcs) 550 """ 551 for func in funcs: --> 552 data = func(data) 553 return data 554 ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/toolz/functoolz.py in __call__(self, *args, **kwargs) 281 def __call__(self, *args, **kwargs): 282 try: --> 283 return self._partial(*args, **kwargs) 284 except TypeError as exc: 285 if self._should_curry(args, kwargs, exc): ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/altair/vegalite/data.py in default_data_transformer(data, max_rows) 10 @curry 11 def default_data_transformer(data, max_rows=5000): ---> 12 return pipe(data, limit_rows(max_rows=max_rows), to_values) 13 14 ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/toolz/functoolz.py in pipe(data, *funcs) 550 """ 551 for func in funcs: --> 552 data = func(data) 553 return data 554 ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/toolz/functoolz.py in __call__(self, *args, **kwargs) 281 def __call__(self, *args, **kwargs): 282 try: --> 283 return self._partial(*args, **kwargs) 284 except TypeError as exc: 285 if self._should_curry(args, kwargs, exc): ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/altair/utils/data.py in to_values(data) 123 check_data_type(data) 124 if isinstance(data, pd.DataFrame): --> 125 data = sanitize_dataframe(data) 126 return {'values': data.to_dict(orient='records')} 127 elif isinstance(data, dict): ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/altair/utils/core.py in sanitize_dataframe(df) 89 # convert numpy bools to objects; np.bool is not JSON serializable 90 df[col_name] = df[col_name].astype(object) ---> 91 elif np.issubdtype(dtype, np.integer): 92 # convert integers to objects; np.int is not JSON serializable 93 df[col_name] = df[col_name].astype(object) ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/site-packages/numpy/core/numerictypes.py in issubdtype(arg1, arg2) 724 """ 725 if not issubclass_(arg1, generic): --> 726 arg1 = dtype(arg1).type 727 if not issubclass_(arg2, generic): 728 arg2_orig = arg2 TypeError: data type not understood Chart({ data: tz_datetime 0 2000-01-01 00:00:00+00:00 1 2000-01-02 00:00:00+00:00 2 2000-01-03 00:00:00+00:00 3 2000-01-04 00:00:00+00:00 4 2000-01-05 00:00:00+00:00 }) ``` In: ```python print('altair',alt.__version__) print('pandas',pd.__version__) print('numpy',np.__version__) ``` Out: ```python altair 2.0.1 pandas 0.22.0 numpy 1.14.2 ``` Same for ``` altair 2.0.1 pandas 0.23.0 numpy 1.14.3 ```
2018-06-09T16:56:16Z
[]
[]
vega/altair
974
vega__altair-974
[ "967" ]
368a6dbd4ea571ef7612415a966cfedbea592d33
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -97,6 +97,7 @@ def sanitize_dataframe(df): * Convert np.int dtypes to Python int objects * Convert floats to objects and replace NaNs/infs with None. * Convert DateTime dtypes into appropriate string representations + * Raise a ValueError for TimeDelta dtypes """ df = df.copy() @@ -124,6 +125,11 @@ def to_list_if_array(val): # Convert datetimes to strings # astype(str) will choose the appropriate resolution df[col_name] = df[col_name].astype(str).replace('NaT', '') + elif str(dtype).startswith('timedelta'): + raise ValueError('Field "{col_name}" has type "{dtype}" which is ' + 'not supported by Altair. Please convert to ' + 'either a timestamp or a numerical value.' + ''.format(col_name=col_name, dtype=dtype)) elif np.issubdtype(dtype, np.integer): # convert integers to objects; np.int is not JSON serializable df[col_name] = df[col_name].astype(object)
diff --git a/altair/utils/tests/test_utils.py b/altair/utils/tests/test_utils.py --- a/altair/utils/tests/test_utils.py +++ b/altair/utils/tests/test_utils.py @@ -80,6 +80,13 @@ def test_sanitize_dataframe(): assert df.equals(df2) +def test_sanitize_dataframe_timedelta(): + df = pd.DataFrame({'r': pd.timedelta_range(start='1 day', periods=4)}) + with pytest.raises(ValueError) as err: + sanitize_dataframe(df) + assert str(err.value).startswith('Field "r" has type "timedelta') + + def test_sanitize_dataframe_infs(): df = pd.DataFrame({'x': [0, 1, 2, np.inf, -np.inf, np.nan]}) df_clean = sanitize_dataframe(df)
pd.Timedelta is not JSON serializable In: ```python td = pd.timedelta_range(0,periods=3,freq='h') alt.Chart( pd.DataFrame(dict(id=np.arange(td.size),timedelta = td)) ).mark_bar( ).encode( x = 'timedelta', y ='id:O' ) ``` Out: ```python ~/anaconda/anaconda/envs/rr_dev/lib/python3.5/json/encoder.py in default(self, o) 177 178 """ --> 179 raise TypeError(repr(o) + " is not JSON serializable") 180 181 def encode(self, o): TypeError: Timedelta('0 days 00:00:00') is not JSON serializable ``` In: ```python print ('pandas',pd.__version__) print ('altair',alt.__version__) ``` Out: ```python pandas 0.23.0 altair 2.1.0 ``` Expected, but I'm not sure that is achievable without `timeUnit="hoursminutes"`. ![visualization 17](https://user-images.githubusercontent.com/11561581/41821223-01e72d06-77e6-11e8-9850-b8d61faad284.png)
Vega only supports time stamps, not time deltas. The best apporach to time deltas is to encode your data as a timestamp and extract the part of the date you want with a timeunit. For example: ```python import altair as alt import pandas as pd import numpy as np td = pd.timedelta_range(0,periods=3,freq='h') timestamp = pd.to_datetime('2018-01-01') + td df = pd.DataFrame(dict(id=np.arange(td.size), time=timestamp)) alt.Chart(df).mark_bar().encode( x='hoursminutes(time)', y='id:O' ) ``` ![visualization 19](https://user-images.githubusercontent.com/781659/41821886-19dd75ea-779c-11e8-8ef8-23bc1c29fb2f.png) IMHO, will be great in that case at least throw `NotImplemented` with your answer it's more understandable than JSON error. Or just do what you propose while sanitizing DataFrame and parsing shorthand. It will involve some magic to understand what is appropriate precision for timedelta but field maximum value will give us that information. I don't think it's appropriate to automatically convert timedeltas to time stamps, because it would be quite confusing. A different error might help, though. What would you suggest? In my case I came to converting it to hours as float. That worked better for stacked bar chart displaying how daily hours was spent. I do not have enough experience with that type to propose some reasonable conversion. But `"is not JSON serializable"` works for me like a red rag on a bull. I read it as altair is broken again :) I propose throwing `NotImplementedException` with text something like : `Field {fieldName} has type {fieldType} that has no representation in vega-lite. Drop the field before passing DataFrame to Altair or convert to other type. ` Or just to **drop fields with known unsupported types with same warning** to user that may be useful when you get wide DataFrame from unknown source and exploring what you just get. In that case the need for writing extra code just for cleaning DataFrame before first look annoying. I think it is the most useful way to solve a problem because if you use that field in a chart it would not work anyway but if you don't you will get a result without any efforts and thats cool. OK, I've added a better error in #974 For what it's worth, the ``"is not JSON serializable"`` error comes from JSON, not from Altair, so the only way we get around that is to anticipate what types the user might pass to Altair and catch those errors earlier.
2018-06-26T14:25:09Z
[]
[]
vega/altair
1,075
vega__altair-1075
[ "1072" ]
c578fda2c2e19fb2345a7dd878e019b9edac1f51
diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -830,8 +830,12 @@ def transform_filter(self, filter, **kwargs): alt.FilterTransform : underlying transform object """ + selection_predicates = (core.SelectionNot, core.SelectionOr, + core.SelectionAnd, core.SelectionOperand) if isinstance(filter, NamedSelection): - filter = filter.ref() + filter = {'selection': filter._get_name()} + elif isinstance(filter, selection_predicates): + filter = {'selection': filter} return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) def transform_lookup(self, as_=Undefined, from_=Undefined, lookup=Undefined, default=Undefined, **kwargs):
diff --git a/altair/vegalite/v2/tests/test_api.py b/altair/vegalite/v2/tests/test_api.py --- a/altair/vegalite/v2/tests/test_api.py +++ b/altair/vegalite/v2/tests/test_api.py @@ -336,6 +336,24 @@ def test_transforms(): window=window[::-1])]) +def test_filter_transform_selection_predicates(): + selector1 = alt.selection_interval(name='s1') + selector2 = alt.selection_interval(name='s2') + base = alt.Chart('data.txt').mark_point() + + chart = base.transform_filter(selector1) + assert chart.to_dict()['transform'] == [{'filter': {'selection': 's1'}}] + + chart = base.transform_filter(~selector1) + assert chart.to_dict()['transform'] == [{'filter': {'selection': {'not': 's1'}}}] + + chart = base.transform_filter(selector1 & selector2) + assert chart.to_dict()['transform'] == [{'filter': {'selection': {'and': ['s1', 's2']}}}] + + chart = base.transform_filter(selector1 | selector2) + assert chart.to_dict()['transform'] == [{'filter': {'selection': {'or': ['s1', 's2']}}}] + + def test_resolve_methods(): chart = alt.LayerChart().resolve_axis(x='shared', y='independent')
SelectionNot is not appropriately serialized See https://github.com/altair-viz/altair/issues/695#issuecomment-411506890 and https://github.com/altair-viz/altair/issues/695#issuecomment-411536841
Issue is that ``SelectionNot`` returns ``{'not': 'selection_name'}`` which is valid within a conditional, but not within a filter. Alternatives are ``{'selection': {'not': 'selection_name'}}`` or ``{'not': {'selection': 'selection_name'}}``. Difference is whether the ``not`` comes from ``definitions.SelectionNot`` or from ``LogicalNot<Predicate>`` definitions. Currently ``transform_filter`` special-cases selections here: https://github.com/altair-viz/altair/blob/e744f1b343ee7ecb92846bb2db24c63f7ef66ea5/altair/vegalite/v2/api.py#L833-L834 it should also special-case selection operands.
2018-08-09T20:20:56Z
[]
[]
vega/altair
1,092
vega__altair-1092
[ "1091" ]
2fbbb9ae469c4a8306462e0fcc81f8df57b29776
diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -17,18 +17,50 @@ # ------------------------------------------------------------------------ # Data Utilities -def _dataset_name(data): - """Generate a unique hash of the data""" - def hash_(dct): - dct_str = json.dumps(dct, sort_keys=True) - return hashlib.md5(dct_str.encode()).hexdigest() +def _dataset_name(values): + """Generate a unique hash of the data + + Parameters + ---------- + values : list or dict + A list/dict representation of data values. + + Returns + ------- + name : string + A unique name generated from the hash of the values. + """ + if isinstance(values, core.InlineDataset): + values = values.to_dict() + values_json = json.dumps(values, sort_keys=True) + hsh = hashlib.md5(values_json.encode()).hexdigest() + return 'data-' + hsh + + +def _consolidate_data(data, context): + """If data is specified inline, then move it to context['datasets'] + + This function will modify context in-place, and return a new version of data + """ + values = Undefined + kwds = {} if isinstance(data, core.InlineData): - return 'data-' + hash_(data.values) - elif isinstance(data, dict) and 'values' in data: - return 'data-' + hash_(data['values']) - else: - raise ValueError("Cannot generate name for data {0}".format(data)) + if data.name is Undefined and data.values is not Undefined: + values = data.values + kwds = {'format': data.format} + + elif isinstance(data, dict): + if 'name' not in data and 'values' in data: + values = data['values'] + kwds = {k:v for k,v in data.items() if k != 'values'} + + if values is not Undefined: + name = _dataset_name(values) + data = core.NamedData(name=name, **kwds) + context.setdefault('datasets', {})[name] = values + + return data def _prepare_data(data, context): @@ -46,35 +78,25 @@ def _prepare_data(data, context): """ if data is Undefined: return data - if isinstance(data, core.InlineData): - if data_transformers.consolidate_datasets: - name = _dataset_name(data) - context.setdefault('datasets', {})[name] = data.values - return core.NamedData(name=name) - else: - return data - elif isinstance(data, dict) and 'values' in data: - if data_transformers.consolidate_datasets: - name = _dataset_name(data) - context.setdefault('datasets', {})[name] = data['values'] - return core.NamedData(name=name) - else: - return data - elif isinstance(data, pd.DataFrame): + + # convert dataframes to dict + if isinstance(data, pd.DataFrame): data = pipe(data, data_transformers.get()) - if data_transformers.consolidate_datasets and isinstance(data, dict) and 'values' in data: - name = _dataset_name(data) - context.setdefault('datasets', {})[name] = data['values'] - return core.NamedData(name=name) - else: - return data - elif isinstance(data, (dict, core.Data, core.UrlData, core.NamedData)): - return data - elif isinstance(data, six.string_types): - return core.UrlData(data) - else: + + # convert string input to a URLData + if isinstance(data, six.string_types): + data = core.UrlData(data) + + # 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, core.UrlData, + core.InlineData, core.NamedData)): warnings.warn("data of type {0} not recognized".format(type(data))) - return data + + return data # ------------------------------------------------------------------------
diff --git a/altair/vegalite/v2/tests/test_api.py b/altair/vegalite/v2/tests/test_api.py --- a/altair/vegalite/v2/tests/test_api.py +++ b/altair/vegalite/v2/tests/test_api.py @@ -460,3 +460,35 @@ def test_consolidate_datasets(basic_chart): for spec in dct_consolidated['hconcat']: assert spec['data'] == {'name': name} + + +def test_consolidate_InlineData(): + data = alt.InlineData( + values=[{'a': 1, 'b': 1}, {'a': 2, 'b': 2}], + format={'type': 'csv'} + ) + chart = alt.Chart(data).mark_point() + + with alt.data_transformers.enable(consolidate_datasets=False): + dct = chart.to_dict() + assert dct['data']['format'] == data.format + assert dct['data']['values'] == data.values + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = chart.to_dict() + assert dct['data']['format'] == data.format + assert list(dct['datasets'].values())[0] == data.values + + data = alt.InlineData( + values=[], + name='runtime_data' + ) + chart = alt.Chart(data).mark_point() + + with alt.data_transformers.enable(consolidate_datasets=False): + dct = chart.to_dict() + assert dct['data'] == data.to_dict() + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = chart.to_dict() + assert dct['data'] == data.to_dict()
Altair 2.2 losses format property of InlineData object ~~~python data = alt.InlineData( values={'a':[{'b': 0}, {'b': 1}, {'b': 2}]}, format=alt.DataFormat( type='json', property='a', )) chart = alt.Chart( data ).mark_tick( ).encode( x='b:N' ) chart ~~~ ![visualization 36](https://user-images.githubusercontent.com/11561581/44123732-63aeb738-a032-11e8-9ee2-d3ced575296d.png) **but** ~~~python alt.data_transformers.enable(consolidate_datasets=False) chart ~~~ ![visualization 37](https://user-images.githubusercontent.com/11561581/44123818-b9c2fefe-a032-11e8-91a8-53a262ef8989.png)
Thanks – looks like dataset consolidation ignores extra properties of the inline data. I think it should be a fairly straightforward fix.
2018-08-15T02:33:35Z
[]
[]
vega/altair
1,433
vega__altair-1433
[ "1431" ]
5cdf0cc3a96159a4eac81a1beec3a0c9efae722d
diff --git a/altair/examples/interactive_cross_highlight.py b/altair/examples/interactive_cross_highlight.py --- a/altair/examples/interactive_cross_highlight.py +++ b/altair/examples/interactive_cross_highlight.py @@ -36,10 +36,9 @@ y='count()', color=alt.condition(pts, alt.ColorValue("steelblue"), alt.ColorValue("grey")) ).properties( - selection=pts, width=550, height=200 -) +).add_selection(pts) alt.vconcat( rect + circ, diff --git a/altair/examples/interactive_layered_crossfilter.py b/altair/examples/interactive_layered_crossfilter.py --- a/altair/examples/interactive_layered_crossfilter.py +++ b/altair/examples/interactive_layered_crossfilter.py @@ -27,7 +27,7 @@ ) # blue background with selection -background = base.properties(selection=brush) +background = base.add_selection(brush) # yellow highlights on the transformed data highlight = base.encode( diff --git a/altair/examples/interval_selection.py b/altair/examples/interval_selection.py --- a/altair/examples/interval_selection.py +++ b/altair/examples/interval_selection.py @@ -15,7 +15,7 @@ brush = alt.selection(type='interval', encodings=['x']) upper = alt.Chart().mark_area().encode( - alt.X('date:T', scale={'domain': brush.ref()}), + alt.X('date:T', scale=alt.Scale(domain=brush)), y='price:Q' ).properties( width=600, diff --git a/altair/examples/scatter_with_histogram.py b/altair/examples/scatter_with_histogram.py --- a/altair/examples/scatter_with_histogram.py +++ b/altair/examples/scatter_with_histogram.py @@ -32,7 +32,7 @@ x='x', y='y' ).transform_filter( - pts.ref() + pts ).properties( width=300, height=300 @@ -44,10 +44,9 @@ y="count()", color=alt.condition(pts, alt.value("black"), alt.value("lightgray")) ).properties( - selection=pts, width=300, height=300 -) +).add_selection(pts) # build the chart: alt.hconcat( diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -243,6 +243,8 @@ def _todict(val): elif isinstance(val, dict): return {k: _todict(v) for k, v in val.items() if v is not Undefined} + elif hasattr(val, 'to_dict'): + return val.to_dict() else: return val diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -197,7 +197,7 @@ def ref(self): Examples -------- - >>> import altair as alt + >>> import altair.vegalite.v2 as alt >>> sel = alt.selection_interval(name='interval') >>> sel.ref() {'selection': 'interval'} @@ -685,7 +685,7 @@ def transform_aggregate(self, aggregate=Undefined, groupby=Undefined, **kwds): The aggregate transform allows you to specify transforms directly using the same shorthand syntax as used in encodings: - >>> import altair as alt + >>> import altair.vegalite.v2 as alt >>> chart1 = alt.Chart().transform_aggregate( ... mean_acc='mean(Acceleration)', ... groupby=['Origin'] @@ -752,7 +752,7 @@ def transform_bin(self, as_=Undefined, field=Undefined, bin=True, **kwargs): Examples -------- - >>> import altair as alt + >>> import altair.vegalite.v2 as alt >>> chart = alt.Chart().transform_bin("x_binned", "x") >>> chart.transform[0] BinTransform({ @@ -807,7 +807,7 @@ def transform_calculate(self, as_=Undefined, calculate=Undefined, **kwargs): Examples -------- - >>> import altair as alt + >>> import altair.vegalite.v2 as alt >>> from altair import datum, expr >>> chart = alt.Chart().transform_calculate(y = 2 * expr.sin(datum.x)) @@ -941,7 +941,7 @@ def transform_timeunit(self, as_=Undefined, field=Undefined, timeUnit=Undefined, Examples -------- - >>> import altair as alt + >>> import altair.vegalite.v2 as alt >>> from altair import datum, expr >>> chart = alt.Chart().transform_timeunit(month='month(date)') @@ -1041,7 +1041,7 @@ def transform_window(self, window=Undefined, frame=Undefined, groupby=Undefined, -------- A cumulative line chart - >>> import altair as alt + >>> import altair.vegalite.v2 as alt >>> import numpy as np >>> import pandas as pd >>> data = pd.DataFrame({'x': np.arange(100), diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -150,82 +150,36 @@ def _get_channels_mapping(): # ------------------------------------------------------------------------- # Tools for working with selections -class SelectionMapping(core.VegaLiteSchema): - """A mapping of selection names to selection definitions. +class Selection(object): + """A Selection object""" + _counter = 1 - This is designed to match the schema of the "selection" property of - top-level objects. - """ - _schema = { - 'type': 'object', - 'additionalPropeties': {'$ref': '#/definitions/SelectionDef'} - } - _rootschema = core.Root._schema - - def __add__(self, other): - if isinstance(other, SelectionMapping): - copy = self.copy() - copy._kwds.update(other._kwds) - return copy - else: - return NotImplemented - - def __iadd__(self, other): - if isinstance(other, SelectionMapping): - self._kwds.update(other._kwds) - return self - else: - return NotImplemented - - -class NamedSelection(SelectionMapping): - """A SelectionMapping with a single named selection item""" - _schema = { - 'type': 'object', - 'additionalPropeties': {'$ref': '#/definitions/SelectionDef'}, - 'minProperties': 1, 'maxProperties': 1 - } - _rootschema = core.Root._schema - - def _get_name(self): - if len(self._kwds) != 1: - raise ValueError("NamedSelection has multiple properties") - return next(iter(self._kwds)) + def __init__(self, name, selection): + if name is None: + name = "selector{:03d}".format(self._counter) + self._counter += 1 + self.name = name + self.selection = selection def ref(self): - """Return a selection reference to this object - - Examples - -------- - >>> import altair as alt - >>> sel = alt.selection_interval(name='interval') - >>> sel.ref() - {'selection': 'interval'} + return {'selection': self.name} - """ - return {"selection": self._get_name()} + def to_dict(self): + return {'selection': self.name} def __invert__(self): - return core.SelectionNot(**{'not': self._get_name()}) + return core.SelectionNot(**{'not': self.name}) def __and__(self, other): - if isinstance(other, NamedSelection): - other = other._get_name() - return core.SelectionAnd(**{'and': [self._get_name(), other]}) + if isinstance(other, Selection): + other = other.name + return core.SelectionAnd(**{'and': [self.name, other]}) def __or__(self, other): - if isinstance(other, NamedSelection): - other = other._get_name() - return core.SelectionOr(**{'or': [self._get_name(), other]}) + if isinstance(other, Selection): + other = other.name + return core.SelectionOr(**{'or': [self.name, other]}) - def __add__(self, other): - copy = SelectionMapping(**self._kwds) - copy += other - return copy - - def __iadd__(self, other): - # this will be delegated to SelectionMapping - return NotImplemented # ------------------------------------------------------------------------ # Top-Level Functions @@ -251,15 +205,11 @@ def selection(name=None, type=Undefined, **kwds): Returns ------- - selection: NamedSelection + selection: Selection The selection object that can be used in chart creation. """ - if name is None: - name = "selector{:03d}".format(selection.counter) - selection.counter += 1 - return NamedSelection(**{name: core.SelectionDef(type=type, **kwds)}) + return Selection(name, core.SelectionDef(type=type, **kwds)) -selection.counter = 1 @utils.use_signature(core.IntervalSelection) def selection_interval(**kwargs): @@ -314,7 +264,7 @@ def condition(predicate, if_true, if_false, **kwargs): Parameters ---------- - predicate: NamedSelection, LogicalOperandPredicate, expr.Expression, dict, or string + predicate: Selection, LogicalOperandPredicate, expr.Expression, dict, or string the selection predicate or test predicate for the condition. if a string is passed, it will be treated as a test operand. if_true: @@ -339,8 +289,8 @@ def condition(predicate, if_true, if_false, **kwargs): core.FieldGTPredicate, core.FieldLTEPredicate, core.FieldGTEPredicate, core.SelectionPredicate) - if isinstance(predicate, NamedSelection): - condition = {'selection': predicate._get_name()} + if isinstance(predicate, Selection): + condition = {'selection': predicate.name} elif isinstance(predicate, selection_predicates): condition = {'selection': predicate} elif isinstance(predicate, test_predicates): @@ -563,16 +513,15 @@ def properties(self, **kwargs): return copy def add_selection(self, *selections): - """Add one or more selections to the chart""" + """Add one or more selections to the chart.""" if not selections: return self - else: - copy = self.copy(deep=True, ignore=['data']) - if copy.selection is Undefined: - copy.selection = SelectionMapping() - for selection in selections: - copy.selection += selection - return copy + copy = self.copy(deep=True, ignore=['data']) + if copy.selection is Undefined: + copy.selection = {} + for s in selections: + copy.selection[s.name] = s.selection + return copy def project(self, type='mercator', center=Undefined, clipAngle=Undefined, clipExtent=Undefined, coefficient=Undefined, distance=Undefined, fraction=Undefined, lobes=Undefined, @@ -961,7 +910,7 @@ def transform_filter(self, filter, **kwargs): (2) a range predicate (3) a selection predicate (4) a logical operand combining (1)-(3) - (5) a NamedSelection object + (5) a Selection object Returns ------- @@ -975,8 +924,8 @@ def transform_filter(self, filter, **kwargs): """ selection_predicates = (core.SelectionNot, core.SelectionOr, core.SelectionAnd, core.SelectionOperand) - if isinstance(filter, NamedSelection): - filter = {'selection': filter._get_name()} + if isinstance(filter, Selection): + filter = {'selection': filter.name} elif isinstance(filter, selection_predicates): filter = {'selection': filter} return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) @@ -1417,7 +1366,7 @@ def encode(self, *args, **kwargs): "".format(encoding)) kwargs[encoding] = arg - def _wrap_in_channel_class(obj, prop): + def _wrap_in_channel_class(obj, prop): clsname = prop.title() if isinstance(obj, core.SchemaBase): @@ -1598,15 +1547,8 @@ def interactive(self, name=None, bind_x=True, bind_y=True): encodings.append('x') if bind_y: encodings.append('y') - copy = self.copy(deep=True, ignore=['data']) - - if copy.selection is Undefined: - copy.selection = SelectionMapping() - if isinstance(copy.selection, dict): - copy.selection = SelectionMapping(**copy.selection) - copy.selection += selection(type='interval', bind='scales', - encodings=encodings) - return copy + return self.add_selection(selection_interval(bind='scales', + encodings=encodings)) def facet(self, row=Undefined, column=Undefined, data=Undefined, **kwargs): """Create a facet chart from the current chart. diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -239,6 +239,8 @@ def _todict(val): elif isinstance(val, dict): return {k: _todict(v) for k, v in val.items() if v is not Undefined} + elif hasattr(val, 'to_dict'): + return val.to_dict() else: return val
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -254,35 +254,29 @@ def test_facet_parse_data(): 'row': {'field': 'row', 'type': 'nominal'}} -def test_SelectionMapping(): +def test_selection(): # test instantiation of selections interval = alt.selection_interval(name='selec_1') - assert interval['selec_1'].type == 'interval' - assert interval._get_name() == 'selec_1' + assert interval.selection.type == 'interval' + assert interval.name == 'selec_1' single = alt.selection_single(name='selec_2') - assert single['selec_2'].type == 'single' - assert single._get_name() == 'selec_2' + assert single.selection.type == 'single' + assert single.name == 'selec_2' multi = alt.selection_multi(name='selec_3') - assert multi['selec_3'].type == 'multi' - assert multi._get_name() == 'selec_3' + assert multi.selection.type == 'multi' + assert multi.name == 'selec_3' - # test addition - x = single + multi + interval - assert set(x.to_dict().keys()) == {'selec_1', 'selec_2', 'selec_3'} - - y = single.copy() - y += multi - y += interval - assert x.to_dict() == y.to_dict() + # test adding to chart + chart = alt.Chart().add_selection(single) + chart = chart.add_selection(multi, interval) + assert set(chart.selection.keys()) == {'selec_1', 'selec_2', 'selec_3'} # test logical operations - x = single & multi - assert isinstance(x, alt.SelectionAnd) - - y = single | multi - assert isinstance(y, alt.SelectionOr) + assert isinstance(single & multi, alt.SelectionAnd) + assert isinstance(single | multi, alt.SelectionOr) + assert isinstance(~single, alt.SelectionNot) def test_transforms(): @@ -416,8 +410,8 @@ def test_add_selection(): selections[1], selections[2] ) - expected = selections[0] + selections[1] + selections[2] - assert chart.selection.to_dict() == expected.to_dict() + expected = {s.name: s.selection for s in selections} + assert chart.selection == expected def test_LookupData():
Altair selections resolve incorrectly as scale domain values. I am observing this issue in Altair 2.x. Apologies if this issue has already been addressed for v3! The following code for an overview + detail plot fails: ```python brush = alt.selection_interval(encodings=['x']); base = alt.Chart().mark_area().encode( x=alt.X('date:T', title=None), y='price:Q' ).properties( width=700 ) alt.vconcat( base.encode(alt.X('date:T', title=None, scale=alt.Scale(domain=brush))), base.add_selection(brush).properties(height=60), data='https://vega.github.io/vega-datasets/data/sp500.csv' ) ``` The errors indicate that Altair is expanding the brush to the full selection definition (what you would use for `add_selection`) rather than generating a selection reference. If I add `name='brush'` to the selection definition and then replace `domain=brush` with `domain={'selection': 'brush'}`, the example works.
Just ran into this same issue a second time but in a different context: creating a logical `or` predicate for a filter transform: ```python base = plot.transform_filter( # filter to points in either selection {'or': [{'selection': 'hover'}, {'selection': 'click'}]} ) ``` Consider this an up-vote for #695 as well! :) You need to use ``selection.ref()`` in this context, as demonstrated in this example: https://altair-viz.github.io/gallery/interval_selection.html Explanation: serialization of Altair objects is context free, and how selections should be represented in JSON depends on the context. The solution we came up with in Altair is to use ``selection`` to refer to the full selection definition, and ``selection.ref()`` to refer to a reference to the selection. Thanks! It seems that direct use as an argument to `transform_filter` and `alt.condition` are exceptions? That’s what threw me off in the first place. Perhaps it would help others to consistently distinguish selection defs and refs? FWIW I implemented context sensitive resolutions in the VL JavaScript API via serialization flags that can be set (or not set) in different contexts. In the case of selections I made refs the default serialization as they show up in many contexts, whereas selection definitions only show up within chart add_selection contexts. Happy to share more if that is of interest. The difference there are that ``transform_filter()`` and ``alt.condition`` are functions that are manually defined in the code, whereas ``alt.Scale`` is an auto-generated wrapper of the Vega-Lite ``Scale`` definition. We could certainly do a manual re-definition of ``Scale`` and handle the ``domain`` keyword differently, but then every time Vega-Lite updates we'd have to manually update our scale definition. It's a tug-of-war between maintainability and usability, and because maintenance falls on basically just me, I tend to err toward maintainability. One way we could maybe improve this is to not make Altair selections equivalent Vega-Lite selection objects, but rather make them objects with a JSON representation of ``{selection: "name"}`` , but which resolve the same way as selection objects within the context of ``add_selection``. It would take a bit of refactoring, but probably would be better. Sounds good to me! That is the solution the JS API uses (the bit above about serialization flags is just how I implemented it in a reusable fashion in my analogue of schemapi).
2019-04-13T20:19:38Z
[]
[]
vega/altair
1,477
vega__altair-1477
[ "1470" ]
84c4f9f67f6c9a786b0f7d9fcdeec6b04e2c927f
diff --git a/altair/examples/us_population_over_time_facet.py b/altair/examples/us_population_over_time_facet.py new file mode 100644 --- /dev/null +++ b/altair/examples/us_population_over_time_facet.py @@ -0,0 +1,26 @@ +""" +US Population: Wrapped Facet +============================ +This chart visualizes the age distribution of the US population over time, +using a wrapped faceting of the data by decade. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +source = data.population.url + +alt.Chart(source).mark_area().encode( + x='age:O', + y=alt.Y( + 'sum(people):Q', + title='Population', + axis=alt.Axis(format='~s') + ), + facet='year:O' +).properties( + title='US Age Distribution By Year', + columns=5, + width=90, + height=80 +) \ No newline at end of file diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -1434,19 +1434,56 @@ def _wrap_in_channel_class(obj, prop): copy.encoding = core.FacetedEncoding(**encoding) return copy - def facet(self, row=Undefined, column=Undefined, data=Undefined, **kwargs): + def facet(self, facet=Undefined, row=Undefined, column=Undefined, data=Undefined, + columns=Undefined, **kwargs): """Create a facet chart from the current chart. Faceted charts require data to be specified at the top level; if data is not specified, the data from the current chart will be used at the top level. + + Parameters + ---------- + facet : string or alt.Facet (optional) + The data column to use as an encoding for a wrapped facet. + If specified, then neither row nor column may be specified. + column : string or alt.Column (optional) + The data column to use as an encoding for a column facet. + May be combined with row argument, but not with facet argument. + row : string or alt.Column (optional) + The data column to use as an encoding for a row facet. + May be combined with column argument, but not with facet argument. + data : string or dataframe (optional) + The dataset to use for faceting. If not supplied, then data must + be specified in the top-level chart that calls this method. + columns : integer + the maximum number of columns for a wrapped facet. + + Returns + ------- + self : + for chaining """ + facet_specified = (facet is not Undefined) + rowcol_specified = (row is not Undefined or column is not Undefined) + + if facet_specified and rowcol_specified: + raise ValueError("facet argument cannot be combined with row/column argument.") + if data is Undefined: - data = self.data - self = self.copy() - self.data = Undefined - return FacetChart(spec=self, facet=FacetMapping(row=row, column=column), - data=data, **kwargs) + if self.data is Undefined: + raise ValueError("Facet charts require data to be specified at the top level.") + self = self.copy(ignore=['data']) + data, self.data = self.data, Undefined + + if facet_specified: + if isinstance(column, six.string_types): + column = channels.Facet(column) + facet = column + else: + facet = FacetMapping(row=row, column=column) + + return FacetChart(spec=self, facet=facet, data=data, columns=columns, **kwargs) class Chart(TopLevelMixin, EncodingMixin, mixins.MarkMethodMixin,
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -491,6 +491,7 @@ def test_chart_from_dict(): base | base, base & base, base.facet(row='c:N'), + (base + base).facet(row='c:N', data='data.csv'), base.repeat(row=['c:N', 'd:N'])] for chart in charts:
Improve facet wrap The ``facet()`` method of the chart does not easily allow specifying wrapped facets. This should be improved. I think, for example ``` chart.facet(row='x', col='y') ``` should do old-style faceting, while ``` chart.facet('x', columns=2) ``` should do new-style wrapped faceting.
2019-05-06T22:05:45Z
[]
[]
vega/altair
1,493
vega__altair-1493
[ "1478" ]
5894423b359fcd911defab1495dd7e7b89f65bfe
diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -487,7 +487,7 @@ def __and__(self, other): def __or__(self, other): return HConcatChart(hconcat=[self, other]) - def repeat(self, row=Undefined, column=Undefined, **kwargs): + def repeat(self, repeat=Undefined, row=Undefined, column=Undefined, columns=Undefined, **kwargs): """Return a RepeatChart built from the chart Fields within the chart can be set to correspond to the row or @@ -495,19 +495,36 @@ def repeat(self, row=Undefined, column=Undefined, **kwargs): Parameters ---------- + repeat : list + a list of data column names to be repeated. This cannot be + used along with the ``row`` or ``column`` argument. row : list a list of data column names to be mapped to the row facet column : list a list of data column names to be mapped to the column facet + columns : int + the maximum number of columns before wrapping. Only referenced + if ``repeat`` is specified. + **kwargs : + additional keywords passed to RepeatChart. Returns ------- chart : RepeatChart a repeated chart. - """ - repeat = core.RepeatMapping(row=row, column=column) - return RepeatChart(spec=self, repeat=repeat, **kwargs) + repeat_specified = (repeat is not Undefined) + rowcol_specified = (row is not Undefined or column is not Undefined) + + if repeat_specified and rowcol_specified: + raise ValueError("repeat argument cannot be combined with row/column argument.") + + if repeat_specified: + repeat = repeat + else: + repeat = core.RepeatMapping(row=row, column=column) + + return RepeatChart(spec=self, repeat=repeat, columns=columns, **kwargs) def properties(self, **kwargs): """Set top-level properties of the Chart. @@ -1378,7 +1395,7 @@ def encode(self, *args, **kwargs): "".format(encoding)) kwargs[encoding] = arg - def _wrap_in_channel_class(obj, prop): + def _wrap_in_channel_class(obj, prop): clsname = prop.title() if isinstance(obj, core.SchemaBase): @@ -1662,7 +1679,7 @@ def interactive(self, name=None, bind_x=True, bind_y=True): return copy -def repeat(repeater): +def repeat(repeater='repeat'): """Tie a channel to the row or column within a repeated chart The output of this should be passed to the ``field`` attribute of @@ -1671,13 +1688,14 @@ def repeat(repeater): Parameters ---------- repeater : {'row'|'column'|'repeat'} - The repeater to tie the field to. + The repeater to tie the field to. Default is 'repeat'. Returns ------- repeat : RepeatRef object """ - assert repeater in ['row', 'column', 'repeat'] + if repeater not in ['row', 'column', 'repeat']: + raise ValueError("repeater must be one of ['row', 'column', 'repeat']") return core.RepeatRef(repeat=repeater)
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -493,9 +493,10 @@ def test_chart_from_dict(): base & base, base.facet(row='c:N'), (base + base).facet(row='c:N', data='data.csv'), - base.repeat(row=['c:N', 'd:N'])] + base.repeat(['c:N', 'd:N'])] for chart in charts: + print(chart) chart_out = alt.Chart.from_dict(chart.to_dict()) assert type(chart_out) is type(chart) @@ -571,4 +572,37 @@ def test_deprecated_encodings(): assert 'alt.StrokeOpacity' in record[0].message.args[0] chart2 = base.encode(strokeOpacity=alt.StrokeOpacity('x:Q')).to_dict() - assert chart1 == chart2 \ No newline at end of file + assert chart1 == chart2 + + +def test_repeat(): + # wrapped repeat + chart1 = alt.Chart('data.csv').mark_point().encode( + x=alt.X(alt.repeat(), type='quantitative'), + y='y:Q', + ).repeat( + ['A', 'B', 'C', 'D'], + columns=2 + ) + + dct1 = chart1.to_dict() + + assert dct1['repeat'] == ['A', 'B', 'C', 'D'] + assert dct1['columns'] == 2 + assert dct1['spec']['encoding']['x']['field'] == {'repeat': 'repeat'} + + # explicit row/col repeat + chart2 = alt.Chart('data.csv').mark_point().encode( + x=alt.X(alt.repeat('row'), type='quantitative'), + y=alt.Y(alt.repeat('column'), type='quantitative') + ).repeat( + row=['A', 'B', 'C'], + column=['C', 'B', 'A'] + ) + + dct2 = chart2.to_dict() + + assert dct2['repeat'] == {'row': ['A', 'B', 'C'], 'column': ['C', 'B', 'A']} + assert 'columns' not in dct2 + assert dct2['spec']['encoding']['x']['field'] == {'repeat': 'row'} + assert dct2['spec']['encoding']['y']['field'] == {'repeat': 'column'}
repeat() function is borked in Altair 3 Need to make certain ``alt.repeat()`` and ``alt.Chart.repeat()`` work correctly together and support wrapped repeats.
2019-05-09T17:36:06Z
[]
[]
vega/altair
1,538
vega__altair-1538
[ "1537" ]
35fad6bc10a14ab1072c3ce37ab2c1653d8364b7
diff --git a/altair/vegalite/data.py b/altair/vegalite/data.py --- a/altair/vegalite/data.py +++ b/altair/vegalite/data.py @@ -3,8 +3,9 @@ from ..utils.core import sanitize_dataframe from ..utils.data import ( MaxRowsError, limit_rows, sample, to_csv, to_json, to_values, - check_data_type, DataTransformerRegistry + check_data_type ) +from ..utils.data import DataTransformerRegistry as _DataTransformerRegistry @curry @@ -12,6 +13,16 @@ def default_data_transformer(data, max_rows=5000): return pipe(data, limit_rows(max_rows=max_rows), to_values) +class DataTransformerRegistry(_DataTransformerRegistry): + def disable_max_rows(self): + """Disable the MaxRowsError.""" + options = self.options + if self.active == 'default': + options = options.copy() + options['max_rows'] = None + return self.enable(**options) + + __all__ = ( 'DataTransformerRegistry', 'MaxRowsError', diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -445,9 +445,9 @@ def save(self, fp, format=None, override_data_transformer=True, the format to write: one of ['json', 'html', 'png', 'svg']. If not specified, the format will be determined from the filename. override_data_transformer : boolean (optional) - If True (default), then the save action will be done with the - default data_transformer with max_rows set to None. If False, - then use the currently active data transformer. + If True (default), then the save action will be done with + the MaxRowsError disabled. If False, then do not change the data + transformer. scale_factor : float For svg or png formats, scale the image by this factor when saving. This can be used to control the size or resolution of the output. @@ -470,7 +470,7 @@ def save(self, fp, format=None, override_data_transformer=True, # that save() will succeed even for large datasets that would # normally trigger a MaxRowsError if override_data_transformer: - with data_transformers.enable('default', max_rows=None): + with data_transformers.disable_max_rows(): result = save(**kwds) else: result = save(**kwds)
diff --git a/altair/vegalite/v2/tests/test_data.py b/altair/vegalite/v2/tests/test_data.py new file mode 100644 --- /dev/null +++ b/altair/vegalite/v2/tests/test_data.py @@ -0,0 +1,33 @@ +import os + +import pandas as pd +import pytest + +from .. import data as alt + + [email protected] +def sample_data(): + return pd.DataFrame({'x': range(10), 'y': range(10)}) + + +def test_disable_max_rows(sample_data): + with alt.data_transformers.enable('default', max_rows=5): + # Ensure max rows error is raised. + with pytest.raises(alt.MaxRowsError): + alt.data_transformers.get()(sample_data) + + # Ensure that max rows error is properly disabled. + with alt.data_transformers.disable_max_rows(): + alt.data_transformers.get()(sample_data) + + try: + with alt.data_transformers.enable('json'): + # Ensure that there is no TypeError for non-max_rows transformers. + with alt.data_transformers.disable_max_rows(): + jsonfile = alt.data_transformers.get()(sample_data) + except: + jsonfile = {} + finally: + if jsonfile: + os.remove(jsonfile['url']) \ No newline at end of file diff --git a/altair/vegalite/v3/tests/test_data.py b/altair/vegalite/v3/tests/test_data.py new file mode 100644 --- /dev/null +++ b/altair/vegalite/v3/tests/test_data.py @@ -0,0 +1,33 @@ +import os + +import pandas as pd +import pytest + +from .. import data as alt + + [email protected] +def sample_data(): + return pd.DataFrame({'x': range(10), 'y': range(10)}) + + +def test_disable_max_rows(sample_data): + with alt.data_transformers.enable('default', max_rows=5): + # Ensure max rows error is raised. + with pytest.raises(alt.MaxRowsError): + alt.data_transformers.get()(sample_data) + + # Ensure that max rows error is properly disabled. + with alt.data_transformers.disable_max_rows(): + alt.data_transformers.get()(sample_data) + + try: + with alt.data_transformers.enable('json'): + # Ensure that there is no TypeError for non-max_rows transformers. + with alt.data_transformers.disable_max_rows(): + jsonfile = alt.data_transformers.get()(sample_data) + except: + jsonfile = {} + finally: + if jsonfile: + os.remove(jsonfile['url']) \ No newline at end of file
chart.serve() ignores data transformers ```python import altair as alt alt.data_transformers.enable('data_server') from vega_datasets import data cars = data.cars() chart = alt.Chart(cars).mark_point().encode( x='Horsepower', y='Miles_per_Gallon', color='Origin', ).interactive() chart.serve() ``` Examining the HTML from the above chart, we see that the data is not transformed.
Turns out we need ```python chart.serve(override_data_transformer=False) ``` This default option is meant to disable ``MaxRowsError`` in the common case... perhaps there's a less obtrusive way to do that? I think given the intent of the keyword, we should introduce something like ``alt.data_transformers.set_max_rows(None)`` and use that function instead.
2019-05-29T04:25:14Z
[]
[]
vega/altair
1,539
vega__altair-1539
[ "781" ]
2e74eb40bf7a832747436b2c18d696371c84df01
diff --git a/altair/vegalite/v3/theme.py b/altair/vegalite/v3/theme.py --- a/altair/vegalite/v3/theme.py +++ b/altair/vegalite/v3/theme.py @@ -2,6 +2,23 @@ from ...utils.theme import ThemeRegistry +VEGA_THEMES = ['ggplot2', 'quartz', 'vox', 'fivethirtyeight', 'dark', 'latimes'] + + +class VegaTheme(object): + """Implementation of a builtin vega theme.""" + def __init__(self, theme): + self.theme = theme + + def __call__(self): + return {"usermeta": {"embedOptions": {"theme": self.theme}}, + "config": {"view": {"width": 400, "height": 300}, + "mark": {"tooltip": None}}} + + def __repr__(self): + return "VegaTheme({!r})".format(self.theme) + + # The entry point group that can be used by other packages to declare other # renderers that will be auto-detected. Explicit registration is also # allowed by the PluginRegistery API. @@ -14,4 +31,8 @@ "view": {"width": 400, "height": 300}, "mark": {"tooltip": None}}}) themes.register('none', lambda: {}) + +for theme in VEGA_THEMES: + themes.register(theme, VegaTheme(theme)) + themes.enable('default')
diff --git a/altair/vegalite/v3/tests/test_theme.py b/altair/vegalite/v3/tests/test_theme.py new file mode 100644 --- /dev/null +++ b/altair/vegalite/v3/tests/test_theme.py @@ -0,0 +1,17 @@ +import pytest + +import altair.vegalite.v3 as alt +from altair.vegalite.v3.theme import VEGA_THEMES + + [email protected] +def chart(): + return alt.Chart('data.csv').mark_bar().encode(x='x:Q') + +def test_vega_themes(chart): + for theme in VEGA_THEMES: + with alt.themes.enable(theme): + dct = chart.to_dict() + assert dct['usermeta'] == {'embedOptions': {'theme': theme}} + assert dct['config'] == {"view": {"width": 400, "height": 300}, + "mark": {"tooltip": None}}
Support built-in vega themes See [vega-themes](https://github.com/vega/vega-themes). Themes should be supported via the current theme infrastructure, maybe something like this: ```python alt.themes.enable('vega.themes.dark') ``` We'll have to think about how to best populate the list of available themes, and how to make this work cleanly with user-specified themes from within Altair.
Possibly this could be done via a pip-installable ``vega_themes`` package that uses entrypoints to define available themes... I just released vega3 0.11.0 with the latest Vega-Embed, which has support for themes. See https://github.com/vega/vega-embed#options I made a little demo at https://beta.observablehq.com/@domoritz/vega-themes-demo. The themes are definitely not tuned yet but having the infrastructure in place will be useful in the future and I hope that we get people to help with improving the themes. I just ported the LA Times theme to Altair so that I could use it in a conference presentation. https://github.com/AlgorexHealth/ACO-PUF-Analysis/blob/master/ACO%20Results.ipynb I could take a stab at this. **Some Options**: It does seem that having a pip installable "vega_themes" would be the way to go. 1. Could simply copy the themes from the typescript source into python dictionaries stored in source files. This is what I did for the LA times theme it took about 10 minutes for each theme. 2. Should be pretty easy to write some typescript that would consume the existing vega-themes source code and serialize all of the themes into JSON files that python could load and make available to Altair. I tried this quickly simply running `JSON.stringify` on one of the themes and this worked pretty well. ``` {"background":"#333","title":{"color":"#fff"},"style":{"guide-label":{"fill":"#fff"},"guide-title":{"fill":"#fff"}},"axis":{"domainColor":"#fff","gridColor":"#888","tickColor":"#fff"}} ``` Either @domoritz or @jakevdp might have a much better idea for consuming these so that we can allow all theme changes to be made in the existing repository and have altair just consume them or at the very least point to new version. As noted elsewhere (I can't find the reference now) it's also possible to use vega themes directly in Altair, by running e.g. ```python import altair as alt alt.renderers.set_embed_options(theme='latimes') ``` I prefer setting the theme in Vega-Embed so that users always get the latest version of the themes. Maybe Altair can have a convenience wrapper to support what @jakevdp showed above. I was just in the process of editing my comment to include that option. @jakevdp I will send up a PR to add that to the documentation. I stumbled on this github issue and didn't get that context so I assumed this wasn't possible. Unfortunately the mechanisms used by Altair themes and by Vega themes are entirely orthogonal... I've put a bit of thought into how they might be unified into a single user interface in Altair, but there's really no clean way to do it that I can see currently. The problem is that in Altair, themes are controlled via the chart spec, while in Vega-Lite, themes are controlled via javascript arguments the vega-embed library's interface. In my opinion, I think the latter should change: themes affect the appearance of the chart, and thus enabling or disabling them should be part of the chart specification. If Vega-Lite were to make that change (perhaps with a ``"config": "theme"`` setting) then the API for Altair and Vega themes could be unified. As a concrete example of why the current vega theme implementation is suboptimal, consider a world in which other means of rendering Vega-Lite specs are created (for example, you could imagine a matplotlib renderer for a vega-lite spec). You could pass your spec to the other renderer, but where do you pass the theme name? It's not part of the chart spec, so the answer is not obvious. Perhaps there could be some optional args to whatever python function does the matplotlib rendering, similar to how vega-embed takes optional args to control the theme. But at that point, we've admitted that Vega-Lite no longer provides a self-contained declarative representation of the chart we want to create. Ok, I'll leave it alone and if anyone finds this thread they will see the solution if they simply want to use a vega theme on render. @jakevdp I think we could add an annotation to Vega and Vega-Lite about what theme to load but Vega and Vega-Lite would by default ignore the annotation. Vega-Embed could then be able to read it and load the appropriate theme. How does that sound? I think that would be a useful addition. In fact, we could support this easily with `usermeta`. ```json { "$schema": "https://vega.github.io/schema/vega-lite/v3.json", "description": "A simple bar chart with embedded data.", "usermeta": { "embedOptions": { "theme": "dark" } }, "data": { "values": [ {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43}, {"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53}, {"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52} ] }, "mark": "bar", "encoding": { "x": {"field": "a", "type": "ordinal"}, "y": {"field": "b", "type": "quantitative"} } } ``` I could update Vega-Embed to look for `usermeta.embedOptions`. In that case on the Altair side, would it be as simple as adding something like this to vegalite/v3/theme.py and the others? ``` themes.register(‘latimes', lambda: {“usermeta": {“embedOptions": {“theme”:”latimes”}}} ``` > On May 15, 2019, at 12:47 PM, Dominik Moritz <[email protected]> wrote: > > In fact, we could support this easily with usermeta. > > { > "$schema": "https://vega.github.io/schema/vega-lite/v3.json", > "description": "A simple bar chart with embedded data.", > "usermeta": { > "embedOptions": { > "theme": "dark" > } > }, > "data": { > "values": [ > {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43}, > {"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53}, > {"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52} > ] > }, > "mark": "bar", > "encoding": { > "x": {"field": "a", "type": "ordinal"}, > "y": {"field": "b", "type": "quantitative"} > } > } > I could update Vega-Embed to look for usermeta.embedOptions. > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub <https://github.com/altair-viz/altair/issues/781?email_source=notifications&email_token=AE6I5MD4EONV63HDXOLMDG3PVQ5BNA5CNFSM4E4RYZI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVPIHZI#issuecomment-492733413>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AE6I5MB43EACCN6CGHKZC4DPVQ5BNANCNFSM4E4RYZIQ>. > > I think we could add an annotation to Vega and Vega-Lite about what theme to load but Vega and Vega-Lite would by default ignore the annotation. What is the rational for that? Wouldn't it be much easier if the theme choice is just part of the spec properly? > In fact, we could support this easily with usermeta I think I would prefer something less obscure, why not go with @jakevdp's suggestion of `"config": "theme"`? Update: Vega-Embed now supports `userMeta.embedOptions`. > What is the rational for that? Wouldn't it be much easier if the theme choice is just part of the spec properly? Themes are still developing and have not reached the maturity of Vega and Vega-Lite. You can always bake a theme into the spec as a config. Right now, Vega and Vega-Lite have no dependency on Vega-Themes and I think that's a good thing at this point. > I think I would prefer something less obscure, why not go with @jakevdp's suggestion of "config": "theme"? `usermeta` is already a supported property in Vega and Vega-Lite so I put it in there. `"config": "theme"` would require updates to Vega and Vega-Lite and also is less flexible compared to supporting all embed options. Awesome, thanks Dom! I'll put together a PR for enabling vega themes via the existing Altair themes settings.
2019-05-30T03:52:50Z
[]
[]
vega/altair
1,543
vega__altair-1543
[ "1541" ]
35a9127a099cdbbedfce6d9e7031b258e7a04ff8
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -453,7 +453,7 @@ def hash_schema(cls, schema, use_json=True): on recursive conversions of unhashable to hashable types; the former seems to be slightly faster in several benchmarks. """ - if cls._hash_exclude_keys: + if cls._hash_exclude_keys and isinstance(schema, dict): schema = {key: val for key, val in schema.items() if key not in cls._hash_exclude_keys} if use_json: diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -449,7 +449,7 @@ def hash_schema(cls, schema, use_json=True): on recursive conversions of unhashable to hashable types; the former seems to be slightly faster in several benchmarks. """ - if cls._hash_exclude_keys: + if cls._hash_exclude_keys and isinstance(schema, dict): schema = {key: val for key, val in schema.items() if key not in cls._hash_exclude_keys} if use_json:
diff --git a/altair/utils/tests/test_schemapi.py b/altair/utils/tests/test_schemapi.py --- a/altair/utils/tests/test_schemapi.py +++ b/altair/utils/tests/test_schemapi.py @@ -30,7 +30,8 @@ class MySchema(_TestSchema): 'b2': {'type': 'array', 'items': {'type': 'number'}}, 'c': {'type': ['string', 'number']}, 'd': {'anyOf': [{'$ref': '#/definitions/StringMapping'}, - {'$ref': '#/definitions/StringArray'}]} + {'$ref': '#/definitions/StringArray'}]}, + 'e': {'items': [{'type': 'string'}, {'type': 'string'}]} } } @@ -114,7 +115,7 @@ class InvalidProperties(_TestSchema): def test_construct_multifaceted_schema(): dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z']} + 'd': ['x', 'y', 'z'], 'e': ['a', 'b']} myschema = MySchema.from_dict(dct) assert myschema.to_dict() == dct @@ -256,7 +257,7 @@ def test_attribute_error(): def test_to_from_json(): dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z']} + 'd': ['x', 'y', 'z'], 'e': ['g', 'h']} json_str = MySchema.from_dict(dct).to_json() new_dct = MySchema.from_json(json_str).to_dict() diff --git a/tools/schemapi/tests/test_schemapi.py b/tools/schemapi/tests/test_schemapi.py --- a/tools/schemapi/tests/test_schemapi.py +++ b/tools/schemapi/tests/test_schemapi.py @@ -26,7 +26,8 @@ class MySchema(_TestSchema): 'b2': {'type': 'array', 'items': {'type': 'number'}}, 'c': {'type': ['string', 'number']}, 'd': {'anyOf': [{'$ref': '#/definitions/StringMapping'}, - {'$ref': '#/definitions/StringArray'}]} + {'$ref': '#/definitions/StringArray'}]}, + 'e': {'items': [{'type': 'string'}, {'type': 'string'}]} } } @@ -110,7 +111,7 @@ class InvalidProperties(_TestSchema): def test_construct_multifaceted_schema(): dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z']} + 'd': ['x', 'y', 'z'], 'e': ['a', 'b']} myschema = MySchema.from_dict(dct) assert myschema.to_dict() == dct @@ -252,7 +253,7 @@ def test_attribute_error(): def test_to_from_json(): dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z']} + 'd': ['x', 'y', 'z'], 'e': ['g', 'h']} json_str = MySchema.from_dict(dct).to_json() new_dct = MySchema.from_json(json_str).to_dict()
BUG: deserialization of objects containing lists can lead to errors I've only been able to make this happen with the fold transform: ```python chart = alt.Chart('data.txt').mark_point().transform_fold( ['y1', 'y2'], as_=['key', 'value'] ) dct = chart.to_dict() alt.Chart.from_dict(dct) ``` ```pytb --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-3-c02fc13e6329> in <module>() 6 dct = chart.to_dict() 7 ----> 8 alt.Chart.from_dict(dct) /usr/local/lib/python3.6/dist-packages/altair/vegalite/v3/api.py in from_dict(cls, dct, validate) 1520 # First try from_dict for the Chart type 1521 try: -> 1522 return super(Chart, cls).from_dict(dct, validate=validate) 1523 except jsonschema.ValidationError: 1524 pass /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in from_dict(cls, dct, validate, _wrapper_classes) 339 converter = _FromDict(_wrapper_classes) 340 return converter.from_dict(constructor=cls, root=cls, --> 341 schema=cls._schema, dct=dct) 342 343 @classmethod /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in from_dict(self, constructor, root, schema, dct) 492 if key in props: 493 prop_constructor, prop_schema = _get_constructor(props[key]) --> 494 val = self.from_dict(prop_constructor, root, prop_schema, val) 495 kwds[key] = val 496 return constructor(**kwds) /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in from_dict(self, constructor, root, schema, dct) 504 item_constructor = self._passthrough 505 dct = [self.from_dict(item_constructor, root, item_schema, val) --> 506 for val in dct] 507 return constructor(dct) 508 else: /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in <listcomp>(.0) 504 item_constructor = self._passthrough 505 dct = [self.from_dict(item_constructor, root, item_schema, val) --> 506 for val in dct] 507 return constructor(dct) 508 else: /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in from_dict(self, constructor, root, schema, dct) 483 continue 484 else: --> 485 return self.from_dict(this_constructor, root, this_schema, dct) 486 487 if isinstance(dct, dict): /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in from_dict(self, constructor, root, schema, dct) 492 if key in props: 493 prop_constructor, prop_schema = _get_constructor(props[key]) --> 494 val = self.from_dict(prop_constructor, root, prop_schema, val) 495 kwds[key] = val 496 return constructor(**kwds) /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in from_dict(self, constructor, root, schema, dct) 499 if 'items' in schema: 500 item_schema = schema['items'] --> 501 item_constructor, item_schema = _get_constructor(item_schema) 502 else: 503 item_schema = {} /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in _get_constructor(schema) 468 def _get_constructor(schema): 469 # TODO: do something more than simply selecting the last match? --> 470 hash_ = self.hash_schema(schema) 471 matches = self.class_dict[hash_] 472 constructor = matches[-1] if matches else self._passthrough /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in hash_schema(cls, schema, use_json) 432 """ 433 if cls._hash_exclude_keys: --> 434 schema = {key: val for key, val in schema.items() 435 if key not in cls._hash_exclude_keys} 436 if use_json: AttributeError: 'list' object has no attribute 'items' ```
Simpler reproduction: ```python alt.FoldTransform.from_dict({'fold': ['a', 'b'], 'as': ['key', 'value']}) ```
2019-05-31T14:42:32Z
[]
[]
vega/altair
1,587
vega__altair-1587
[ "1586" ]
d9e2d60c61945fc3bb0f59dbb962e320bdca9fda
diff --git a/altair/vegalite/v2/schema/channels.py b/altair/vegalite/v2/schema/channels.py --- a/altair/vegalite/v2/schema/channels.py +++ b/altair/vegalite/v2/schema/channels.py @@ -24,7 +24,7 @@ def to_dict(self, validate=True, ignore=(), context=None): # If given a list of shorthands, then transform it to a list of classes kwds = self._kwds.copy() kwds.pop('shorthand') - return [self.__class__(shorthand, **kwds).to_dict() + return [self.__class__(shorthand, **kwds).to_dict(validate=validate, ignore=ignore, context=context) for shorthand in self.shorthand] elif isinstance(self.shorthand, six.string_types): kwds = parse_shorthand(self.shorthand, data=context.get('data', None)) diff --git a/altair/vegalite/v3/schema/channels.py b/altair/vegalite/v3/schema/channels.py --- a/altair/vegalite/v3/schema/channels.py +++ b/altair/vegalite/v3/schema/channels.py @@ -24,7 +24,7 @@ def to_dict(self, validate=True, ignore=(), context=None): # If given a list of shorthands, then transform it to a list of classes kwds = self._kwds.copy() kwds.pop('shorthand') - return [self.__class__(shorthand, **kwds).to_dict() + return [self.__class__(shorthand, **kwds).to_dict(validate=validate, ignore=ignore, context=context) for shorthand in self.shorthand] elif isinstance(self.shorthand, six.string_types): kwds = parse_shorthand(self.shorthand, data=context.get('data', None)) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -88,7 +88,7 @@ def to_dict(self, validate=True, ignore=(), context=None): # If given a list of shorthands, then transform it to a list of classes kwds = self._kwds.copy() kwds.pop('shorthand') - return [self.__class__(shorthand, **kwds).to_dict() + return [self.__class__(shorthand, **kwds).to_dict(validate=validate, ignore=ignore, context=context) for shorthand in self.shorthand] elif isinstance(self.shorthand, six.string_types): kwds = parse_shorthand(self.shorthand, data=context.get('data', None))
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -19,6 +19,10 @@ selenium = None +def getargs(*args, **kwargs): + return args, kwargs + + OP_DICT = { 'layer': operator.add, 'hconcat': operator.or_, @@ -111,28 +115,27 @@ def _check_encodings(chart): assert dct['encoding']['y']['type'] == 'ordinal' -def test_multiple_encodings(): [email protected]('args, kwargs', [ + getargs(detail=['value:Q', 'name:N'], tooltip=['value:Q', 'name:N']), + getargs(detail=['value', 'name'], tooltip=['value', 'name']), + getargs(alt.Detail(['value:Q', 'name:N']), alt.Tooltip(['value:Q', 'name:N'])), + getargs(alt.Detail(['value', 'name']), alt.Tooltip(['value', 'name'])), + getargs([alt.Detail('value:Q'), alt.Detail('name:N')], + [alt.Tooltip('value:Q'), alt.Tooltip('name:N')]), + getargs([alt.Detail('value'), alt.Detail('name')], + [alt.Tooltip('value'), alt.Tooltip('name')]), +]) +def test_multiple_encodings(args, kwargs): + df = pd.DataFrame({ + 'value': [1, 2, 3], + 'name': ['A', 'B', 'C'], + }) encoding_dct = [{'field': 'value', 'type': 'quantitative'}, {'field': 'name', 'type': 'nominal'}] - chart1 = alt.Chart('data.csv').mark_point().encode( - detail=['value:Q', 'name:N'], - tooltip=['value:Q', 'name:N'] - ) - - chart2 = alt.Chart('data.csv').mark_point().encode( - alt.Detail(['value:Q', 'name:N']), - alt.Tooltip(['value:Q', 'name:N']) - ) - - chart3 = alt.Chart('data.csv').mark_point().encode( - [alt.Detail('value:Q'), alt.Detail('name:N')], - [alt.Tooltip('value:Q'), alt.Tooltip('name:N')] - ) - - for chart in [chart1, chart2, chart3]: - dct = chart.to_dict() - assert dct['encoding']['detail'] == encoding_dct - assert dct['encoding']['tooltip'] == encoding_dct + chart = alt.Chart(df).mark_point().encode(*args, **kwargs) + dct = chart.to_dict() + assert dct['encoding']['detail'] == encoding_dct + assert dct['encoding']['tooltip'] == encoding_dct def test_chart_operations():
alt.Tooltip not behaving the same way as not specifying the object Excuse the weird title but I am not sure how to properly phrase the issue. This is on Altair 3.1. Let's take the following example code from another issue: ``` from vega_datasets import data df=data.barley() base = alt.Chart(df).transform_joinaggregate( yield_sum='sum(yield)', groupby=['year', 'variety'] ).transform_calculate( yield_norm='datum.yield / datum.yield_sum' ).mark_bar().encode( x=alt.X('yield', stack='normalize', axis=alt.Axis(title='Normalized Yield', format='.0%')), y=alt.Y('variety', title='Variety'), tooltip=['yield', 'variety', 'year', 'yield_norm:Q'], order='site' ) bars = base.encode( detail='site', color=alt.Color('site', title='Site') ) text = base.mark_text(dx=-15, dy=3).encode( text=alt.Text('yield_norm:Q', format='.0%'), ) alt.layer(bars, text).facet(column=alt.Column('year:O', title='Year')) ``` This works fine. However changing the tooltip line to `tooltip=alt.Tooltip(['yield', 'variety', 'year', 'yield_norm:Q'])` will throw the following error: > ValueError: yield encoding field is specified without a type; the type cannot be automatically inferred because the data is not specified as a pandas.DataFrame. Should the two ways of specifying the tooltip not work interchangeably? Or is it maybe related to this issue #1573?
Yes, the type should propagate similarly in each case. I suspect internally the ``context`` argument is not being properly propagated in this case. #1587 should fix this
2019-07-01T16:16:41Z
[]
[]
vega/altair
1,597
vega__altair-1597
[ "1573" ]
f4eb754ea4ab324842fdacf5c4461716e65c3977
diff --git a/altair/utils/__init__.py b/altair/utils/__init__.py --- a/altair/utils/__init__.py +++ b/altair/utils/__init__.py @@ -1,5 +1,6 @@ from .core import ( infer_vegalite_type, + infer_encoding_types, sanitize_dataframe, parse_shorthand, use_signature, @@ -16,6 +17,7 @@ __all__ = ( 'infer_vegalite_type', + 'infer_encoding_types', 'sanitize_dataframe', 'spec_to_html', 'parse_shorthand', diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -9,6 +9,7 @@ import traceback import warnings +import jsonschema import six import pandas as pd import numpy as np @@ -406,3 +407,86 @@ def display_traceback(in_ipython=True): ip.showtraceback(exc_info) else: traceback.print_exception(*exc_info) + + +def infer_encoding_types(args, kwargs, channels): + """Infer typed keyword arguments for args and kwargs + + Parameters + ---------- + args : tuple + List of function args + kwargs : dict + Dict of function kwargs + channels : module + The module containing all altair encoding channel classes. + + Returns + ------- + kwargs : dict + All args and kwargs in a single dict, with keys and types + based on the channels mapping. + """ + # Construct a dictionary of channel type to encoding name + # TODO: cache this somehow? + channel_objs = (getattr(channels, name) for name in dir(channels)) + channel_objs = (c for c in channel_objs + if isinstance(c, type) and issubclass(c, SchemaBase)) + channel_to_name = {c: c._encoding_name for c in channel_objs} + name_to_channel = {} + for chan, name in channel_to_name.items(): + chans = name_to_channel.setdefault(name, {}) + key = 'value' if chan.__name__.endswith('Value') else 'field' + chans[key] = chan + + # First use the mapping to convert args to kwargs based on their types. + for arg in args: + if isinstance(arg, (list, tuple)) and len(arg) > 0: + type_ = type(arg[0]) + else: + type_ = type(arg) + + encoding = channel_to_name.get(type_, None) + if encoding is None: + raise NotImplementedError("positional of type {}" + "".format(type_)) + if encoding in kwargs: + raise ValueError("encoding {} specified twice.".format(encoding)) + kwargs[encoding] = arg + + def _wrap_in_channel_class(obj, encoding): + try: + condition = obj['condition'] + except (KeyError, TypeError): + pass + else: + if condition is not Undefined: + obj = obj.copy() + obj['condition'] = _wrap_in_channel_class(condition, encoding) + + if isinstance(obj, SchemaBase): + return obj + + if isinstance(obj, six.string_types): + obj = {'shorthand': obj} + + if isinstance(obj, (list, tuple)): + return [_wrap_in_channel_class(subobj, encoding) for subobj in obj] + + if encoding not in name_to_channel: + warnings.warn("Unrecognized encoding channel '{}'".format(encoding)) + return obj + + classes = name_to_channel[encoding] + cls = classes['value'] if 'value' in obj else classes['field'] + + try: + # Don't force validation here; some objects won't be valid until + # they're created in the context of a chart. + return cls.from_dict(obj, validate=False) + except jsonschema.ValidationError: + # our attempts at finding the correct class have failed + return obj + + return {encoding: _wrap_in_channel_class(obj, encoding) + for encoding, obj in kwargs.items()} diff --git a/altair/vegalite/v2/api.py b/altair/vegalite/v2/api.py --- a/altair/vegalite/v2/api.py +++ b/altair/vegalite/v2/api.py @@ -1198,72 +1198,13 @@ def serve(self, ip='127.0.0.1', port=8888, n_retries=50, files=None, class EncodingMixin(object): @utils.use_signature(core.EncodingWithFacet) def encode(self, *args, **kwargs): - # First convert args to kwargs by inferring the class from the argument - if args: - channels_mapping = _get_channels_mapping() - for arg in args: - if isinstance(arg, (list, tuple)) and len(arg) > 0: - type_ = type(arg[0]) - else: - type_ = type(arg) - - encoding = channels_mapping.get(type_, None) - if encoding is None: - raise NotImplementedError("non-keyword arg of type {}" - "".format(type(arg))) - if encoding in kwargs: - raise ValueError("encode: encoding {} specified twice" - "".format(encoding)) - kwargs[encoding] = arg - - def _wrap_in_channel_class(obj, prop): - clsname = prop.title() - - if isinstance(obj, core.SchemaBase): - return obj - - if isinstance(obj, six.string_types): - obj = {'shorthand': obj} - - if isinstance(obj, (list, tuple)): - return [_wrap_in_channel_class(subobj, prop) for subobj in obj] - - if 'value' in obj: - clsname += 'Value' - - try: - cls = getattr(channels, clsname) - except AttributeError: - raise ValueError("Unrecognized encoding channel '{}'".format(prop)) - - try: - # Don't force validation here; some objects won't be valid until - # they're created in the context of a chart. - return cls.from_dict(obj, validate=False) - except jsonschema.ValidationError: - # our attempts at finding the correct class have failed - return obj - - for prop, obj in list(kwargs.items()): - try: - condition = obj['condition'] - except (KeyError, TypeError): - pass - else: - if condition is not Undefined: - obj['condition'] = _wrap_in_channel_class(condition, prop) - kwargs[prop] = _wrap_in_channel_class(obj, prop) - - - copy = self.copy(deep=True, ignore=['data']) + # Convert args to kwargs based on their types. + kwargs = utils.infer_encoding_types(args, kwargs, channels) # get a copy of the dict representation of the previous encoding - encoding = copy.encoding - if encoding is Undefined: - encoding = {} - elif isinstance(encoding, dict): - pass - else: + copy = self.copy(deep=['encoding']) + encoding = copy._get('encoding', {}) + if isinstance(encoding, core.VegaLiteSchema): encoding = {k: v for k, v in encoding._kwds.items() if v is not Undefined} diff --git a/altair/vegalite/v2/schema/channels.py b/altair/vegalite/v2/schema/channels.py --- a/altair/vegalite/v2/schema/channels.py +++ b/altair/vegalite/v2/schema/channels.py @@ -197,6 +197,7 @@ class Color(FieldChannelMixin, core.MarkPropFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "color" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -222,6 +223,7 @@ class ColorValue(ValueChannelMixin, core.MarkPropValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "color" def __init__(self, value, condition=Undefined, **kwds): super(ColorValue, self).__init__(value=value, condition=condition, **kwds) @@ -324,6 +326,7 @@ class Column(FieldChannelMixin, core.FacetFieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "column" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, @@ -403,6 +406,7 @@ class Detail(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "detail" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -528,6 +532,7 @@ class Fill(FieldChannelMixin, core.MarkPropFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "fill" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -553,6 +558,7 @@ class FillValue(ValueChannelMixin, core.MarkPropValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "fill" def __init__(self, value, condition=Undefined, **kwds): super(FillValue, self).__init__(value=value, condition=condition, **kwds) @@ -634,6 +640,7 @@ class Href(FieldChannelMixin, core.FieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "href" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -658,6 +665,7 @@ class HrefValue(ValueChannelMixin, core.ValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "href" def __init__(self, value, condition=Undefined, **kwds): super(HrefValue, self).__init__(value=value, condition=condition, **kwds) @@ -733,6 +741,7 @@ class Key(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "key" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -810,6 +819,7 @@ class Latitude(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "latitude" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -887,6 +897,7 @@ class Latitude2(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "latitude2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -964,6 +975,7 @@ class Longitude(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "longitude" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -1041,6 +1053,7 @@ class Longitude2(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "longitude2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -1166,6 +1179,7 @@ class Opacity(FieldChannelMixin, core.MarkPropFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "opacity" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -1191,6 +1205,7 @@ class OpacityValue(ValueChannelMixin, core.MarkPropValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "opacity" def __init__(self, value, condition=Undefined, **kwds): super(OpacityValue, self).__init__(value=value, condition=condition, **kwds) @@ -1267,6 +1282,7 @@ class Order(FieldChannelMixin, core.OrderFieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "order" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -1288,6 +1304,7 @@ class OrderValue(ValueChannelMixin, core.ValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "order" def __init__(self, value, **kwds): super(OrderValue, self).__init__(value=value, **kwds) @@ -1390,6 +1407,7 @@ class Row(FieldChannelMixin, core.FacetFieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "row" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, @@ -1517,6 +1535,7 @@ class Shape(FieldChannelMixin, core.MarkPropFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "shape" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -1542,6 +1561,7 @@ class ShapeValue(ValueChannelMixin, core.MarkPropValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "shape" def __init__(self, value, condition=Undefined, **kwds): super(ShapeValue, self).__init__(value=value, condition=condition, **kwds) @@ -1665,6 +1685,7 @@ class Size(FieldChannelMixin, core.MarkPropFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "size" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -1690,6 +1711,7 @@ class SizeValue(ValueChannelMixin, core.MarkPropValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "size" def __init__(self, value, condition=Undefined, **kwds): super(SizeValue, self).__init__(value=value, condition=condition, **kwds) @@ -1813,6 +1835,7 @@ class Stroke(FieldChannelMixin, core.MarkPropFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "stroke" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -1838,6 +1861,7 @@ class StrokeValue(ValueChannelMixin, core.MarkPropValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "stroke" def __init__(self, value, condition=Undefined, **kwds): super(StrokeValue, self).__init__(value=value, condition=condition, **kwds) @@ -1922,6 +1946,7 @@ class Text(FieldChannelMixin, core.TextFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "text" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, format=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, @@ -1947,6 +1972,7 @@ class TextValue(ValueChannelMixin, core.TextValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "text" def __init__(self, value, condition=Undefined, **kwds): super(TextValue, self).__init__(value=value, condition=condition, **kwds) @@ -2031,6 +2057,7 @@ class Tooltip(FieldChannelMixin, core.TextFieldDefWithCondition): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "tooltip" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, format=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, @@ -2056,6 +2083,7 @@ class TooltipValue(ValueChannelMixin, core.TextValueDefWithCondition): A constant value in visual domain. """ _class_is_valid_at_instantiation = False + _encoding_name = "tooltip" def __init__(self, value, condition=Undefined, **kwds): super(TooltipValue, self).__init__(value=value, condition=condition, **kwds) @@ -2199,6 +2227,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "x" def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bin=Undefined, field=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, @@ -2222,6 +2251,7 @@ class XValue(ValueChannelMixin, core.ValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "x" def __init__(self, value, **kwds): super(XValue, self).__init__(value=value, **kwds) @@ -2297,6 +2327,7 @@ class X2(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "x2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -2318,6 +2349,7 @@ class X2Value(ValueChannelMixin, core.ValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "x2" def __init__(self, value, **kwds): super(X2Value, self).__init__(value=value, **kwds) @@ -2461,6 +2493,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "y" def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bin=Undefined, field=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, @@ -2484,6 +2517,7 @@ class YValue(ValueChannelMixin, core.ValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "y" def __init__(self, value, **kwds): super(YValue, self).__init__(value=value, **kwds) @@ -2559,6 +2593,7 @@ class Y2(FieldChannelMixin, core.FieldDef): <https://vega.github.io/vega-lite/docs/geoshape.html>`__. """ _class_is_valid_at_instantiation = False + _encoding_name = "y2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -2580,6 +2615,7 @@ class Y2Value(ValueChannelMixin, core.ValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "y2" def __init__(self, value, **kwds): super(Y2Value, self).__init__(value=value, **kwds) diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -1389,66 +1389,11 @@ def serve(self, ip='127.0.0.1', port=8888, n_retries=50, files=None, class EncodingMixin(object): @utils.use_signature(core.FacetedEncoding) def encode(self, *args, **kwargs): - # First convert args to kwargs by inferring the class from the argument - if args: - channels_mapping = _get_channels_mapping() - for arg in args: - if isinstance(arg, (list, tuple)) and len(arg) > 0: - type_ = type(arg[0]) - else: - type_ = type(arg) - - encoding = channels_mapping.get(type_, None) - if encoding is None: - raise NotImplementedError("non-keyword arg of type {}" - "".format(type(arg))) - if encoding in kwargs: - raise ValueError("encode: encoding {} specified twice" - "".format(encoding)) - kwargs[encoding] = arg - - def _wrap_in_channel_class(obj, prop): - clsname = prop.title() - - if isinstance(obj, core.SchemaBase): - return obj - - if isinstance(obj, six.string_types): - obj = {'shorthand': obj} - - if isinstance(obj, (list, tuple)): - return [_wrap_in_channel_class(subobj, prop) for subobj in obj] - - if 'value' in obj: - clsname += 'Value' - - try: - cls = getattr(channels, clsname) - except AttributeError: - raise ValueError("Unrecognized encoding channel '{}'".format(prop)) - - try: - # Don't force validation here; some objects won't be valid until - # they're created in the context of a chart. - return cls.from_dict(obj, validate=False) - except jsonschema.ValidationError: - # our attempts at finding the correct class have failed - return obj - - for prop, obj in list(kwargs.items()): - try: - condition = obj['condition'] - except (KeyError, TypeError): - pass - else: - if condition is not Undefined: - obj['condition'] = _wrap_in_channel_class(condition, prop) - if obj is not None: - kwargs[prop] = _wrap_in_channel_class(obj, prop) - - copy = self.copy(deep=['encoding']) + # Convert args to kwargs based on their types. + kwargs = utils.infer_encoding_types(args, kwargs, channels) # get a copy of the dict representation of the previous encoding + copy = self.copy(deep=['encoding']) encoding = copy._get('encoding', {}) if isinstance(encoding, core.VegaLiteSchema): encoding = {k: v for k, v in encoding._kwds.items() diff --git a/altair/vegalite/v3/schema/channels.py b/altair/vegalite/v3/schema/channels.py --- a/altair/vegalite/v3/schema/channels.py +++ b/altair/vegalite/v3/schema/channels.py @@ -243,6 +243,7 @@ class Color(FieldChannelMixin, core.StringFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "color" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -261,6 +262,7 @@ class ColorValue(ValueChannelMixin, core.StringValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "color" def __init__(self, value, **kwds): super(ColorValue, self).__init__(value=value, **kwds) @@ -403,6 +405,7 @@ class Column(FieldChannelMixin, core.FacetFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "column" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, @@ -522,6 +525,7 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "detail" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -666,6 +670,7 @@ class Facet(FieldChannelMixin, core.FacetFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "facet" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, @@ -839,6 +844,7 @@ class Fill(FieldChannelMixin, core.StringFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "fill" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -857,6 +863,7 @@ class FillValue(ValueChannelMixin, core.StringValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "fill" def __init__(self, value, **kwds): super(FillValue, self).__init__(value=value, **kwds) @@ -1026,6 +1033,7 @@ class FillOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "fillOpacity" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -1044,6 +1052,7 @@ class FillOpacityValue(ValueChannelMixin, core.NumericValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "fillOpacity" def __init__(self, value, **kwds): super(FillOpacityValue, self).__init__(value=value, **kwds) @@ -1193,6 +1202,7 @@ class Href(FieldChannelMixin, core.TextFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "href" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, @@ -1212,6 +1222,7 @@ class HrefValue(ValueChannelMixin, core.TextValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "href" def __init__(self, value, **kwds): super(HrefValue, self).__init__(value=value, **kwds) @@ -1327,6 +1338,7 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "key" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -1443,6 +1455,7 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "latitude" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -1464,6 +1477,7 @@ class LatitudeValue(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "latitude" def __init__(self, value, **kwds): super(LatitudeValue, self).__init__(value=value, **kwds) @@ -1547,6 +1561,7 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "latitude2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -1568,6 +1583,7 @@ class Latitude2Value(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "latitude2" def __init__(self, value, **kwds): super(Latitude2Value, self).__init__(value=value, **kwds) @@ -1682,6 +1698,7 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "longitude" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -1703,6 +1720,7 @@ class LongitudeValue(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "longitude" def __init__(self, value, **kwds): super(LongitudeValue, self).__init__(value=value, **kwds) @@ -1786,6 +1804,7 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "longitude2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -1807,6 +1826,7 @@ class Longitude2Value(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "longitude2" def __init__(self, value, **kwds): super(Longitude2Value, self).__init__(value=value, **kwds) @@ -1976,6 +1996,7 @@ class Opacity(FieldChannelMixin, core.NumericFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "opacity" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -1994,6 +2015,7 @@ class OpacityValue(ValueChannelMixin, core.NumericValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "opacity" def __init__(self, value, **kwds): super(OpacityValue, self).__init__(value=value, **kwds) @@ -2110,6 +2132,7 @@ class Order(FieldChannelMixin, core.OrderFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "order" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): @@ -2131,6 +2154,7 @@ class OrderValue(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "order" def __init__(self, value, **kwds): super(OrderValue, self).__init__(value=value, **kwds) @@ -2273,6 +2297,7 @@ class Row(FieldChannelMixin, core.FacetFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "row" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, @@ -2446,6 +2471,7 @@ class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "shape" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -2464,6 +2490,7 @@ class ShapeValue(ValueChannelMixin, core.ShapeValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "shape" def __init__(self, value, **kwds): super(ShapeValue, self).__init__(value=value, **kwds) @@ -2633,6 +2660,7 @@ class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "size" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -2651,6 +2679,7 @@ class SizeValue(ValueChannelMixin, core.NumericValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "size" def __init__(self, value, **kwds): super(SizeValue, self).__init__(value=value, **kwds) @@ -2820,6 +2849,7 @@ class Stroke(FieldChannelMixin, core.StringFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "stroke" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -2838,6 +2868,7 @@ class StrokeValue(ValueChannelMixin, core.StringValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "stroke" def __init__(self, value, **kwds): super(StrokeValue, self).__init__(value=value, **kwds) @@ -3007,6 +3038,7 @@ class StrokeOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -3026,6 +3058,7 @@ class StrokeOpacityValue(ValueChannelMixin, core.NumericValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" def __init__(self, value, **kwds): super(StrokeOpacityValue, self).__init__(value=value, **kwds) @@ -3195,6 +3228,7 @@ class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "strokeWidth" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -3213,6 +3247,7 @@ class StrokeWidthValue(ValueChannelMixin, core.NumericValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "strokeWidth" def __init__(self, value, **kwds): super(StrokeWidthValue, self).__init__(value=value, **kwds) @@ -3362,6 +3397,7 @@ class Text(FieldChannelMixin, core.TextFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "text" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, @@ -3381,6 +3417,7 @@ class TextValue(ValueChannelMixin, core.TextValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "text" def __init__(self, value, **kwds): super(TextValue, self).__init__(value=value, **kwds) @@ -3530,6 +3567,7 @@ class Tooltip(FieldChannelMixin, core.TextFieldDefWithCondition): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "tooltip" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, @@ -3549,6 +3587,7 @@ class TooltipValue(ValueChannelMixin, core.TextValueDefWithCondition): optional. """ _class_is_valid_at_instantiation = False + _encoding_name = "tooltip" def __init__(self, value, **kwds): super(TooltipValue, self).__init__(value=value, **kwds) @@ -3743,6 +3782,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "x" def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bin=Undefined, field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, @@ -3766,6 +3806,7 @@ class XValue(ValueChannelMixin, core.XValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "x" def __init__(self, value, **kwds): super(XValue, self).__init__(value=value, **kwds) @@ -3849,6 +3890,7 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "x2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -3870,6 +3912,7 @@ class X2Value(ValueChannelMixin, core.XValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "x2" def __init__(self, value, **kwds): super(X2Value, self).__init__(value=value, **kwds) @@ -3953,6 +3996,7 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "xError" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -3974,6 +4018,7 @@ class XErrorValue(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "xError" def __init__(self, value, **kwds): super(XErrorValue, self).__init__(value=value, **kwds) @@ -4057,6 +4102,7 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "xError2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -4078,6 +4124,7 @@ class XError2Value(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "xError2" def __init__(self, value, **kwds): super(XError2Value, self).__init__(value=value, **kwds) @@ -4272,6 +4319,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): ``x``, ``y`` ). """ _class_is_valid_at_instantiation = False + _encoding_name = "y" def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bin=Undefined, field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, @@ -4295,6 +4343,7 @@ class YValue(ValueChannelMixin, core.YValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "y" def __init__(self, value, **kwds): super(YValue, self).__init__(value=value, **kwds) @@ -4378,6 +4427,7 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "y2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -4399,6 +4449,7 @@ class Y2Value(ValueChannelMixin, core.YValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "y2" def __init__(self, value, **kwds): super(Y2Value, self).__init__(value=value, **kwds) @@ -4482,6 +4533,7 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "yError" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -4503,6 +4555,7 @@ class YErrorValue(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "yError" def __init__(self, value, **kwds): super(YErrorValue, self).__init__(value=value, **kwds) @@ -4586,6 +4639,7 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False + _encoding_name = "yError2" def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): @@ -4607,6 +4661,7 @@ class YError2Value(ValueChannelMixin, core.NumberValueDef): between ``0`` to ``1`` for opacity). """ _class_is_valid_at_instantiation = False + _encoding_name = "yError2" def __init__(self, value, **kwds): super(YError2Value, self).__init__(value=value, **kwds) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -148,6 +148,7 @@ class FieldSchemaGenerator(SchemaGenerator): class {classname}(FieldChannelMixin, core.{basename}): """{docstring}""" _class_is_valid_at_instantiation = False + _encoding_name = "{encodingname}" {init_code} ''') @@ -158,6 +159,7 @@ class ValueSchemaGenerator(SchemaGenerator): class {classname}(ValueChannelMixin, core.{basename}): """{docstring}""" _class_is_valid_at_instantiation = False + _encoding_name = "{encodingname}" {init_code} ''') @@ -320,6 +322,7 @@ def generate_vegalite_channel_wrappers(schemafile, version, imports=None): gen = Generator(classname=classname, basename=basename, schema=defschema, rootschema=schema, + encodingname=prop, nodefault=nodefault) contents.append(gen.schema_class()) return '\n'.join(contents) diff --git a/tools/schemapi/codegen.py b/tools/schemapi/codegen.py --- a/tools/schemapi/codegen.py +++ b/tools/schemapi/codegen.py @@ -75,6 +75,8 @@ class SchemaGenerator(object): rootschemarepr : CodeSnippet or object, optional An object whose repr will be used in the place of the explicit root schema. + **kwargs : dict + Additional keywords for derived classes. """ schema_class_template = textwrap.dedent(''' class {classname}({basename}): @@ -95,7 +97,7 @@ def _process_description(self, description): def __init__(self, classname, schema, rootschema=None, basename='SchemaBase', schemarepr=None, rootschemarepr=None, - nodefault=()): + nodefault=(), **kwargs): self.classname = classname self.schema = schema self.rootschema = rootschema @@ -103,6 +105,7 @@ def __init__(self, classname, schema, rootschema=None, self.schemarepr = schemarepr self.rootschemarepr = rootschemarepr self.nodefault = nodefault + self.kwargs = kwargs def schema_class(self): """Generate code for a schema class""" @@ -120,7 +123,8 @@ def schema_class(self): schema=schemarepr, rootschema=rootschemarepr, docstring=self.docstring(indent=4), - init_code=self.init_code(indent=4) + init_code=self.init_code(indent=4), + **self.kwargs ) def docstring(self, indent=0):
diff --git a/altair/utils/tests/test_core.py b/altair/utils/tests/test_core.py --- a/altair/utils/tests/test_core.py +++ b/altair/utils/tests/test_core.py @@ -1,7 +1,58 @@ +import types + import pandas as pd +import pytest import altair as alt -from .. import parse_shorthand, update_nested +from .. import parse_shorthand, update_nested, infer_encoding_types + +FAKE_CHANNELS_MODULE = ''' +"""Fake channels module for utility tests.""" + +from altair.utils import schemapi + + +class FieldChannel(object): + def __init__(self, shorthand, **kwargs): + kwargs['shorthand'] = shorthand + return super(FieldChannel, self).__init__(**kwargs) + + +class ValueChannel(object): + def __init__(self, value, **kwargs): + kwargs['value'] = value + return super(ValueChannel, self).__init__(**kwargs) + + +class X(FieldChannel, schemapi.SchemaBase): + _schema = {} + _encoding_name = "x" + + +class XValue(ValueChannel, schemapi.SchemaBase): + _schema = {} + _encoding_name = "x" + + +class Y(FieldChannel, schemapi.SchemaBase): + _schema = {} + _encoding_name = "y" + + +class YValue(ValueChannel, schemapi.SchemaBase): + _schema = {} + _encoding_name = "y" + + +class StrokeWidth(FieldChannel, schemapi.SchemaBase): + _schema = {} + _encoding_name = "strokeWidth" + + +class StrokeWidthValue(ValueChannel, schemapi.SchemaBase): + _schema = {} + _encoding_name = "strokeWidth" +''' def test_parse_shorthand(): @@ -124,3 +175,53 @@ def test_update_nested(): output2 = update_nested(original, update) assert output2 is original assert output == output2 + + [email protected] +def channels(): + channels = types.ModuleType('channels') + exec(FAKE_CHANNELS_MODULE, channels.__dict__) + return channels + + +def _getargs(*args, **kwargs): + return args, kwargs + + +def test_infer_encoding_types(channels): + expected = dict(x=channels.X('xval'), + y=channels.YValue('yval'), + strokeWidth=channels.StrokeWidthValue(value=4)) + + # All positional args + args, kwds = _getargs(channels.X('xval'), + channels.YValue('yval'), + channels.StrokeWidthValue(4)) + assert infer_encoding_types(args, kwds, channels) == expected + + # All keyword args + args, kwds = _getargs(x='xval', + y=alt.value('yval'), + strokeWidth=alt.value(4)) + assert infer_encoding_types(args, kwds, channels) == expected + + # Mixed positional & keyword + args, kwds = _getargs(channels.X('xval'), + channels.YValue('yval'), + strokeWidth=alt.value(4)) + assert infer_encoding_types(args, kwds, channels) == expected + + +def test_infer_encoding_types_with_condition(channels): + args, kwds = _getargs( + x=alt.condition('pred1', alt.value(1), alt.value(2)), + y=alt.condition('pred2', alt.value(1), 'yval'), + strokeWidth=alt.condition('pred3', 'sval', alt.value(2)) + ) + expected = dict( + x=channels.XValue(2, condition=channels.XValue(1, test='pred1')), + y=channels.Y('yval', condition=channels.YValue(1, test='pred2')), + strokeWidth=channels.StrokeWidthValue(2, + condition=channels.StrokeWidth('sval', test='pred3')) + ) + assert infer_encoding_types(args, kwds, channels) == expected
Some new V3 encodings not properly handled This fails: ```python alt.Chart('data.txt').mark_point().encode( strokeOpacity='x:Q' ) ``` Where it should do the same as this: ```python alt.Chart('data.txt').mark_point().encode( strokeOpacity=alt.StrokeOpacity('x:Q') ) ``` The issue is that this line is not correct for the new camel case encodings introduced in v3: https://github.com/altair-viz/altair/blob/d7a774a00dfb872ba02041a66ea8c2239a0ea0a1/altair/vegalite/v3/api.py#L1411 While this is being fixed, the arg inferring mechanism should be factored out so that it can also be used in the ``facet()`` method, so that ``facet()`` operates similarly to ``encode()``.
2019-07-04T05:36:45Z
[]
[]
vega/altair
1,607
vega__altair-1607
[ "1605" ]
079f8727deca3178089f5c2042145a60f874af1e
diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -559,18 +559,6 @@ def properties(self, **kwargs): setattr(copy, key, val) return copy - def add_selection(self, *selections): - """Add one or more selections to the chart.""" - if not selections: - return self - copy = self.copy(deep=['selection']) - if copy.selection is Undefined: - copy.selection = {} - - for s in selections: - copy.selection[s.name] = s.selection - return copy - def project(self, type='mercator', center=Undefined, clipAngle=Undefined, clipExtent=Undefined, coefficient=Undefined, distance=Undefined, fraction=Undefined, lobes=Undefined, parallel=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, @@ -1561,6 +1549,18 @@ def from_dict(cls, dct, validate=True): # As a last resort, try using the Root vegalite object return core.Root.from_dict(dct, validate) + def add_selection(self, *selections): + """Add one or more selections to the chart.""" + if not selections: + return self + copy = self.copy(deep=['selection']) + if copy.selection is Undefined: + copy.selection = {} + + for s in selections: + copy.selection[s.name] = s.selection + return copy + def interactive(self, name=None, bind_x=True, bind_y=True): """Make chart axes scales interactive @@ -1669,6 +1669,13 @@ def interactive(self, name=None, bind_x=True, bind_y=True): copy.spec = copy.spec.interactive(name=name, bind_x=bind_x, bind_y=bind_y) return copy + def add_selection(self, *selections): + """Add one or more selections to the chart.""" + if not selections or self.spec is Undefined: + return self + copy = self.copy() + copy.spec = copy.spec.add_selection(*selections) + return copy def repeat(repeater='repeat'): """Tie a channel to the row or column within a repeated chart @@ -1712,6 +1719,15 @@ def __or__(self, other): copy |= other return copy + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.concat: + return self + copy = self.copy() + copy.concat = [chart.add_selection(*selections) + for chart in copy.concat] + return copy + def concat(*charts, **kwargs): """Concatenate charts horizontally""" @@ -1739,6 +1755,15 @@ def __or__(self, other): copy |= other return copy + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.hconcat: + return self + copy = self.copy() + copy.hconcat = [chart.add_selection(*selections) + for chart in copy.hconcat] + return copy + def hconcat(*charts, **kwargs): """Concatenate charts horizontally""" @@ -1766,6 +1791,15 @@ def __and__(self, other): copy &= other return copy + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.vconcat: + return self + copy = self.copy() + copy.vconcat = [chart.add_selection(*selections) + for chart in copy.vconcat] + return copy + def vconcat(*charts, **kwargs): """Concatenate charts vertically""" @@ -1773,8 +1807,7 @@ def vconcat(*charts, **kwargs): @utils.use_signature(core.TopLevelLayerSpec) -class LayerChart(TopLevelMixin, EncodingMixin, mixins.MarkMethodMixin, - core.TopLevelLayerSpec): +class LayerChart(TopLevelMixin, EncodingMixin, core.TopLevelLayerSpec): """A Chart with layers within a single panel""" def __init__(self, data=Undefined, layer=(), **kwargs): # TODO: move common data to top level? @@ -1829,6 +1862,15 @@ def interactive(self, name=None, bind_x=True, bind_y=True): copy.layer[0] = copy.layer[0].interactive(name=name, bind_x=bind_x, bind_y=bind_y) return copy + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.layer: + return self + copy = self.copy() + copy.layer = [chart.add_selection(*selections) + for chart in copy.layer] + return copy + def layer(*charts, **kwargs): """layer multiple charts""" @@ -1865,6 +1907,14 @@ def interactive(self, name=None, bind_x=True, bind_y=True): copy.spec = copy.spec.interactive(name=name, bind_x=bind_x, bind_y=bind_y) return copy + def add_selection(self, *selections): + """Add one or more selections to the chart.""" + if not selections or self.spec is Undefined: + return self + copy = self.copy() + copy.spec = copy.spec.add_selection(*selections) + return copy + def topo_feature(url, feature, **kwargs): """A convenience function for extracting features from a topojson url
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -457,20 +457,6 @@ def test_resolve_methods(): assert chart.resolve == alt.Resolve(scale=alt.ScaleResolveMap(x='shared', y='independent')) -def test_layer_marks(): - chart = alt.LayerChart().mark_point() - assert chart.mark == 'point' - - chart = alt.LayerChart().mark_point(color='red') - assert chart.mark == alt.MarkDef('point', color='red') - - chart = alt.LayerChart().mark_bar() - assert chart.mark == 'bar' - - chart = alt.LayerChart().mark_bar(color='green') - assert chart.mark == alt.MarkDef('bar', color='green') - - def test_layer_encodings(): chart = alt.LayerChart().encode(x='column:Q') assert chart.encoding.x == alt.X(shorthand='column:Q') @@ -490,6 +476,34 @@ def test_add_selection(): assert chart.selection == expected +def test_repeat_add_selections(): + base = alt.Chart('data.csv').mark_point() + selection = alt.selection_single() + chart1 = base.add_selection(selection).repeat(list('ABC')) + chart2 = base.repeat(list('ABC')).add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + +def test_facet_add_selections(): + base = alt.Chart('data.csv').mark_point() + selection = alt.selection_single() + chart1 = base.add_selection(selection).facet('val:Q') + chart2 = base.facet('val:Q').add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + [email protected]('charttype', [alt.layer, alt.concat, alt.hconcat, alt.vconcat]) +def test_compound_add_selections(charttype): + base = alt.Chart('data.csv').mark_point() + selection = alt.selection_single() + chart1 = charttype( + base.add_selection(selection), + base.add_selection(selection) + ) + chart2 = charttype(base, base).add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + def test_selection_property(): sel = alt.selection_interval() chart = alt.Chart('data.csv').mark_point().properties(
BUG: Remove invalid methods from top-level chart objects Examples of methods that never result in valid chart specs: - ``LayerChart.mark_*`` - ``LayerChart.add_selection`` - ``*ConcatChart.add_selection`` - ``FacetChart.add_selection`` - ``RepeatChart.add_selection``
2019-07-12T00:18:12Z
[]
[]
vega/altair
1,667
vega__altair-1667
[ "1660" ]
93846e70ad7fed56e02001f5af4c1bfed1ba3e3e
diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -93,7 +93,8 @@ def _prepare_data(data, context): # if data is still not a recognized type, then return if not isinstance(data, (dict, core.Data, core.UrlData, - core.InlineData, core.NamedData)): + core.InlineData, core.NamedData, + core.GraticuleGenerator, core.SequenceGenerator)): warnings.warn("data of type {} not recognized".format(type(data))) return data @@ -1962,3 +1963,25 @@ def remove_data(subchart): subcharts = [remove_data(c) for c in subcharts] return data, subcharts + + [email protected]_signature(core.SequenceParams) +def sequence(start, stop=None, step=Undefined, as_=Undefined, **kwds): + """Sequence generator.""" + if stop is None: + start, stop = 0, start + params = core.SequenceParams( + start=start, stop=stop, step=step, **{'as': as_} + ) + return core.SequenceGenerator(sequence=params, **kwds) + + [email protected]_signature(core.GraticuleParams) +def graticule(**kwds): + """Graticule generator.""" + if not kwds: + # graticule: True indicates default parameters + graticule = True + else: + graticule = core.GraticuleParams(**kwds) + return core.GraticuleGenerator(graticule=graticule) \ No newline at end of file
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -840,3 +840,22 @@ def test_facet(chart_type, facet_arg): assert dct['facet'] == expected else: assert dct['facet'][facet_arg] == expected + + +def test_sequence(): + data = alt.sequence(100) + assert data.to_dict() == {'sequence': {'start': 0, 'stop': 100}} + + data = alt.sequence(5, 10) + assert data.to_dict() == {'sequence': {'start': 5, 'stop': 10}} + + data = alt.sequence(0, 1, 0.1, as_='x') + assert data.to_dict() == {'sequence': {'start': 0, 'stop': 1, 'step': 0.1, 'as': 'x'}} + + +def test_graticule(): + data = alt.graticule() + assert data.to_dict() == {'graticule': True} + + data = alt.graticule(step=[15, 15]) + assert data.to_dict() == {'graticule': {'step': [15, 15]}} \ No newline at end of file
Refine data generator support Vega-Lite supports _data generators_ for geo spheres, geo graticules, and numeric sequences: https://vega.github.io/vega-lite/docs/data.html#data-generators Altair includes auto-generated classes (e.g., `alt.GraticuleGenerator`, `alt.GraticuleParams`) corresponding to these features. However, passing a generator class as the data for a Chart can result in warning output: ``` UserWarning: data of type <class ‘altair.vegalite.v3.schema.core.SphereGenerator’> not recognized warnings.warn(“data of type {} not recognized”.format(type(data))) ``` Moreover, code like `alt.GraticuleGenerator(graticule=alt.GraticuleParams(...))` feels unnecessarily verbose. Perhaps a more concise syntax would be helpful? For example, merging the generator and params into a single call... For comparison, the Vega-Lite JavaScript API includes top-level methods for generators (`vl.graticule()`); https://observablehq.com/@vega/vega-lite-cartographic-projections provides an example of their use.
Great suggestion! I think something like ``alt.graticule()`` or ``alt.data.graticule()`` would make sense. What version were these added to Vega-Lite?
2019-08-20T21:32:51Z
[]
[]
vega/altair
1,751
vega__altair-1751
[ "1750" ]
4c33b14cf32e3f4d07db01e7bb125c977843af65
diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -915,9 +915,9 @@ def transform_joinaggregate(self, joinaggregate=Undefined, groupby=Undefined, ** >>> chart.transform[0] JoinAggregateTransform({ joinaggregate: [JoinAggregateFieldDef({ - as: FieldName('x'), - field: FieldName('y'), - op: AggregateOp('sum') + as: 'x', + field: 'y', + op: 'sum' })] }) @@ -932,7 +932,7 @@ def transform_joinaggregate(self, joinaggregate=Undefined, groupby=Undefined, ** dct = {'as': key, 'field': parsed.get('field', Undefined), 'op': parsed.get('aggregate', Undefined)} - joinaggregate.append(core.JoinAggregateFieldDef.from_dict(dct)) + joinaggregate.append(core.JoinAggregateFieldDef(**dct)) return self._add_transform(core.JoinAggregateTransform( joinaggregate=joinaggregate, groupby=groupby ))
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -402,9 +402,9 @@ def test_transforms(): kwds = { 'joinaggregate': [ alt.JoinAggregateFieldDef( - field=alt.FieldName('x'), - op=alt.AggregateOp('min'), - **{'as': alt.FieldName('min')}) + field='x', + op='min', + **{'as': 'min'}) ], 'groupby': ['key'] }
Can't use 'count' operation in join aggregate transform Some join aggregate operations work as expected: ```python data = pd.DataFrame({ 'x': [0, 1, 2, 0, 1, 2], 'a': [1, 1, 2, 3, 3, 4], 'group': [1, 1, 1, 2, 2, 2] }) import altair as alt alt.Chart( data ).transform_joinaggregate( group_sum='sum(a)', groupby=['group'] ).transform_calculate( normalized_a="datum.a / datum.group_sum", ).mark_point().encode( x='x:Q', y="normalized_a:Q", color='group:N', ) ``` ![visualization](https://user-images.githubusercontent.com/14128078/67480639-a100fa80-f660-11e9-806f-1ed1d1e13ff1.png) ...but the 'count' operation raises the following error: ```python import altair as alt alt.Chart( data ).transform_joinaggregate( group_count='count()', groupby=['group'] ).transform_calculate( normalized_a="datum.a / datum.group_count", ).mark_point().encode( x='x:Q', y="normalized_a:Q", color='group:N', ) ``` ``` --------------------------------------------------------------------------- ValidationError Traceback (most recent call last) <ipython-input-142-2bf583dd0be9> in <module>() 5 ).transform_joinaggregate( 6 group_count='count()', ----> 7 groupby=['group'] 8 ).transform_calculate( 9 normalized_a="datum.a / datum.group_count", ~/.virtualenvs/simulate/lib/python3.6/site-packages/altair/vegalite/v3/api.py in transform_joinaggregate(self, joinaggregate, groupby, **kwargs) 929 'field': parsed.get('field', Undefined), 930 'op': parsed.get('aggregate', Undefined)} --> 931 joinaggregate.append(core.JoinAggregateFieldDef.from_dict(dct)) 932 return self._add_transform(core.JoinAggregateTransform( 933 joinaggregate=joinaggregate, groupby=groupby ~/.virtualenvs/simulate/lib/python3.6/site-packages/altair/utils/schemapi.py in from_dict(cls, dct, validate, _wrapper_classes) 366 """ 367 if validate: --> 368 cls.validate(dct) 369 if _wrapper_classes is None: 370 _wrapper_classes = cls._default_wrapper_classes() ~/.virtualenvs/simulate/lib/python3.6/site-packages/altair/utils/schemapi.py in validate(cls, instance, schema) 402 schema = cls._schema 403 resolver = jsonschema.RefResolver.from_schema(cls._rootschema or cls._schema) --> 404 return jsonschema.validate(instance, schema, resolver=resolver) 405 406 @classmethod ~/.virtualenvs/simulate/lib/python3.6/site-packages/jsonschema/validators.py in validate(instance, schema, cls, *args, **kwargs) 897 error = exceptions.best_match(validator.iter_errors(instance)) 898 if error is not None: --> 899 raise error 900 901 ValidationError: Undefined is not of type 'string' Failed validating 'type' in schema['properties']['field']: {'type': 'string'} On instance['field']: Undefined ``` Am I missing something? As a side note, if there's a simpler way of normalizing a histogram than using this type of transform, I'd love to hear about it. Thanks
Thanks for the report - that's a bug, and it should be fixed by #1751. In the meantime, as a workaround you can use ``count(*)``: ```python chart.transform_joinaggregate( group_count='count(*)', groupby=['group'] ) ```
2019-10-24T13:30:13Z
[]
[]
vega/altair
1,794
vega__altair-1794
[ "1792", "1792" ]
1d80b5979a47b118db67c408d09237a9173ea455
diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -1882,8 +1882,7 @@ def add_selection(self, *selections): if not selections or not self.layer: return self copy = self.copy() - copy.layer = [chart.add_selection(*selections) - for chart in copy.layer] + copy.layer[0] = copy.layer[0].add_selection(*selections) return copy
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -535,7 +535,15 @@ def test_facet_add_selections(): assert chart1.to_dict() == chart2.to_dict() [email protected]('charttype', [alt.layer, alt.concat, alt.hconcat, alt.vconcat]) +def test_layer_add_selection(): + base = alt.Chart('data.csv').mark_point() + selection = alt.selection_single() + chart1 = alt.layer(base.add_selection(selection), base) + chart2 = alt.layer(base, base).add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + [email protected]('charttype', [alt.concat, alt.hconcat, alt.vconcat]) def test_compound_add_selections(charttype): base = alt.Chart('data.csv').mark_point() selection = alt.selection_single()
Calling add_selection() on a layered chart results in an invalid spec Example: ```python import altair as alt import pandas as pd df = pd.DataFrame({ 'x': range(5), 'y1': [1, 3, 2, 4, 5], 'y2': [2, 1, 4, 5, 3] }) alt.layer( alt.Chart(df).mark_line().encode(x='x', y='y1'), alt.Chart(df).mark_line().encode(x='x', y='y2') ).add_selection( alt.selection_interval() ) ``` ```err JavaScript Error: Duplicate signal name: "selector012_x_1" This usually means there's a typo in your chart specification. See the javascript console for the full traceback. Calling add_selection() on a layered chart results in an invalid spec Example: ```python import altair as alt import pandas as pd df = pd.DataFrame({ 'x': range(5), 'y1': [1, 3, 2, 4, 5], 'y2': [2, 1, 4, 5, 3] }) alt.layer( alt.Chart(df).mark_line().encode(x='x', y='y1'), alt.Chart(df).mark_line().encode(x='x', y='y2') ).add_selection( alt.selection_interval() ) ``` ```err JavaScript Error: Duplicate signal name: "selector012_x_1" This usually means there's a typo in your chart specification. See the javascript console for the full traceback.
In the case of a layered chart, ``add_selection()`` should only add to the first chart, not all charts. In the case of a layered chart, ``add_selection()`` should only add to the first chart, not all charts.
2019-11-18T13:21:29Z
[]
[]
vega/altair
1,805
vega__altair-1805
[ "1681" ]
76b8fde8c2180927e1d013713b6d94db94c798d3
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -230,6 +230,8 @@ def _get(self, attr, default=Undefined): def __getattr__(self, attr): # reminder: getattr is called after the normal lookups + if attr == '_kwds': + raise AttributeError() if attr in self._kwds: return self._kwds[attr] else: diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -37,7 +37,7 @@ def debug_mode(arg): def _subclasses(cls): - """Breadth-first sequence of classes which inherit from cls.""" + """Breadth-first sequence of all classes which inherit from cls.""" seen = set() current_set = {cls} while current_set: @@ -226,6 +226,8 @@ def _get(self, attr, default=Undefined): def __getattr__(self, attr): # reminder: getattr is called after the normal lookups + if attr == '_kwds': + raise AttributeError() if attr in self._kwds: return self._kwds[attr] else: @@ -494,7 +496,9 @@ def _passthrough(*args, **kwds): return args[0] if args else kwds if cls is None: - # TODO: do something more than simply selecting the last match? + # If there are multiple matches, we use the last one in the dict. + # Our class dict is constructed breadth-first from top to bottom, + # so the last class that matches is the most specific. matches = self.class_dict[self.hash_schema(schema)] cls = matches[-1] if matches else _passthrough schema = _resolve_references(schema, rootschema)
diff --git a/altair/utils/tests/test_schemapi.py b/altair/utils/tests/test_schemapi.py --- a/altair/utils/tests/test_schemapi.py +++ b/altair/utils/tests/test_schemapi.py @@ -2,7 +2,10 @@ # # The contents of this file are automatically written by # tools/generate_schema_wrapper.py. Do not modify directly. +import copy +import io import jsonschema +import pickle import pytest from ..schemapi import (UndefinedType, SchemaBase, Undefined, _FromDict, @@ -211,11 +214,16 @@ def test_undefined_singleton(): assert Undefined is UndefinedType() -def test_copy(): - dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, - 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z']} [email protected] +def dct(): + return { + 'a': {'foo': 'bar'}, 'a2': {'foo': 42}, + 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, + 'd': ['x', 'y', 'z'] + } + +def test_copy_method(dct): myschema = MySchema.from_dict(dct) # Make sure copy is deep @@ -246,6 +254,16 @@ def test_copy(): assert mydct['c'] == dct['c'] +def test_copy_module(dct): + myschema = MySchema.from_dict(dct) + + cp = copy.deepcopy(myschema) + cp['a']['foo'] = 'new value' + cp['b'] = ['A', 'B', 'C'] + cp['c'] = 164 + assert myschema.to_dict() == dct + + def test_attribute_error(): m = MySchema() with pytest.raises(AttributeError) as err: @@ -254,16 +272,23 @@ def test_attribute_error(): "'invalid_attribute'") -def test_to_from_json(): - dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, - 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z'], 'e': ['g', 'h']} +def test_to_from_json(dct): json_str = MySchema.from_dict(dct).to_json() new_dct = MySchema.from_json(json_str).to_dict() assert new_dct == dct +def test_to_from_pickle(dct): + myschema = MySchema.from_dict(dct) + output = io.BytesIO() + pickle.dump(myschema, output) + output.seek(0) + myschema_new = pickle.load(output) + + assert myschema_new.to_dict() == dct + + def test_class_with_no_schema(): class BadSchema(SchemaBase): pass @@ -298,3 +323,4 @@ def test_schema_validation_error(): assert 'test_schemapi.MySchema->a' in message assert "validating {!r}".format(the_err.validator) in message assert the_err.message in message + diff --git a/tools/schemapi/tests/test_schemapi.py b/tools/schemapi/tests/test_schemapi.py --- a/tools/schemapi/tests/test_schemapi.py +++ b/tools/schemapi/tests/test_schemapi.py @@ -1,4 +1,7 @@ +import copy +import io import jsonschema +import pickle import pytest from ..schemapi import (UndefinedType, SchemaBase, Undefined, _FromDict, @@ -207,11 +210,16 @@ def test_undefined_singleton(): assert Undefined is UndefinedType() -def test_copy(): - dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, - 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z']} [email protected] +def dct(): + return { + 'a': {'foo': 'bar'}, 'a2': {'foo': 42}, + 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, + 'd': ['x', 'y', 'z'] + } + +def test_copy_method(dct): myschema = MySchema.from_dict(dct) # Make sure copy is deep @@ -242,6 +250,16 @@ def test_copy(): assert mydct['c'] == dct['c'] +def test_copy_module(dct): + myschema = MySchema.from_dict(dct) + + cp = copy.deepcopy(myschema) + cp['a']['foo'] = 'new value' + cp['b'] = ['A', 'B', 'C'] + cp['c'] = 164 + assert myschema.to_dict() == dct + + def test_attribute_error(): m = MySchema() with pytest.raises(AttributeError) as err: @@ -250,16 +268,23 @@ def test_attribute_error(): "'invalid_attribute'") -def test_to_from_json(): - dct = {'a': {'foo': 'bar'}, 'a2': {'foo': 42}, - 'b': ['a', 'b', 'c'], 'b2': [1, 2, 3], 'c': 42, - 'd': ['x', 'y', 'z'], 'e': ['g', 'h']} +def test_to_from_json(dct): json_str = MySchema.from_dict(dct).to_json() new_dct = MySchema.from_json(json_str).to_dict() assert new_dct == dct +def test_to_from_pickle(dct): + myschema = MySchema.from_dict(dct) + output = io.BytesIO() + pickle.dump(myschema, output) + output.seek(0) + myschema_new = pickle.load(output) + + assert myschema_new.to_dict() == dct + + def test_class_with_no_schema(): class BadSchema(SchemaBase): pass @@ -294,3 +319,4 @@ def test_schema_validation_error(): assert 'test_schemapi.MySchema->a' in message assert "validating {!r}".format(the_err.validator) in message assert the_err.message in message +
Unable to pickle or copy charts I'm unable to pickle a chart. Consider this minimal example: ```python import pickle import altair from vega_datasets import data iris = data.iris() ch = altair.Chart(iris).mark_point().encode( x='petalLength', y='petalWidth', color='species' ) with open('chart.pck', 'wb') as fid: pickle.dump(ch, fid) with open('chart.pck', 'rb') as fid: pch = pickle.load(fid) ``` Running this results in a RecursionError: ``` (py36) C:\Develop\plab>python sandbox\test_altair_pickle.py Traceback (most recent call last): File "sandbox\test_altair_pickle.py", line 15, in <module> pch = pickle.load(fid) File "C:\opt\Anaconda3\envs\py36\lib\site-packages\altair\utils\schemapi.py", line 213, in __getattr__ if attr in self._kwds: File "C:\opt\Anaconda3\envs\py36\lib\site-packages\altair\utils\schemapi.py", line 213, in __getattr__ if attr in self._kwds: File "C:\opt\Anaconda3\envs\py36\lib\site-packages\altair\utils\schemapi.py", line 213, in __getattr__ if attr in self._kwds: [Previous line repeated 330 more times] RecursionError: maximum recursion depth exceeded while calling a Python object ``` ``` It can be fixed using ```python def __getattr__(self, attr): # reminder: getattr is called after the normal lookups if attr == '_kwds': raise AttributeError() if attr in self._kwds: return self._kwds[attr] else: try: _getattr = super(SchemaBase, self).__getattr__ except AttributeError: _getattr = super(SchemaBase, self).__getattribute__ return _getattr(attr) ``` I can submit a pull request if desired.
I would avoid pickle and instead use ``to_json``/``from_json``. Pickle is quite brittle. But the `to_json` / `from_json` will change my chart as you commented in another issue #1644. I would really like to save/load a chart from file and have an equivalent object. The change in `__getattr__` is minimal in my opinion, I just added the two lines: ``` if attr == '_kwds': raise AttributeError() ``` which should be there anyways IMO. If you don't like the pickle argument, then maybe you buy the copy argument: ```python import altair from vega_datasets import data import copy iris = data.iris() ch = altair.Chart(iris).mark_point().encode( x='petalLength', y='petalWidth', color='species' ) cch = copy.copy(ch) ``` BAM, infinite recursion. OK, feel free to submit a fix – the ground truth for this code is in tools/schemapi. (FYI, ``ch.copy()`` will do the right thing, and will be the preferred method of copying a chart even after this bug is fixed)
2019-11-24T13:54:57Z
[]
[]
vega/altair
1,839
vega__altair-1839
[ "1836" ]
bd593867f4413936ab723b7583a508aa8c13e06d
diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -63,7 +63,7 @@ def _consolidate_data(data, context): return data -def _prepare_data(data, context): +def _prepare_data(data, context=None): """Convert input data to data for use within schema Parameters @@ -71,7 +71,7 @@ def _prepare_data(data, context): data : The input dataset in the form of a DataFrame, dictionary, altair data object, or other type that is recognized by the data transformers. - context : dict + context : dict (optional) The to_dict context in which the data is being prepared. This is used to keep track of information that needs to be passed up and down the recursive serialization routine, such as global named datasets. @@ -88,7 +88,7 @@ def _prepare_data(data, context): data = core.UrlData(data) # consolidate inline data to top-level datasets - if data_transformers.consolidate_datasets: + if context is not None and data_transformers.consolidate_datasets: data = _consolidate_data(data, context) # if data is still not a recognized type, then return @@ -107,8 +107,7 @@ class LookupData(core.LookupData): def to_dict(self, *args, **kwargs): """Convert the chart to a dictionary suitable for JSON export""" copy = self.copy(deep=False) - context = kwargs.get('context', {}) - copy.data = _prepare_data(copy.data, context) + copy.data = _prepare_data(copy.data, kwargs.get('context')) return super(LookupData, copy).to_dict(*args, **kwargs) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -63,7 +63,7 @@ def _consolidate_data(data, context): return data -def _prepare_data(data, context): +def _prepare_data(data, context=None): """Convert input data to data for use within schema Parameters @@ -71,7 +71,7 @@ def _prepare_data(data, context): data : The input dataset in the form of a DataFrame, dictionary, altair data object, or other type that is recognized by the data transformers. - context : dict + context : dict (optional) The to_dict context in which the data is being prepared. This is used to keep track of information that needs to be passed up and down the recursive serialization routine, such as global named datasets. @@ -88,7 +88,7 @@ def _prepare_data(data, context): data = core.UrlData(data) # consolidate inline data to top-level datasets - if data_transformers.consolidate_datasets: + if context is not None and data_transformers.consolidate_datasets: data = _consolidate_data(data, context) # if data is still not a recognized type, then return @@ -107,8 +107,7 @@ class LookupData(core.LookupData): def to_dict(self, *args, **kwargs): """Convert the chart to a dictionary suitable for JSON export""" copy = self.copy(deep=False) - context = kwargs.get('context', {}) - copy.data = _prepare_data(copy.data, context) + copy.data = _prepare_data(copy.data, kwargs.get('context')) return super(LookupData, copy).to_dict(*args, **kwargs)
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -568,8 +568,7 @@ def test_LookupData(): df = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]}) lookup = alt.LookupData(data=df, key='x') - with alt.data_transformers.enable(consolidate_datasets=False): - dct = lookup.to_dict() + dct = lookup.to_dict() assert dct['key'] == 'x' assert dct['data'] == {'values': [{'x': 1, 'y': 4}, {'x': 2, 'y': 5}, diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -601,8 +601,7 @@ def test_LookupData(): df = pd.DataFrame({'x': [1, 2, 3], 'y': [4, 5, 6]}) lookup = alt.LookupData(data=df, key='x') - with alt.data_transformers.enable(consolidate_datasets=False): - dct = lookup.to_dict() + dct = lookup.to_dict() assert dct['key'] == 'x' assert dct['data'] == {'values': [{'x': 1, 'y': 4}, {'x': 2, 'y': 5},
Internal: overzealous dataset conversion Example: ``` >>> alt.LookupData.from_dict({'data': {'values': []}, 'key': 'x'}).to_dict() {'data': {'name': 'data-d751713988987e9331980363e24189ce'}, 'key': 'x'} ``` The issue is it assumes that ``context`` is always relevant; we should properly handle ``context=None``.
2019-12-04T15:02:37Z
[]
[]
vega/altair
1,852
vega__altair-1852
[ "1847" ]
c05a7caa26c2f592ed69a6d4d95276fdb1e80331
diff --git a/altair/vega/v5/schema/core.py b/altair/vega/v5/schema/core.py --- a/altair/vega/v5/schema/core.py +++ b/altair/vega/v5/schema/core.py @@ -774,7 +774,7 @@ class projection(VegaSchema): extent : oneOf(List(oneOf(List(:class:`numberOrSignal`), :class:`signal`)), :class:`signal`) - fit : oneOf(Mapping(required=[]), List(Mapping(required=[]))) + fit : oneOf(Mapping(required=[]), List(Any)) parallels : oneOf(List(:class:`numberOrSignal`), :class:`signal`) @@ -868,7 +868,7 @@ def __init__(self, axes=Undefined, data=Undefined, encode=Undefined, layout=Unde class signalName(VegaSchema): """signalName schema wrapper - not Mapping(required=[]) + not enum('parent', 'datum', 'event', 'item') """ _schema = {'$ref': '#/defs/signalName'} _rootschema = Root._schema @@ -977,7 +977,7 @@ class crossfilterTransform(VegaSchema): fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), :class:`signal`) - query : oneOf(List(Mapping(required=[])), :class:`signal`) + query : oneOf(List(Any), :class:`signal`) type : enum('crossfilter') @@ -1000,7 +1000,7 @@ class resolvefilterTransform(VegaSchema): Attributes ---------- - filter : Mapping(required=[]) + filter : Any ignore : anyOf(float, :class:`signal`) @@ -1339,11 +1339,11 @@ class graticuleTransform(VegaSchema): type : enum('graticule') - extent : oneOf(List(Mapping(required=[])), :class:`signal`) + extent : oneOf(List(Any), :class:`signal`) - extentMajor : oneOf(List(Mapping(required=[])), :class:`signal`) + extentMajor : oneOf(List(Any), :class:`signal`) - extentMinor : oneOf(List(Mapping(required=[])), :class:`signal`) + extentMinor : oneOf(List(Any), :class:`signal`) precision : anyOf(float, :class:`signal`) @@ -2182,13 +2182,13 @@ class imputeTransform(VegaSchema): groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), :class:`signal`) - keyvals : oneOf(List(Mapping(required=[])), :class:`signal`) + keyvals : oneOf(List(Any), :class:`signal`) method : anyOf(enum('value', 'mean', 'median', 'max', 'min'), :class:`signal`) signal : string - value : Mapping(required=[]) + value : Any """ _schema = {'$ref': '#/defs/imputeTransform'} @@ -2301,7 +2301,7 @@ class lookupTransform(VegaSchema): type : enum('lookup') - default : Mapping(required=[]) + default : Any signal : string @@ -2586,7 +2586,7 @@ class voronoiTransform(VegaSchema): y : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) - extent : oneOf(List(Mapping(required=[])), :class:`signal`) + extent : oneOf(List(Any), :class:`signal`) signal : string @@ -3458,7 +3458,7 @@ def __init__(self, signal=Undefined, **kwds): class arrayOrSignal(VegaSchema): """arrayOrSignal schema wrapper - oneOf(List(Mapping(required=[])), :class:`signal`) + oneOf(List(Any), :class:`signal`) """ _schema = {'$ref': '#/refs/arrayOrSignal'} _rootschema = Root._schema diff --git a/altair/vegalite/v3/schema/core.py b/altair/vegalite/v3/schema/core.py --- a/altair/vegalite/v3/schema/core.py +++ b/altair/vegalite/v3/schema/core.py @@ -1321,7 +1321,7 @@ class BaseMarkConfig(VegaLiteSchema): the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in radians, with ``0`` indicating "north". - tooltip : Mapping(required=[]) + tooltip : Any The tooltip text to show upon mouse hover. width : float Width of the marks. @@ -1550,7 +1550,7 @@ class BindRadioSelect(Binding): input : enum('radio', 'select') - options : List(Mapping(required=[])) + options : List(Any) debounce : float @@ -4059,13 +4059,13 @@ def __init__(self, *args): class EventStream(VegaLiteSchema): """EventStream schema wrapper - Mapping(required=[]) + Any """ _schema = {'$ref': '#/definitions/EventStream'} _rootschema = Root._schema - def __init__(self, **kwds): - super(EventStream, self).__init__(**kwds) + def __init__(self, *args, **kwds): + super(EventStream, self).__init__(*args, **kwds) class FacetFieldDef(VegaLiteSchema): @@ -5927,7 +5927,7 @@ class ImputeParams(VegaLiteSchema): **Default value:** : ``[null, null]`` indicating that the window includes all objects. - keyvals : anyOf(List(Mapping(required=[])), :class:`ImputeSequence`) + keyvals : anyOf(List(Any), :class:`ImputeSequence`) Defines the key values that should be considered for imputation. An array of key values or an object defining a `number sequence <https://vega.github.io/vega-lite/docs/impute.html#sequence-def>`__. @@ -5943,7 +5943,7 @@ class ImputeParams(VegaLiteSchema): One of ``value``, ``mean``, ``median``, ``max`` or ``min``. **Default value:** ``"value"`` - value : Mapping(required=[]) + value : Any The field value to use when the imputation ``method`` is ``"value"``. """ _schema = {'$ref': '#/definitions/ImputeParams'} @@ -15392,7 +15392,7 @@ class ImputeTransform(Transform): groupby : List(:class:`FieldName`) An optional array of fields by which to group the values. Imputation will then be performed on a per-group basis. - keyvals : anyOf(List(Mapping(required=[])), :class:`ImputeSequence`) + keyvals : anyOf(List(Any), :class:`ImputeSequence`) Defines the key values that should be considered for imputation. An array of key values or an object defining a `number sequence <https://vega.github.io/vega-lite/docs/impute.html#sequence-def>`__. @@ -15408,7 +15408,7 @@ class ImputeTransform(Transform): One of ``value``, ``mean``, ``median``, ``max`` or ``min``. **Default value:** ``"value"`` - value : Mapping(required=[]) + value : Any The field value to use when the imputation ``method`` is ``"value"``. """ _schema = {'$ref': '#/definitions/ImputeTransform'} diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -1414,7 +1414,7 @@ class BaseMarkConfig(VegaLiteSchema): the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in radians, with ``0`` indicating "north". - tooltip : Mapping(required=[]) + tooltip : Any The tooltip text to show upon mouse hover. width : float Width of the marks. @@ -1693,7 +1693,7 @@ class BindRadioSelect(Binding): input : enum('radio', 'select') - options : List(Mapping(required=[])) + options : List(Any) debounce : float @@ -7557,7 +7557,7 @@ class ImputeParams(VegaLiteSchema): **Default value:** : ``[null, null]`` indicating that the window includes all objects. - keyvals : anyOf(List(Mapping(required=[])), :class:`ImputeSequence`) + keyvals : anyOf(List(Any), :class:`ImputeSequence`) Defines the key values that should be considered for imputation. An array of key values or an object defining a `number sequence <https://vega.github.io/vega-lite/docs/impute.html#sequence-def>`__. @@ -7573,7 +7573,7 @@ class ImputeParams(VegaLiteSchema): One of ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. **Default value:** ``"value"`` - value : Mapping(required=[]) + value : Any The field value to use when the imputation ``method`` is ``"value"``. """ _schema = {'$ref': '#/definitions/ImputeParams'} @@ -17546,7 +17546,7 @@ class ImputeTransform(Transform): groupby : List(:class:`FieldName`) An optional array of fields by which to group the values. Imputation will then be performed on a per-group basis. - keyvals : anyOf(List(Mapping(required=[])), :class:`ImputeSequence`) + keyvals : anyOf(List(Any), :class:`ImputeSequence`) Defines the key values that should be considered for imputation. An array of key values or an object defining a `number sequence <https://vega.github.io/vega-lite/docs/impute.html#sequence-def>`__. @@ -17562,7 +17562,7 @@ class ImputeTransform(Transform): One of ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. **Default value:** ``"value"`` - value : Mapping(required=[]) + value : Any The field value to use when the imputation ``method`` is ``"value"``. """ _schema = {'$ref': '#/definitions/ImputeTransform'} diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -188,7 +188,7 @@ def medium_description(self): return '[{0}]'.format(', '.join(self.child(s).short_description for s in self.schema)) elif self.is_empty(): - return 'any object' + return 'Any' elif self.is_enum(): return 'enum({})'.format(', '.join(map(repr, self.enum))) elif self.is_anyOf(): @@ -266,7 +266,7 @@ def allOf(self): @property def not_(self): - return self.child(self.schema.get('not_', {})) + return self.child(self.schema.get('not', {})) @property def items(self): @@ -299,7 +299,7 @@ def is_enum(self): return 'enum' in self.schema def is_empty(self): - return set(self.schema.keys()) - set(EXCLUDE_KEYS) == {} + return not (set(self.schema.keys()) - set(EXCLUDE_KEYS)) def is_compound(self): return any(key in self.schema for key in ['anyOf', 'allOf', 'oneOf'])
diff --git a/tools/schemapi/tests/test_utils.py b/tools/schemapi/tests/test_utils.py --- a/tools/schemapi/tests/test_utils.py +++ b/tools/schemapi/tests/test_utils.py @@ -1,6 +1,6 @@ import pytest -from ..utils import get_valid_identifier +from ..utils import get_valid_identifier, SchemaInfo from ..schemapi import _FromDict @@ -31,3 +31,16 @@ def test_hash_schema(refschema, use_json): copy['description'] = "A schema" copy['title'] = "Schema to test" assert _FromDict.hash_schema(refschema) == _FromDict.hash_schema(copy) + [email protected]('schema, expected', [ + ({}, 'Any'), + ({'type': 'number'}, 'float'), + ({'enum': ['A', 'B', 'C']}, "enum('A', 'B', 'C')"), + ({'type': 'array'}, 'List(Any)'), + ({'type': 'object'}, 'Mapping(required=[])'), + ({"type": "string", "not": {'enum': ['A', 'B', 'C']}}, "not enum('A', 'B', 'C')"), +]) +def test_medium_description(schema, expected): + description = SchemaInfo(schema).medium_description + assert description == expected +
Code generator uses `mapping(required=[])` in confusing ways In particular: ``` >>> alt.Chart.transform_impute? [...] keyvals : anyOf(List(Mapping(required=[])), :class:`ImputeSequence`) [...] ``` This should be something like ``` keyvals : anyOf(List(Any), :class:`ImputeSequence`) ``` Somehow the schema generator is treating an empty ``items`` schema as an object.
2019-12-07T17:11:08Z
[]
[]
vega/altair
1,914
vega__altair-1914
[ "1909" ]
cce8a4c9a939f81d3022ac1bb812046aa46885f4
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -8,6 +8,8 @@ import json import jsonschema +import numpy as np +import pandas as pd # If DEBUG_MODE is True, then schema objects are converted to dict and @@ -54,13 +56,17 @@ def _todict(obj, validate, context): """Convert an object to a dict representation.""" if isinstance(obj, SchemaBase): return obj.to_dict(validate=validate, context=context) - elif isinstance(obj, (list, tuple)): + elif isinstance(obj, (list, tuple, np.ndarray)): return [_todict(v, validate, context) for v in obj] elif isinstance(obj, dict): return {k: _todict(v, validate, context) for k, v in obj.items() if v is not Undefined} elif hasattr(obj, 'to_dict'): return obj.to_dict() + elif isinstance(obj, np.number): + return float(obj) + elif isinstance(obj, (pd.Timestamp, np.datetime64)): + return pd.Timestamp(obj).isoformat() else: return obj diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -4,6 +4,8 @@ import json import jsonschema +import numpy as np +import pandas as pd # If DEBUG_MODE is True, then schema objects are converted to dict and @@ -50,13 +52,17 @@ def _todict(obj, validate, context): """Convert an object to a dict representation.""" if isinstance(obj, SchemaBase): return obj.to_dict(validate=validate, context=context) - elif isinstance(obj, (list, tuple)): + elif isinstance(obj, (list, tuple, np.ndarray)): return [_todict(v, validate, context) for v in obj] elif isinstance(obj, dict): return {k: _todict(v, validate, context) for k, v in obj.items() if v is not Undefined} elif hasattr(obj, 'to_dict'): return obj.to_dict() + elif isinstance(obj, np.number): + return float(obj) + elif isinstance(obj, (pd.Timestamp, np.datetime64)): + return pd.Timestamp(obj).isoformat() else: return obj
diff --git a/altair/utils/tests/test_schemapi.py b/altair/utils/tests/test_schemapi.py --- a/altair/utils/tests/test_schemapi.py +++ b/altair/utils/tests/test_schemapi.py @@ -4,10 +4,13 @@ # tools/generate_schema_wrapper.py. Do not modify directly. import copy import io +import json import jsonschema import pickle import pytest +import numpy as np + from ..schemapi import (UndefinedType, SchemaBase, Undefined, _FromDict, SchemaValidationError) @@ -324,3 +327,17 @@ def test_schema_validation_error(): assert "validating {!r}".format(the_err.validator) in message assert the_err.message in message + +def test_serialize_numpy_types(): + m = MySchema( + a={'date': np.datetime64('2019-01-01')}, + a2={'int64': np.int64(1), 'float64': np.float64(2)}, + b2=np.arange(4), + ) + out = m.to_json() + dct = json.loads(out) + assert dct == { + 'a': {'date': '2019-01-01T00:00:00'}, + 'a2': {'int64': 1, 'float64': 2}, + 'b2': [0, 1, 2, 3], + } diff --git a/tools/schemapi/tests/test_schemapi.py b/tools/schemapi/tests/test_schemapi.py --- a/tools/schemapi/tests/test_schemapi.py +++ b/tools/schemapi/tests/test_schemapi.py @@ -1,9 +1,12 @@ import copy import io +import json import jsonschema import pickle import pytest +import numpy as np + from ..schemapi import (UndefinedType, SchemaBase, Undefined, _FromDict, SchemaValidationError) @@ -320,3 +323,17 @@ def test_schema_validation_error(): assert "validating {!r}".format(the_err.validator) in message assert the_err.message in message + +def test_serialize_numpy_types(): + m = MySchema( + a={'date': np.datetime64('2019-01-01')}, + a2={'int64': np.int64(1), 'float64': np.float64(2)}, + b2=np.arange(4), + ) + out = m.to_json() + dct = json.loads(out) + assert dct == { + 'a': {'date': '2019-01-01T00:00:00'}, + 'a2': {'int64': 1, 'float64': 2}, + 'b2': [0, 1, 2, 3], + }
Using numpy scalars in charts leads to JSON serialization errors simple example: ```python import numpy as np import altair as alt size = np.arange(10).max() # seems innocuous enough... alt.Chart('data.csv').mark_point(size=size).to_json() ``` ```pytb --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-593a48d22bb1> in <module>() 2 import altair as alt 3 ----> 4 alt.Chart('data.csv').mark_point(size=np.arange(10).max()).to_json() /usr/local/lib/python3.6/dist-packages/altair/utils/schemapi.py in to_json(self, validate, ignore, context, indent, sort_keys, **kwargs) 338 """ 339 dct = self.to_dict(validate=validate, ignore=ignore, context=context) --> 340 return json.dumps(dct, indent=indent, sort_keys=sort_keys, **kwargs) 341 342 @classmethod /usr/lib/python3.6/json/__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw) 236 check_circular=check_circular, allow_nan=allow_nan, indent=indent, 237 separators=separators, default=default, sort_keys=sort_keys, --> 238 **kw).encode(obj) 239 240 /usr/lib/python3.6/json/encoder.py in encode(self, o) 199 chunks = self.iterencode(o, _one_shot=True) 200 if not isinstance(chunks, (list, tuple)): --> 201 chunks = list(chunks) 202 return ''.join(chunks) 203 /usr/lib/python3.6/json/encoder.py in _iterencode(o, _current_indent_level) 428 yield from _iterencode_list(o, _current_indent_level) 429 elif isinstance(o, dict): --> 430 yield from _iterencode_dict(o, _current_indent_level) 431 else: 432 if markers is not None: /usr/lib/python3.6/json/encoder.py in _iterencode_dict(dct, _current_indent_level) 402 else: 403 chunks = _iterencode(value, _current_indent_level) --> 404 yield from chunks 405 if newline_indent is not None: 406 _current_indent_level -= 1 /usr/lib/python3.6/json/encoder.py in _iterencode_dict(dct, _current_indent_level) 402 else: 403 chunks = _iterencode(value, _current_indent_level) --> 404 yield from chunks 405 if newline_indent is not None: 406 _current_indent_level -= 1 /usr/lib/python3.6/json/encoder.py in _iterencode(o, _current_indent_level) 435 raise ValueError("Circular reference detected") 436 markers[markerid] = o --> 437 o = _default(o) 438 yield from _iterencode(o, _current_indent_level) 439 if markers is not None: /usr/lib/python3.6/json/encoder.py in default(self, o) 178 """ 179 raise TypeError("Object of type '%s' is not JSON serializable" % --> 180 o.__class__.__name__) 181 182 def encode(self, o): TypeError: Object of type 'int64' is not JSON serializable ```
While fixing this, it would be nice to serialize numpy datetimes correctly within chart specs, so they could e.g. be used directly in ``scale.domain`` arguments
2020-01-14T01:12:33Z
[]
[]
vega/altair
1,943
vega__altair-1943
[ "1876" ]
18766f719c1e91b9cd4a27e72f10dab0000d0e6a
diff --git a/altair/sphinxext/altairgallery.py b/altair/sphinxext/altairgallery.py --- a/altair/sphinxext/altairgallery.py +++ b/altair/sphinxext/altairgallery.py @@ -132,7 +132,7 @@ def save_example_pngs(examples, image_dir, make_thumbnails=True): chart.save(image_file) hashes[filename] = example_hash except ImportError: - warnings.warn("Could not import selenium: using generic image") + warnings.warn("Unable to save image: using generic image") create_generic_image(image_file) with open(hash_file, 'w') as f: diff --git a/altair/utils/headless.py b/altair/utils/headless.py deleted file mode 100644 --- a/altair/utils/headless.py +++ /dev/null @@ -1,173 +0,0 @@ -""" -Utilities that use selenium + chrome headless to save figures -""" - -import contextlib -import os -import tempfile - - [email protected] -def temporary_filename(**kwargs): - """Create and clean-up a temporary file - - Arguments are the same as those passed to tempfile.mkstemp - - We could use tempfile.NamedTemporaryFile here, but that causes issues on - windows (see https://bugs.python.org/issue14243). - """ - filedescriptor, filename = tempfile.mkstemp(**kwargs) - os.close(filedescriptor) - - try: - yield filename - finally: - if os.path.exists(filename): - os.remove(filename) - - -HTML_TEMPLATE = """ -<!DOCTYPE html> -<html> -<head> - <title>Embedding Vega-Lite</title> - <script src="https://cdn.jsdelivr.net/npm/vega@{vega_version}"></script> - <script src="https://cdn.jsdelivr.net/npm/vega-lite@{vegalite_version}"></script> - <script src="https://cdn.jsdelivr.net/npm/vega-embed@{vegaembed_version}"></script> -</head> -<body> - <div id="vis"></div> -</body> -</html> -""" - -EXTRACT_CODE = { -'png': """ - var spec = arguments[0]; - var mode = arguments[1]; - var scaleFactor = arguments[2]; - var done = arguments[3]; - - if(mode === 'vega-lite'){ - // compile vega-lite to vega - vegaLite = (typeof vegaLite === "undefined") ? vl : vegaLite; - const compiled = vegaLite.compile(spec); - spec = compiled.spec; - } - - new vega.View(vega.parse(spec), { - loader: vega.loader(), - logLevel: vega.Warn, - renderer: 'none', - }) - .initialize() - .toCanvas(scaleFactor) - .then(function(canvas){return canvas.toDataURL('image/png');}) - .then(done) - .catch(function(err) { console.error(err); }); - """, -'svg': """ - var spec = arguments[0]; - var mode = arguments[1]; - var scaleFactor = arguments[2]; - var done = arguments[3]; - - if(mode === 'vega-lite'){ - // compile vega-lite to vega - vegaLite = (typeof vegaLite === "undefined") ? vl : vegaLite; - const compiled = vegaLite.compile(spec); - spec = compiled.spec; - } - - new vega.View(vega.parse(spec), { - loader: vega.loader(), - logLevel: vega.Warn, - renderer: 'none', - }) - .initialize() - .toSVG(scaleFactor) - .then(done) - .catch(function(err) { console.error(err); }); - """, -'vega': """ - var spec = arguments[0]; - var mode = arguments[1]; - var done = arguments[3]; - - if(mode === 'vega-lite'){ - // compile vega-lite to vega - vegaLite = (typeof vegaLite === "undefined") ? vl : vegaLite; - const compiled = vegaLite.compile(spec); - spec = compiled.spec; - } - - done(spec); - """} - - -def compile_spec(spec, format, mode, - vega_version, vegaembed_version, vegalite_version, - scale_factor=1, driver_timeout=20, webdriver='chrome'): - # TODO: detect & use local Jupyter caches of JS packages? - - # selenium is an optional dependency, so import it here - try: - import selenium.webdriver - except ImportError: - raise ImportError("selenium package is required " - "for saving chart as {}".format(format)) - - if format not in ['png', 'svg', 'vega']: - raise NotImplementedError("format must be 'svg', 'png' or 'vega'") - - if mode not in ['vega', 'vega-lite']: - raise ValueError("mode must be either 'vega' or 'vega-lite'") - - if vega_version is None: - raise ValueError("must specify vega_version") - - if vegaembed_version is None: - raise ValueError("must specify vegaembed_version") - - if mode == 'vega-lite' and vegalite_version is None: - raise ValueError("must specify vega-lite version") - - if webdriver == 'chrome': - webdriver_class = selenium.webdriver.Chrome - webdriver_options_class = selenium.webdriver.chrome.options.Options - elif webdriver == 'firefox': - webdriver_class = selenium.webdriver.Firefox - webdriver_options_class = selenium.webdriver.firefox.options.Options - else: - raise ValueError("webdriver must be 'chrome' or 'firefox'") - - html = HTML_TEMPLATE.format(vega_version=vega_version, - vegalite_version=vegalite_version, - vegaembed_version=vegaembed_version) - - webdriver_options = webdriver_options_class() - webdriver_options.add_argument("--headless") - - if issubclass(webdriver_class, selenium.webdriver.Chrome): - # for linux/osx root user, need to add --no-sandbox option. - # since geteuid doesn't exist on windows, we don't check it - if hasattr(os, 'geteuid') and (os.geteuid() == 0): - webdriver_options.add_argument('--no-sandbox') - - driver = webdriver_class(options=webdriver_options) - - try: - driver.set_page_load_timeout(driver_timeout) - - with temporary_filename(suffix='.html') as htmlfile: - with open(htmlfile, 'w') as f: - f.write(html) - driver.get("file://" + htmlfile) - online = driver.execute_script("return navigator.onLine") - if not online: - raise ValueError("Internet connection required for saving " - "chart as {}".format(format)) - return driver.execute_async_script(EXTRACT_CODE[format], - spec, mode, scale_factor) - finally: - driver.close() diff --git a/altair/utils/mimebundle.py b/altair/utils/mimebundle.py --- a/altair/utils/mimebundle.py +++ b/altair/utils/mimebundle.py @@ -1,6 +1,3 @@ -import base64 - -from .headless import compile_spec from .html import spec_to_html @@ -12,13 +9,13 @@ def spec_to_mimebundle(spec, format, mode=None, """Convert a vega/vega-lite specification to a mimebundle The mimebundle type is controlled by the ``format`` argument, which can be - one of the following ['png', 'svg', 'vega', 'vega-lite', 'html', 'json'] + one of the following ['html', 'json', 'png', 'svg', 'pdf', 'vega', 'vega-lite'] Parameters ---------- spec : dict a dictionary representing a vega-lite plot spec - format : string {'png', 'svg', 'vega', 'vega-lite', 'html', 'json'} + format : string {'html', 'json', 'png', 'svg', 'pdf', 'vega', 'vega-lite'} the file format to be saved. mode : string {'vega', 'vega-lite'} The rendering mode. @@ -38,9 +35,8 @@ def spec_to_mimebundle(spec, format, mode=None, Note ---- - The png, svg, and vega outputs require the pillow and selenium Python modules - to be installed. Additionally they requires either chromedriver - (if webdriver=='chrome') or geckodriver (if webdriver=='firefox') + The png, svg, pdf, and vega outputs require the altair_saver package + to be installed. """ if mode not in ['vega', 'vega-lite']: raise ValueError("mode must be either 'vega' or 'vega-lite'") @@ -49,34 +45,29 @@ def spec_to_mimebundle(spec, format, mode=None, if vega_version is None: raise ValueError("Must specify vega_version") return {'application/vnd.vega.v{}+json'.format(vega_version[0]): spec} - elif format in ['png', 'svg', 'vega']: - render = compile_spec(spec, format=format, mode=mode, - vega_version=vega_version, - vegaembed_version=vegaembed_version, - vegalite_version=vegalite_version, **kwargs) - if format == 'png': - render = base64.b64decode(render.split(',', 1)[1].encode()) - return {'image/png': render} - elif format == 'svg': - return {'image/svg+xml': render} - elif format == 'vega': - assert mode == 'vega-lite' # TODO: handle vega->vega conversion more gracefully - return {'application/vnd.vega.v{}+json'.format(vega_version[0]): render} - elif format == 'html': + if format in ['png', 'svg', 'pdf', 'vega']: + try: + import altair_saver + except ImportError: + raise ValueError( + "Saving charts in {fmt!r} format requires the altair_saver package: " + "see http://github.com/altair-viz/altair_saver/".format(fmt=format) + ) + return altair_saver.render(spec, format, mode=mode, **kwargs) + if format == 'html': html = spec_to_html(spec, mode=mode, vega_version=vega_version, vegaembed_version=vegaembed_version, vegalite_version=vegalite_version, **kwargs) return {'text/html': html} - elif format == 'vega-lite': + if format == 'vega-lite': assert mode == 'vega-lite' # sanity check: should never be False if mode == 'vega': raise ValueError("Cannot convert a vega spec to vegalite") if vegalite_version is None: raise ValueError("Must specify vegalite_version") return {'application/vnd.vegalite.v{}+json'.format(vegalite_version[0]): spec} - elif format == 'json': + if format == 'json': return {'application/json': spec} - else: - raise ValueError("format must be one of " - "['png', 'svg', 'vega', 'vega-lite', 'html', 'json']") + raise ValueError("format must be one of " + "['html', 'json', 'png', 'svg', 'pdf', 'vega', 'vega-lite']")
diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -1,195 +1,192 @@ import pytest -import json - -try: - import selenium -except ImportError: - selenium = None +import altair as alt from ..mimebundle import spec_to_mimebundle -# example from https://vega.github.io/editor/#/examples/vega-lite/bar -VEGALITE_SPEC = json.loads( - """ - { - "$schema": "https://vega.github.io/schema/vega-lite/v2.json", - "description": "A simple bar chart with embedded data.", - "data": { - "values": [ - {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43}, - {"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53}, - {"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52} - ] - }, - "mark": "bar", - "encoding": { - "x": {"field": "a", "type": "ordinal"}, - "y": {"field": "b", "type": "quantitative"} - } - } - """ -) +def require_altair_saver(func): + try: + import altair_saver # noqa: F401 + except ImportError: + return pytest.mark.skip("altair_saver not importable; cannot run saver tests")(func) + else: + return func -VEGA_SPEC = json.loads( - """ - { - "$schema": "https://vega.github.io/schema/vega/v3.0.json", - "description": "A simple bar chart with embedded data.", - "autosize": "pad", - "padding": 5, - "height": 200, - "style": "cell", - "data": [ - { - "name": "source_0", - "values": [ - {"a": "A", "b": 28}, - {"a": "B", "b": 55}, - {"a": "C", "b": 43}, - {"a": "D", "b": 91}, - {"a": "E", "b": 81}, - {"a": "F", "b": 53}, - {"a": "G", "b": 19}, - {"a": "H", "b": 87}, - {"a": "I", "b": 52} - ] + [email protected] +def vegalite_spec(): + return { + "$schema": "https://vega.github.io/schema/vega-lite/v4.json", + "description": "A simple bar chart with embedded data.", + "data": { + "values": [ + {"a": "A", "b": 28}, + {"a": "B", "b": 55}, + {"a": "C", "b": 43}, + {"a": "D", "b": 91}, + {"a": "E", "b": 81}, + {"a": "F", "b": 53}, + {"a": "G", "b": 19}, + {"a": "H", "b": 87}, + {"a": "I", "b": 52}, + ] }, - { - "name": "data_0", - "source": "source_0", - "transform": [ - {"type": "formula", "expr": "toNumber(datum[\\"b\\"])", "as": "b"}, - { - "type": "filter", - "expr": "datum[\\"b\\"] !== null && !isNaN(datum[\\"b\\"])" - } - ] - } - ], - "signals": [ - {"name": "x_step", "value": 21}, - { - "name": "width", - "update": "bandspace(domain('x').length, 0.1, 0.05) * x_step" - } - ], - "marks": [ - { - "name": "marks", - "type": "rect", - "style": ["bar"], - "from": {"data": "data_0"}, - "encode": { - "update": { - "fill": {"value": "#4c78a8"}, - "x": {"scale": "x", "field": "a"}, - "width": {"scale": "x", "band": true}, - "y": {"scale": "y", "field": "b"}, - "y2": {"scale": "y", "value": 0} - } - } - } - ], - "scales": [ - { - "name": "x", - "type": "band", - "domain": {"data": "data_0", "field": "a", "sort": true}, - "range": {"step": {"signal": "x_step"}}, - "paddingInner": 0.1, - "paddingOuter": 0.05 + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, }, - { - "name": "y", - "type": "linear", - "domain": {"data": "data_0", "field": "b"}, - "range": [{"signal": "height"}, 0], - "nice": true, - "zero": true - } - ], - "axes": [ - { - "scale": "x", - "orient": "bottom", - "title": "a", - "labelOverlap": true, - "encode": { - "labels": { - "update": { - "angle": {"value": 270}, - "align": {"value": "right"}, - "baseline": {"value": "middle"} - } + } + + [email protected] +def vega_spec(): + return { + "$schema": "https://vega.github.io/schema/vega/v5.json", + "axes": [ + { + "domain": False, + "grid": True, + "gridScale": "x", + "labels": False, + "maxExtent": 0, + "minExtent": 0, + "orient": "left", + "scale": "y", + "tickCount": {"signal": "ceil(height/40)"}, + "ticks": False, + "zindex": 0, + }, + { + "grid": False, + "labelAlign": "right", + "labelAngle": 270, + "labelBaseline": "middle", + "labelOverlap": True, + "orient": "bottom", + "scale": "x", + "title": "a", + "zindex": 0, + }, + { + "grid": False, + "labelOverlap": True, + "orient": "left", + "scale": "y", + "tickCount": {"signal": "ceil(height/40)"}, + "title": "b", + "zindex": 0, + }, + ], + "background": "white", + "data": [ + { + "name": "source_0", + "values": [ + {"a": "A", "b": 28}, + {"a": "B", "b": 55}, + {"a": "C", "b": 43}, + {"a": "D", "b": 91}, + {"a": "E", "b": 81}, + {"a": "F", "b": 53}, + {"a": "G", "b": 19}, + {"a": "H", "b": 87}, + {"a": "I", "b": 52}, + ], + }, + { + "name": "data_0", + "source": "source_0", + "transform": [ + { + "expr": 'isValid(datum["b"]) && isFinite(+datum["b"])', + "type": "filter", + } + ], + }, + ], + "description": "A simple bar chart with embedded data.", + "height": 200, + "marks": [ + { + "encode": { + "update": { + "fill": {"value": "#4c78a8"}, + "width": {"band": True, "scale": "x"}, + "x": {"field": "a", "scale": "x"}, + "y": {"field": "b", "scale": "y"}, + "y2": {"scale": "y", "value": 0}, + } + }, + "from": {"data": "data_0"}, + "name": "marks", + "style": ["bar"], + "type": "rect", } - }, - "zindex": 1 - }, - { - "scale": "y", - "orient": "left", - "title": "b", - "labelOverlap": true, - "tickCount": {"signal": "ceil(height/40)"}, - "zindex": 1 - }, - { - "scale": "y", - "orient": "left", - "grid": true, - "tickCount": {"signal": "ceil(height/40)"}, - "gridScale": "x", - "domain": false, - "labels": false, - "maxExtent": 0, - "minExtent": 0, - "ticks": false, - "zindex": 0 - } - ], - "config": {"axisY": {"minExtent": 30}} + ], + "padding": 5, + "scales": [ + { + "domain": {"data": "data_0", "field": "a", "sort": True}, + "name": "x", + "paddingInner": 0.1, + "paddingOuter": 0.05, + "range": {"step": {"signal": "x_step"}}, + "type": "band", + }, + { + "domain": {"data": "data_0", "field": "b"}, + "name": "y", + "nice": True, + "range": [{"signal": "height"}, 0], + "type": "linear", + "zero": True, + }, + ], + "signals": [ + {"name": "x_step", "value": 20}, + { + "name": "width", + "update": "bandspace(domain('x').length, 0.1, 0.05) * x_step", + }, + ], + "style": "cell", } - """ -) -VEGAEMBED_VERSION = '3.14.0' -VEGALITE_VERSION = '2.3.1' -VEGA_VERSION = '3.3.1' [email protected]('not selenium') -def test_spec_to_vega_mimebundle(): - try: - bundle = spec_to_mimebundle( - spec=VEGALITE_SPEC, - format='vega', - mode='vega-lite', - vega_version=VEGA_VERSION, - vegalite_version=VEGALITE_VERSION, - vegaembed_version=VEGAEMBED_VERSION - ) - except ValueError as err: - if str(err).startswith('Internet connection'): - pytest.skip("web connection required for png/svg export") - else: - raise - assert bundle == {'application/vnd.vega.v3+json': VEGA_SPEC} +@require_altair_saver +def test_vegalite_to_vega_mimebundle(vegalite_spec, vega_spec): + bundle = spec_to_mimebundle( + spec=vegalite_spec, + format="vega", + mode="vega-lite", + vega_version=alt.VEGA_VERSION, + vegalite_version=alt.VEGALITE_VERSION, + vegaembed_version=alt.VEGAEMBED_VERSION, + ) + assert bundle == {"application/vnd.vega.v5+json": vega_spec} -def test_spec_to_vegalite_mimebundle(): +def test_spec_to_vegalite_mimebundle(vegalite_spec): bundle = spec_to_mimebundle( - spec=VEGALITE_SPEC, - mode='vega-lite', - format='vega-lite', - vegalite_version=VEGALITE_VERSION + spec=vegalite_spec, + mode="vega-lite", + format="vega-lite", + vegalite_version=alt.VEGALITE_VERSION, ) - assert bundle == {'application/vnd.vegalite.v2+json': VEGALITE_SPEC} + assert bundle == {"application/vnd.vegalite.v4+json": vegalite_spec} -def test_spec_to_json_mimebundle(): +def test_spec_to_vega_mimebundle(vega_spec): bundle = spec_to_mimebundle( - spec=VEGALITE_SPEC, - mode='vega-lite', - format='json', + spec=vega_spec, + mode="vega", + format="vega", + vega_version=alt.VEGA_VERSION ) - assert bundle == {'application/json': VEGALITE_SPEC} + assert bundle == {"application/vnd.vega.v5+json": vega_spec} + + +def test_spec_to_json_mimebundle(): + bundle = spec_to_mimebundle(spec=vegalite_spec, mode="vega-lite", format="json",) + assert bundle == {"application/json": vegalite_spec} diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -14,9 +14,9 @@ from altair.utils import AltairDeprecationWarning try: - import selenium + import altair_saver # noqa: F401 except ImportError: - selenium = None + altair_saver = None def getargs(*args, **kwargs): @@ -230,44 +230,39 @@ def test_selection_expression(): @pytest.mark.parametrize('format', ['html', 'json', 'png', 'svg']) [email protected]('not selenium') def test_save(format, basic_chart): - if format in ['html', 'json', 'svg']: - out = io.StringIO() - mode = 'r' - else: + if format == 'png': out = io.BytesIO() mode = 'rb' + else: + out = io.StringIO() + mode = 'r' + + if format in ['svg', 'png'] and not altair_saver: + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert "github.com/altair-viz/altair_saver" in str(err.value) + return + + basic_chart.save(out, format=format) + out.seek(0) + content = out.read() + + if format == 'json': + assert '$schema' in json.loads(content) + if format == 'html': + assert content.startswith('<!DOCTYPE html>') fid, filename = tempfile.mkstemp(suffix='.' + format) os.close(fid) - + try: - try: - basic_chart.save(out, format=format) - basic_chart.save(filename) - except ValueError as err: - if str(err).startswith('Internet connection'): - pytest.skip("web connection required for png/svg export") - else: - raise - - out.seek(0) + basic_chart.save(filename) with open(filename, mode) as f: - assert f.read() == out.read() + assert f.read() == content finally: os.remove(filename) - out.seek(0) - - if format == 'json': - spec = json.load(out) - assert '$schema' in spec - - elif format == 'html': - content = out.read() - assert content.startswith('<!DOCTYPE html>') - def test_facet(): # wrapped facet diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -13,9 +13,9 @@ import altair.vegalite.v4 as alt try: - import selenium + import altair_saver # noqa: F401 except ImportError: - selenium = None + altair_saver = None def getargs(*args, **kwargs): @@ -229,44 +229,39 @@ def test_selection_expression(): @pytest.mark.parametrize('format', ['html', 'json', 'png', 'svg']) [email protected]('not selenium') def test_save(format, basic_chart): - if format in ['html', 'json', 'svg']: - out = io.StringIO() - mode = 'r' - else: + if format == 'png': out = io.BytesIO() mode = 'rb' + else: + out = io.StringIO() + mode = 'r' + + if format in ['svg', 'png'] and not altair_saver: + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert "github.com/altair-viz/altair_saver" in str(err.value) + return + + basic_chart.save(out, format=format) + out.seek(0) + content = out.read() + + if format == 'json': + assert '$schema' in json.loads(content) + if format == 'html': + assert content.startswith('<!DOCTYPE html>') fid, filename = tempfile.mkstemp(suffix='.' + format) os.close(fid) try: - try: - basic_chart.save(out, format=format) - basic_chart.save(filename) - except ValueError as err: - if str(err).startswith('Internet connection'): - pytest.skip("web connection required for png/svg export") - else: - raise - - out.seek(0) + basic_chart.save(filename) with open(filename, mode) as f: - assert f.read() == out.read() + assert f.read() == content finally: os.remove(filename) - out.seek(0) - - if format == 'json': - spec = json.load(out) - assert '$schema' in spec - - elif format == 'html': - content = out.read() - assert content.startswith('<!DOCTYPE html>') - def test_facet(): # wrapped facet
Move chart saving to an extension Currently, saving charts to PNG or SVG requires some additional setup in the form of optional dependencies. I think a clearer model would be to move this functionality to another package, which could then specify (and test) these dependencies itself.
I use Databricks Notebooks and installing browsers and web drivers in a databricks cluster is a lot of overhead to save a chart. Would be great if I could programmatically save them as part of pipeline runs to send out through slack webhooks or imported in dashboards. Take a look at https://github.com/altair-viz/altair_saver You can save charts via a nodejs stack instead of a selenium/headless driver stack. Installing the nodejs stack on a databricks cluster was _not_ easy. But altair_saver worked for me. Thanks!
2020-02-01T15:59:10Z
[]
[]
vega/altair
2,063
vega__altair-2063
[ "2062" ]
17cc9b10da162037b0fada923a571ec9d33b6ea5
diff --git a/altair/utils/save.py b/altair/utils/save.py --- a/altair/utils/save.py +++ b/altair/utils/save.py @@ -73,7 +73,7 @@ def save( format = fp.split(".")[-1] else: raise ValueError( - "must specify file format: " "['png', 'svg', 'html', 'json']" + "must specify file format: " "['png', 'svg', 'pdf', 'html', 'json']" ) spec = chart.to_dict() @@ -108,7 +108,7 @@ def save( **kwargs, ) write_file_or_filename(fp, mimebundle["text/html"], mode="w") - elif format in ["png", "svg"]: + elif format in ["png", "svg", "pdf"]: mimebundle = spec_to_mimebundle( spec=spec, format=format, @@ -122,6 +122,8 @@ def save( ) if format == "png": write_file_or_filename(fp, mimebundle["image/png"], mode="wb") + elif format == "pdf": + write_file_or_filename(fp, mimebundle["application/pdf"], mode="wb") else: write_file_or_filename(fp, mimebundle["image/svg+xml"], mode="w") else: diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -455,7 +455,8 @@ def save( ): """Save a chart to file in a variety of formats - Supported formats are json, html, png, svg + Supported formats are json, html, png, svg, pdf; the last three require + the altair_saver package to be installed. Parameters ---------- diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -433,14 +433,15 @@ def save( ): """Save a chart to file in a variety of formats - Supported formats are json, html, png, svg + Supported formats are json, html, png, svg, pdf; the last three require + the altair_saver package to be installed. Parameters ---------- fp : string filename or file-like object file in which to write the chart. format : string (optional) - the format to write: one of ['json', 'html', 'png', 'svg']. + the format to write: one of ['json', 'html', 'png', 'svg', 'pdf']. If not specified, the format will be determined from the filename. override_data_transformer : boolean (optional) If True (default), then the save action will be done with
diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -242,20 +242,28 @@ def test_selection_expression(): assert selection["value"].to_dict() == "{0}['value']".format(selection.name) [email protected]("format", ["html", "json", "png", "svg"]) [email protected]("format", ["html", "json", "png", "svg", "pdf"]) def test_save(format, basic_chart): - if format == "png": + if format in ["pdf", "png"]: out = io.BytesIO() mode = "rb" else: out = io.StringIO() mode = "r" - if format in ["svg", "png"] and not altair_saver: - with pytest.raises(ValueError) as err: - basic_chart.save(out, format=format) - assert "github.com/altair-viz/altair_saver" in str(err.value) - return + if format in ["svg", "png", "pdf"]: + if not altair_saver: + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert "github.com/altair-viz/altair_saver" in str(err.value) + return + elif format not in altair_saver.available_formats(): + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert f"No enabled saver found that supports format='{format}'" in str( + err.value + ) + return basic_chart.save(out, format=format) out.seek(0) @@ -272,7 +280,7 @@ def test_save(format, basic_chart): try: basic_chart.save(filename) with open(filename, mode) as f: - assert f.read() == content + assert f.read()[:1000] == content[:1000] finally: os.remove(filename) diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -241,20 +241,28 @@ def test_selection_expression(): assert selection["value"].to_dict() == "{0}['value']".format(selection.name) [email protected]("format", ["html", "json", "png", "svg"]) [email protected]("format", ["html", "json", "png", "svg", "pdf"]) def test_save(format, basic_chart): - if format == "png": + if format in ["pdf", "png"]: out = io.BytesIO() mode = "rb" else: out = io.StringIO() mode = "r" - if format in ["svg", "png"] and not altair_saver: - with pytest.raises(ValueError) as err: - basic_chart.save(out, format=format) - assert "github.com/altair-viz/altair_saver" in str(err.value) - return + if format in ["svg", "png", "pdf"]: + if not altair_saver: + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert "github.com/altair-viz/altair_saver" in str(err.value) + return + elif format not in altair_saver.available_formats(): + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert f"No enabled saver found that supports format='{format}'" in str( + err.value + ) + return basic_chart.save(out, format=format) out.seek(0) @@ -271,7 +279,7 @@ def test_save(format, basic_chart): try: basic_chart.save(filename) with open(filename, mode) as f: - assert f.read() == content + assert f.read()[:1000] == content[:1000] finally: os.remove(filename)
chart.save does not support pdf as shown in docs [The docs](https://altair-viz.github.io/user_guide/saving_charts.html#png-svg-and-pdf-format) for saving charts show `chart.save('chart.pdf')` as one of the options, but running that results in `ValueError: unrecognized format: 'pdf'`, even though `altair_saver` is installed and `from altair_saver import save; save(chart, "chart.pdf")` works. By contrast, `chart.save("chart.svg")` works fine. Looking at the [docstring of `Chart.save`](https://altair-viz.github.io/user_guide/generated/toplevel/altair.Chart.html#altair.Chart.save), it looks like pdf isn't even supposed to work: "Supported formats are json, html, png, svg". But maybe it's just a matter of wiring it up? If the issue is more complicated than that (maybe because `Chart.save` is currently hardwired to use the Selenium backend, which doesn't offer pdf export?), then I would suggest just removing `chart.save('chart.pdf')` from the code example and refer users who are interested in pdf export functionality to `altair_saver`'s docs :)
This requires altair version 4.1 or later. Check what version you are using with ```python import altair print(altair.__version__) ``` `4.1.0`, I've just installed it... But maybe I've misconfigured it then? Ah, yeah, you're right. the mimebundle code has been updated, but we neglected to thread through the save method for pdf. This is a bug. What error do you get when trying to save a png? I'm surprised that doesn't work, because (unlike PDF) it's covered in the test suite in several places.
2020-04-04T04:34:19Z
[]
[]
vega/altair
2,355
vega__altair-2355
[ "2354" ]
54e03d403c1cec9ce2f2e8b14dc3d936c6686128
diff --git a/altair/utils/save.py b/altair/utils/save.py --- a/altair/utils/save.py +++ b/altair/utils/save.py @@ -1,11 +1,13 @@ import json +import pathlib from .mimebundle import spec_to_mimebundle def write_file_or_filename(fp, content, mode="w"): - """Write content to fp, whether fp is a string or a file-like object""" - if isinstance(fp, str): + """Write content to fp, whether fp is a string, a pathlib Path or a + file-like object""" + if isinstance(fp, str) or isinstance(fp, pathlib.PurePath): with open(fp, mode) as f: f.write(content) else: @@ -34,8 +36,8 @@ def save( ---------- chart : alt.Chart the chart instance to save - fp : string filename or file-like object - file in which to write the chart. + fp : string filename, pathlib.Path or file-like object + file to which to write the chart. format : string (optional) the format to write: one of ['json', 'html', 'png', 'svg']. If not specified, the format will be determined from the filename. @@ -71,6 +73,8 @@ def save( if format is None: if isinstance(fp, str): format = fp.split(".")[-1] + elif isinstance(fp, pathlib.PurePath): + format = fp.suffix.lstrip(".") else: raise ValueError( "must specify file format: " "['png', 'svg', 'pdf', 'html', 'json']"
diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -4,6 +4,7 @@ import json import operator import os +import pathlib import tempfile import jsonschema @@ -284,12 +285,14 @@ def test_save(format, basic_chart): fid, filename = tempfile.mkstemp(suffix="." + format) os.close(fid) - try: - basic_chart.save(filename) - with open(filename, mode) as f: - assert f.read()[:1000] == content[:1000] - finally: - os.remove(filename) + # test both string filenames and pathlib.Paths + for fp in [filename, pathlib.Path(filename)]: + try: + basic_chart.save(fp) + with open(fp, mode) as f: + assert f.read()[:1000] == content[:1000] + finally: + os.remove(fp) def test_facet_basic():
Allow Paths in save() Instead of allowing only string paths or file-likes, allow pathlib.Paths to be passed to `save()`. Are these two the only places that would have to be changed? https://github.com/altair-viz/altair/blob/54e03d403c1cec9ce2f2e8b14dc3d936c6686128/altair/utils/save.py#L8 https://github.com/altair-viz/altair/blob/54e03d403c1cec9ce2f2e8b14dc3d936c6686128/altair/utils/save.py#L72
I think these are the correct places to make the change. Additionally, I think similar changes would be required in [altair_saver](https://github.com/altair-viz/altair_saver), which altair delegates to for png & pdf saves. In that case, let me try to take a crack at this!
2020-11-30T20:34:56Z
[]
[]
vega/altair
2,403
vega__altair-2403
[ "2402" ]
8e42747ddc6e8784b4caad2a85db290a604cc96b
diff --git a/altair/expr/core.py b/altair/expr/core.py --- a/altair/expr/core.py +++ b/altair/expr/core.py @@ -8,6 +8,8 @@ def __repr__(self): return "datum" def __getattr__(self, attr): + if attr.startswith("__") and attr.endswith("__"): + raise AttributeError(attr) return GetAttrExpression("datum", attr) def __getitem__(self, attr): diff --git a/altair/vegalite/v3/api.py b/altair/vegalite/v3/api.py --- a/altair/vegalite/v3/api.py +++ b/altair/vegalite/v3/api.py @@ -194,6 +194,8 @@ def __or__(self, other): return Selection(core.SelectionOr(**{"or": [self.name, other]}), self.selection) def __getattr__(self, field_name): + if field_name.startswith("__") and field_name.endswith("__"): + raise AttributeError(field_name) return expr.core.GetAttrExpression(self.name, field_name) def __getitem__(self, field_name): diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -194,6 +194,8 @@ def __or__(self, other): return Selection(core.SelectionOr(**{"or": [self.name, other]}), self.selection) def __getattr__(self, field_name): + if field_name.startswith("__") and field_name.endswith("__"): + raise AttributeError(field_name) return expr.core.GetAttrExpression(self.name, field_name) def __getitem__(self, field_name):
diff --git a/altair/expr/tests/test_expr.py b/altair/expr/tests/test_expr.py --- a/altair/expr/tests/test_expr.py +++ b/altair/expr/tests/test_expr.py @@ -1,5 +1,7 @@ import operator +import pytest + from ... import expr from .. import datum @@ -95,6 +97,9 @@ def test_datum_getattr(): x = datum["foo"] assert repr(x) == "datum['foo']" + with pytest.raises(AttributeError): + datum.__magic__ + def test_expression_getitem(): x = datum.foo[0] diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -249,6 +249,9 @@ def test_selection_expression(): assert isinstance(selection["value"], alt.expr.Expression) assert selection["value"].to_dict() == "{0}['value']".format(selection.name) + with pytest.raises(AttributeError): + selection.__magic__ + @pytest.mark.parametrize("format", ["html", "json", "png", "svg", "pdf"]) def test_save(format, basic_chart): diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -249,6 +249,9 @@ def test_selection_expression(): assert isinstance(selection["value"], alt.expr.Expression) assert selection["value"].to_dict() == "{0}['value']".format(selection.name) + with pytest.raises(AttributeError): + selection.__magic__ + @pytest.mark.parametrize("format", ["html", "json", "png", "svg", "pdf"]) def test_save(format, basic_chart):
`DatumType` and `Selection` instances are not deep copyable. Thanks for your work on Altair, which makes generating VegaLite plots in Python super easy. One issue I've come across is that you cannot deep-copy some of the object types because the `__getattr__` implementations of some objects are too broad (i.e. https://github.com/altair-viz/altair/blob/master/altair/expr/core.py#L14, https://github.com/altair-viz/altair/blob/d862ad494ecc0a5cff7e8b114df14e0796efa108/altair/vegalite/v3/api.py#L196, https://github.com/altair-viz/altair/blob/d862ad494ecc0a5cff7e8b114df14e0796efa108/altair/vegalite/v4/api.py#L196). These methods return a result for *any* request, including Python magic attributes of form `__<name>__`, which causes issues for modules like `copy.deepcopy` which looks for a `__deepcopy__` method on the object being copied to see if the copying behaviour has been overridden. Would you be willing to accept patches to fix this? Or is this done intentionally?
This was done intentionally, becuase charts may have a column named `__deepcopy__` in which case `alt.datum.__deepcopy__` is how you would access that attribute within an expression. But that's probably a rare case, and `alt.datum['__deepcopy__']` is a reasonable workaround. I'd be open to a change that makes `__getattr__` return an `AttributeError` for dunder attributes.
2021-02-10T05:38:42Z
[]
[]
vega/altair
2,522
vega__altair-2522
[ "245" ]
1f6d1c953cac4a50e9ff2ba0a25ba3f398887784
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -193,8 +193,6 @@ def infer_vegalite_type(data): # Otherwise, infer based on the dtype of the input typ = infer_dtype(data) - # TODO: Once this returns 'O', please update test_select_x and test_select_y in test_api.py - if typ in [ "floating", "mixed-integer-float", @@ -203,6 +201,8 @@ def infer_vegalite_type(data): "complex", ]: return "quantitative" + elif typ == "categorical" and data.cat.ordered: + return ("ordinal", data.cat.categories.tolist()) elif typ in ["string", "bytes", "categorical", "boolean", "mixed", "unicode"]: return "nominal" elif typ in [ @@ -316,8 +316,9 @@ def to_list_if_array(val): for col_name, dtype in df.dtypes.items(): if str(dtype) == "category": - # XXXX: work around bug in to_json for categorical types + # Work around bug in to_json for categorical types in older versions of pandas # https://github.com/pydata/pandas/issues/10778 + # https://github.com/altair-viz/altair/pull/2170 col = df[col_name].astype(object) df[col_name] = col.where(col.notnull(), None) elif str(dtype) == "string": @@ -527,6 +528,10 @@ def parse_shorthand( if isinstance(data, pd.DataFrame) and "type" not in attrs: if "field" in attrs and attrs["field"] in data.columns: attrs["type"] = infer_vegalite_type(data[attrs["field"]]) + # ordered categorical dataframe columns return the type and sort order as a tuple + if isinstance(attrs["type"], tuple): + attrs["sort"] = attrs["type"][1] + attrs["type"] = attrs["type"][0] return attrs diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -364,6 +364,14 @@ def to_dict(self, validate=True, ignore=None, context=None): # parsed_shorthand is removed from context if it exists so that it is # not passed to child to_dict function calls parsed_shorthand = context.pop("parsed_shorthand", {}) + # Prevent that pandas categorical data is automatically sorted + # when a non-ordinal data type is specifed manually + if "sort" in parsed_shorthand and kwds["type"] not in [ + "ordinal", + Undefined, + ]: + parsed_shorthand.pop("sort") + kwds.update( { k: v diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -362,6 +362,14 @@ def to_dict(self, validate=True, ignore=None, context=None): # parsed_shorthand is removed from context if it exists so that it is # not passed to child to_dict function calls parsed_shorthand = context.pop("parsed_shorthand", {}) + # Prevent that pandas categorical data is automatically sorted + # when a non-ordinal data type is specifed manually + if "sort" in parsed_shorthand and kwds["type"] not in [ + "ordinal", + Undefined, + ]: + parsed_shorthand.pop("sort") + kwds.update( { k: v
diff --git a/tests/vegalite/v5/tests/test_api.py b/tests/vegalite/v5/tests/test_api.py --- a/tests/vegalite/v5/tests/test_api.py +++ b/tests/vegalite/v5/tests/test_api.py @@ -123,6 +123,7 @@ def test_chart_infer_types(): "x": pd.date_range("2012", periods=10, freq="Y"), "y": range(10), "c": list("abcabcabca"), + "s": pd.Categorical([1, 2] * 5, categories=[2, 1], ordered=True), } ) @@ -134,32 +135,45 @@ def _check_encodings(chart): assert dct["encoding"]["y"]["field"] == "y" assert dct["encoding"]["color"]["type"] == "nominal" assert dct["encoding"]["color"]["field"] == "c" + assert dct["encoding"]["size"]["type"] == "ordinal" + assert dct["encoding"]["size"]["field"] == "s" + assert dct["encoding"]["size"]["sort"] == [2, 1] # Pass field names by keyword - chart = alt.Chart(data).mark_point().encode(x="x", y="y", color="c") + chart = alt.Chart(data).mark_point().encode(x="x", y="y", color="c", size="s") _check_encodings(chart) # pass Channel objects by keyword chart = ( alt.Chart(data) .mark_point() - .encode(x=alt.X("x"), y=alt.Y("y"), color=alt.Color("c")) + .encode(x=alt.X("x"), y=alt.Y("y"), color=alt.Color("c"), size=alt.Size("s")) ) _check_encodings(chart) # pass Channel objects by value - chart = alt.Chart(data).mark_point().encode(alt.X("x"), alt.Y("y"), alt.Color("c")) + chart = ( + alt.Chart(data) + .mark_point() + .encode(alt.X("x"), alt.Y("y"), alt.Color("c"), alt.Size("s")) + ) _check_encodings(chart) # override default types chart = ( alt.Chart(data) .mark_point() - .encode(alt.X("x", type="nominal"), alt.Y("y", type="ordinal")) + .encode( + alt.X("x", type="nominal"), + alt.Y("y", type="ordinal"), + alt.Size("s", type="nominal"), + ) ) dct = chart.to_dict() assert dct["encoding"]["x"]["type"] == "nominal" assert dct["encoding"]["y"]["type"] == "ordinal" + assert dct["encoding"]["size"]["type"] == "nominal" + assert "sort" not in dct["encoding"]["size"] @pytest.mark.parametrize(
Support of ordinal based on pandas' ordered Categorical type? I've just started to play with altair, using the [diamonds](http://vincentarelbundock.github.io/Rdatasets/datasets.html) dataset. Here is the notebook to clarify what I did https://gist.github.com/pierre-haessig/09fa9268aa0a0e7d91356f681f96ca18 Since, I'm not familiar with altair, I maybe missed something, but I've got the feeling that ordered Categorical types from pandas are not supported. Indeed, if I use a color='cut' encoding, when cut is a pandas Series with an _ordered_ category dtype, I get by default a nominal type of coloring (with "unordered" colors). On the other hand, if I force the use of ordered with color='cut:O', I indeed get the ordered colored (the shades of green), but the _order is wrong_! (I get Fair, Good, Ideal, Premium, Very Good, while the correct order is 'Fair', 'Good', 'Very Good', 'Premium', 'Ideal', as manually defined in pandas' category)
Hi, thanks for the report! Currently, because of a [bug](https://github.com/pydata/pandas/issues/10778) in behavior for categoricals in Pandas' `to_json` function, altair first [converts categorical types to strings](https://github.com/altair-viz/altair/blob/master/altair/utils/core.py#L152) before serializing a dataframe as JSON. Thus Altair only knows about alphabetical ordering. This is something that we should figure out how to address. In the meantime, you can specify the order manually within the encoding with, e.g. `x=X('cut:O', scale=Scale(domain=['Fair', 'Good', 'Very Good', 'Premium', 'Ideal'])` I haven't tested that, but I think it should work. @jakevdp thanks for the feedback. I had to adapt your suggestion, since it's the color I wants, rather than x. this is what I end up with: ``` python c = Chart(data_samp) cut_cat = ['Fair', 'Good', 'Very Good', 'Premium', 'Ideal'] cut_scale = Scale(domain=cut_cat, type='ordinal') c.mark_circle().encode(x='carat', y='price', color=Color('cut:O', scale=cut_scale)) ``` so there are two remaining issues: 1. I shouldn't have to specify that the scale is ordinal if I already say it in the data encoding. However, if I remove `type='ordinal'` from the def of Scale, I get black marks... 2. After specifying `type='ordinal'`, I get the shades of green, but the order is really messy (i.e.: order in the legend is back to alphabetical, and color order is mysterious), see plot below. ![vega](https://cloud.githubusercontent.com/assets/1010404/19677881/abd3a8b4-9a9b-11e6-8dee-a9e4d8170258.png) ! Huh... that's not great. I'm not certain why Vega-Lite requires you to specify 'ordinal' in both places, or why the color order is so strange. Maybe @kanitw would have ideas? Having the same issue. See [this notebook](https://github.com/dhimmel/biorxiv-licenses/blob/8af02ba1cbdc3dd1c8ca179b5576b341fdd47b52/1.analysis.ipynb) where I use nominal ordering as a workaround to the [color issue](https://github.com/altair-viz/altair/issues/245#issuecomment-255968124): ![vega](https://cloud.githubusercontent.com/assets/1117703/20689191/05107662-b592-11e6-9075-60739ae18fd2.png) Another issue arises where the legend ordering doesn't match the ordering in the plot. The legend is in the right order, but the area marks are incorrectly ordered. I think this would be worth posting as a bug to Vega-Lite itself. @pierre-haessig -- Thanks for reporting. This is definitely a bug. I just created https://github.com/vega/vega-lite/issues/1732. The issue contains a workaround for this: using nominal type like @dhimmel suggests and set custom color range manually. (You might find [colorbrewer](http://colorbrewer2.org) useful.) We will make sure to fix this for the 2.0 release. (We probably won't fix this in 1.x since it should be very easy to fix this in Vega 3, but quite complicated to do this in Vega 2. Since we have a temporary workaround, we will focus our efforts on 2.0 development.) @kanitw I posted https://github.com/vega/vega-lite/issues/1732#issuecomment-263454554 before I saw the previous comment. > The issue contains a workaround for this: using nominal type like @dhimmel suggests It's not quite a workaround because the marks (bands) are not in the right order? Is there a way to fix that? For other people following this issue, here is [a workaround](https://github.com/vega/vega-lite/issues/1734#issuecomment-263481177) for the following question. > It's not quite a workaround because the marks (bands) are not in the right order? Is there a way to fix that? FWIW the to_json segfault issue for Categorical dtype appears to be fixed in pandas: https://github.com/pandas-dev/pandas/pull/12802 @dsaxton Did you PR work for using pandas categoricals? I would love this functionality i Altair and it seems promising that the pandas json bug has been fixed! > @dsaxton Did you PR work for using pandas categoricals? I would love this functionality i Altair and it seems promising that the pandas json bug has been fixed! It seemed to be working, although I didn't do any testing outside of Altair's CI Just to add another example where this issue is limiting. The [Stacked Bar Chart example with Sorted Segments ](https://altair-viz.github.io/gallery/stacked_bar_chart_sorted_segments.html) in the Example's gallery doesn't sort if one uses custom ordering on a pandas categorical data type. ```python from vega_datasets import data source = data.barley() # custom ordering of categorical data type site_lst = ['Crookston', 'Morris', 'University Farm','Duluth', 'Grand Rapids', 'Waseca'] source.site = pd.Categorical(source.site, site_lst, ordered = True) # The stacks are not ordered according to the 'site' variable ordering # They use alphabetical sort by default and I have no idea how to alter this to work. alt.Chart(source).mark_bar().encode( x='sum(yield)', y='variety', color='site', order=alt.Order( # Sort the segments of the bars by this field 'site', sort= 'ascending' ) ) ``` ![image](https://user-images.githubusercontent.com/76084890/102465487-b8285600-4073-11eb-85d2-f0db60c0f0b6.png) Things I have tried to no avail: 1. I tried using `sort = None` as an argument for `alt.Color` but that doesn't work for correcting the stack either. 2. `alt.Order` doesn't accept a list; only accepts `"ascending"` or `"descending"` 3. using the sort argument with the list `site_lst` in `alt.X` doesn't work either @sadzart Custom sorting is possible, by accessing undocumented created new fields during compilation.. probably not recommended. (related to https://github.com/vega/vega-lite/issues/1734#issuecomment-533223530) ```python import altair as alt import pandas as pd from vega_datasets import data source = data.barley() # custom ordering of categorical data type site_lst = ['Crookston', 'Morris', 'University Farm','Duluth', 'Grand Rapids', 'Waseca'] source.site = pd.Categorical(source.site, site_lst, ordered = True) alt.Chart(source).mark_bar().encode( x='sum(yield)', y='variety', color=alt.Color('site', sort=alt.Sort(site_lst)), order=alt.Order('color_site_sort_index:Q', sort='ascending' ) ) ``` <img width="616" alt="image" src="https://user-images.githubusercontent.com/5186265/102685040-e9bd3080-41dd-11eb-8910-88c61ac0f0bb.png"> By introducing a `sort` for the `color` channel, the `color_site_sort_index` is added as a new field/column in the dataset. You'll have to use `:Q` to assign type manually in the `order` channel, since Altair cannot defer the type of a yet unexisting field. To observe what happens to your chart you can inspect the data-viewer in the Vega editor. [Open the Chart in the Vega Editor](https://vega.github.io/editor/#/url/vega-lite/N4Igxg9gdgZglgcxALlANzgUwO4tJKAFzigFcJSBnAdTgBNCALFAFgAY2AacaYsiygAlMiRoRQBmDgF9p3OgENCCvCCgKAtphQhFygLRsAnBMxhMADjASArACM7AJjosAjMZZgYdgGyuJFmYW7nYgciAaCgBOANY6dtEg3JhQkHQkSKg8ADYQUaqEAJ4ADtrIahAaJArZSSDwmNl0OpRwhNrclHniyADaIADCURAQMZSE0HUAsnlRcJR1AKpQcGiYUa1FAAQAYtEadQAipNmkTHUA4lEKUHRbAEoKxfQL3NQKlGYqALrheXTrAolMoVKrqWrcBpNFptDogLpRHogD7mW4ZMLcAAeQNKOgAjqQbsRlMQ1nUFAgEFFMAglCDKKQDpCsNDyoUWc1woUcSCoJVqhD6hydGholgimFwgASShgRiYSI6MSEYqUZAAenVa1pADoEG1GKQ7Dq4BB1bL5ZEtTSFPpsrCtSwdRYda4dQArLpQOp6D6YQgLLK+wwmMyWaz2JwudxGTzePwBIIhFC9UDsxrNZCOADs3FFc393PKUxuctIcxU3EKmESyFcJlcnVhOmWq3Wm0Ku32GLTwuQLBdFh8w9zIHz4qLIBLqUNFbq1dr9YkjfhzfK70+YBUcl7GZQOZ1LAkx5YebFhZ007Lc6rNfydYbTfal9m8x7IHTrIkRh1JmPEjPAsJWLUtZzgSsPzvFAlxXTYQSGEYxgmb0dw-PsJEcX9hx8UdxwvECZ3LcD5ygh9lyfEErhuO5HmeOgFlQz9M0cF0jGw3Dz2AqdQKIiCF3vGCKJ0Y5TnORi+yPHU2GwnxAInHQLmyBQ7GGb1b0XR9V2fcpWzWDY2k7PYogOcS92QGwbB1Rw5PwkBFOU1SSI08itJBDcvnfJj9xdbN2Jsrj7JUyZ1IEzS4JfKI5gYzhdy-F1-H-fzJ0CxyQugsK10GYZRnGSZTNZRwfwS48koUpSgrUyDnNgzKqNuB4nheTy+0KnUZI4oDkvK1KqtClzwvKESzmYfLM1sV1-wAsdOMnABlUUoC6ZQnL6mrtJAXT2wMrtjOasyWGzHVJqmvCuPmm4lr40jBNcnR3K3PaCss3yR1K8pzsWiBlrSsi1pBGZIrfUbWDYQ8-OmzqdA+y6VvS-rMoQnLkMe5if3at6QGhr6ruqoTyjqmjGvolH92ejGse+3q4b+4STmGknkG-X8MYANUaNZxB+m6Bo2lY9I7HaTJitCzJsUHHEm1n2f9WHfrxkB7u3YWvKzHwJsSiH5PKNnsg52XucygGooZtwjslzXbJ1vWuYy9bEaQvLlZaiQpPN07JytmWbfh9aCYaujoti5i1ZOmadE9zmqbl27BrpsSnbMiQ1ZsGSMYAFWpOw4H122QU2-TtiMoWg5QHwXYsDX3Z0DPMCznOfbcv0HuB-sXZenD08z7PvZp4tX0DkXWRYNW-xKi2uJruue-l+3cpQhOCp-duOq1kBJ+7qODd9656topqW+PX83bD8p1-r3uQCG+OS9bqzwar8oADkIB1LYWBsbNz-l-OBaLhmbHihjZ+r936f2njHBWTclY3xYjqFetlgFvw-l-CBRsgYL0zO-Nq98T4gEQaAlBPNZ7IwPphVwODIZPxfkgsBm9c4KR3oTAODND6yXHpOfByDwE8yviNDBkg1ZsIfng6hw9HCEMyj-baf8W4+Geq9dhOh8E+HEdwzKisWGgyTgo4RyjVF0IbhFY2LcBw6hTthIBoiVESLttlB288YFOlHqeRRVCQHWLUdvai-t978KzIA1xIj3H6P4tTeWvCWGYWXhjAACjWQgSlbg2LznzLahduwmJdOY4csT4mJOaJ4xum5oGD1Rs6Chq84lKHyckox6Cb6myEbgqpCTqK1PKMQx2N8JBOngVxFpNTCkMO8XvYmpDcnVLaUM2Ook+GOOwTo3B+Dsw2HabzNsBdDIZL8cPOBFSEGiJWWsjRLdHCYSaZQoJb8jnTKnP3E2ToVy6MOas25nSHGlPSnAyxICbkGIvn7UZA8VaH2khYwJyzXn-PCXHOZnzGY-lDpc2gspoCtCgFsRBAQ1lSPSbtFuADnQYxRQQdFmLqHYtuScvxrVh6LORfMUlJByWv0pdC1B9yTE-iHPS1eJK0XMqxRYNZ7yWFOjpR3QJ-LFqCopcK25gKibAvQm6C5fLGUCoxUKtZETTkjwxleMCOM+rWQgbirZ+K-GHwlX0ychreL11NTzal3SnTaJyYE+1N4DFOsNpyq1mE2K8tsl64i3tfW2MQnPBmZz1Zj2EaG41cMI2UUYT4sZNLMLZNtZeHi3rQlkRTbTWZLC1YWAxilYKPrv6pM2YLFhh1szH0uZWyqBalxFvXFAlhllipItXq2x18s0HKrMo4NW5Dg0BW6lW9tJhO1ZSjSQvxrhxXNoHTOtt1153y0Vcw05lkeWSuEYO8NMKS2nMOkeE85MFowzPWa2tv9tndKybei62Mh0QJdfC8abB122Qpkmwtw7-UwNBmXSuuCgNfqIXY6NLdyFtQA2dO9n6H08z3b4mBmEJZQcuTBjDmVdU0rLVLXWXtq2Po2c+y13Sr3ketlR513aD6DhQx7aWkc50YVA4DUdX5MJgo9cIiOsGEbweXd03DHHw5cfE143eSqY2YRtYxyjPGF0kZgT+YTObT5dwUykmj0iX3wpYD+PD-bbJnyI+tH9KtdmQfjbg2zzG-X8ZNm6Cu+HV5uc0zPSTXT4WOAg7JgztcN4BYgVhjN3SIOd0i0Z4t9M9WHn-C455ICuHufWua+tJjcM-JoclrtxSTYuxsBl4rBC7P-TA7+t14Wrm1dy-BILHyVb1jBlOjhoicvRcw2moFKnvkQv67QwbxHYUxsstmmrHi2stifaZuj5nekLZCdu3j37WM7P0y1xbU31ojs0WY5rejSuLqRsFrrP4jCbau7FgTzEs2Pbqyl6+IWXR6Yma0pJH2dIrbxcXX9at-2+dsgMqZS2yseRMS7U1wjocA9h3czzB6rLNZRwUtHoq0vRMCTjp7w3lMHzdO6g7xPAeXxmwfLg43flQuO8Z-mq3QeObdOO3rSiXlXYcxJJ0VnrNcUhVd07pC40i760zq7+OV2WWFzVv5LPhlKf3TSw6lPlfM+21punVry1So1TKrVcqrv5ZkX4wlk7j24OlWS7VNOBf7UOrbg7DvZWsvlWjiXVrLIPeN6i03LKthstVx0jrMaIP7K4p7s33uScjLJzSxFzX4+h-D3r89qXfjSCAA) @mattijn Worked like a charm. Thanks That's a really neat solution @mattijn - but I'm having trouble with my dataset. I can change the legend order, but the order on the actual plot doesn't change. Here's a minimal example: ``` import altair as alt import pandas as pd dfdict = { "Questions": { 0: "Question Text", 1: "Question Text", 2: "Question Text", 3: "Question Text", 4: "Question Text", 5: "Question Text", }, "level": { 0: "1 - Strongly Disagree", 1: "2 - Disagree", 2: "3 - Neutral", 3: "4 - Agree", 4: "5 - Strongly Agree", 5: "N/A", }, "value": {0: 1.4, 1: 5.7, 2: 10.0, 3: 32.9, 4: 47.1, 5: 2.9}, } df = pd.DataFrame(dfdict) sort_order = [ "N/A", "5 - Strongly Agree", "4 - Agree", "3 - Neutral", "2 - Disagree", "1 - Strongly Disagree", ] # This doesn't seem to be needed df["level"] = pd.Categorical(df["level"], sort_order, ordered=True) chart = ( alt.Chart(df) .mark_bar() .encode( x=alt.X("value"), y=alt.Y("Questions", title=""), color=alt.Color("level", sort=alt.Sort(sort_order)), order=alt.Order("color_site_sort_index:Q"), ) ) chart ``` <img width="764" alt="Screen Shot 2021-03-07 at 5 32 25 PM" src="https://user-images.githubusercontent.com/2507459/110263290-1e35c280-7f6b-11eb-9aad-176a7cb30fb2.png"> Ideal order would be - from left to right - N/A, 5 - Strongly Agree, 4 - Agree, etc... What I am able to accomplish is my ideal order from right to left. Inverting the sort_order list just changes the legend order, but the order the data is plotted. FYI: I know this is an issue with my plot because I can reproduce your example just fine. Thanks in advance The syntax of the undocumented feature is `"color_<column-name>_sort_index"`, so if you change your example to `"color_level_sort_index:O"`, it works. Whoops!! Good catch! Thanks that works. Full code for someone looking to reproduce: ``` import altair as alt import pandas as pd dfdict = { "Questions": { 0: "Question Text", 1: "Question Text", 2: "Question Text", 3: "Question Text", 4: "Question Text", 5: "Question Text", }, "level": { 0: "1 - Strongly Disagree", 1: "2 - Disagree", 2: "3 - Neutral", 3: "4 - Agree", 4: "5 - Strongly Agree", 5: "N/A", }, "value": {0: 1.4, 1: 5.7, 2: 10.0, 3: 32.9, 4: 47.1, 5: 2.9}, } df = pd.DataFrame(dfdict) sort_order = [ "N/A", "5 - Strongly Agree", "4 - Agree", "3 - Neutral", "2 - Disagree", "1 - Strongly Disagree", ] # This doesn't seem to be needed df["level"] = pd.Categorical(df["level"], sort_order, ordered=True) chart = ( alt.Chart(df) .mark_bar() .encode( x=alt.X("value"), y=alt.Y("Questions", title=""), color=alt.Color("level", sort=alt.Sort(sort_order)), order=alt.Order("color_level_sort_index:Q"), ) ) chart ``` <img width="839" alt="Screen Shot 2021-03-07 at 7 24 42 PM" src="https://user-images.githubusercontent.com/2507459/110270487-c606bc80-7f7a-11eb-9af6-7f64f3f18277.png">
2021-11-18T03:19:55Z
[]
[]
vega/altair
2,568
vega__altair-2568
[ "2565" ]
ef8ff946bf610c19ccbecfbbd6b624004c25fb32
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -6,6 +6,7 @@ import json import textwrap from typing import Any, Sequence, List +from itertools import zip_longest import jsonschema import jsonschema.exceptions @@ -15,6 +16,7 @@ from altair import vegalite + # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for # larger specs, but leads to much more useful tracebacks for the user. @@ -158,6 +160,63 @@ def __init__(self, obj, err): self.obj = obj self._additional_errors = getattr(err, "_additional_errors", []) + @staticmethod + def _format_params_as_table(param_dict_keys): + """Format param names into a table so that they are easier to read""" + param_names, name_lengths = zip( + *[ + (name, len(name)) + for name in param_dict_keys + if name not in ["kwds", "self"] + ] + ) + # Worst case scenario with the same longest param name in the same + # row for all columns + max_name_length = max(name_lengths) + max_column_width = 80 + # Output a square table if not too big (since it is easier to read) + num_param_names = len(param_names) + square_columns = int(np.ceil(num_param_names**0.5)) + columns = min(max_column_width // max_name_length, square_columns) + + # Compute roughly equal column heights to evenly divide the param names + def split_into_equal_parts(n, p): + return [n // p + 1] * (n % p) + [n // p] * (p - n % p) + + column_heights = split_into_equal_parts(num_param_names, columns) + + # Section the param names into columns and compute their widths + param_names_columns = [] + column_max_widths = [] + last_end_idx = 0 + for ch in column_heights: + param_names_columns.append(param_names[last_end_idx : last_end_idx + ch]) + column_max_widths.append( + max([len(param_name) for param_name in param_names_columns[-1]]) + ) + last_end_idx = ch + last_end_idx + + # Transpose the param name columns into rows to facilitate looping + param_names_rows = [] + for li in zip_longest(*param_names_columns, fillvalue=""): + param_names_rows.append(li) + # Build the table as a string by iterating over and formatting the rows + param_names_table = "" + for param_names_row in param_names_rows: + for num, param_name in enumerate(param_names_row): + # Set column width based on the longest param in the column + max_name_length_column = column_max_widths[num] + column_pad = 3 + param_names_table += "{:<{}}".format( + param_name, max_name_length_column + column_pad + ) + # Insert newlines and spacing after the last element in each row + if num == (len(param_names_row) - 1): + param_names_table += "\n" + # 16 is the indendation of the returned multiline string below + param_names_table += " " * 16 + return param_names_table + def __str__(self): # Try to get the lowest class possible in the chart hierarchy so # it can be displayed in the error message. This should lead to more informative @@ -174,26 +233,48 @@ def __str__(self): # back on the class of the top-level object which created # the SchemaValidationError cls = self.obj.__class__ - schema_path = ["{}.{}".format(cls.__module__, cls.__name__)] - schema_path.extend(self.schema_path) - schema_path = "->".join( - str(val) - for val in schema_path[:-1] - if val not in (0, "properties", "additionalProperties", "patternProperties") - ) - message = self.message - if self._additional_errors: - message += "\n " + "\n ".join( - [e.message for e in self._additional_errors] - ) - return """Invalid specification - {}, validating {!r} + # Output all existing parameters when an unknown parameter is specified + if self.validator == "additionalProperties": + param_dict_keys = inspect.signature(cls).parameters.keys() + param_names_table = self._format_params_as_table(param_dict_keys) + + # `cleandoc` removes multiline string indentation in the output + return inspect.cleandoc( + """`{}` has no parameter named {!r} + + Existing parameter names are: + {} + See the help for `{}` to read the full description of these parameters + """.format( + cls.__name__, + self.message.split("('")[-1].split("'")[0], + param_names_table, + cls.__name__, + ) + ) + # Use the default error message for all other cases than unknown parameter errors + else: + message = self.message + # Add a summary line when parameters are passed an invalid value + # For example: "'asdf' is an invalid value for `stack` + if self.absolute_path: + # The indentation here must match that of `cleandoc` below + message = f"""'{self.instance}' is an invalid value for `{self.absolute_path[-1]}`: + + {message}""" + + if self._additional_errors: + message += "\n " + "\n ".join( + [e.message for e in self._additional_errors] + ) - {} - """.format( - schema_path, self.validator, message - ) + return inspect.cleandoc( + """{} + """.format( + message + ) + ) class UndefinedType(object): diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -4,6 +4,7 @@ import json import textwrap from typing import Any, Sequence, List +from itertools import zip_longest import jsonschema import jsonschema.exceptions @@ -13,6 +14,7 @@ from altair import vegalite + # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for # larger specs, but leads to much more useful tracebacks for the user. @@ -156,6 +158,63 @@ def __init__(self, obj, err): self.obj = obj self._additional_errors = getattr(err, "_additional_errors", []) + @staticmethod + def _format_params_as_table(param_dict_keys): + """Format param names into a table so that they are easier to read""" + param_names, name_lengths = zip( + *[ + (name, len(name)) + for name in param_dict_keys + if name not in ["kwds", "self"] + ] + ) + # Worst case scenario with the same longest param name in the same + # row for all columns + max_name_length = max(name_lengths) + max_column_width = 80 + # Output a square table if not too big (since it is easier to read) + num_param_names = len(param_names) + square_columns = int(np.ceil(num_param_names**0.5)) + columns = min(max_column_width // max_name_length, square_columns) + + # Compute roughly equal column heights to evenly divide the param names + def split_into_equal_parts(n, p): + return [n // p + 1] * (n % p) + [n // p] * (p - n % p) + + column_heights = split_into_equal_parts(num_param_names, columns) + + # Section the param names into columns and compute their widths + param_names_columns = [] + column_max_widths = [] + last_end_idx = 0 + for ch in column_heights: + param_names_columns.append(param_names[last_end_idx : last_end_idx + ch]) + column_max_widths.append( + max([len(param_name) for param_name in param_names_columns[-1]]) + ) + last_end_idx = ch + last_end_idx + + # Transpose the param name columns into rows to facilitate looping + param_names_rows = [] + for li in zip_longest(*param_names_columns, fillvalue=""): + param_names_rows.append(li) + # Build the table as a string by iterating over and formatting the rows + param_names_table = "" + for param_names_row in param_names_rows: + for num, param_name in enumerate(param_names_row): + # Set column width based on the longest param in the column + max_name_length_column = column_max_widths[num] + column_pad = 3 + param_names_table += "{:<{}}".format( + param_name, max_name_length_column + column_pad + ) + # Insert newlines and spacing after the last element in each row + if num == (len(param_names_row) - 1): + param_names_table += "\n" + # 16 is the indendation of the returned multiline string below + param_names_table += " " * 16 + return param_names_table + def __str__(self): # Try to get the lowest class possible in the chart hierarchy so # it can be displayed in the error message. This should lead to more informative @@ -172,26 +231,48 @@ def __str__(self): # back on the class of the top-level object which created # the SchemaValidationError cls = self.obj.__class__ - schema_path = ["{}.{}".format(cls.__module__, cls.__name__)] - schema_path.extend(self.schema_path) - schema_path = "->".join( - str(val) - for val in schema_path[:-1] - if val not in (0, "properties", "additionalProperties", "patternProperties") - ) - message = self.message - if self._additional_errors: - message += "\n " + "\n ".join( - [e.message for e in self._additional_errors] - ) - return """Invalid specification - {}, validating {!r} + # Output all existing parameters when an unknown parameter is specified + if self.validator == "additionalProperties": + param_dict_keys = inspect.signature(cls).parameters.keys() + param_names_table = self._format_params_as_table(param_dict_keys) + + # `cleandoc` removes multiline string indentation in the output + return inspect.cleandoc( + """`{}` has no parameter named {!r} + + Existing parameter names are: + {} + See the help for `{}` to read the full description of these parameters + """.format( + cls.__name__, + self.message.split("('")[-1].split("'")[0], + param_names_table, + cls.__name__, + ) + ) + # Use the default error message for all other cases than unknown parameter errors + else: + message = self.message + # Add a summary line when parameters are passed an invalid value + # For example: "'asdf' is an invalid value for `stack` + if self.absolute_path: + # The indentation here must match that of `cleandoc` below + message = f"""'{self.instance}' is an invalid value for `{self.absolute_path[-1]}`: + + {message}""" + + if self._additional_errors: + message += "\n " + "\n ".join( + [e.message for e in self._additional_errors] + ) - {} - """.format( - schema_path, self.validator, message - ) + return inspect.cleandoc( + """{} + """.format( + message + ) + ) class UndefinedType(object):
diff --git a/tests/utils/tests/test_schemapi.py b/tests/utils/tests/test_schemapi.py --- a/tests/utils/tests/test_schemapi.py +++ b/tests/utils/tests/test_schemapi.py @@ -2,6 +2,7 @@ # tools/generate_schema_wrapper.py. Do not modify directly. import copy import io +import inspect import json import jsonschema import re @@ -377,9 +378,6 @@ def test_schema_validation_error(): assert isinstance(the_err, SchemaValidationError) message = str(the_err) - assert message.startswith("Invalid specification") - assert "test_schemapi.MySchema->a" in message - assert "validating {!r}".format(the_err.validator) in message assert the_err.message in message @@ -467,36 +465,77 @@ def chart_example_invalid_y_option_value_with_condition(): [ ( chart_example_invalid_y_option, - r"schema.channels.X.*" - + r"Additional properties are not allowed \('unknown' was unexpected\)", + inspect.cleandoc( + r"""`X` has no parameter named 'unknown' + + Existing parameter names are: + shorthand bin scale timeUnit + aggregate field sort title + axis impute stack type + bandPosition + + See the help for `X` to read the full description of these parameters""" # noqa: W291 + ), ), ( - chart_example_invalid_y_option_value, - r"schema.channels.Y.*" - + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" - + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + chart_example_layer, + inspect.cleandoc( + r"""`VConcatChart` has no parameter named 'width' + + Existing parameter names are: + vconcat center description params title + autosize config name resolve transform + background data padding spacing usermeta + bounds datasets + + See the help for `VConcatChart` to read the full description of these parameters""" # noqa: W291 + ), ), ( - chart_example_layer, - r"api.VConcatChart.*" - + r"Additional properties are not allowed \('width' was unexpected\)", + chart_example_invalid_y_option_value, + inspect.cleandoc( + r"""'asdf' is an invalid value for `stack`: + + 'asdf' is not one of \['zero', 'center', 'normalize'\] + 'asdf' is not of type 'null' + 'asdf' is not of type 'boolean'""" + ), ), ( chart_example_invalid_y_option_value_with_condition, - r"schema.channels.Y.*" - + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" - + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + inspect.cleandoc( + r"""'asdf' is an invalid value for `stack`: + + 'asdf' is not one of \['zero', 'center', 'normalize'\] + 'asdf' is not of type 'null' + 'asdf' is not of type 'boolean'""" + ), ), ( chart_example_hconcat, - r"schema.core.TitleParams.*" - + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'string'.*" - + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'array'", + inspect.cleandoc( + r"""'{'text': 'Horsepower', 'align': 'right'}' is an invalid value for `title`: + + {'text': 'Horsepower', 'align': 'right'} is not of type 'string' + {'text': 'Horsepower', 'align': 'right'} is not of type 'array'""" + ), ), ( chart_example_invalid_channel_and_condition, - r"schema.core.Encoding->encoding.*" - + r"Additional properties are not allowed \('invalidChannel' was unexpected\)", + inspect.cleandoc( + r"""`Encoding` has no parameter named 'invalidChannel' + + Existing parameter names are: + angle key order strokeDash tooltip xOffset + color latitude radius strokeOpacity url y + description latitude2 radius2 strokeWidth x y2 + detail longitude shape text x2 yError + fill longitude2 size theta xError yError2 + fillOpacity opacity stroke theta2 xError2 yOffset + href + + See the help for `Encoding` to read the full description of these parameters""" # noqa: W291 + ), ), ], ) diff --git a/tools/schemapi/tests/test_schemapi.py b/tools/schemapi/tests/test_schemapi.py --- a/tools/schemapi/tests/test_schemapi.py +++ b/tools/schemapi/tests/test_schemapi.py @@ -1,5 +1,6 @@ import copy import io +import inspect import json import jsonschema import re @@ -375,9 +376,6 @@ def test_schema_validation_error(): assert isinstance(the_err, SchemaValidationError) message = str(the_err) - assert message.startswith("Invalid specification") - assert "test_schemapi.MySchema->a" in message - assert "validating {!r}".format(the_err.validator) in message assert the_err.message in message @@ -465,36 +463,77 @@ def chart_example_invalid_y_option_value_with_condition(): [ ( chart_example_invalid_y_option, - r"schema.channels.X.*" - + r"Additional properties are not allowed \('unknown' was unexpected\)", + inspect.cleandoc( + r"""`X` has no parameter named 'unknown' + + Existing parameter names are: + shorthand bin scale timeUnit + aggregate field sort title + axis impute stack type + bandPosition + + See the help for `X` to read the full description of these parameters""" # noqa: W291 + ), ), ( - chart_example_invalid_y_option_value, - r"schema.channels.Y.*" - + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" - + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + chart_example_layer, + inspect.cleandoc( + r"""`VConcatChart` has no parameter named 'width' + + Existing parameter names are: + vconcat center description params title + autosize config name resolve transform + background data padding spacing usermeta + bounds datasets + + See the help for `VConcatChart` to read the full description of these parameters""" # noqa: W291 + ), ), ( - chart_example_layer, - r"api.VConcatChart.*" - + r"Additional properties are not allowed \('width' was unexpected\)", + chart_example_invalid_y_option_value, + inspect.cleandoc( + r"""'asdf' is an invalid value for `stack`: + + 'asdf' is not one of \['zero', 'center', 'normalize'\] + 'asdf' is not of type 'null' + 'asdf' is not of type 'boolean'""" + ), ), ( chart_example_invalid_y_option_value_with_condition, - r"schema.channels.Y.*" - + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" - + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + inspect.cleandoc( + r"""'asdf' is an invalid value for `stack`: + + 'asdf' is not one of \['zero', 'center', 'normalize'\] + 'asdf' is not of type 'null' + 'asdf' is not of type 'boolean'""" + ), ), ( chart_example_hconcat, - r"schema.core.TitleParams.*" - + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'string'.*" - + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'array'", + inspect.cleandoc( + r"""'{'text': 'Horsepower', 'align': 'right'}' is an invalid value for `title`: + + {'text': 'Horsepower', 'align': 'right'} is not of type 'string' + {'text': 'Horsepower', 'align': 'right'} is not of type 'array'""" + ), ), ( chart_example_invalid_channel_and_condition, - r"schema.core.Encoding->encoding.*" - + r"Additional properties are not allowed \('invalidChannel' was unexpected\)", + inspect.cleandoc( + r"""`Encoding` has no parameter named 'invalidChannel' + + Existing parameter names are: + angle key order strokeDash tooltip xOffset + color latitude radius strokeOpacity url y + description latitude2 radius2 strokeWidth x y2 + detail longitude shape text x2 yError + fill longitude2 size theta xError yError2 + fillOpacity opacity stroke theta2 xError2 yOffset + href + + See the help for `Encoding` to read the full description of these parameters""" # noqa: W291 + ), ), ], )
Make `SchemaValidationError` more helpful by printing expected parameters When a non-existing parameter name is used, I think it would be helpful to include the existing parameter names in the error message. For example, when misspelling a parameter name like in the example below it is not immediately clear whether I made a typo or something else went wrong, so the immediate feedback of seeing the correct parameter names would be helpful. ```python import altair as alt import pandas as pd source = pd.DataFrame({ 'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'], 'b': [28, 55, 43, 91, 81, 53, 19, 87, 52] }) alt.Chart(source).mark_bar().encode( x=alt.X("a", scale=alt.Scale(padingOuter=0.5)), y=alt.Y("b") ) ``` ``` SchemaValidationError: Invalid specification altair.vegalite.v4.schema.core.Scale, validating 'additionalProperties' Additional properties are not allowed ('padingOuter' was unexpected) ``` I also belive the error message text could be clarified a little. Especially for novices, I don't think it is immediately clear what it means that "Additional properties are not allowed" and it could helpful to update this error message to something like: ``` SchemaValidationError: Invalid specification altair.vegalite.v4.schema.core.Scale, validating 'additionalProperties' No such parameter name exists: 'padingOuter' Existing parameter names are: 'align', 'base', 'bins', 'clamp', 'constant', 'domain', 'domainMid', 'exponent', 'interpolate', 'nice', 'padding', 'paddingInner', 'paddingOuter', 'range', 'reverse', 'round', 'scheme', 'type', 'zero', 'kwds' See the help for altair.Scale` for the full description of these parameters. ``` We can use the `inspect` module to retrieve the list of expected parameter names via `list(inspect.signature(altair.vegalite.v4.schema.core.Scale).parameters.keys())`. I can try to PR this if it sounds like a good idea (it looks like modifying the returned value of [altair/utils/schemapi.py](https://github.com/altair-viz/altair/blob/55bb4b7df07996abb4ff05e80a69cadae291482a/altair/utils/schemapi.py#L116-L123) is the right place?).
Strongly agree - I just don’t know how to do it, because schema validation is done by the jsonschema package and it doesn’t really return anything useful. If you can figure out how to do it robustly I’ll happily review the PR!
2022-03-22T10:22:14Z
[]
[]
vega/altair
2,785
vega__altair-2785
[ "2581" ]
0d82108e95c5607c07f93c7cacc57f9a321cccb1
diff --git a/altair/vegalite/v5/theme.py b/altair/vegalite/v5/theme.py --- a/altair/vegalite/v5/theme.py +++ b/altair/vegalite/v5/theme.py @@ -22,7 +22,7 @@ def __init__(self, theme): def __call__(self): return { "usermeta": {"embedOptions": {"theme": self.theme}}, - "config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, + "config": {"view": {"continuousWidth": 300, "continuousHeight": 300}}, } def __repr__(self): @@ -37,14 +37,14 @@ def __repr__(self): themes.register( "default", - lambda: {"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}}, + lambda: {"config": {"view": {"continuousWidth": 300, "continuousHeight": 300}}}, ) themes.register( "opaque", lambda: { "config": { "background": "white", - "view": {"continuousWidth": 400, "continuousHeight": 300}, + "view": {"continuousWidth": 300, "continuousHeight": 300}, } }, )
diff --git a/tests/vegalite/v5/tests/test_api.py b/tests/vegalite/v5/tests/test_api.py --- a/tests/vegalite/v5/tests/test_api.py +++ b/tests/vegalite/v5/tests/test_api.py @@ -704,13 +704,13 @@ def test_themes(): with alt.themes.enable("default"): assert chart.to_dict()["config"] == { - "view": {"continuousWidth": 400, "continuousHeight": 300} + "view": {"continuousWidth": 300, "continuousHeight": 300} } with alt.themes.enable("opaque"): assert chart.to_dict()["config"] == { "background": "white", - "view": {"continuousWidth": 400, "continuousHeight": 300}, + "view": {"continuousWidth": 300, "continuousHeight": 300}, } with alt.themes.enable("none"): diff --git a/tests/vegalite/v5/tests/test_theme.py b/tests/vegalite/v5/tests/test_theme.py --- a/tests/vegalite/v5/tests/test_theme.py +++ b/tests/vegalite/v5/tests/test_theme.py @@ -15,5 +15,5 @@ def test_vega_themes(chart): dct = chart.to_dict() assert dct["usermeta"] == {"embedOptions": {"theme": theme}} assert dct["config"] == { - "view": {"continuousWidth": 400, "continuousHeight": 300} + "view": {"continuousWidth": 300, "continuousHeight": 300} }
Equal default chart dimensions Currently the default theme in Altair specifies an aspect ratio of 4/3, with a width of 400 and a height of 300 (for continuous data): ![image](https://user-images.githubusercontent.com/4560057/160310026-189ab3c6-226b-4659-9fe0-e2a7b9d595a0.png) The default in VegaLite is to make both dimensions of equal length, which I think makes sense since it spreads the data over the same amount of pixels on both the X and Y axis. This could have benefits in terms of making it easier to fairly compare the distribution of the data between the two plotted variables instead of it appearing more spread out over the X axis due to the increase chart width. The default in Vega-Lite is to use 200 px for the width and height which I think is a bit small, but setting both to 300 px looks good: ![image](https://user-images.githubusercontent.com/4560057/160310042-ca229ef9-2d9c-451e-9af2-a66c899bd941.png) What do you all think about changing the default width in Altair to 300 px, so that both the X and Y axes occupy the same amount of pixels by default? Are there benefits of having an unequal aspect ratio like the current default that I am missing (maybe that it is more similar to the screen aspect ratio)? I don't think this is a major concern, but thought I would bring it up and see if others also regard it as a small improvement or just a matter of personal aesthetics/taste.
I like the default of vega-lite I see your point about the distortion along the x axis for scatter plots. However, for some charts such as histograms and timeseries charts I prefer a wider chart which better uses the usual screen ratio. I don't have a strong opinion on this as I usually use a custom theme anyway to increase the size of the chart to something like 400x700 and font sizes to 14-16. To me, this is visually more appealing and easier to read especially on bigger screens. It's also feedback I got when showing the Altair library as an alternative to e.g. Plotly ```python def altair_theme(font_size: int = 16): return { "config": { "axis": { "labelFontSize": font_size, "titleFontSize": font_size, }, "header": {"labelFontSize": font_size, "titleFontSize": font_size}, "legend": { "labelFontSize": font_size, "titleFontSize": font_size, }, "title": {"fontSize": font_size}, "view": {"width": 700, "height": 400}, } } ``` Is there any interest in including such a slight modification of the default theme in Altair, maybe "default_large"? For charts which are used for reports, web apps, etc. I'd specify the exact configuration anyway but for data exploration it's great if such a theme can be quickly activated at the start of a notebook with `alt.themes.enable('default_large')` instead of having to import it from a custom module or always defining this function. I agree that histograms and timeseries can benefit from a wider aspect ratio. However, I think that at least timeseries often need to be changed even from the current aspect ratio. For histograms, I don't think they look terrible with[ the default square dimensions](https://vega.github.io/vega-lite/examples/#histograms-density-plots-and-dot-plots), although I would probably have them at around half the height personally. Importantly, I don't think that either of these scenarios can lead to misintrerpreting the data and it is often easy to see that you want to make the chart wider in these cases, whereas having non-equal axis can distort the data a little and make it more difficult to realize that you should change it so it feels like the safer default for me which is also the most appropriate in many cases. I agree with you that the font size is small by default and would be in favor of having it slightly bigger in the default theme. I am think 1-2 pts bigger, so around 13-14 if the default is 12 (which I think it is). Rather than adding a different theme for this, I think we should add a way to easily scale all fonts and all chart elements [as I suggested here for vega](https://github.com/vega/vega/issues/2946). I would be happy if we added this to altair in the meantime and I am thinking it would be similar to how in Seaborn's [set_theme](http://seaborn.pydata.org/generated/seaborn.set_theme.html#seaborn.set_theme) function, you can change the scaling of all plot elements (so text, axes, markers, etc) via the `plotting_context` param, and control the size of just the text with the `font_scale` param. One part that is tricky in Altair, is that all the default font sizes are only available in the Vega source files, so we would need to manually right those down to be able to scale them properly. We also need a mechanism that appends to the current theme rather than overwrites it (e.g. if someone enable the dark theme and then wanted to scale the font size). I started working on these a while back but haven't had time to revisit. This is what I had then in case someone is interested of continuing this before I get back to it (which likely will not be soon): ```diff commit f775500aa35b3b6d6d2aa87032099de250224910 Author: Joel Ostblom <[email protected]> Date: Sun Mar 27 21:53:01 2022 -0700 Add draft of theme modification function diff --git a/altair/utils/theme.py b/altair/utils/theme.py index 10dc6fa8..35294f96 100644 --- a/altair/utils/theme.py +++ b/altair/utils/theme.py @@ -1,10 +1,39 @@ """Utilities for registering and working with themes""" -from .plugin_registry import PluginRegistry +from .plugin_registry import PluginRegistry, PluginEnabler from typing import Callable ThemeType = Callable[..., dict] class ThemeRegistry(PluginRegistry[ThemeType]): - pass + + # The name could be update / edit / modify + # TODO how to make a useful docstring listing all params? + # docs mention that **config can be passed + # does this need to accept the **options kwds?? then we can't use **kwds which is convenient here, maybe optins_dict? + # also add scaling of all graphical elements? + # Could fonts be partial points? Otherwise always round down? + # if this is added in VL in the future, we can likely keep this interface the same, forward compatible + def modify(self, font_scale=None, **config): + if font_scale is not None: + config = self._scale_font() + + # Register the modified theme under a new name + if self.active.split("_")[-1] == "modified": + updated_theme_name = self.active + else: + updated_theme_name = "{}_modified".format(self.active) + self.register(updated_theme_name, lambda: {"config": config}) + + # Enable the newly registered theme + return PluginEnabler(self, updated_theme_name) + + def _scale_font(self, config): + # scale font and append to dict + # I think all font options are defined here https://github.com/vega/vega/blob/main/packages/vega-parser/src/config.js#L82-L129= + return config ``` I really like the idea of scaling the chart elements and fonts as in Seaborn! I'll take the scaling of the fonts first as that seems easier and still very useful. Thanks for the code snippet. I made some minor progress but don't think I get around to a decent solution before the release of version 5. If someone else wants to pick this up, of course feel free! But this functionality could also easily be added in a minor release. @mattijn @joelostblom However, the switch to the vega-lite default chart sizes should probably happen in a major release as it is quite a noticeable change impacting many users and not opt-in. What do you think? Height would need to be changed in https://github.com/altair-viz/altair/blob/master/altair/vegalite/v5/theme.py, https://github.com/altair-viz/altair/blob/master/altair/vegalite/v5/tests/test_theme.py, and https://github.com/altair-viz/altair/blob/master/altair/vegalite/v5/tests/test_api.py. Optionally, also in v3 and v4 folders.
2022-12-30T19:35:32Z
[]
[]
vega/altair
2,812
vega__altair-2812
[ "2800" ]
8a71d2e127a74148dfb812f01be7ae1d3fb0c09a
diff --git a/altair/utils/display.py b/altair/utils/display.py --- a/altair/utils/display.py +++ b/altair/utils/display.py @@ -125,7 +125,10 @@ def _validate(self): # type: () -> None """Validate the spec against the schema.""" schema_dict = json.loads(pkgutil.get_data(*self.schema_path).decode("utf-8")) - validate_jsonschema(self.spec, schema_dict) + validate_jsonschema( + self.spec, + schema_dict, + ) def _repr_mimebundle_(self, include=None, exclude=None): """Return a MIME bundle for display in Jupyter frontends.""" diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -9,12 +9,12 @@ import jsonschema import jsonschema.exceptions +import jsonschema.validators import numpy as np import pandas as pd from altair import vegalite -JSONSCHEMA_VALIDATOR = jsonschema.Draft7Validator # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for # larger specs, but leads to much more useful tracebacks for the user. @@ -44,7 +44,7 @@ def debug_mode(arg): DEBUG_MODE = original -def validate_jsonschema(spec, schema, resolver=None): +def validate_jsonschema(spec, schema, rootschema=None): # We don't use jsonschema.validate as this would validate the schema itself. # Instead, we pass the schema directly to the validator class. This is done for # two reasons: The schema comes from Vega-Lite and is not based on the user @@ -54,9 +54,18 @@ def validate_jsonschema(spec, schema, resolver=None): # e.g. '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef, # (Gradient|string|null)>' would be a valid $ref in a Vega-Lite schema but # it is not a valid URI reference due to the characters such as '<'. - validator = JSONSCHEMA_VALIDATOR( - schema, format_checker=JSONSCHEMA_VALIDATOR.FORMAT_CHECKER, resolver=resolver - ) + if rootschema is not None: + validator_cls = jsonschema.validators.validator_for(rootschema) + resolver = jsonschema.RefResolver.from_schema(rootschema) + else: + validator_cls = jsonschema.validators.validator_for(schema) + # No resolver is necessary if the schema is already the full schema + resolver = None + + validator_kwargs = {"resolver": resolver} + if hasattr(validator_cls, "FORMAT_CHECKER"): + validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER + validator = validator_cls(schema, **validator_kwargs) error = jsonschema.exceptions.best_match(validator.iter_errors(spec)) if error is not None: raise error @@ -177,7 +186,6 @@ class SchemaBase(object): _schema = None _rootschema = None _class_is_valid_at_instantiation = True - _validator = JSONSCHEMA_VALIDATOR def __init__(self, *args, **kwds): # Two valid options for initialization, which should be handled by @@ -466,8 +474,9 @@ def validate(cls, instance, schema=None): """ if schema is None: schema = cls._schema - resolver = jsonschema.RefResolver.from_schema(cls._rootschema or cls._schema) - return validate_jsonschema(instance, schema, resolver=resolver) + return validate_jsonschema( + instance, schema, rootschema=cls._rootschema or cls._schema + ) @classmethod def resolve_references(cls, schema=None): @@ -485,8 +494,9 @@ def validate_property(cls, name, value, schema=None): """ value = _todict(value, validate=False, context={}) props = cls.resolve_references(schema or cls._schema).get("properties", {}) - resolver = jsonschema.RefResolver.from_schema(cls._rootschema or cls._schema) - return validate_jsonschema(value, props.get(name, {}), resolver=resolver) + return validate_jsonschema( + value, props.get(name, {}), rootschema=cls._rootschema or cls._schema + ) def __dir__(self): return list(self._kwds.keys()) @@ -578,9 +588,8 @@ def from_dict( if "anyOf" in schema or "oneOf" in schema: schemas = schema.get("anyOf", []) + schema.get("oneOf", []) for possible_schema in schemas: - resolver = jsonschema.RefResolver.from_schema(rootschema) try: - validate_jsonschema(dct, possible_schema, resolver=resolver) + validate_jsonschema(dct, possible_schema, rootschema=rootschema) except jsonschema.ValidationError: continue else: diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -7,12 +7,12 @@ import jsonschema import jsonschema.exceptions +import jsonschema.validators import numpy as np import pandas as pd from altair import vegalite -JSONSCHEMA_VALIDATOR = jsonschema.Draft7Validator # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for # larger specs, but leads to much more useful tracebacks for the user. @@ -42,7 +42,7 @@ def debug_mode(arg): DEBUG_MODE = original -def validate_jsonschema(spec, schema, resolver=None): +def validate_jsonschema(spec, schema, rootschema=None): # We don't use jsonschema.validate as this would validate the schema itself. # Instead, we pass the schema directly to the validator class. This is done for # two reasons: The schema comes from Vega-Lite and is not based on the user @@ -52,9 +52,18 @@ def validate_jsonschema(spec, schema, resolver=None): # e.g. '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef, # (Gradient|string|null)>' would be a valid $ref in a Vega-Lite schema but # it is not a valid URI reference due to the characters such as '<'. - validator = JSONSCHEMA_VALIDATOR( - schema, format_checker=JSONSCHEMA_VALIDATOR.FORMAT_CHECKER, resolver=resolver - ) + if rootschema is not None: + validator_cls = jsonschema.validators.validator_for(rootschema) + resolver = jsonschema.RefResolver.from_schema(rootschema) + else: + validator_cls = jsonschema.validators.validator_for(schema) + # No resolver is necessary if the schema is already the full schema + resolver = None + + validator_kwargs = {"resolver": resolver} + if hasattr(validator_cls, "FORMAT_CHECKER"): + validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER + validator = validator_cls(schema, **validator_kwargs) error = jsonschema.exceptions.best_match(validator.iter_errors(spec)) if error is not None: raise error @@ -175,7 +184,6 @@ class SchemaBase(object): _schema = None _rootschema = None _class_is_valid_at_instantiation = True - _validator = JSONSCHEMA_VALIDATOR def __init__(self, *args, **kwds): # Two valid options for initialization, which should be handled by @@ -464,8 +472,9 @@ def validate(cls, instance, schema=None): """ if schema is None: schema = cls._schema - resolver = jsonschema.RefResolver.from_schema(cls._rootschema or cls._schema) - return validate_jsonschema(instance, schema, resolver=resolver) + return validate_jsonschema( + instance, schema, rootschema=cls._rootschema or cls._schema + ) @classmethod def resolve_references(cls, schema=None): @@ -483,8 +492,9 @@ def validate_property(cls, name, value, schema=None): """ value = _todict(value, validate=False, context={}) props = cls.resolve_references(schema or cls._schema).get("properties", {}) - resolver = jsonschema.RefResolver.from_schema(cls._rootschema or cls._schema) - return validate_jsonschema(value, props.get(name, {}), resolver=resolver) + return validate_jsonschema( + value, props.get(name, {}), rootschema=cls._rootschema or cls._schema + ) def __dir__(self): return list(self._kwds.keys()) @@ -576,9 +586,8 @@ def from_dict( if "anyOf" in schema or "oneOf" in schema: schemas = schema.get("anyOf", []) + schema.get("oneOf", []) for possible_schema in schemas: - resolver = jsonschema.RefResolver.from_schema(rootschema) try: - validate_jsonschema(dct, possible_schema, resolver=resolver) + validate_jsonschema(dct, possible_schema, rootschema=rootschema) except jsonschema.ValidationError: continue else:
diff --git a/tests/utils/tests/test_schemapi.py b/tests/utils/tests/test_schemapi.py --- a/tests/utils/tests/test_schemapi.py +++ b/tests/utils/tests/test_schemapi.py @@ -9,6 +9,7 @@ import numpy as np +from altair import load_schema from altair.utils.schemapi import ( UndefinedType, SchemaBase, @@ -17,6 +18,7 @@ SchemaValidationError, ) +_JSONSCHEMA_DRAFT = load_schema()["$schema"] # Make tests inherit from _TestSchema, so that when we test from_dict it won't # try to use SchemaBase objects defined elsewhere as wrappers. @@ -29,6 +31,7 @@ def _default_wrapper_classes(cls): class MySchema(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "definitions": { "StringMapping": { "type": "object", @@ -65,6 +68,7 @@ class StringArray(_TestSchema): class Derived(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "definitions": { "Foo": {"type": "object", "properties": {"d": {"type": "string"}}}, "Bar": {"type": "string", "enum": ["A", "B"]}, @@ -90,7 +94,10 @@ class Bar(_TestSchema): class SimpleUnion(_TestSchema): - _schema = {"anyOf": [{"type": "integer"}, {"type": "string"}]} + _schema = { + "$schema": _JSONSCHEMA_DRAFT, + "anyOf": [{"type": "integer"}, {"type": "string"}], + } class DefinitionUnion(_TestSchema): @@ -100,6 +107,7 @@ class DefinitionUnion(_TestSchema): class SimpleArray(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "type": "array", "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, } @@ -107,11 +115,30 @@ class SimpleArray(_TestSchema): class InvalidProperties(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "type": "object", "properties": {"for": {}, "as": {}, "vega-lite": {}, "$schema": {}}, } +class Draft7Schema(_TestSchema): + _schema = { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "e": {"items": [{"type": "string"}, {"type": "string"}]}, + }, + } + + +class Draft202012Schema(_TestSchema): + _schema = { + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "properties": { + "e": {"items": [{"type": "string"}, {"type": "string"}]}, + }, + } + + def test_construct_multifaceted_schema(): dct = { "a": {"foo": "bar"}, @@ -221,6 +248,21 @@ def test_undefined_singleton(): assert Undefined is UndefinedType() +def test_schema_validator_selection(): + # Tests if the correct validator class is chosen based on the $schema + # property in the schema. Reason for the AttributeError below is, that Draft 2020-12 + # introduced changes to the "items" keyword, see + # https://json-schema.org/draft/2020-12/release-notes.html#changes-to- + # items-and-additionalitems + dct = { + "e": ["a", "b"], + } + + assert Draft7Schema.from_dict(dct).to_dict() == dct + with pytest.raises(AttributeError, match="'list' object has no attribute 'get'"): + Draft202012Schema.from_dict(dct) + + @pytest.fixture def dct(): return { diff --git a/tools/schemapi/tests/test_schemapi.py b/tools/schemapi/tests/test_schemapi.py --- a/tools/schemapi/tests/test_schemapi.py +++ b/tools/schemapi/tests/test_schemapi.py @@ -7,6 +7,7 @@ import numpy as np +from altair import load_schema from altair.utils.schemapi import ( UndefinedType, SchemaBase, @@ -15,6 +16,7 @@ SchemaValidationError, ) +_JSONSCHEMA_DRAFT = load_schema()["$schema"] # Make tests inherit from _TestSchema, so that when we test from_dict it won't # try to use SchemaBase objects defined elsewhere as wrappers. @@ -27,6 +29,7 @@ def _default_wrapper_classes(cls): class MySchema(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "definitions": { "StringMapping": { "type": "object", @@ -63,6 +66,7 @@ class StringArray(_TestSchema): class Derived(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "definitions": { "Foo": {"type": "object", "properties": {"d": {"type": "string"}}}, "Bar": {"type": "string", "enum": ["A", "B"]}, @@ -88,7 +92,10 @@ class Bar(_TestSchema): class SimpleUnion(_TestSchema): - _schema = {"anyOf": [{"type": "integer"}, {"type": "string"}]} + _schema = { + "$schema": _JSONSCHEMA_DRAFT, + "anyOf": [{"type": "integer"}, {"type": "string"}], + } class DefinitionUnion(_TestSchema): @@ -98,6 +105,7 @@ class DefinitionUnion(_TestSchema): class SimpleArray(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "type": "array", "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, } @@ -105,11 +113,30 @@ class SimpleArray(_TestSchema): class InvalidProperties(_TestSchema): _schema = { + "$schema": _JSONSCHEMA_DRAFT, "type": "object", "properties": {"for": {}, "as": {}, "vega-lite": {}, "$schema": {}}, } +class Draft7Schema(_TestSchema): + _schema = { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "e": {"items": [{"type": "string"}, {"type": "string"}]}, + }, + } + + +class Draft202012Schema(_TestSchema): + _schema = { + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "properties": { + "e": {"items": [{"type": "string"}, {"type": "string"}]}, + }, + } + + def test_construct_multifaceted_schema(): dct = { "a": {"foo": "bar"}, @@ -219,6 +246,21 @@ def test_undefined_singleton(): assert Undefined is UndefinedType() +def test_schema_validator_selection(): + # Tests if the correct validator class is chosen based on the $schema + # property in the schema. Reason for the AttributeError below is, that Draft 2020-12 + # introduced changes to the "items" keyword, see + # https://json-schema.org/draft/2020-12/release-notes.html#changes-to- + # items-and-additionalitems + dct = { + "e": ["a", "b"], + } + + assert Draft7Schema.from_dict(dct).to_dict() == dct + with pytest.raises(AttributeError, match="'list' object has no attribute 'get'"): + Draft202012Schema.from_dict(dct) + + @pytest.fixture def dct(): return {
Use dialect identifier from vega-lite-schema to set jsonschema validator As was pointed out in https://github.com/altair-viz/altair/pull/2771#issuecomment-1369219098, and summarised here: * vega specifies the `$schema` property in the schema (see for example L3 [here](https://raw.githubusercontent.com/altair-viz/altair/master/altair/vegalite/v5/schema/vega-lite-schema.json)), which is a "dialect identifier", it basically is a URI that identifies which version of the JSON Schema spec the schema is written for -- an example of one is `https://json-schema.org/draft-07/schema` which is the dialect ID for draft 7 of the spec * we can then use [`jsonschema.validators.validator_for`](https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/validators/#jsonschema.validators.validator_for) to get the right validator class given the schema, which will return you `Draft7Validator` if the schema use draft 7, but if/when Vega-lite repo upgrade to draft2020 say, then you'd get `Draft202012Validator` instead and things will work properly still. Currently (or at least after PR https://github.com/altair-viz/altair/pull/2771 is merged) the validator version is defined as a constant (draft 7). Altair currently uses this validator for the schema definitions for Vega-lite v3/v4/v5 (and that is still fine as they all use the draft 7 schema). So in my understanding the required change to get this working properly is to make it dynamic and set and define the validator on a version by version basis.
Thanks for the summary! I'll look into this.
2023-01-07T16:10:48Z
[]
[]
vega/altair
2,813
vega__altair-2813
[ "2497" ]
291bcfc376b6954a09e2c4292b0b7ba13868b108
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -358,8 +358,24 @@ def to_dict(self, validate=True, ignore=None, context=None): if self._args and not self._kwds: result = _todict(self._args[0], validate=sub_validate, context=context) elif not self._args: + kwds = self._kwds.copy() + # parsed_shorthand is added by FieldChannelMixin. + # It's used below to replace shorthand with its long form equivalent + # parsed_shorthand is removed from context if it exists so that it is + # not passed to child to_dict function calls + parsed_shorthand = context.pop("parsed_shorthand", {}) + kwds.update( + { + k: v + for k, v in parsed_shorthand.items() + if kwds.get(k, Undefined) is Undefined + } + ) + kwds = { + k: v for k, v in kwds.items() if k not in list(ignore) + ["shorthand"] + } result = _todict( - {k: v for k, v in self._kwds.items() if k not in ignore}, + kwds, validate=sub_validate, context=context, ) diff --git a/altair/vegalite/v5/schema/channels.py b/altair/vegalite/v5/schema/channels.py --- a/altair/vegalite/v5/schema/channels.py +++ b/altair/vegalite/v5/schema/channels.py @@ -50,11 +50,8 @@ def to_dict(self, validate=True, ignore=(), context=None): # Shorthand is not a string; we pass the definition to field, # and do not do any parsing. parsed = {'field': shorthand} + context["parsed_shorthand"] = parsed - # Set shorthand to Undefined, because it's not part of the base schema. - self.shorthand = Undefined - self._kwds.update({k: v for k, v in parsed.items() - if self._get(k) is Undefined}) return super(FieldChannelMixin, self).to_dict( validate=validate, ignore=ignore, diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -132,11 +132,8 @@ def to_dict(self, validate=True, ignore=(), context=None): # Shorthand is not a string; we pass the definition to field, # and do not do any parsing. parsed = {'field': shorthand} + context["parsed_shorthand"] = parsed - # Set shorthand to Undefined, because it's not part of the base schema. - self.shorthand = Undefined - self._kwds.update({k: v for k, v in parsed.items() - if self._get(k) is Undefined}) return super(FieldChannelMixin, self).to_dict( validate=validate, ignore=ignore, diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -356,8 +356,24 @@ def to_dict(self, validate=True, ignore=None, context=None): if self._args and not self._kwds: result = _todict(self._args[0], validate=sub_validate, context=context) elif not self._args: + kwds = self._kwds.copy() + # parsed_shorthand is added by FieldChannelMixin. + # It's used below to replace shorthand with its long form equivalent + # parsed_shorthand is removed from context if it exists so that it is + # not passed to child to_dict function calls + parsed_shorthand = context.pop("parsed_shorthand", {}) + kwds.update( + { + k: v + for k, v in parsed_shorthand.items() + if kwds.get(k, Undefined) is Undefined + } + ) + kwds = { + k: v for k, v in kwds.items() if k not in list(ignore) + ["shorthand"] + } result = _todict( - {k: v for k, v in self._kwds.items() if k not in ignore}, + kwds, validate=sub_validate, context=context, )
diff --git a/tests/utils/tests/test_schemapi.py b/tests/utils/tests/test_schemapi.py --- a/tests/utils/tests/test_schemapi.py +++ b/tests/utils/tests/test_schemapi.py @@ -8,7 +8,9 @@ import pytest import numpy as np +import pandas as pd +import altair as alt from altair import load_schema from altair.utils.schemapi import ( UndefinedType, @@ -391,3 +393,36 @@ def test_serialize_numpy_types(): "a2": {"int64": 1, "float64": 2}, "b2": [0, 1, 2, 3], } + + +def test_to_dict_no_side_effects(): + # Tests that shorthands are expanded in returned dictionary when calling to_dict + # but that they remain untouched in the chart object. Goal is to ensure that + # the chart object stays unchanged when to_dict is called + def validate_encoding(encoding): + assert encoding.x["shorthand"] == "a" + assert encoding.x["field"] is alt.Undefined + assert encoding.x["type"] is alt.Undefined + assert encoding.y["shorthand"] == "b:Q" + assert encoding.y["field"] is alt.Undefined + assert encoding.y["type"] is alt.Undefined + + data = pd.DataFrame( + { + "a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"], + "b": [28, 55, 43, 91, 81, 53, 19, 87, 52], + } + ) + + chart = alt.Chart(data).mark_bar().encode(x="a", y="b:Q") + + validate_encoding(chart.encoding) + dct = chart.to_dict() + validate_encoding(chart.encoding) + + assert "shorthand" not in dct["encoding"]["x"] + assert dct["encoding"]["x"]["field"] == "a" + + assert "shorthand" not in dct["encoding"]["y"] + assert dct["encoding"]["y"]["field"] == "b" + assert dct["encoding"]["y"]["type"] == "quantitative" diff --git a/tools/schemapi/tests/test_schemapi.py b/tools/schemapi/tests/test_schemapi.py --- a/tools/schemapi/tests/test_schemapi.py +++ b/tools/schemapi/tests/test_schemapi.py @@ -6,7 +6,9 @@ import pytest import numpy as np +import pandas as pd +import altair as alt from altair import load_schema from altair.utils.schemapi import ( UndefinedType, @@ -389,3 +391,36 @@ def test_serialize_numpy_types(): "a2": {"int64": 1, "float64": 2}, "b2": [0, 1, 2, 3], } + + +def test_to_dict_no_side_effects(): + # Tests that shorthands are expanded in returned dictionary when calling to_dict + # but that they remain untouched in the chart object. Goal is to ensure that + # the chart object stays unchanged when to_dict is called + def validate_encoding(encoding): + assert encoding.x["shorthand"] == "a" + assert encoding.x["field"] is alt.Undefined + assert encoding.x["type"] is alt.Undefined + assert encoding.y["shorthand"] == "b:Q" + assert encoding.y["field"] is alt.Undefined + assert encoding.y["type"] is alt.Undefined + + data = pd.DataFrame( + { + "a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"], + "b": [28, 55, 43, 91, 81, 53, 19, 87, 52], + } + ) + + chart = alt.Chart(data).mark_bar().encode(x="a", y="b:Q") + + validate_encoding(chart.encoding) + dct = chart.to_dict() + validate_encoding(chart.encoding) + + assert "shorthand" not in dct["encoding"]["x"] + assert dct["encoding"]["x"]["field"] == "a" + + assert "shorthand" not in dct["encoding"]["y"] + assert dct["encoding"]["y"]["field"] == "b" + assert dct["encoding"]["y"]["type"] == "quantitative"
Chart representation changes after the chart is displayed The representation of the chart object seems to change after the chart is displayed. Take this example ```py import altair as alt from vega_datasets import data cars = data.cars() scatter = alt.Chart(cars).mark_point().encode( x='Weight_in_lbs:Q', y='Horsepower', color='Origin') ``` It looks like this initially ```py scatter.encoding ``` ```py FacetedEncoding({ color: Color({ shorthand: 'Origin' }), x: X({ shorthand: 'Weight_in_lbs:Q' }), y: Y({ shorthand: 'Horsepower' }) }) ``` But after displaying the chart in JuptyerLab (by just typing `scatter` in a cell and executing it), the encoding representation changes to this longer format: ```py FacetedEncoding({ color: Color({ field: 'Origin', type: 'nominal' }), x: X({ field: 'Weight_in_lbs', type: 'quantitative' }), y: Y({ field: 'Horsepower', type: 'quantitative' }) }) ``` There is probably some good reason for this that I don't understand, but for testing/autograding purposes it would be convenient if the representation was always the same and did not change after the chart is displayed. Edit: It seems like `scatter.to_dict()` will always return the long format so maybe that could be relied on instead.
Thanks for flagging this - it looks like the `to_dict()` method on encoding channels is not pure; see e.g. https://github.com/altair-viz/altair/blob/8ff06cfbbfb470aba6798999c61128be398c4996/tools/generate_schema_wrapper.py#L134-L142 (this is the template that is used for all auto-generated encoding classes). I think that we could probably remove this mutation without any noticeable consequences, though it would be a bit subtle because of the way this relies on `super()` calls. I tried to look into this, but for some reason it seems like the changes I make in the file you linked don't have any effect on my chart objects. Changes I make in other files results in updates to the charts. I tried restarting everything, but maybe I am missing something here... Those lines are in the codegen source, so they won't affect the altair code until it is regenerated: ``` $ python tools/generate_schema_wrapper.py ```
2023-01-07T17:25:26Z
[]
[]
vega/altair
2,814
vega__altair-2814
[ "2574" ]
79986bbe8a093a73b8a92c2c96f6109508c6c4ba
diff --git a/altair/__init__.py b/altair/__init__.py --- a/altair/__init__.py +++ b/altair/__init__.py @@ -1,6 +1,590 @@ # flake8: noqa __version__ = "4.3.0.dev0" + +# The content of __all__ is automatically written by +# tools/update_init_file.py. Do not modify directly. +__all__ = [ + "Aggregate", + "AggregateOp", + "AggregateTransform", + "AggregatedFieldDef", + "Align", + "AllSortString", + "Angle", + "AngleDatum", + "AngleValue", + "AnyMark", + "AnyMarkConfig", + "AreaConfig", + "ArgmaxDef", + "ArgminDef", + "AutoSizeParams", + "AutosizeType", + "Axis", + "AxisConfig", + "AxisOrient", + "AxisResolveMap", + "BarConfig", + "BaseTitleNoValueRefs", + "Baseline", + "Bin", + "BinExtent", + "BinParams", + "BinTransform", + "BindCheckbox", + "BindDirect", + "BindInput", + "BindRadioSelect", + "BindRange", + "Binding", + "Blend", + "BoxPlot", + "BoxPlotConfig", + "BoxPlotDef", + "BrushConfig", + "CalculateTransform", + "Categorical", + "Chart", + "Color", + "ColorDatum", + "ColorDef", + "ColorName", + "ColorScheme", + "ColorValue", + "Column", + "CompositeMark", + "CompositeMarkDef", + "CompositionConfig", + "ConcatChart", + "ConcatSpecGenericSpec", + "ConditionalAxisColor", + "ConditionalAxisLabelAlign", + "ConditionalAxisLabelBaseline", + "ConditionalAxisLabelFontStyle", + "ConditionalAxisLabelFontWeight", + "ConditionalAxisNumber", + "ConditionalAxisNumberArray", + "ConditionalAxisPropertyAlignnull", + "ConditionalAxisPropertyColornull", + "ConditionalAxisPropertyFontStylenull", + "ConditionalAxisPropertyFontWeightnull", + "ConditionalAxisPropertyTextBaselinenull", + "ConditionalAxisPropertynumberArraynull", + "ConditionalAxisPropertynumbernull", + "ConditionalAxisPropertystringnull", + "ConditionalAxisString", + "ConditionalMarkPropFieldOrDatumDef", + "ConditionalMarkPropFieldOrDatumDefTypeForShape", + "ConditionalParameterMarkPropFieldOrDatumDef", + "ConditionalParameterMarkPropFieldOrDatumDefTypeForShape", + "ConditionalParameterStringFieldDef", + "ConditionalParameterValueDefGradientstringnullExprRef", + "ConditionalParameterValueDefTextExprRef", + "ConditionalParameterValueDefnumber", + "ConditionalParameterValueDefnumberArrayExprRef", + "ConditionalParameterValueDefnumberExprRef", + "ConditionalParameterValueDefstringExprRef", + "ConditionalParameterValueDefstringnullExprRef", + "ConditionalPredicateMarkPropFieldOrDatumDef", + "ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape", + "ConditionalPredicateStringFieldDef", + "ConditionalPredicateValueDefAlignnullExprRef", + "ConditionalPredicateValueDefColornullExprRef", + "ConditionalPredicateValueDefFontStylenullExprRef", + "ConditionalPredicateValueDefFontWeightnullExprRef", + "ConditionalPredicateValueDefGradientstringnullExprRef", + "ConditionalPredicateValueDefTextBaselinenullExprRef", + "ConditionalPredicateValueDefTextExprRef", + "ConditionalPredicateValueDefnumber", + "ConditionalPredicateValueDefnumberArrayExprRef", + "ConditionalPredicateValueDefnumberArraynullExprRef", + "ConditionalPredicateValueDefnumberExprRef", + "ConditionalPredicateValueDefnumbernullExprRef", + "ConditionalPredicateValueDefstringExprRef", + "ConditionalPredicateValueDefstringnullExprRef", + "ConditionalStringFieldDef", + "ConditionalValueDefGradientstringnullExprRef", + "ConditionalValueDefTextExprRef", + "ConditionalValueDefnumber", + "ConditionalValueDefnumberArrayExprRef", + "ConditionalValueDefnumberExprRef", + "ConditionalValueDefstringExprRef", + "ConditionalValueDefstringnullExprRef", + "Config", + "CsvDataFormat", + "Cursor", + "Cyclical", + "Data", + "DataFormat", + "DataSource", + "Datasets", + "DateTime", + "DatumChannelMixin", + "DatumDef", + "Day", + "DensityTransform", + "DerivedStream", + "Description", + "DescriptionValue", + "Detail", + "Dict", + "DictInlineDataset", + "DictSelectionInit", + "DictSelectionInitInterval", + "Diverging", + "DomainUnionWith", + "DsvDataFormat", + "Element", + "Encoding", + "EncodingSortField", + "ErrorBand", + "ErrorBandConfig", + "ErrorBandDef", + "ErrorBar", + "ErrorBarConfig", + "ErrorBarDef", + "ErrorBarExtent", + "EventStream", + "EventType", + "Expr", + "ExprRef", + "Facet", + "FacetChart", + "FacetEncodingFieldDef", + "FacetFieldDef", + "FacetMapping", + "FacetSpec", + "FacetedEncoding", + "FacetedUnitSpec", + "Field", + "FieldChannelMixin", + "FieldDefWithoutScale", + "FieldEqualPredicate", + "FieldGTEPredicate", + "FieldGTPredicate", + "FieldLTEPredicate", + "FieldLTPredicate", + "FieldName", + "FieldOneOfPredicate", + "FieldOrDatumDefWithConditionDatumDefGradientstringnull", + "FieldOrDatumDefWithConditionDatumDefnumber", + "FieldOrDatumDefWithConditionDatumDefnumberArray", + "FieldOrDatumDefWithConditionDatumDefstringnull", + "FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull", + "FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull", + "FieldOrDatumDefWithConditionMarkPropFieldDefnumber", + "FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray", + "FieldOrDatumDefWithConditionStringDatumDefText", + "FieldOrDatumDefWithConditionStringFieldDefText", + "FieldOrDatumDefWithConditionStringFieldDefstring", + "FieldRange", + "FieldRangePredicate", + "FieldValidPredicate", + "Fill", + "FillDatum", + "FillOpacity", + "FillOpacityDatum", + "FillOpacityValue", + "FillValue", + "FilterTransform", + "Fit", + "FlattenTransform", + "FoldTransform", + "FontStyle", + "FontWeight", + "Generator", + "GenericUnitSpecEncodingAnyMark", + "GeoJsonFeature", + "GeoJsonFeatureCollection", + "Gradient", + "GradientStop", + "GraticuleGenerator", + "GraticuleParams", + "HConcatChart", + "HConcatSpecGenericSpec", + "Header", + "HeaderConfig", + "HexColor", + "Href", + "HrefValue", + "Impute", + "ImputeMethod", + "ImputeParams", + "ImputeSequence", + "ImputeTransform", + "InlineData", + "InlineDataset", + "Interpolate", + "IntervalSelectionConfig", + "IntervalSelectionConfigWithoutType", + "JoinAggregateFieldDef", + "JoinAggregateTransform", + "JsonDataFormat", + "Key", + "LabelOverlap", + "LatLongDef", + "LatLongFieldDef", + "Latitude", + "Latitude2", + "Latitude2Datum", + "Latitude2Value", + "LatitudeDatum", + "LayerChart", + "LayerRepeatMapping", + "LayerRepeatSpec", + "LayerSpec", + "LayoutAlign", + "Legend", + "LegendBinding", + "LegendConfig", + "LegendOrient", + "LegendResolveMap", + "LegendStreamBinding", + "LineConfig", + "LinearGradient", + "LocalMultiTimeUnit", + "LocalSingleTimeUnit", + "Locale", + "LoessTransform", + "LogicalAndPredicate", + "LogicalNotPredicate", + "LogicalOrPredicate", + "Longitude", + "Longitude2", + "Longitude2Datum", + "Longitude2Value", + "LongitudeDatum", + "LookupData", + "LookupSelection", + "LookupTransform", + "Mark", + "MarkConfig", + "MarkDef", + "MarkPropDefGradientstringnull", + "MarkPropDefnumber", + "MarkPropDefnumberArray", + "MarkPropDefstringnullTypeForShape", + "MarkType", + "MaxRowsError", + "MergedStream", + "Month", + "MultiTimeUnit", + "NamedData", + "NonArgAggregateOp", + "NonLayerRepeatSpec", + "NonNormalizedSpec", + "NumberLocale", + "NumericArrayMarkPropDef", + "NumericMarkPropDef", + "OffsetDef", + "Opacity", + "OpacityDatum", + "OpacityValue", + "Order", + "OrderFieldDef", + "OrderValue", + "OrderValueDef", + "Orient", + "Orientation", + "OverlayMarkDef", + "Padding", + "Parameter", + "ParameterExpression", + "ParameterExtent", + "ParameterName", + "ParameterPredicate", + "Parse", + "ParseValue", + "PivotTransform", + "PointSelectionConfig", + "PointSelectionConfigWithoutType", + "PolarDef", + "Position2Def", + "PositionDatumDef", + "PositionDatumDefBase", + "PositionDef", + "PositionFieldDef", + "PositionFieldDefBase", + "PositionValueDef", + "Predicate", + "PredicateComposition", + "PrimitiveValue", + "Projection", + "ProjectionConfig", + "ProjectionType", + "QuantileTransform", + "RadialGradient", + "Radius", + "Radius2", + "Radius2Datum", + "Radius2Value", + "RadiusDatum", + "RadiusValue", + "RangeConfig", + "RangeEnum", + "RangeRaw", + "RangeRawArray", + "RangeScheme", + "RectConfig", + "RegressionTransform", + "RelativeBandSize", + "RepeatChart", + "RepeatMapping", + "RepeatRef", + "RepeatSpec", + "Resolve", + "ResolveMode", + "Root", + "Row", + "RowColLayoutAlign", + "RowColboolean", + "RowColnumber", + "RowColumnEncodingFieldDef", + "SCHEMA_URL", + "SCHEMA_VERSION", + "SampleTransform", + "Scale", + "ScaleBinParams", + "ScaleBins", + "ScaleConfig", + "ScaleDatumDef", + "ScaleFieldDef", + "ScaleInterpolateEnum", + "ScaleInterpolateParams", + "ScaleResolveMap", + "ScaleType", + "SchemaBase", + "SchemeParams", + "SecondaryFieldDef", + "SelectionConfig", + "SelectionExpression", + "SelectionInit", + "SelectionInitInterval", + "SelectionInitIntervalMapping", + "SelectionInitMapping", + "SelectionParameter", + "SelectionPredicateComposition", + "SelectionResolution", + "SelectionType", + "SequenceGenerator", + "SequenceParams", + "SequentialMultiHue", + "SequentialSingleHue", + "Shape", + "ShapeDatum", + "ShapeDef", + "ShapeValue", + "SharedEncoding", + "SingleDefUnitChannel", + "SingleTimeUnit", + "Size", + "SizeDatum", + "SizeValue", + "Sort", + "SortArray", + "SortByChannel", + "SortByChannelDesc", + "SortByEncoding", + "SortField", + "SortOrder", + "Spec", + "SphereGenerator", + "StackOffset", + "StackTransform", + "StandardType", + "Step", + "StepFor", + "Stream", + "StringFieldDef", + "StringFieldDefWithCondition", + "StringValueDefWithCondition", + "Stroke", + "StrokeCap", + "StrokeDash", + "StrokeDashDatum", + "StrokeDashValue", + "StrokeDatum", + "StrokeJoin", + "StrokeOpacity", + "StrokeOpacityDatum", + "StrokeOpacityValue", + "StrokeValue", + "StrokeWidth", + "StrokeWidthDatum", + "StrokeWidthValue", + "StyleConfigIndex", + "SymbolShape", + "TOPLEVEL_ONLY_KEYS", + "Text", + "TextBaseline", + "TextDatum", + "TextDef", + "TextDirection", + "TextValue", + "Theta", + "Theta2", + "Theta2Datum", + "Theta2Value", + "ThetaDatum", + "ThetaValue", + "TickConfig", + "TickCount", + "TimeInterval", + "TimeIntervalStep", + "TimeLocale", + "TimeUnit", + "TimeUnitParams", + "TimeUnitTransform", + "Title", + "TitleAnchor", + "TitleConfig", + "TitleFrame", + "TitleOrient", + "TitleParams", + "Tooltip", + "TooltipContent", + "TooltipValue", + "TopLevelConcatSpec", + "TopLevelFacetSpec", + "TopLevelHConcatSpec", + "TopLevelLayerSpec", + "TopLevelMixin", + "TopLevelRepeatSpec", + "TopLevelSelectionParameter", + "TopLevelSpec", + "TopLevelUnitSpec", + "TopLevelVConcatSpec", + "TopoDataFormat", + "Transform", + "Type", + "TypeForShape", + "TypedFieldDef", + "URI", + "Undefined", + "UnitSpec", + "UnitSpecWithFrame", + "Url", + "UrlData", + "UrlValue", + "UtcMultiTimeUnit", + "UtcSingleTimeUnit", + "VConcatChart", + "VConcatSpecGenericSpec", + "VEGAEMBED_VERSION", + "VEGALITE_VERSION", + "VEGA_VERSION", + "ValueChannelMixin", + "ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull", + "ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull", + "ValueDefWithConditionMarkPropFieldOrDatumDefnumber", + "ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray", + "ValueDefWithConditionMarkPropFieldOrDatumDefstringnull", + "ValueDefWithConditionStringFieldDefText", + "ValueDefnumber", + "ValueDefnumberwidthheightExprRef", + "VariableParameter", + "Vector10string", + "Vector12string", + "Vector2DateTime", + "Vector2Vector2number", + "Vector2boolean", + "Vector2number", + "Vector2string", + "Vector3number", + "Vector7string", + "VegaLite", + "VegaLiteSchema", + "ViewBackground", + "ViewConfig", + "WindowEventType", + "WindowFieldDef", + "WindowOnlyOp", + "WindowTransform", + "X", + "X2", + "X2Datum", + "X2Value", + "XDatum", + "XError", + "XError2", + "XError2Value", + "XErrorValue", + "XOffset", + "XOffsetDatum", + "XOffsetValue", + "XValue", + "Y", + "Y2", + "Y2Datum", + "Y2Value", + "YDatum", + "YError", + "YError2", + "YError2Value", + "YErrorValue", + "YOffset", + "YOffsetDatum", + "YOffsetValue", + "YValue", + "api", + "binding", + "binding_checkbox", + "binding_radio", + "binding_range", + "binding_select", + "channels", + "check_fields_and_encodings", + "concat", + "condition", + "core", + "curry", + "data", + "data_transformers", + "datasets", + "datum", + "default_data_transformer", + "display", + "expr", + "graticule", + "hconcat", + "layer", + "limit_rows", + "load_ipython_extension", + "load_schema", + "mixins", + "overload", + "param", + "parse_shorthand", + "pipe", + "renderers", + "repeat", + "sample", + "schema", + "selection", + "selection_interval", + "selection_point", + "sequence", + "sphere", + "theme", + "themes", + "to_csv", + "to_json", + "to_values", + "topo_feature", + "utils", + "v5", + "value", + "vconcat", + "vegalite", + "with_property_setters", +] + + +def __dir__(): + return __all__ + + from .vegalite import * diff --git a/altair/utils/deprecation.py b/altair/utils/deprecation.py --- a/altair/utils/deprecation.py +++ b/altair/utils/deprecation.py @@ -65,6 +65,7 @@ def new_obj(*args, **kwargs): warnings.warn(message, AltairDeprecationWarning) return obj(*args, **kwargs) + new_obj._deprecated = True return new_obj else: raise ValueError("Cannot deprecate object of type {}".format(type(obj))) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -631,11 +631,13 @@ def main(): copy_schemapi_util() vegalite_main(args.skip_download) - # Altair is imported after the generation of the new schema files so that - # the API docs reflect the newest changes + # The modules below are imported after the generation of the new schema files + # as these modules import Altair. This allows them to use the new changes import generate_api_docs # noqa: E402 + import update_init_file # noqa: E402 generate_api_docs.write_api_file() + update_init_file.update__all__variable() if __name__ == "__main__": diff --git a/tools/update_init_file.py b/tools/update_init_file.py new file mode 100644 --- /dev/null +++ b/tools/update_init_file.py @@ -0,0 +1,77 @@ +""" +This script updates the attribute __all__ in altair/__init__.py +based on the updated Altair schema. +""" +import inspect +import sys +from pathlib import Path +from os.path import abspath, dirname, join + +import black + +# Import Altair from head +ROOT_DIR = abspath(join(dirname(__file__), "..")) +sys.path.insert(0, ROOT_DIR) +import altair as alt # noqa: E402 + + +def update__all__variable(): + """Updates the __all__ variable to all relevant attributes of top-level Altair. + This is for example useful to hide deprecated attributes from code completion in + Jupyter. + """ + # Read existing file content + init_path = alt.__file__ + with open(init_path, "r") as f: + lines = f.readlines() + lines = [line.strip("\n") for line in lines] + + # Find first and last line of the definition of __all__ + first_definition_line = None + last_definition_line = None + for idx, line in enumerate(lines): + if line.startswith("__all__ ="): + first_definition_line = idx + elif first_definition_line is not None and line.startswith("]"): + last_definition_line = idx + break + assert first_definition_line is not None and last_definition_line is not None + + # Figure out which attributes are relevant + relevant_attributes = [x for x in alt.__dict__ if _is_relevant_attribute(x)] + relevant_attributes.sort() + relevant_attributes_str = f"__all__ = {relevant_attributes}" + + # Put file back together, replacing old definition of __all__ with new one, keeping + # the rest of the file as is + new_lines = ( + lines[:first_definition_line] + + [relevant_attributes_str] + + lines[last_definition_line + 1 :] + ) + # Format file content with black + new_file_content = black.format_str("\n".join(new_lines), mode=black.Mode()) + + # Write new version of altair/__init__.py + with open(init_path, "w") as f: + f.write(new_file_content) + + +def _is_relevant_attribute(attr_name): + attr = getattr(alt, attr_name) + if getattr(attr, "_deprecated", False) is True or attr_name.startswith("_"): + return False + else: + if inspect.ismodule(attr): + # Only include modules which are part of Altair. This excludes built-in + # modules (they do not have a __file__ attribute), standard library, + # and third-party packages. + return getattr(attr, "__file__", "").startswith( + str(Path(alt.__file__).parent) + ) + else: + return True + + +if __name__ == "__main__": + update__all__variable()
diff --git a/tests/test_toplevel.py b/tests/test_toplevel.py new file mode 100644 --- /dev/null +++ b/tests/test_toplevel.py @@ -0,0 +1,20 @@ +import sys +from os.path import abspath, join, dirname + +import altair as alt + +current_dir = dirname(__file__) +sys.path.insert(0, abspath(join(current_dir, ".."))) +from tools import update_init_file # noqa: E402 + + +def test_completeness_of__all__(): + relevant_attributes = [ + x for x in alt.__dict__ if update_init_file._is_relevant_attribute(x) + ] + relevant_attributes.sort() + + # If the assert statement fails below, there are probably either new objects + # in the top-level Altair namespace or some were removed. + # In that case, run tools/update_init_file.py to update __all__ + assert getattr(alt, "__all__") == relevant_attributes
confusing auto-completion of new and deprecated selections as was mentioned here: https://github.com/altair-viz/altair/pull/2528#issuecomment-1016173679. > Discussion point: currently the following is confusing me: > <img width="553" alt="image" src="https://user-images.githubusercontent.com/5186265/150086926-b6b7c726-07a3-4d05-91b7-f49b84dae65d.png"> > For me it is not clear which method is preferred or deprecated. I don't mind changing `alt.selection_multi` and `alt.selection_single` to `alt._selection_multi` and `alt._selection_single`. Potential solution given here: https://github.com/altair-viz/altair/pull/2528#issuecomment-1061075908, but still need some thought as raised here: https://github.com/altair-viz/altair/pull/2528#issuecomment-1069380746.
2023-01-07T18:08:26Z
[]
[]
vega/altair
2,842
vega__altair-2842
[ "2175", "2744" ]
74b3515644f16f27cb1924398fbbbc155e5dfaed
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -5,7 +5,7 @@ import inspect import json import textwrap -from typing import Any +from typing import Any, Sequence, List import jsonschema import jsonschema.exceptions @@ -66,9 +66,50 @@ def validate_jsonschema(spec, schema, rootschema=None): if hasattr(validator_cls, "FORMAT_CHECKER"): validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER validator = validator_cls(schema, **validator_kwargs) - error = jsonschema.exceptions.best_match(validator.iter_errors(spec)) - if error is not None: - raise error + errors = list(validator.iter_errors(spec)) + if errors: + errors = _get_most_relevant_errors(errors) + main_error = errors[0] + # They can be used to craft more helpful error messages when this error + # is being converted to a SchemaValidationError + main_error._additional_errors = errors[1:] + raise main_error + + +def _get_most_relevant_errors( + errors: Sequence[jsonschema.exceptions.ValidationError], +) -> List[jsonschema.exceptions.ValidationError]: + if len(errors) == 0: + return [] + + # Go to lowest level in schema where an error happened as these give + # the most relevant error messages + lowest_level = errors[0] + while lowest_level.context: + lowest_level = lowest_level.context[0] + + most_relevant_errors = [] + if lowest_level.validator == "additionalProperties": + # For these errors, the message is already informative enough and the other + # errors on the lowest level are not helpful for a user but instead contain + # the same information in a more verbose way + most_relevant_errors = [lowest_level] + else: + parent = lowest_level.parent + if parent is None: + # In this case we are still at the top level and can return all errors + most_relevant_errors = errors + else: + # Return all errors of the lowest level out of which + # we can construct more informative error messages + most_relevant_errors = lowest_level.parent.context + + # This should never happen but might still be good to test for it as else + # the original error would just slip through without being raised + if len(most_relevant_errors) == 0: + raise Exception("Could not determine the most relevant errors") from errors[0] + + return most_relevant_errors def _subclasses(cls): @@ -82,18 +123,14 @@ def _subclasses(cls): yield cls -def _todict(obj, validate, context): +def _todict(obj, context): """Convert an object to a dict representation.""" if isinstance(obj, SchemaBase): - return obj.to_dict(validate=validate, context=context) + return obj.to_dict(validate=False, context=context) elif isinstance(obj, (list, tuple, np.ndarray)): - return [_todict(v, validate, context) for v in obj] + return [_todict(v, context) for v in obj] elif isinstance(obj, dict): - return { - k: _todict(v, validate, context) - for k, v in obj.items() - if v is not Undefined - } + return {k: _todict(v, context) for k, v in obj.items() if v is not Undefined} elif hasattr(obj, "to_dict"): return obj.to_dict() elif isinstance(obj, np.number): @@ -117,24 +154,9 @@ class SchemaValidationError(jsonschema.ValidationError): """A wrapper for jsonschema.ValidationError with friendlier traceback""" def __init__(self, obj, err): - super(SchemaValidationError, self).__init__(**self._get_contents(err)) + super(SchemaValidationError, self).__init__(**err._contents()) self.obj = obj - - @staticmethod - def _get_contents(err): - """Get a dictionary with the contents of a ValidationError""" - try: - # works in jsonschema 2.3 or later - contents = err._contents() - except AttributeError: - try: - # works in Python >=3.4 - spec = inspect.getfullargspec(err.__init__) - except AttributeError: - # works in Python <3.4 - spec = inspect.getargspec(err.__init__) - contents = {key: getattr(err, key) for key in spec.args[1:]} - return contents + self._additional_errors = getattr(err, "_additional_errors", []) def __str__(self): cls = self.obj.__class__ @@ -145,13 +167,18 @@ def __str__(self): for val in schema_path[:-1] if val not in ("properties", "additionalProperties", "patternProperties") ) + message = self.message + if self._additional_errors: + message += "\n " + "\n ".join( + [e.message for e in self._additional_errors] + ) return """Invalid specification {}, validating {!r} {} """.format( - schema_path, self.validator, self.message + schema_path, self.validator, message ) @@ -327,11 +354,9 @@ def to_dict(self, validate=True, ignore=None, context=None): Parameters ---------- - validate : boolean or string + validate : boolean If True (default), then validate the output dictionary - against the schema. If "deep" then recursively validate - all objects in the spec. This takes much more time, but - it results in friendlier tracebacks for large objects. + against the schema. ignore : list A list of keys to ignore. This will *not* passed to child to_dict function calls. @@ -353,10 +378,9 @@ def to_dict(self, validate=True, ignore=None, context=None): context = {} if ignore is None: ignore = [] - sub_validate = "deep" if validate == "deep" else False if self._args and not self._kwds: - result = _todict(self._args[0], validate=sub_validate, context=context) + result = _todict(self._args[0], context=context) elif not self._args: kwds = self._kwds.copy() # parsed_shorthand is added by FieldChannelMixin. @@ -384,7 +408,6 @@ def to_dict(self, validate=True, ignore=None, context=None): } result = _todict( kwds, - validate=sub_validate, context=context, ) else: @@ -406,11 +429,9 @@ def to_json( Parameters ---------- - validate : boolean or string + validate : boolean If True (default), then validate the output dictionary - against the schema. If "deep" then recursively validate - all objects in the spec. This takes much more time, but - it results in friendlier tracebacks for large objects. + against the schema. ignore : list A list of keys to ignore. This will *not* passed to child to_dict function calls. @@ -516,7 +537,7 @@ def validate_property(cls, name, value, schema=None): Validate a property against property schema in the context of the rootschema """ - value = _todict(value, validate=False, context={}) + value = _todict(value, context={}) props = cls.resolve_references(schema or cls._schema).get("properties", {}) return validate_jsonschema( value, props.get(name, {}), rootschema=cls._rootschema or cls._schema diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -556,17 +556,7 @@ def to_dict(self, *args, **kwargs): context["top_level"] = False kwargs["context"] = context - try: - dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs) - except jsonschema.ValidationError: - dct = None - - # If we hit an error, then re-convert with validate='deep' to get - # a more useful traceback. We don't do this by default because it's - # much slower in the case that there are no errors. - if dct is None: - kwargs["validate"] = "deep" - dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs) + dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs) # TODO: following entries are added after validation. Should they be validated? if is_top_level: diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -3,7 +3,7 @@ import inspect import json import textwrap -from typing import Any +from typing import Any, Sequence, List import jsonschema import jsonschema.exceptions @@ -64,9 +64,50 @@ def validate_jsonschema(spec, schema, rootschema=None): if hasattr(validator_cls, "FORMAT_CHECKER"): validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER validator = validator_cls(schema, **validator_kwargs) - error = jsonschema.exceptions.best_match(validator.iter_errors(spec)) - if error is not None: - raise error + errors = list(validator.iter_errors(spec)) + if errors: + errors = _get_most_relevant_errors(errors) + main_error = errors[0] + # They can be used to craft more helpful error messages when this error + # is being converted to a SchemaValidationError + main_error._additional_errors = errors[1:] + raise main_error + + +def _get_most_relevant_errors( + errors: Sequence[jsonschema.exceptions.ValidationError], +) -> List[jsonschema.exceptions.ValidationError]: + if len(errors) == 0: + return [] + + # Go to lowest level in schema where an error happened as these give + # the most relevant error messages + lowest_level = errors[0] + while lowest_level.context: + lowest_level = lowest_level.context[0] + + most_relevant_errors = [] + if lowest_level.validator == "additionalProperties": + # For these errors, the message is already informative enough and the other + # errors on the lowest level are not helpful for a user but instead contain + # the same information in a more verbose way + most_relevant_errors = [lowest_level] + else: + parent = lowest_level.parent + if parent is None: + # In this case we are still at the top level and can return all errors + most_relevant_errors = errors + else: + # Return all errors of the lowest level out of which + # we can construct more informative error messages + most_relevant_errors = lowest_level.parent.context + + # This should never happen but might still be good to test for it as else + # the original error would just slip through without being raised + if len(most_relevant_errors) == 0: + raise Exception("Could not determine the most relevant errors") from errors[0] + + return most_relevant_errors def _subclasses(cls): @@ -80,18 +121,14 @@ def _subclasses(cls): yield cls -def _todict(obj, validate, context): +def _todict(obj, context): """Convert an object to a dict representation.""" if isinstance(obj, SchemaBase): - return obj.to_dict(validate=validate, context=context) + return obj.to_dict(validate=False, context=context) elif isinstance(obj, (list, tuple, np.ndarray)): - return [_todict(v, validate, context) for v in obj] + return [_todict(v, context) for v in obj] elif isinstance(obj, dict): - return { - k: _todict(v, validate, context) - for k, v in obj.items() - if v is not Undefined - } + return {k: _todict(v, context) for k, v in obj.items() if v is not Undefined} elif hasattr(obj, "to_dict"): return obj.to_dict() elif isinstance(obj, np.number): @@ -115,24 +152,9 @@ class SchemaValidationError(jsonschema.ValidationError): """A wrapper for jsonschema.ValidationError with friendlier traceback""" def __init__(self, obj, err): - super(SchemaValidationError, self).__init__(**self._get_contents(err)) + super(SchemaValidationError, self).__init__(**err._contents()) self.obj = obj - - @staticmethod - def _get_contents(err): - """Get a dictionary with the contents of a ValidationError""" - try: - # works in jsonschema 2.3 or later - contents = err._contents() - except AttributeError: - try: - # works in Python >=3.4 - spec = inspect.getfullargspec(err.__init__) - except AttributeError: - # works in Python <3.4 - spec = inspect.getargspec(err.__init__) - contents = {key: getattr(err, key) for key in spec.args[1:]} - return contents + self._additional_errors = getattr(err, "_additional_errors", []) def __str__(self): cls = self.obj.__class__ @@ -143,13 +165,18 @@ def __str__(self): for val in schema_path[:-1] if val not in ("properties", "additionalProperties", "patternProperties") ) + message = self.message + if self._additional_errors: + message += "\n " + "\n ".join( + [e.message for e in self._additional_errors] + ) return """Invalid specification {}, validating {!r} {} """.format( - schema_path, self.validator, self.message + schema_path, self.validator, message ) @@ -325,11 +352,9 @@ def to_dict(self, validate=True, ignore=None, context=None): Parameters ---------- - validate : boolean or string + validate : boolean If True (default), then validate the output dictionary - against the schema. If "deep" then recursively validate - all objects in the spec. This takes much more time, but - it results in friendlier tracebacks for large objects. + against the schema. ignore : list A list of keys to ignore. This will *not* passed to child to_dict function calls. @@ -351,10 +376,9 @@ def to_dict(self, validate=True, ignore=None, context=None): context = {} if ignore is None: ignore = [] - sub_validate = "deep" if validate == "deep" else False if self._args and not self._kwds: - result = _todict(self._args[0], validate=sub_validate, context=context) + result = _todict(self._args[0], context=context) elif not self._args: kwds = self._kwds.copy() # parsed_shorthand is added by FieldChannelMixin. @@ -382,7 +406,6 @@ def to_dict(self, validate=True, ignore=None, context=None): } result = _todict( kwds, - validate=sub_validate, context=context, ) else: @@ -404,11 +427,9 @@ def to_json( Parameters ---------- - validate : boolean or string + validate : boolean If True (default), then validate the output dictionary - against the schema. If "deep" then recursively validate - all objects in the spec. This takes much more time, but - it results in friendlier tracebacks for large objects. + against the schema. ignore : list A list of keys to ignore. This will *not* passed to child to_dict function calls. @@ -514,7 +535,7 @@ def validate_property(cls, name, value, schema=None): Validate a property against property schema in the context of the rootschema """ - value = _todict(value, validate=False, context={}) + value = _todict(value, context={}) props = cls.resolve_references(schema or cls._schema).get("properties", {}) return validate_jsonschema( value, props.get(name, {}), rootschema=cls._rootschema or cls._schema
diff --git a/tests/utils/tests/test_schemapi.py b/tests/utils/tests/test_schemapi.py --- a/tests/utils/tests/test_schemapi.py +++ b/tests/utils/tests/test_schemapi.py @@ -4,11 +4,14 @@ import io import json import jsonschema +import re import pickle -import pytest +import warnings import numpy as np import pandas as pd +import pytest +from vega_datasets import data import altair as alt from altair import load_schema @@ -380,6 +383,131 @@ def test_schema_validation_error(): assert the_err.message in message +def chart_example_layer(): + points = ( + alt.Chart(data.cars.url) + .mark_point() + .encode( + x="Horsepower:Q", + y="Miles_per_Gallon:Q", + ) + ) + return (points & points).properties(width=400) + + +def chart_example_hconcat(): + source = data.cars() + points = ( + alt.Chart(source) + .mark_point() + .encode( + x="Horsepower", + y="Miles_per_Gallon", + ) + ) + + text = ( + alt.Chart(source) + .mark_text(align="right") + .encode(alt.Text("Horsepower:N", title=dict(text="Horsepower", align="right"))) + ) + + return points | text + + +def chart_example_invalid_channel_and_condition(): + selection = alt.selection_point() + return ( + alt.Chart(data.barley()) + .mark_circle() + .add_params(selection) + .encode( + color=alt.condition(selection, alt.value("red"), alt.value("green")), + invalidChannel=None, + ) + ) + + +def chart_example_invalid_y_option(): + return ( + alt.Chart(data.barley()) + .mark_bar() + .encode( + x=alt.X("variety", unknown=2), + y=alt.Y("sum(yield)", stack="asdf"), + ) + ) + + +def chart_example_invalid_y_option_value(): + return ( + alt.Chart(data.barley()) + .mark_bar() + .encode( + x=alt.X("variety"), + y=alt.Y("sum(yield)", stack="asdf"), + ) + ) + + +def chart_example_invalid_y_option_value_with_condition(): + return ( + alt.Chart(data.barley()) + .mark_bar() + .encode( + x="variety", + y=alt.Y("sum(yield)", stack="asdf"), + opacity=alt.condition("datum.yield > 0", alt.value(1), alt.value(0.2)), + ) + ) + + [email protected]( + "chart_func, expected_error_message", + [ + ( + chart_example_invalid_y_option, + r"Additional properties are not allowed \('unknown' was unexpected\)", + ), + ( + chart_example_invalid_y_option_value, + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" + + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + ), + ( + chart_example_layer, + r"Additional properties are not allowed \('width' was unexpected\)", + ), + ( + chart_example_invalid_y_option_value_with_condition, + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" + + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + ), + ( + chart_example_hconcat, + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'string'.*" + + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'array'", + ), + ( + chart_example_invalid_channel_and_condition, + r"Additional properties are not allowed \('invalidChannel' was unexpected\)", + ), + ], +) +def test_chart_validation_errors(chart_func, expected_error_message): + # DOTALL flag makes that a dot (.) also matches new lines + pattern = re.compile(expected_error_message, re.DOTALL) + # For some wrong chart specifications such as an unknown encoding channel, + # Altair already raises a warning before the chart specifications are validated. + # We can ignore these warnings as we are interested in the errors being raised + # during validation which is triggered by to_dict + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=UserWarning) + chart = chart_func() + with pytest.raises(SchemaValidationError, match=pattern): + chart.to_dict() + + def test_serialize_numpy_types(): m = MySchema( a={"date": np.datetime64("2019-01-01")}, diff --git a/tools/schemapi/tests/test_schemapi.py b/tools/schemapi/tests/test_schemapi.py --- a/tools/schemapi/tests/test_schemapi.py +++ b/tools/schemapi/tests/test_schemapi.py @@ -2,11 +2,14 @@ import io import json import jsonschema +import re import pickle -import pytest +import warnings import numpy as np import pandas as pd +import pytest +from vega_datasets import data import altair as alt from altair import load_schema @@ -378,6 +381,131 @@ def test_schema_validation_error(): assert the_err.message in message +def chart_example_layer(): + points = ( + alt.Chart(data.cars.url) + .mark_point() + .encode( + x="Horsepower:Q", + y="Miles_per_Gallon:Q", + ) + ) + return (points & points).properties(width=400) + + +def chart_example_hconcat(): + source = data.cars() + points = ( + alt.Chart(source) + .mark_point() + .encode( + x="Horsepower", + y="Miles_per_Gallon", + ) + ) + + text = ( + alt.Chart(source) + .mark_text(align="right") + .encode(alt.Text("Horsepower:N", title=dict(text="Horsepower", align="right"))) + ) + + return points | text + + +def chart_example_invalid_channel_and_condition(): + selection = alt.selection_point() + return ( + alt.Chart(data.barley()) + .mark_circle() + .add_params(selection) + .encode( + color=alt.condition(selection, alt.value("red"), alt.value("green")), + invalidChannel=None, + ) + ) + + +def chart_example_invalid_y_option(): + return ( + alt.Chart(data.barley()) + .mark_bar() + .encode( + x=alt.X("variety", unknown=2), + y=alt.Y("sum(yield)", stack="asdf"), + ) + ) + + +def chart_example_invalid_y_option_value(): + return ( + alt.Chart(data.barley()) + .mark_bar() + .encode( + x=alt.X("variety"), + y=alt.Y("sum(yield)", stack="asdf"), + ) + ) + + +def chart_example_invalid_y_option_value_with_condition(): + return ( + alt.Chart(data.barley()) + .mark_bar() + .encode( + x="variety", + y=alt.Y("sum(yield)", stack="asdf"), + opacity=alt.condition("datum.yield > 0", alt.value(1), alt.value(0.2)), + ) + ) + + [email protected]( + "chart_func,expected_error_message", + [ + ( + chart_example_invalid_y_option, + r"Additional properties are not allowed \('unknown' was unexpected\)", + ), + ( + chart_example_invalid_y_option_value, + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" + + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + ), + ( + chart_example_layer, + r"Additional properties are not allowed \('width' was unexpected\)", + ), + ( + chart_example_invalid_y_option_value_with_condition, + r"'asdf' is not one of \['zero', 'center', 'normalize'\].*" + + r"'asdf' is not of type 'null'.*'asdf' is not of type 'boolean'", + ), + ( + chart_example_hconcat, + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'string'.*" + + r"\{'text': 'Horsepower', 'align': 'right'\} is not of type 'array'", + ), + ( + chart_example_invalid_channel_and_condition, + r"Additional properties are not allowed \('invalidChannel' was unexpected\)", + ), + ], +) +def test_chart_validation_errors(chart_func, expected_error_message): + # DOTALL flag makes that a dot (.) also matches new lines + pattern = re.compile(expected_error_message, re.DOTALL) + # For some wrong chart specifications such as an unknown encoding channel, + # Altair already raises a warning before the chart specifications are validated. + # We can ignore these warnings as we are interested in the errors being raised + # during validation which is triggered by to_dict + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=UserWarning) + chart = chart_func() + with pytest.raises(SchemaValidationError, match=pattern): + chart.to_dict() + + def test_serialize_numpy_types(): m = MySchema( a={"date": np.datetime64("2019-01-01")},
Chart.encode() returns confusing error message when using an invalid channel and selections Consider: ```python selection = alt.selection_single() (alt.Chart(data=None) .mark_circle() .encode(color=alt.value('red'), invalidChannel=None)) ``` Predictably, this fails with: ``` SchemaValidationError: Invalid specification altair.vegalite.v4.schema.core.FacetedEncoding, validating 'additionalProperties' Additional properties are not allowed ('invalidChannel' was unexpected) ``` So far so good. But now watch what happens if `x` is set to a selection: ```python selection = alt.selection_single() (alt.Chart(data=None) .mark_circle() .add_selection(selection) .encode( color=alt.condition(selection, alt.value('red'), alt.value('green')), invalidChannel=None)) ``` This time, the error message is way more confusing and doesn't point to the actual cause of the problem: ``` SchemaValidationError: Invalid specification altair.vegalite.v4.schema.channels.ColorValue, validating 'additionalProperties' Additional properties are not allowed ('selection' was unexpected) ``` The misleading error message made me waste a lot of time chasing down dead ends simply because I mistyped `tooltip` as `tooltips` :( Incorrect error message when an unknown param value is used I just noted that in a spec that contains a condition, using an unknown parameter value anywhere in the spec will always return an error pointing to the condition even when it has nothing to do with actual error. For example, the following spec: ```py import altair as alt from vega_datasets import data source = data.barley() alt.Chart(source).mark_bar().encode( x='variety', y=alt.Y('sum(yield)', stack='asdf'), opacity=alt.condition('datum.yield > 0', alt.value(1), alt.value(0.2)) ) ``` returns: ``` SchemaValidationError: Invalid specification altair.vegalite.v4.schema.channels.OpacityValue, validating 'additionalProperties' Additional properties are not allowed ('test' was unexpected) ``` If we change to `opacity=alt.value(0.6)` we get the expected output: ``` SchemaValidationError: Invalid specification altair.vegalite.v4.schema.channels.Y->0, validating 'enum' '' is not one of ['zero', 'center', 'normalize'] ``` Note that there is nothing wrong the opacity condition here and removing the incorrect `stack` value leads to zero errors. Looking closer at the error raising sequence, it seems like the stack error is always raised first, but if there is a conditional in the spec there will also be a second error raised. Not sure how raising one error leads to the other or why the sequence doesn't stop at the first raised error. It seems like `{'test': 'datum.yield > 0', 'value': 1}` is evaluating against a schema that only contains the `condition` key, so it should have been `{'condition': {'test': 'datum.yield > 0', 'value': 1}}` instead and then `{'test': 'datum.yield > 0', 'value': 1}` in the next validation.
Yes, this is pretty misleading. It’s difficult to specialize, because validation errors come from validating the schema of the full chart. This is not unique to `condition`, it also happens for concat charts. In the example below the error is with the title data type, but this gets swallowed and leads to another error being raised: ``` import altair as alt from vega_datasets import data source = data.cars() points = alt.Chart(source).mark_point().encode( x='Horsepower', y='Miles_per_Gallon', ) text = alt.Chart(source).mark_text(align='right').encode( alt.Text('Horsepower:N', title=dict(text='Horsepower', align='right')) ) points | text ``` The real error is the first one printed below, but the one that actually gets raised is the last one which is really confusing ![image](https://user-images.githubusercontent.com/4560057/207788941-4ea79f92-5577-419b-88a6-88f7fb728e58.png) If we do faceting instead of concating, the real error is raised correctly, but note that Altair is still taking three rounds of looping through the validation and finding error messages for some reason (I am not sure why it doesn't stop when it encounters the first error): ![image](https://user-images.githubusercontent.com/4560057/207789288-ba5e8bff-0be9-473a-b588-ba0d9319831a.png) Making some more incremental progress here, it seems like concatenated specs with data and any spec with a condition are just not working with deep validation in general even when the spec is perfectly valid (not sure if this is a regression or they just never worked). Spec with a condition: ```py alt.Chart().mark_bar().encode( opacity=alt.condition('', alt.value(1), alt.value(0.2)) ).to_dict(validate='deep') # Works without `validate='deep'` ``` ``` ValidationError: Additional properties are not allowed ('test' was unexpected) ``` Any concat or layer spec with data or a data url: ```py # Works without `validate='deep'` or with empty data alt.hconcat(alt.Chart('some_data').mark_point()).to_dict(validate='deep') ``` ``` ValidationError: 'data' is a required property ``` It seems like for concatenated specs, the issue is that the `rootschema` only allows marks to be defined together with a `data` key in the same dictionary as in a regular single chart: ```py {'data': {'url': 'some_data_or_url'}, 'mark': 'point'} ``` However, for a layered or concatenated chart, the specification looks slightly different: ```py {'layer': [{'mark': 'point'}], 'data': {'url': 'some_data_or_url'}} ``` This results in the the part that says `{'mark': 'point'}` being evaluated on it's own without the data part and the error `'data' is a required property` is raised. Hi @joelostblom, as an experiment, do you like the error messages better if you comment out this line: https://github.com/altair-viz/altair/blob/af756e9a9549b2bf0f88685d2f93e6224665bf18/altair/vegalite/v5/api.py#L568 (That doesn't explain what's wrong with `validate="deep"`, but at first glance the error messages seem nicer this way. Very possible the error messages are nicer in a few examples and worse in many others.) I tried that and I agree that it is better for the scenarios that currently don't work with 'deep'. However, ideally we would make everything work with 'deep' because it does make the messages more informative, e.g. this spec: ```py alt.Chart(data.barley()).mark_bar().encode( x='variety', y=alt.Y('sum(yield)', stack='asdf'), ) ``` gives the following with 'deep': ``` 'asdf' is not one of ['zero', 'center', 'normalize'] ``` But if we remove it, the error message would just say: ``` {'aggregate': 'sum', 'field': 'yield', 'stack': 'asdf', 'type': 'quantitative'} is not valid under any of the given schemas ``` I will look a bit more at this now Hi @joelostblom, I played around a little more and my best guess is that the first two examples at the top of this issue are related to two separate issues. This comment is only about the first example. If you define a Chart `c` using the following code (which is valid as far as I can tell) ``` import altair as alt cond = alt.condition('true', alt.value(100), alt.value(10)) c = alt.Chart().mark_circle().encode( size=cond ) ``` and then compute ``` c.encoding.size ``` the result is ``` SizeValue({ condition: SizeValue({ test: 'true', value: 100 }), value: 10 }) ``` I believe the issue is that (for this particular Chart) Altair is wrapping too deep (notice how `SizeValue` occurs twice). If we use `validate="deep"` on this object, an error is raised because {"test": "true", "value": 100} is not a valid `alt.SizeValue`. This I think explains the error message `'test' was unexpected` that we saw in your first example above. This particular error can be solved by removing these lines, which wrap the condition: https://github.com/altair-viz/altair/blob/6a3db4d9d8685437953237d9b7a8d8f3c99dfb3e/altair/utils/core.py#L672-L674 but then examples using more complicated conditions break (such as this [interactive rectangular brush](https://github.com/altair-viz/altair/blob/6a3db4d9d8685437953237d9b7a8d8f3c99dfb3e/tests/examples_arguments_syntax/interactive_brush.py) example). I'm optimistic this particular bug can be solved by adding some more logic to the lines I linked above, but I haven't tried yet. I don't think this is related to your concatenated charts example (how could it be, since there is no condition in that example). That's great! Thank you for looking into that in more detail Chris! Feel free to play around with that logic if you wanted. I am mainly working to solve the concat/layer issue right now and I think I have figured out that it is due to the top level data not being taking into account when evaluating the individual layers/concats, so I am trying to change the logic in one of the other files so that each layered/concated spec is evaluated in the context of the top level data.
2023-01-20T20:09:27Z
[]
[]
vega/altair
2,874
vega__altair-2874
[ "2863" ]
7509e452a8c5da2870b48b30969d170dc4015597
diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -2272,24 +2272,38 @@ def _get(spec, attr): if encoding is not Undefined: for channel in ["row", "column", "facet"]: if _get(encoding, channel) is not Undefined: - raise ValueError("Faceted charts cannot be layered.") + raise ValueError( + "Faceted charts cannot be layered. Instead, layer the charts before faceting." + ) if isinstance(spec, (Chart, LayerChart)): return if not isinstance(spec, (core.SchemaBase, dict)): raise ValueError("Only chart objects can be layered.") if _get(spec, "facet") is not Undefined: - raise ValueError("Faceted charts cannot be layered.") + raise ValueError( + "Faceted charts cannot be layered. Instead, layer the charts before faceting." + ) if isinstance(spec, FacetChart) or _get(spec, "facet") is not Undefined: - raise ValueError("Faceted charts cannot be layered.") + raise ValueError( + "Faceted charts cannot be layered. Instead, layer the charts before faceting." + ) if isinstance(spec, RepeatChart) or _get(spec, "repeat") is not Undefined: - raise ValueError("Repeat charts cannot be layered.") + raise ValueError( + "Repeat charts cannot be layered. Instead, layer the charts before repeating." + ) if isinstance(spec, ConcatChart) or _get(spec, "concat") is not Undefined: - raise ValueError("Concatenated charts cannot be layered.") + raise ValueError( + "Concatenated charts cannot be layered. Instead, layer the charts before concatenating." + ) if isinstance(spec, HConcatChart) or _get(spec, "hconcat") is not Undefined: - raise ValueError("Concatenated charts cannot be layered.") + raise ValueError( + "Concatenated charts cannot be layered. Instead, layer the charts before concatenating." + ) if isinstance(spec, VConcatChart) or _get(spec, "vconcat") is not Undefined: - raise ValueError("Concatenated charts cannot be layered.") + raise ValueError( + "Concatenated charts cannot be layered. Instead, layer the charts before concatenating." + ) @utils.use_signature(core.TopLevelRepeatSpec)
diff --git a/tests/vegalite/v5/tests/test_api.py b/tests/vegalite/v5/tests/test_api.py --- a/tests/vegalite/v5/tests/test_api.py +++ b/tests/vegalite/v5/tests/test_api.py @@ -944,17 +944,33 @@ def test_layer_errors(): 'Objects with "config" attribute cannot be used within LayerChart.' ) + with pytest.raises(ValueError) as err: + alt.hconcat(simple_chart) + simple_chart + assert ( + str(err.value) + == "Concatenated charts cannot be layered. Instead, layer the charts before concatenating." + ) + with pytest.raises(ValueError) as err: repeat_chart + simple_chart - assert str(err.value) == "Repeat charts cannot be layered." + assert ( + str(err.value) + == "Repeat charts cannot be layered. Instead, layer the charts before repeating." + ) with pytest.raises(ValueError) as err: facet_chart1 + simple_chart - assert str(err.value) == "Faceted charts cannot be layered." + assert ( + str(err.value) + == "Faceted charts cannot be layered. Instead, layer the charts before faceting." + ) with pytest.raises(ValueError) as err: alt.layer(simple_chart) + facet_chart2 - assert str(err.value) == "Faceted charts cannot be layered." + assert ( + str(err.value) + == "Faceted charts cannot be layered. Instead, layer the charts before faceting." + ) @pytest.mark.parametrize(
doc: ValueError: Faceted charts cannot be layered. The error: `ValueError: Faceted charts cannot be layered.` is an often reoccurring error: - https://github.com/altair-viz/altair/issues/2862 - https://github.com/altair-viz/altair/issues/1570 - https://github.com/altair-viz/altair/issues/1329 - https://github.com/altair-viz/altair/issues/1147 - https://github.com/altair-viz/altair/issues/785 How can we improve the error message and/or improve the documentation, so that this is explained a bit better?
2023-02-06T00:02:53Z
[]
[]
vega/altair
2,885
vega__altair-2885
[ "2879" ]
c6cbdfa72c93a94631177b6bc8b0d3f0d8871704
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -404,10 +404,10 @@ def to_dict(self, validate=True, ignore=None, context=None): parsed_shorthand = context.pop("parsed_shorthand", {}) # Prevent that pandas categorical data is automatically sorted # when a non-ordinal data type is specifed manually - if "sort" in parsed_shorthand and kwds["type"] not in [ - "ordinal", - Undefined, - ]: + # or if the encoding channel does not support sorting + if "sort" in parsed_shorthand and ( + "sort" not in kwds or kwds["type"] not in ["ordinal", Undefined] + ): parsed_shorthand.pop("sort") kwds.update( diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -402,10 +402,10 @@ def to_dict(self, validate=True, ignore=None, context=None): parsed_shorthand = context.pop("parsed_shorthand", {}) # Prevent that pandas categorical data is automatically sorted # when a non-ordinal data type is specifed manually - if "sort" in parsed_shorthand and kwds["type"] not in [ - "ordinal", - Undefined, - ]: + # or if the encoding channel does not support sorting + if "sort" in parsed_shorthand and ( + "sort" not in kwds or kwds["type"] not in ["ordinal", Undefined] + ): parsed_shorthand.pop("sort") kwds.update(
diff --git a/tests/vegalite/v5/tests/test_api.py b/tests/vegalite/v5/tests/test_api.py --- a/tests/vegalite/v5/tests/test_api.py +++ b/tests/vegalite/v5/tests/test_api.py @@ -138,16 +138,30 @@ def _check_encodings(chart): assert dct["encoding"]["size"]["type"] == "ordinal" assert dct["encoding"]["size"]["field"] == "s" assert dct["encoding"]["size"]["sort"] == [2, 1] + assert dct["encoding"]["tooltip"]["type"] == "ordinal" + assert dct["encoding"]["tooltip"]["field"] == "s" + # "sort" should be removed for channels that don't support it + assert "sort" not in dct["encoding"]["tooltip"] # Pass field names by keyword - chart = alt.Chart(data).mark_point().encode(x="x", y="y", color="c", size="s") + chart = ( + alt.Chart(data) + .mark_point() + .encode(x="x", y="y", color="c", size="s", tooltip="s") + ) _check_encodings(chart) # pass Channel objects by keyword chart = ( alt.Chart(data) .mark_point() - .encode(x=alt.X("x"), y=alt.Y("y"), color=alt.Color("c"), size=alt.Size("s")) + .encode( + x=alt.X("x"), + y=alt.Y("y"), + color=alt.Color("c"), + size=alt.Size("s"), + tooltip=alt.Tooltip("s"), + ) ) _check_encodings(chart) @@ -155,7 +169,7 @@ def _check_encodings(chart): chart = ( alt.Chart(data) .mark_point() - .encode(alt.X("x"), alt.Y("y"), alt.Color("c"), alt.Size("s")) + .encode(alt.X("x"), alt.Y("y"), alt.Color("c"), alt.Size("s"), alt.Tooltip("s")) ) _check_encodings(chart) @@ -167,6 +181,7 @@ def _check_encodings(chart): alt.X("x", type="nominal"), alt.Y("y", type="ordinal"), alt.Size("s", type="nominal"), + alt.Tooltip("s", type="nominal"), ) ) dct = chart.to_dict() @@ -174,6 +189,8 @@ def _check_encodings(chart): assert dct["encoding"]["y"]["type"] == "ordinal" assert dct["encoding"]["size"]["type"] == "nominal" assert "sort" not in dct["encoding"]["size"] + assert dct["encoding"]["tooltip"]["type"] == "nominal" + assert "sort" not in dct["encoding"]["tooltip"] @pytest.mark.parametrize(
tooltip throws error for Categorical variable The following code used to work in recent versions of `altair` including the current in-development branch But by commit f8912bad75d4247ab7 this code throws an error. The problem appears to be that specifying a variable for a tooltip without a type throws an error if the variable in a `pandas.Categorical`. Specifically, this code: ```` import altair as alt import pandas as pd df = ( pd.DataFrame({"x": [1, 2], "y": [1, 2], "note": ["a", "b"]}) .assign(note=lambda x: pd.Categorical(x["note"], ordered=True)) ) alt.Chart(df).encode(x="x", y="y", tooltip=["x", "y", "note"]).mark_point() ``` Now throws an error. The error is: ``` --------------------------------------------------------------------------- SchemaValidationError Traceback (most recent call last) File /fh/fast/bloom_j/software/miniconda3/envs/dms-vep-pipeline/lib/python3.11/site-packages/altair/vegalite/v5/api.py:2194, in Chart.to_dict(self, *args, **kwargs) 2192 copy.data = core.InlineData(values=[{}]) 2193 return super(Chart, copy).to_dict(*args, **kwargs) -> 2194 return super().to_dict(*args, **kwargs) File /fh/fast/bloom_j/software/miniconda3/envs/dms-vep-pipeline/lib/python3.11/site-packages/altair/vegalite/v5/api.py:559, in TopLevelMixin.to_dict(self, *args, **kwargs) 556 context["top_level"] = False 557 kwargs["context"] = context --> 559 dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs) 561 # TODO: following entries are added after validation. Should they be validated? 562 if is_top_level: 563 # since this is top-level we add $schema if it's missing File /fh/fast/bloom_j/software/miniconda3/envs/dms-vep-pipeline/lib/python3.11/site-packages/altair/utils/schemapi.py:422, in SchemaBase.to_dict(self, validate, ignore, context) 420 self.validate(result) 421 except jsonschema.ValidationError as err: --> 422 raise SchemaValidationError(self, err) 423 return result SchemaValidationError: Invalid specification altair.vegalite.v5.api.Chart->0, validating 'type' [{'field': 'x', 'type': 'quantitative'}, {'field': 'y', 'type': 'quantitative'}, {'field': 'note', 'type': 'ordinal', 'sort': ['a', 'b']}] is not of type 'object' [{'field': 'x', 'type': 'quantitative'}, {'field': 'y', 'type': 'quantitative'}, {'field': 'note', 'type': 'ordinal', 'sort': ['a', 'b']}] is not of type 'object' Additional properties are not allowed ('sort' was unexpected) [{'field': 'x', 'type': 'quantitative'}, {'field': 'y', 'type': 'quantitative'}, {'field': 'note', 'type': 'ordinal', 'sort': ['a', 'b']}] is not of type 'null' ```
Thanks for raising @jbloom! That commit and corresponding PR you refer to appears to be documentation only. It is maybe because of #2522? Unintended side-effect @joelostblom? Sorry, I didn't mean that commit caused the problem (I haven't tried to trace back). Just that I am using the code base at that commit and getting the problem. Previously I was using a commit from ~year earlier and didn't have the problem. No problem. Thanks for clarifying!
2023-02-13T06:12:51Z
[]
[]
vega/altair
2,944
vega__altair-2944
[ "2907" ]
8ef748a42833e0a8ea421811d067e384b919534e
diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -294,20 +294,6 @@ def copy_schemapi_util(): dest.write(HEADER) dest.writelines(source.readlines()) - # Copy the schemapi test file - source_path = abspath( - join(dirname(__file__), "schemapi", "tests", "test_schemapi.py") - ) - destination_path = abspath( - join(dirname(__file__), "..", "tests", "utils", "tests", "test_schemapi.py") - ) - - print("Copying\n {}\n -> {}".format(source_path, destination_path)) - with open(source_path, "r", encoding="utf8") as source: - with open(destination_path, "w", encoding="utf8") as dest: - dest.write(HEADER) - dest.writelines(source.readlines()) - def recursive_dict_update(schema, root, def_dict): if "$ref" in schema: diff --git a/tools/schemapi/__init__.py b/tools/schemapi/__init__.py --- a/tools/schemapi/__init__.py +++ b/tools/schemapi/__init__.py @@ -2,8 +2,7 @@ schemapi: tools for generating Python APIs from JSON schemas """ from .schemapi import SchemaBase, Undefined -from .decorator import schemaclass from .utils import SchemaInfo -__all__ = ("SchemaBase", "Undefined", "schemaclass", "SchemaInfo") +__all__ = ("SchemaBase", "Undefined", "SchemaInfo") diff --git a/tools/schemapi/decorator.py b/tools/schemapi/decorator.py deleted file mode 100644 --- a/tools/schemapi/decorator.py +++ /dev/null @@ -1,58 +0,0 @@ -import warnings -from . import codegen, SchemaBase, Undefined - - -def schemaclass(*args, init_func=True, docstring=True, property_map=True): - """A decorator to add boilerplate to a schema class - - This will read the _json_schema attribute of a SchemaBase class, and add - one or all of three attributes/methods, based on the schema: - - - An __init__ function - - a __doc__ docstring - - In all cases, if the attribute/method is explicitly defined in the class - it will not be overwritten. - - A simple invocation adds all three attributes/methods: - - @schemaclass - class MySchema(SchemaBase): - __schema = {...} - - Optionally, you can invoke schemaclass with arguments to turn off - some of the added behaviors: - - @schemaclass(init_func=True, docstring=False) - class MySchema(SchemaBase): - __schema = {...} - """ - - def _decorator(cls, init_func=init_func, docstring=docstring): - if not (isinstance(cls, type) and issubclass(cls, SchemaBase)): - warnings.warn("class is not an instance of SchemaBase.") - - name = cls.__name__ - gen = codegen.SchemaGenerator( - name, schema=cls._schema, rootschema=cls._rootschema - ) - - if init_func and "__init__" not in cls.__dict__: - init_code = gen.init_code() - globals_ = {name: cls, "Undefined": Undefined} - locals_ = {} - exec(init_code, globals_, locals_) - setattr(cls, "__init__", locals_["__init__"]) - - if docstring and not cls.__doc__: - setattr(cls, "__doc__", gen.docstring()) - return cls - - if len(args) == 0: - return _decorator - elif len(args) == 1: - return _decorator(args[0]) - else: - raise ValueError( - "optional arguments to schemaclass must be " "passed by keyword" - )
diff --git a/tests/utils/tests/test_schemapi.py b/tests/utils/tests/test_schemapi.py --- a/tests/utils/tests/test_schemapi.py +++ b/tests/utils/tests/test_schemapi.py @@ -1,5 +1,3 @@ -# The contents of this file are automatically written by -# tools/generate_schema_wrapper.py. Do not modify directly. import copy import io import inspect diff --git a/tools/schemapi/tests/test_decorator.py b/tools/schemapi/tests/test_decorator.py deleted file mode 100644 --- a/tools/schemapi/tests/test_decorator.py +++ /dev/null @@ -1,65 +0,0 @@ -import inspect - -from .. import SchemaBase, Undefined, schemaclass - - -@schemaclass -class MySchema(SchemaBase): - _schema = { - "definitions": { - "StringMapping": { - "type": "object", - "additionalProperties": {"type": "string"}, - }, - "StringArray": {"type": "array", "items": {"type": "string"}}, - }, - "properties": { - "a": {"$ref": "#/definitions/StringMapping"}, - "a2": {"type": "object", "additionalProperties": {"type": "number"}}, - "b": {"$ref": "#/definitions/StringArray"}, - "b2": {"type": "array", "items": {"type": "number"}}, - "c": {"type": ["string", "number"]}, - "d": { - "anyOf": [ - {"$ref": "#/definitions/StringMapping"}, - {"$ref": "#/definitions/StringArray"}, - ] - }, - }, - "required": ["a", "b"], - } - - -@schemaclass -class StringArray(SchemaBase): - _schema = MySchema._schema["definitions"]["StringArray"] - _rootschema = MySchema._schema - - -def test_myschema_decorator(): - myschema = MySchema({"foo": "bar"}, ["foo", "bar"]) - assert myschema.to_dict() == {"a": {"foo": "bar"}, "b": ["foo", "bar"]} - - myschema = MySchema.from_dict({"a": {"foo": "bar"}, "b": ["foo", "bar"]}) - assert myschema.to_dict() == {"a": {"foo": "bar"}, "b": ["foo", "bar"]} - - assert MySchema.__doc__.startswith("MySchema schema wrapper") - argspec = inspect.getfullargspec(MySchema.__init__) - assert argspec.args == ["self", "a", "b", "a2", "b2", "c", "d"] - assert argspec.defaults == 6 * (Undefined,) - assert argspec.varargs is None - assert argspec.varkw == "kwds" - - -def test_stringarray_decorator(): - arr = StringArray(["a", "b", "c"]) - assert arr.to_dict() == ["a", "b", "c"] - - arr = StringArray.from_dict(["a", "b", "c"]) - assert arr.to_dict() == ["a", "b", "c"] - - assert arr.__doc__.startswith("StringArray schema wrapper") - argspec = inspect.getfullargspec(StringArray.__init__) - assert argspec.args == ["self"] - assert argspec.varargs == "args" - assert argspec.varkw is None diff --git a/tools/schemapi/tests/test_utils.py b/tools/schemapi/tests/test_utils.py deleted file mode 100644 --- a/tools/schemapi/tests/test_utils.py +++ /dev/null @@ -1,52 +0,0 @@ -import pytest - -from ..utils import get_valid_identifier, SchemaInfo -from ..schemapi import _FromDict - - [email protected] -def refschema(): - return { - "$ref": "#/definitions/Foo", - "definitions": { - "Foo": {"$ref": "#/definitions/Bar"}, - "Bar": {"$ref": "#/definitions/Baz"}, - "Baz": {"type": "string"}, - }, - } - - -def test_get_valid_identifier(): - assert get_valid_identifier("$schema") == "schema" - assert get_valid_identifier("$ref") == "ref" - assert get_valid_identifier("foo-bar") == "foobar" - assert get_valid_identifier("$as") == "as_" - assert get_valid_identifier("for") == "for_" - assert get_valid_identifier("--") == "_" - - [email protected]("use_json", [True, False]) -def test_hash_schema(refschema, use_json): - copy = refschema.copy() - copy["description"] = "A schema" - copy["title"] = "Schema to test" - assert _FromDict.hash_schema(refschema) == _FromDict.hash_schema(copy) - - [email protected]( - "schema, expected", - [ - ({}, "Any"), - ({"type": "number"}, "float"), - ({"enum": ["A", "B", "C"]}, "enum('A', 'B', 'C')"), - ({"type": "array"}, "List(Any)"), - ({"type": "object"}, "Mapping(required=[])"), - ( - {"type": "string", "not": {"enum": ["A", "B", "C"]}}, - "not enum('A', 'B', 'C')", - ), - ], -) -def test_medium_description(schema, expected): - description = SchemaInfo(schema).medium_description - assert description == expected
Clean up and simplify tools folder I track some cleanup tasks to the code generation below which we could tackle after the release of version 5: * `tools/schemapi/tests/test_schemapi.py` is the only test file that is copied into `tests`. All other test files are maintaned directly in the `tests` folder -> Maintain directly in `tests` as well * `tools/schemapi/tests/test_decorator.py` and `tools/schemapi/tests/test_utils.py` are not copied -> Evaluate if can be removed or if they should also be maintained in `tests` * `tools/schemapi/decorator.py` is not used anywhere -> Remove? * ...
2023-03-04T12:23:35Z
[]
[]
vega/altair
2,975
vega__altair-2975
[ "2896" ]
97f8edaacc8b85d52588873623a5b57b057d6363
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -299,9 +299,23 @@ def __str__(self): {message}""" if self._additional_errors: - message += "\n " + "\n ".join( - [e.message for e in self._additional_errors] + # Deduplicate error messages and only include them if they are + # different then the main error message stored in self.message. + # Using dict instead of set to keep the original order in case it was + # chosen intentionally to move more relevant error messages to the top + additional_error_messages = list( + dict.fromkeys( + [ + e.message + for e in self._additional_errors + if e.message != self.message + ] + ) ) + if additional_error_messages: + message += "\n " + "\n ".join( + additional_error_messages + ) return inspect.cleandoc( """{} diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -297,9 +297,23 @@ def __str__(self): {message}""" if self._additional_errors: - message += "\n " + "\n ".join( - [e.message for e in self._additional_errors] + # Deduplicate error messages and only include them if they are + # different then the main error message stored in self.message. + # Using dict instead of set to keep the original order in case it was + # chosen intentionally to move more relevant error messages to the top + additional_error_messages = list( + dict.fromkeys( + [ + e.message + for e in self._additional_errors + if e.message != self.message + ] + ) ) + if additional_error_messages: + message += "\n " + "\n ".join( + additional_error_messages + ) return inspect.cleandoc( """{}
diff --git a/tests/utils/tests/test_schemapi.py b/tests/utils/tests/test_schemapi.py --- a/tests/utils/tests/test_schemapi.py +++ b/tests/utils/tests/test_schemapi.py @@ -4,7 +4,6 @@ import json import jsonschema import jsonschema.exceptions -import re import pickle import warnings @@ -476,6 +475,18 @@ def chart_example_invalid_timeunit_value(): return alt.Chart().encode(alt.Angle().timeUnit("invalid_value")) +def chart_example_invalid_sort_value(): + return alt.Chart().encode(alt.Angle().sort("invalid_value")) + + +def chart_example_invalid_bandposition_value(): + return ( + alt.Chart(data.cars()) + .mark_text(align="right") + .encode(alt.Text("Horsepower:N", bandPosition="4")) + ) + + @pytest.mark.parametrize( "chart_func, expected_error_message", [ @@ -490,7 +501,7 @@ def chart_example_invalid_timeunit_value(): axis impute stack type bandPosition - See the help for `X` to read the full description of these parameters""" # noqa: W291 + See the help for `X` to read the full description of these parameters$""" # noqa: W291 ), ), ( @@ -504,7 +515,7 @@ def chart_example_invalid_timeunit_value(): background data padding spacing usermeta bounds datasets - See the help for `VConcatChart` to read the full description of these parameters""" # noqa: W291 + See the help for `VConcatChart` to read the full description of these parameters$""" # noqa: W291 ), ), ( @@ -514,7 +525,7 @@ def chart_example_invalid_timeunit_value(): 'asdf' is not one of \['zero', 'center', 'normalize'\] 'asdf' is not of type 'null' - 'asdf' is not of type 'boolean'""" + 'asdf' is not of type 'boolean'$""" ), ), ( @@ -524,7 +535,7 @@ def chart_example_invalid_timeunit_value(): 'asdf' is not one of \['zero', 'center', 'normalize'\] 'asdf' is not of type 'null' - 'asdf' is not of type 'boolean'""" + 'asdf' is not of type 'boolean'$""" ), ), ( @@ -533,7 +544,7 @@ def chart_example_invalid_timeunit_value(): r"""'{'text': 'Horsepower', 'align': 'right'}' is an invalid value for `title`: {'text': 'Horsepower', 'align': 'right'} is not of type 'string' - {'text': 'Horsepower', 'align': 'right'} is not of type 'array'""" + {'text': 'Horsepower', 'align': 'right'} is not of type 'array'$""" ), ), ( @@ -550,7 +561,7 @@ def chart_example_invalid_timeunit_value(): fillOpacity opacity stroke theta2 xError2 yOffset href - See the help for `Encoding` to read the full description of these parameters""" # noqa: W291 + See the help for `Encoding` to read the full description of these parameters$""" # noqa: W291 ), ), ( @@ -561,14 +572,33 @@ def chart_example_invalid_timeunit_value(): 'invalid_value' is not one of \['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'\] 'invalid_value' is not one of \['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'\] 'invalid_value' is not one of \['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'\] - 'invalid_value' is not one of \['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'\]""" + 'invalid_value' is not one of \['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'\]$""" + ), + ), + ( + chart_example_invalid_sort_value, + # Previuosly, the line + # "'invalid_value' is not of type 'array'" appeared multiple times in + # the error message. This test should prevent a regression. + inspect.cleandoc( + r"""'invalid_value' is an invalid value for `sort`: + + 'invalid_value' is not of type 'array'$""" + ), + ), + ( + chart_example_invalid_bandposition_value, + inspect.cleandoc( + r"""'4' is an invalid value for `bandPosition`: + + '4' is not of type 'number' + Additional properties are not allowed \('field' was unexpected\) + Additional properties are not allowed \('bandPosition', 'field', 'type' were unexpected\)$""" ), ), ], ) def test_chart_validation_errors(chart_func, expected_error_message): - # DOTALL flag makes that a dot (.) also matches new lines - pattern = re.compile(expected_error_message, re.DOTALL) # For some wrong chart specifications such as an unknown encoding channel, # Altair already raises a warning before the chart specifications are validated. # We can ignore these warnings as we are interested in the errors being raised @@ -576,7 +606,7 @@ def test_chart_validation_errors(chart_func, expected_error_message): with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=UserWarning) chart = chart_func() - with pytest.raises(SchemaValidationError, match=pattern): + with pytest.raises(SchemaValidationError, match=expected_error_message): chart.to_dict()
Multiple rounds of the same error message I noticed that some specs shows the same error multiple time, for example: ```py source = data.cars() alt.Chart(source).mark_text(align="right").encode( alt.Text("Horsepower:N", bandPosition='4') ) ``` ``` '4' is not of type 'number' Additional properties are not allowed ('field' was unexpected) '4' is not of type 'number' Additional properties are not allowed ('bandPosition', 'field', 'type' were unexpected) ``` Sometimes these messages can become quite long: ```python alt.Text("Horsepower:N", type=dict(text="Horsepower", align="right")) ``` ``` {'text': 'Horsepower', 'align': 'right'} is not one of ['quantitative', 'ordinal', 'temporal', 'nominal'] {'text': 'Horsepower', 'align': 'right'} is not of type 'string' Additional properties are not allowed ('field' was unexpected) {'text': 'Horsepower', 'align': 'right'} is not one of ['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] {'text': 'Horsepower', 'align': 'right'} is not of type 'string' Additional properties are not allowed ('field', 'type' were unexpected) ``` Granted that these multiple errors are likely rare this is probably not high priority (and maybe even desirable for some reasons that escapes me right now), but I thought I would document them anyways.
2023-03-18T15:15:05Z
[]
[]
vega/altair
3,009
vega__altair-3009
[ "2873" ]
9abc8f0d2f1893a922ae33695f0bb135128ceff6
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -5,7 +5,17 @@ import inspect import json import textwrap -from typing import Any, Sequence, List, Dict, Optional +from typing import ( + Any, + Sequence, + List, + Dict, + Optional, + DefaultDict, + Tuple, + Iterable, + Type, +) from itertools import zip_longest import jsonschema @@ -16,6 +26,9 @@ from altair import vegalite +ValidationErrorList = List[jsonschema.exceptions.ValidationError] +GroupedValidationErrors = Dict[str, ValidationErrorList] + # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for @@ -46,7 +59,51 @@ def debug_mode(arg): DEBUG_MODE = original -def validate_jsonschema(spec, schema, rootschema=None): +def validate_jsonschema( + spec: Dict[str, Any], + schema: Dict[str, Any], + rootschema: Optional[Dict[str, Any]] = None, + raise_error: bool = True, +) -> Optional[jsonschema.exceptions.ValidationError]: + """Validates the passed in spec against the schema in the context of the + rootschema. If any errors are found, they are deduplicated and prioritized + and only the most relevant errors are kept. Errors are then either raised + or returned, depending on the value of `raise_error`. + """ + errors = _get_errors_from_spec(spec, schema, rootschema=rootschema) + if errors: + leaf_errors = _get_leaves_of_error_tree(errors) + grouped_errors = _group_errors_by_json_path(leaf_errors) + grouped_errors = _subset_to_most_specific_json_paths(grouped_errors) + grouped_errors = _deduplicate_errors(grouped_errors) + + # Nothing special about this first error but we need to choose one + # which can be raised + main_error = list(grouped_errors.values())[0][0] + # All errors are then attached as a new attribute to ValidationError so that + # they can be used in SchemaValidationError to craft a more helpful + # error message. Setting a new attribute like this is not ideal as + # it then no longer matches the type ValidationError. It would be better + # to refactor this function to never raise but only return errors. + main_error._all_errors = grouped_errors # type: ignore[attr-defined] + if raise_error: + raise main_error + else: + return main_error + else: + return None + + +def _get_errors_from_spec( + spec: Dict[str, Any], + schema: Dict[str, Any], + rootschema: Optional[Dict[str, Any]] = None, +) -> ValidationErrorList: + """Uses the relevant jsonschema validator to validate the passed in spec + against the schema using the rootschema to resolve references. + The schema and rootschema themselves are not validated but instead considered + as valid. + """ # We don't use jsonschema.validate as this would validate the schema itself. # Instead, we pass the schema directly to the validator class. This is done for # two reasons: The schema comes from Vega-Lite and is not based on the user @@ -69,83 +126,181 @@ def validate_jsonschema(spec, schema, rootschema=None): validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER validator = validator_cls(schema, **validator_kwargs) errors = list(validator.iter_errors(spec)) - if errors: - errors = _get_most_relevant_errors(errors) - main_error = errors[0] - # They can be used to craft more helpful error messages when this error - # is being converted to a SchemaValidationError - main_error._additional_errors = errors[1:] - raise main_error - - -def _get_most_relevant_errors( - errors: Sequence[jsonschema.exceptions.ValidationError], -) -> List[jsonschema.exceptions.ValidationError]: - if len(errors) == 0: - return [] - - # Start from the first error on the top-level as we want to show - # an error message for one specific error only even if the chart - # specification might have multiple issues - top_level_error = errors[0] - - # Go to lowest level in schema where an error happened as these give - # the most relevant error messages. - lowest_level = top_level_error - while lowest_level.context: - lowest_level = lowest_level.context[0] - - most_relevant_errors = [] - if lowest_level.validator == "additionalProperties": - # For these errors, the message is already informative enough and the other - # errors on the lowest level are not helpful for a user but instead contain - # the same information in a more verbose way - most_relevant_errors = [lowest_level] - else: - parent = lowest_level.parent - if parent is None: - # In this case we are still at the top level and can return all errors - most_relevant_errors = list(errors) + return errors + + +def _group_errors_by_json_path( + errors: ValidationErrorList, +) -> GroupedValidationErrors: + """Groups errors by the `json_path` attribute of the jsonschema ValidationError + class. This attribute contains the path to the offending element within + a chart specification and can therefore be considered as an identifier of an + 'issue' in the chart that needs to be fixed. + """ + errors_by_json_path = collections.defaultdict(list) + for err in errors: + errors_by_json_path[err.json_path].append(err) + return dict(errors_by_json_path) + + +def _get_leaves_of_error_tree( + errors: ValidationErrorList, +) -> ValidationErrorList: + """For each error in `errors`, it traverses down the "error tree" that is generated + by the jsonschema library to find and return all "leaf" errors. These are errors + which have no further errors that caused it and so they are the most specific errors + with the most specific error messages. + """ + leaves: ValidationErrorList = [] + for err in errors: + if err.context: + # This means that the error `err` was caused by errors in subschemas. + # The list of errors from the subschemas are available in the property + # `context`. + leaves.extend(_get_leaves_of_error_tree(err.context)) else: - # Use all errors of the lowest level out of which - # we can construct more informative error messages - most_relevant_errors = parent.context or [] - if lowest_level.validator == "enum": - # There might be other possible enums which are allowed, e.g. for - # the "timeUnit" property of the "Angle" encoding channel. These do not - # necessarily need to be in the same branch of this tree of errors that - # we traversed down to the lowest level. We therefore gather - # all enums in the leaves of the error tree. - enum_errors = _get_all_lowest_errors_with_validator( - top_level_error, validator="enum" - ) - # Remove errors which already exist in enum_errors - enum_errors = [ - err - for err in enum_errors - if err.message not in [e.message for e in most_relevant_errors] - ] - most_relevant_errors = most_relevant_errors + enum_errors - - # This should never happen but might still be good to test for it as else - # the original error would just slip through without being raised - if len(most_relevant_errors) == 0: - raise Exception("Could not determine the most relevant errors") from errors[0] - - return most_relevant_errors - - -def _get_all_lowest_errors_with_validator( - error: jsonschema.ValidationError, validator: str -) -> List[jsonschema.ValidationError]: - matches: List[jsonschema.ValidationError] = [] - if error.context: - for err in error.context: - if err.context: - matches.extend(_get_all_lowest_errors_with_validator(err, validator)) - elif err.validator == validator: - matches.append(err) - return matches + leaves.append(err) + return leaves + + +def _subset_to_most_specific_json_paths( + errors_by_json_path: GroupedValidationErrors, +) -> GroupedValidationErrors: + """Removes key (json path), value (errors) pairs where the json path is fully + contained in another json path. For example if `errors_by_json_path` has two + keys, `$.encoding.X` and `$.encoding.X.tooltip`, then the first one will be removed + and only the second one is returned. This is done under the assumption that + more specific json paths give more helpful error messages to the user. + """ + errors_by_json_path_specific: GroupedValidationErrors = {} + for json_path, errors in errors_by_json_path.items(): + if not _contained_at_start_of_one_of_other_values( + json_path, list(errors_by_json_path.keys()) + ): + errors_by_json_path_specific[json_path] = errors + return errors_by_json_path_specific + + +def _contained_at_start_of_one_of_other_values(x: str, values: Sequence[str]) -> bool: + # Does not count as "contained at start of other value" if the values are + # the same. These cases should be handled separately + return any(value.startswith(x) for value in values if x != value) + + +def _deduplicate_errors( + grouped_errors: GroupedValidationErrors, +) -> GroupedValidationErrors: + """Some errors have very similar error messages or are just in general not helpful + for a user. This function removes as many of these cases as possible and + can be extended over time to handle new cases that come up. + """ + grouped_errors_deduplicated: GroupedValidationErrors = {} + for json_path, element_errors in grouped_errors.items(): + errors_by_validator = _group_errors_by_validator(element_errors) + + deduplication_functions = { + "enum": _deduplicate_enum_errors, + "additionalProperties": _deduplicate_additional_properties_errors, + } + deduplicated_errors: ValidationErrorList = [] + for validator, errors in errors_by_validator.items(): + deduplication_func = deduplication_functions.get(validator, None) + if deduplication_func is not None: + errors = deduplication_func(errors) + deduplicated_errors.extend(_deduplicate_by_message(errors)) + + # Removes any ValidationError "'value' is a required property" as these + # errors are unlikely to be the relevant ones for the user. They come from + # validation against a schema definition where the output of `alt.value` + # would be valid. However, if a user uses `alt.value`, the `value` keyword + # is included automatically from that function and so it's unlikely + # that this was what the user intended if the keyword is not present + # in the first place. + deduplicated_errors = [ + err for err in deduplicated_errors if not _is_required_value_error(err) + ] + + grouped_errors_deduplicated[json_path] = deduplicated_errors + return grouped_errors_deduplicated + + +def _is_required_value_error(err: jsonschema.exceptions.ValidationError) -> bool: + return err.validator == "required" and err.validator_value == ["value"] + + +def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidationErrors: + """Groups the errors by the json schema "validator" that casued the error. For + example if the error is that a value is not one of an enumeration in the json schema + then the "validator" is `"enum"`, if the error is due to an unknown property that + was set although no additional properties are allowed then "validator" is + `"additionalProperties`, etc. + """ + errors_by_validator: DefaultDict[ + str, ValidationErrorList + ] = collections.defaultdict(list) + for err in errors: + # Ignore mypy error as err.validator as it wrongly sees err.validator + # as of type Optional[Validator] instead of str which it is according + # to the documentation and all tested cases + errors_by_validator[err.validator].append(err) # type: ignore[index] + return dict(errors_by_validator) + + +def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList: + """Deduplicate enum errors by removing the errors where the allowed values + are a subset of another error. For example, if `enum` contains two errors + and one has `validator_value` (i.e. accepted values) ["A", "B"] and the + other one ["A", "B", "C"] then the first one is removed and the final + `enum` list only contains the error with ["A", "B", "C"]. + """ + if len(errors) > 1: + # Values (and therefore `validator_value`) of an enum are always arrays, + # see https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values + # which is why we can use join below + value_strings = [",".join(err.validator_value) for err in errors] + longest_enums: ValidationErrorList = [] + for value_str, err in zip(value_strings, errors): + if not _contained_at_start_of_one_of_other_values(value_str, value_strings): + longest_enums.append(err) + errors = longest_enums + return errors + + +def _deduplicate_additional_properties_errors( + errors: ValidationErrorList, +) -> ValidationErrorList: + """If there are multiple additional property errors it usually means that + the offending element was validated against multiple schemas and + its parent is a common anyOf validator. + The error messages produced from these cases are usually + very similar and we just take the shortest one. For example, + the following 3 errors are raised for the `unknown` channel option in + `alt.X("variety", unknown=2)`: + - "Additional properties are not allowed ('unknown' was unexpected)" + - "Additional properties are not allowed ('field', 'unknown' were unexpected)" + - "Additional properties are not allowed ('field', 'type', 'unknown' were unexpected)" + """ + if len(errors) > 1: + # Test if all parent errors are the same anyOf error and only do + # the prioritization in these cases. Can't think of a chart spec where this + # would not be the case but still allow for it below to not break anything. + parent = errors[0].parent + if ( + parent is not None + and parent.validator == "anyOf" + # Use [1:] as don't have to check for first error as it was used + # above to define `parent` + and all(err.parent is parent for err in errors[1:]) + ): + errors = [min(errors, key=lambda x: len(x.message))] + return errors + + +def _deduplicate_by_message(errors: ValidationErrorList) -> ValidationErrorList: + """Deduplicate errors by message. This keeps the original order in case + it was chosen intentionally. + """ + return list({e.message: e for e in errors}.values()) def _subclasses(cls): @@ -189,15 +344,108 @@ def _resolve_references(schema, root=None): class SchemaValidationError(jsonschema.ValidationError): """A wrapper for jsonschema.ValidationError with friendlier traceback""" - def __init__(self, obj, err): - super(SchemaValidationError, self).__init__(**err._contents()) + def __init__(self, obj: "SchemaBase", err: jsonschema.ValidationError) -> None: + super().__init__(**err._contents()) self.obj = obj - self._additional_errors = getattr(err, "_additional_errors", []) + self._errors: GroupedValidationErrors = getattr( + err, "_all_errors", {err.json_path: [err]} + ) + # This is the message from err + self._original_message = self.message + self.message = self._get_message() + + def __str__(self) -> str: + return self.message + + def _get_message(self) -> str: + def indent_second_line_onwards(message: str, indent: int = 4) -> str: + modified_lines: List[str] = [] + for idx, line in enumerate(message.split("\n")): + if idx > 0 and len(line) > 0: + line = " " * indent + line + modified_lines.append(line) + return "\n".join(modified_lines) + + error_messages: List[str] = [] + # Only show a maximum of 3 errors as else the final message returned by this + # method could get very long. + for errors in list(self._errors.values())[:3]: + error_messages.append(self._get_message_for_errors_group(errors)) + + message = "" + if len(error_messages) > 1: + error_messages = [ + indent_second_line_onwards(f"Error {error_id}: {m}") + for error_id, m in enumerate(error_messages, start=1) + ] + message += "Multiple errors were found.\n\n" + message += "\n\n".join(error_messages) + return message + + def _get_message_for_errors_group( + self, + errors: ValidationErrorList, + ) -> str: + if errors[0].validator == "additionalProperties": + # During development, we only found cases where an additionalProperties + # error was raised if that was the only error for the offending instance + # as identifiable by the json path. Therefore, we just check here the first + # error. However, other constellations might exist in which case + # this should be adapted so that other error messages are shown as well. + message = self._get_additional_properties_error_message(errors[0]) + else: + message = self._get_default_error_message(errors=errors) + + return message.strip() + + def _get_additional_properties_error_message( + self, + error: jsonschema.exceptions.ValidationError, + ) -> str: + """Output all existing parameters when an unknown parameter is specified.""" + altair_cls = self._get_altair_class_for_error(error) + param_dict_keys = inspect.signature(altair_cls).parameters.keys() + param_names_table = self._format_params_as_table(param_dict_keys) + + # Error messages for these errors look like this: + # "Additional properties are not allowed ('unknown' was unexpected)" + # Line below extracts "unknown" from this string + parameter_name = error.message.split("('")[-1].split("'")[0] + message = f"""\ +`{altair_cls.__name__}` has no parameter named '{parameter_name}' + +Existing parameter names are: +{param_names_table} +See the help for `{altair_cls.__name__}` to read the full description of these parameters""" + return message + + def _get_altair_class_for_error( + self, error: jsonschema.exceptions.ValidationError + ) -> Type["SchemaBase"]: + """Try to get the lowest class possible in the chart hierarchy so + it can be displayed in the error message. This should lead to more informative + error messages pointing the user closer to the source of the issue. + """ + for prop_name in reversed(error.absolute_path): + # Check if str as e.g. first item can be a 0 + if isinstance(prop_name, str): + potential_class_name = prop_name[0].upper() + prop_name[1:] + cls = getattr(vegalite, potential_class_name, None) + if cls is not None: + break + else: + # Did not find a suitable class based on traversing the path so we fall + # back on the class of the top-level object which created + # the SchemaValidationError + cls = self.obj.__class__ + return cls @staticmethod - def _format_params_as_table(param_dict_keys): + def _format_params_as_table(param_dict_keys: Iterable[str]) -> str: """Format param names into a table so that they are easier to read""" - param_names, name_lengths = zip( + param_names: Tuple[str, ...] + name_lengths: Tuple[int, ...] + param_names, name_lengths = zip( # type: ignore[assignment] # Mypy does think it's Tuple[Any] *[ (name, len(name)) for name in param_dict_keys @@ -214,15 +462,15 @@ def _format_params_as_table(param_dict_keys): columns = min(max_column_width // max_name_length, square_columns) # Compute roughly equal column heights to evenly divide the param names - def split_into_equal_parts(n, p): + def split_into_equal_parts(n: int, p: int) -> List[int]: return [n // p + 1] * (n % p) + [n // p] * (p - n % p) column_heights = split_into_equal_parts(num_param_names, columns) # Section the param names into columns and compute their widths - param_names_columns = [] - column_max_widths = [] - last_end_idx = 0 + param_names_columns: List[Tuple[str, ...]] = [] + column_max_widths: List[int] = [] + last_end_idx: int = 0 for ch in column_heights: param_names_columns.append(param_names[last_end_idx : last_end_idx + ch]) column_max_widths.append( @@ -231,11 +479,11 @@ def split_into_equal_parts(n, p): last_end_idx = ch + last_end_idx # Transpose the param name columns into rows to facilitate looping - param_names_rows = [] + param_names_rows: List[Tuple[str, ...]] = [] for li in zip_longest(*param_names_columns, fillvalue=""): param_names_rows.append(li) # Build the table as a string by iterating over and formatting the rows - param_names_table = "" + param_names_table: str = "" for param_names_row in param_names_rows: for num, param_name in enumerate(param_names_row): # Set column width based on the longest param in the column @@ -247,82 +495,60 @@ def split_into_equal_parts(n, p): # Insert newlines and spacing after the last element in each row if num == (len(param_names_row) - 1): param_names_table += "\n" - # 16 is the indendation of the returned multiline string below - param_names_table += " " * 16 return param_names_table - def __str__(self): - # Try to get the lowest class possible in the chart hierarchy so - # it can be displayed in the error message. This should lead to more informative - # error messages pointing the user closer to the source of the issue. - for prop_name in reversed(self.absolute_path): - # Check if str as e.g. first item can be a 0 - if isinstance(prop_name, str): - potential_class_name = prop_name[0].upper() + prop_name[1:] - cls = getattr(vegalite, potential_class_name, None) - if cls is not None: - break - else: - # Did not find a suitable class based on traversing the path so we fall - # back on the class of the top-level object which created - # the SchemaValidationError - cls = self.obj.__class__ - - # Output all existing parameters when an unknown parameter is specified - if self.validator == "additionalProperties": - param_dict_keys = inspect.signature(cls).parameters.keys() - param_names_table = self._format_params_as_table(param_dict_keys) - - # `cleandoc` removes multiline string indentation in the output - return inspect.cleandoc( - """`{}` has no parameter named {!r} - - Existing parameter names are: - {} - See the help for `{}` to read the full description of these parameters - """.format( - cls.__name__, - self.message.split("('")[-1].split("'")[0], - param_names_table, - cls.__name__, - ) - ) - # Use the default error message for all other cases than unknown parameter errors + def _get_default_error_message( + self, + errors: ValidationErrorList, + ) -> str: + bullet_points: List[str] = [] + errors_by_validator = _group_errors_by_validator(errors) + if "enum" in errors_by_validator: + for error in errors_by_validator["enum"]: + bullet_points.append(f"one of {error.validator_value}") + + if "type" in errors_by_validator: + types = [f"'{err.validator_value}'" for err in errors_by_validator["type"]] + point = "of type " + if len(types) == 1: + point += types[0] + elif len(types) == 2: + point += f"{types[0]} or {types[1]}" + else: + point += ", ".join(types[:-1]) + f", or {types[-1]}" + bullet_points.append(point) + + # It should not matter which error is specifically used as they are all + # about the same offending instance (i.e. invalid value), so we can just + # take the first one + error = errors[0] + # Add a summary line when parameters are passed an invalid value + # For example: "'asdf' is an invalid value for `stack` + message = f"'{error.instance}' is an invalid value" + if error.absolute_path: + message += f" for `{error.absolute_path[-1]}`" + + # Add bullet points + if len(bullet_points) == 0: + message += ".\n\n" + elif len(bullet_points) == 1: + message += f". Valid values are {bullet_points[0]}.\n\n" else: - message = self.message - # Add a summary line when parameters are passed an invalid value - # For example: "'asdf' is an invalid value for `stack` - if self.absolute_path: - # The indentation here must match that of `cleandoc` below - message = f"""'{self.instance}' is an invalid value for `{self.absolute_path[-1]}`: - - {message}""" - - if self._additional_errors: - # Deduplicate error messages and only include them if they are - # different then the main error message stored in self.message. - # Using dict instead of set to keep the original order in case it was - # chosen intentionally to move more relevant error messages to the top - additional_error_messages = list( - dict.fromkeys( - [ - e.message - for e in self._additional_errors - if e.message != self.message - ] - ) - ) - if additional_error_messages: - message += "\n " + "\n ".join( - additional_error_messages - ) - - return inspect.cleandoc( - """{} - """.format( - message - ) - ) + # We don't use .capitalize below to make the first letter uppercase + # as that makes the rest of the message lowercase + bullet_points = [point[0].upper() + point[1:] for point in bullet_points] + message += ". Valid values are:\n\n" + message += "\n".join([f"- {point}" for point in bullet_points]) + message += "\n\n" + + # Add unformatted messages of any remaining errors which were not + # considered so far. This is not expected to be used but more exists + # as a fallback for cases which were not known during development. + for validator, errors in errors_by_validator.items(): + if validator not in ("enum", "type"): + message += "\n".join([e.message for e in errors]) + + return message class UndefinedType: diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -3,7 +3,17 @@ import inspect import json import textwrap -from typing import Any, Sequence, List, Dict, Optional +from typing import ( + Any, + Sequence, + List, + Dict, + Optional, + DefaultDict, + Tuple, + Iterable, + Type, +) from itertools import zip_longest import jsonschema @@ -14,6 +24,9 @@ from altair import vegalite +ValidationErrorList = List[jsonschema.exceptions.ValidationError] +GroupedValidationErrors = Dict[str, ValidationErrorList] + # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for @@ -44,7 +57,51 @@ def debug_mode(arg): DEBUG_MODE = original -def validate_jsonschema(spec, schema, rootschema=None): +def validate_jsonschema( + spec: Dict[str, Any], + schema: Dict[str, Any], + rootschema: Optional[Dict[str, Any]] = None, + raise_error: bool = True, +) -> Optional[jsonschema.exceptions.ValidationError]: + """Validates the passed in spec against the schema in the context of the + rootschema. If any errors are found, they are deduplicated and prioritized + and only the most relevant errors are kept. Errors are then either raised + or returned, depending on the value of `raise_error`. + """ + errors = _get_errors_from_spec(spec, schema, rootschema=rootschema) + if errors: + leaf_errors = _get_leaves_of_error_tree(errors) + grouped_errors = _group_errors_by_json_path(leaf_errors) + grouped_errors = _subset_to_most_specific_json_paths(grouped_errors) + grouped_errors = _deduplicate_errors(grouped_errors) + + # Nothing special about this first error but we need to choose one + # which can be raised + main_error = list(grouped_errors.values())[0][0] + # All errors are then attached as a new attribute to ValidationError so that + # they can be used in SchemaValidationError to craft a more helpful + # error message. Setting a new attribute like this is not ideal as + # it then no longer matches the type ValidationError. It would be better + # to refactor this function to never raise but only return errors. + main_error._all_errors = grouped_errors # type: ignore[attr-defined] + if raise_error: + raise main_error + else: + return main_error + else: + return None + + +def _get_errors_from_spec( + spec: Dict[str, Any], + schema: Dict[str, Any], + rootschema: Optional[Dict[str, Any]] = None, +) -> ValidationErrorList: + """Uses the relevant jsonschema validator to validate the passed in spec + against the schema using the rootschema to resolve references. + The schema and rootschema themselves are not validated but instead considered + as valid. + """ # We don't use jsonschema.validate as this would validate the schema itself. # Instead, we pass the schema directly to the validator class. This is done for # two reasons: The schema comes from Vega-Lite and is not based on the user @@ -67,83 +124,181 @@ def validate_jsonschema(spec, schema, rootschema=None): validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER validator = validator_cls(schema, **validator_kwargs) errors = list(validator.iter_errors(spec)) - if errors: - errors = _get_most_relevant_errors(errors) - main_error = errors[0] - # They can be used to craft more helpful error messages when this error - # is being converted to a SchemaValidationError - main_error._additional_errors = errors[1:] - raise main_error - - -def _get_most_relevant_errors( - errors: Sequence[jsonschema.exceptions.ValidationError], -) -> List[jsonschema.exceptions.ValidationError]: - if len(errors) == 0: - return [] - - # Start from the first error on the top-level as we want to show - # an error message for one specific error only even if the chart - # specification might have multiple issues - top_level_error = errors[0] - - # Go to lowest level in schema where an error happened as these give - # the most relevant error messages. - lowest_level = top_level_error - while lowest_level.context: - lowest_level = lowest_level.context[0] - - most_relevant_errors = [] - if lowest_level.validator == "additionalProperties": - # For these errors, the message is already informative enough and the other - # errors on the lowest level are not helpful for a user but instead contain - # the same information in a more verbose way - most_relevant_errors = [lowest_level] - else: - parent = lowest_level.parent - if parent is None: - # In this case we are still at the top level and can return all errors - most_relevant_errors = list(errors) + return errors + + +def _group_errors_by_json_path( + errors: ValidationErrorList, +) -> GroupedValidationErrors: + """Groups errors by the `json_path` attribute of the jsonschema ValidationError + class. This attribute contains the path to the offending element within + a chart specification and can therefore be considered as an identifier of an + 'issue' in the chart that needs to be fixed. + """ + errors_by_json_path = collections.defaultdict(list) + for err in errors: + errors_by_json_path[err.json_path].append(err) + return dict(errors_by_json_path) + + +def _get_leaves_of_error_tree( + errors: ValidationErrorList, +) -> ValidationErrorList: + """For each error in `errors`, it traverses down the "error tree" that is generated + by the jsonschema library to find and return all "leaf" errors. These are errors + which have no further errors that caused it and so they are the most specific errors + with the most specific error messages. + """ + leaves: ValidationErrorList = [] + for err in errors: + if err.context: + # This means that the error `err` was caused by errors in subschemas. + # The list of errors from the subschemas are available in the property + # `context`. + leaves.extend(_get_leaves_of_error_tree(err.context)) else: - # Use all errors of the lowest level out of which - # we can construct more informative error messages - most_relevant_errors = parent.context or [] - if lowest_level.validator == "enum": - # There might be other possible enums which are allowed, e.g. for - # the "timeUnit" property of the "Angle" encoding channel. These do not - # necessarily need to be in the same branch of this tree of errors that - # we traversed down to the lowest level. We therefore gather - # all enums in the leaves of the error tree. - enum_errors = _get_all_lowest_errors_with_validator( - top_level_error, validator="enum" - ) - # Remove errors which already exist in enum_errors - enum_errors = [ - err - for err in enum_errors - if err.message not in [e.message for e in most_relevant_errors] - ] - most_relevant_errors = most_relevant_errors + enum_errors - - # This should never happen but might still be good to test for it as else - # the original error would just slip through without being raised - if len(most_relevant_errors) == 0: - raise Exception("Could not determine the most relevant errors") from errors[0] - - return most_relevant_errors - - -def _get_all_lowest_errors_with_validator( - error: jsonschema.ValidationError, validator: str -) -> List[jsonschema.ValidationError]: - matches: List[jsonschema.ValidationError] = [] - if error.context: - for err in error.context: - if err.context: - matches.extend(_get_all_lowest_errors_with_validator(err, validator)) - elif err.validator == validator: - matches.append(err) - return matches + leaves.append(err) + return leaves + + +def _subset_to_most_specific_json_paths( + errors_by_json_path: GroupedValidationErrors, +) -> GroupedValidationErrors: + """Removes key (json path), value (errors) pairs where the json path is fully + contained in another json path. For example if `errors_by_json_path` has two + keys, `$.encoding.X` and `$.encoding.X.tooltip`, then the first one will be removed + and only the second one is returned. This is done under the assumption that + more specific json paths give more helpful error messages to the user. + """ + errors_by_json_path_specific: GroupedValidationErrors = {} + for json_path, errors in errors_by_json_path.items(): + if not _contained_at_start_of_one_of_other_values( + json_path, list(errors_by_json_path.keys()) + ): + errors_by_json_path_specific[json_path] = errors + return errors_by_json_path_specific + + +def _contained_at_start_of_one_of_other_values(x: str, values: Sequence[str]) -> bool: + # Does not count as "contained at start of other value" if the values are + # the same. These cases should be handled separately + return any(value.startswith(x) for value in values if x != value) + + +def _deduplicate_errors( + grouped_errors: GroupedValidationErrors, +) -> GroupedValidationErrors: + """Some errors have very similar error messages or are just in general not helpful + for a user. This function removes as many of these cases as possible and + can be extended over time to handle new cases that come up. + """ + grouped_errors_deduplicated: GroupedValidationErrors = {} + for json_path, element_errors in grouped_errors.items(): + errors_by_validator = _group_errors_by_validator(element_errors) + + deduplication_functions = { + "enum": _deduplicate_enum_errors, + "additionalProperties": _deduplicate_additional_properties_errors, + } + deduplicated_errors: ValidationErrorList = [] + for validator, errors in errors_by_validator.items(): + deduplication_func = deduplication_functions.get(validator, None) + if deduplication_func is not None: + errors = deduplication_func(errors) + deduplicated_errors.extend(_deduplicate_by_message(errors)) + + # Removes any ValidationError "'value' is a required property" as these + # errors are unlikely to be the relevant ones for the user. They come from + # validation against a schema definition where the output of `alt.value` + # would be valid. However, if a user uses `alt.value`, the `value` keyword + # is included automatically from that function and so it's unlikely + # that this was what the user intended if the keyword is not present + # in the first place. + deduplicated_errors = [ + err for err in deduplicated_errors if not _is_required_value_error(err) + ] + + grouped_errors_deduplicated[json_path] = deduplicated_errors + return grouped_errors_deduplicated + + +def _is_required_value_error(err: jsonschema.exceptions.ValidationError) -> bool: + return err.validator == "required" and err.validator_value == ["value"] + + +def _group_errors_by_validator(errors: ValidationErrorList) -> GroupedValidationErrors: + """Groups the errors by the json schema "validator" that casued the error. For + example if the error is that a value is not one of an enumeration in the json schema + then the "validator" is `"enum"`, if the error is due to an unknown property that + was set although no additional properties are allowed then "validator" is + `"additionalProperties`, etc. + """ + errors_by_validator: DefaultDict[ + str, ValidationErrorList + ] = collections.defaultdict(list) + for err in errors: + # Ignore mypy error as err.validator as it wrongly sees err.validator + # as of type Optional[Validator] instead of str which it is according + # to the documentation and all tested cases + errors_by_validator[err.validator].append(err) # type: ignore[index] + return dict(errors_by_validator) + + +def _deduplicate_enum_errors(errors: ValidationErrorList) -> ValidationErrorList: + """Deduplicate enum errors by removing the errors where the allowed values + are a subset of another error. For example, if `enum` contains two errors + and one has `validator_value` (i.e. accepted values) ["A", "B"] and the + other one ["A", "B", "C"] then the first one is removed and the final + `enum` list only contains the error with ["A", "B", "C"]. + """ + if len(errors) > 1: + # Values (and therefore `validator_value`) of an enum are always arrays, + # see https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values + # which is why we can use join below + value_strings = [",".join(err.validator_value) for err in errors] + longest_enums: ValidationErrorList = [] + for value_str, err in zip(value_strings, errors): + if not _contained_at_start_of_one_of_other_values(value_str, value_strings): + longest_enums.append(err) + errors = longest_enums + return errors + + +def _deduplicate_additional_properties_errors( + errors: ValidationErrorList, +) -> ValidationErrorList: + """If there are multiple additional property errors it usually means that + the offending element was validated against multiple schemas and + its parent is a common anyOf validator. + The error messages produced from these cases are usually + very similar and we just take the shortest one. For example, + the following 3 errors are raised for the `unknown` channel option in + `alt.X("variety", unknown=2)`: + - "Additional properties are not allowed ('unknown' was unexpected)" + - "Additional properties are not allowed ('field', 'unknown' were unexpected)" + - "Additional properties are not allowed ('field', 'type', 'unknown' were unexpected)" + """ + if len(errors) > 1: + # Test if all parent errors are the same anyOf error and only do + # the prioritization in these cases. Can't think of a chart spec where this + # would not be the case but still allow for it below to not break anything. + parent = errors[0].parent + if ( + parent is not None + and parent.validator == "anyOf" + # Use [1:] as don't have to check for first error as it was used + # above to define `parent` + and all(err.parent is parent for err in errors[1:]) + ): + errors = [min(errors, key=lambda x: len(x.message))] + return errors + + +def _deduplicate_by_message(errors: ValidationErrorList) -> ValidationErrorList: + """Deduplicate errors by message. This keeps the original order in case + it was chosen intentionally. + """ + return list({e.message: e for e in errors}.values()) def _subclasses(cls): @@ -187,15 +342,108 @@ def _resolve_references(schema, root=None): class SchemaValidationError(jsonschema.ValidationError): """A wrapper for jsonschema.ValidationError with friendlier traceback""" - def __init__(self, obj, err): - super(SchemaValidationError, self).__init__(**err._contents()) + def __init__(self, obj: "SchemaBase", err: jsonschema.ValidationError) -> None: + super().__init__(**err._contents()) self.obj = obj - self._additional_errors = getattr(err, "_additional_errors", []) + self._errors: GroupedValidationErrors = getattr( + err, "_all_errors", {err.json_path: [err]} + ) + # This is the message from err + self._original_message = self.message + self.message = self._get_message() + + def __str__(self) -> str: + return self.message + + def _get_message(self) -> str: + def indent_second_line_onwards(message: str, indent: int = 4) -> str: + modified_lines: List[str] = [] + for idx, line in enumerate(message.split("\n")): + if idx > 0 and len(line) > 0: + line = " " * indent + line + modified_lines.append(line) + return "\n".join(modified_lines) + + error_messages: List[str] = [] + # Only show a maximum of 3 errors as else the final message returned by this + # method could get very long. + for errors in list(self._errors.values())[:3]: + error_messages.append(self._get_message_for_errors_group(errors)) + + message = "" + if len(error_messages) > 1: + error_messages = [ + indent_second_line_onwards(f"Error {error_id}: {m}") + for error_id, m in enumerate(error_messages, start=1) + ] + message += "Multiple errors were found.\n\n" + message += "\n\n".join(error_messages) + return message + + def _get_message_for_errors_group( + self, + errors: ValidationErrorList, + ) -> str: + if errors[0].validator == "additionalProperties": + # During development, we only found cases where an additionalProperties + # error was raised if that was the only error for the offending instance + # as identifiable by the json path. Therefore, we just check here the first + # error. However, other constellations might exist in which case + # this should be adapted so that other error messages are shown as well. + message = self._get_additional_properties_error_message(errors[0]) + else: + message = self._get_default_error_message(errors=errors) + + return message.strip() + + def _get_additional_properties_error_message( + self, + error: jsonschema.exceptions.ValidationError, + ) -> str: + """Output all existing parameters when an unknown parameter is specified.""" + altair_cls = self._get_altair_class_for_error(error) + param_dict_keys = inspect.signature(altair_cls).parameters.keys() + param_names_table = self._format_params_as_table(param_dict_keys) + + # Error messages for these errors look like this: + # "Additional properties are not allowed ('unknown' was unexpected)" + # Line below extracts "unknown" from this string + parameter_name = error.message.split("('")[-1].split("'")[0] + message = f"""\ +`{altair_cls.__name__}` has no parameter named '{parameter_name}' + +Existing parameter names are: +{param_names_table} +See the help for `{altair_cls.__name__}` to read the full description of these parameters""" + return message + + def _get_altair_class_for_error( + self, error: jsonschema.exceptions.ValidationError + ) -> Type["SchemaBase"]: + """Try to get the lowest class possible in the chart hierarchy so + it can be displayed in the error message. This should lead to more informative + error messages pointing the user closer to the source of the issue. + """ + for prop_name in reversed(error.absolute_path): + # Check if str as e.g. first item can be a 0 + if isinstance(prop_name, str): + potential_class_name = prop_name[0].upper() + prop_name[1:] + cls = getattr(vegalite, potential_class_name, None) + if cls is not None: + break + else: + # Did not find a suitable class based on traversing the path so we fall + # back on the class of the top-level object which created + # the SchemaValidationError + cls = self.obj.__class__ + return cls @staticmethod - def _format_params_as_table(param_dict_keys): + def _format_params_as_table(param_dict_keys: Iterable[str]) -> str: """Format param names into a table so that they are easier to read""" - param_names, name_lengths = zip( + param_names: Tuple[str, ...] + name_lengths: Tuple[int, ...] + param_names, name_lengths = zip( # type: ignore[assignment] # Mypy does think it's Tuple[Any] *[ (name, len(name)) for name in param_dict_keys @@ -212,15 +460,15 @@ def _format_params_as_table(param_dict_keys): columns = min(max_column_width // max_name_length, square_columns) # Compute roughly equal column heights to evenly divide the param names - def split_into_equal_parts(n, p): + def split_into_equal_parts(n: int, p: int) -> List[int]: return [n // p + 1] * (n % p) + [n // p] * (p - n % p) column_heights = split_into_equal_parts(num_param_names, columns) # Section the param names into columns and compute their widths - param_names_columns = [] - column_max_widths = [] - last_end_idx = 0 + param_names_columns: List[Tuple[str, ...]] = [] + column_max_widths: List[int] = [] + last_end_idx: int = 0 for ch in column_heights: param_names_columns.append(param_names[last_end_idx : last_end_idx + ch]) column_max_widths.append( @@ -229,11 +477,11 @@ def split_into_equal_parts(n, p): last_end_idx = ch + last_end_idx # Transpose the param name columns into rows to facilitate looping - param_names_rows = [] + param_names_rows: List[Tuple[str, ...]] = [] for li in zip_longest(*param_names_columns, fillvalue=""): param_names_rows.append(li) # Build the table as a string by iterating over and formatting the rows - param_names_table = "" + param_names_table: str = "" for param_names_row in param_names_rows: for num, param_name in enumerate(param_names_row): # Set column width based on the longest param in the column @@ -245,82 +493,60 @@ def split_into_equal_parts(n, p): # Insert newlines and spacing after the last element in each row if num == (len(param_names_row) - 1): param_names_table += "\n" - # 16 is the indendation of the returned multiline string below - param_names_table += " " * 16 return param_names_table - def __str__(self): - # Try to get the lowest class possible in the chart hierarchy so - # it can be displayed in the error message. This should lead to more informative - # error messages pointing the user closer to the source of the issue. - for prop_name in reversed(self.absolute_path): - # Check if str as e.g. first item can be a 0 - if isinstance(prop_name, str): - potential_class_name = prop_name[0].upper() + prop_name[1:] - cls = getattr(vegalite, potential_class_name, None) - if cls is not None: - break - else: - # Did not find a suitable class based on traversing the path so we fall - # back on the class of the top-level object which created - # the SchemaValidationError - cls = self.obj.__class__ - - # Output all existing parameters when an unknown parameter is specified - if self.validator == "additionalProperties": - param_dict_keys = inspect.signature(cls).parameters.keys() - param_names_table = self._format_params_as_table(param_dict_keys) - - # `cleandoc` removes multiline string indentation in the output - return inspect.cleandoc( - """`{}` has no parameter named {!r} - - Existing parameter names are: - {} - See the help for `{}` to read the full description of these parameters - """.format( - cls.__name__, - self.message.split("('")[-1].split("'")[0], - param_names_table, - cls.__name__, - ) - ) - # Use the default error message for all other cases than unknown parameter errors + def _get_default_error_message( + self, + errors: ValidationErrorList, + ) -> str: + bullet_points: List[str] = [] + errors_by_validator = _group_errors_by_validator(errors) + if "enum" in errors_by_validator: + for error in errors_by_validator["enum"]: + bullet_points.append(f"one of {error.validator_value}") + + if "type" in errors_by_validator: + types = [f"'{err.validator_value}'" for err in errors_by_validator["type"]] + point = "of type " + if len(types) == 1: + point += types[0] + elif len(types) == 2: + point += f"{types[0]} or {types[1]}" + else: + point += ", ".join(types[:-1]) + f", or {types[-1]}" + bullet_points.append(point) + + # It should not matter which error is specifically used as they are all + # about the same offending instance (i.e. invalid value), so we can just + # take the first one + error = errors[0] + # Add a summary line when parameters are passed an invalid value + # For example: "'asdf' is an invalid value for `stack` + message = f"'{error.instance}' is an invalid value" + if error.absolute_path: + message += f" for `{error.absolute_path[-1]}`" + + # Add bullet points + if len(bullet_points) == 0: + message += ".\n\n" + elif len(bullet_points) == 1: + message += f". Valid values are {bullet_points[0]}.\n\n" else: - message = self.message - # Add a summary line when parameters are passed an invalid value - # For example: "'asdf' is an invalid value for `stack` - if self.absolute_path: - # The indentation here must match that of `cleandoc` below - message = f"""'{self.instance}' is an invalid value for `{self.absolute_path[-1]}`: - - {message}""" - - if self._additional_errors: - # Deduplicate error messages and only include them if they are - # different then the main error message stored in self.message. - # Using dict instead of set to keep the original order in case it was - # chosen intentionally to move more relevant error messages to the top - additional_error_messages = list( - dict.fromkeys( - [ - e.message - for e in self._additional_errors - if e.message != self.message - ] - ) - ) - if additional_error_messages: - message += "\n " + "\n ".join( - additional_error_messages - ) - - return inspect.cleandoc( - """{} - """.format( - message - ) - ) + # We don't use .capitalize below to make the first letter uppercase + # as that makes the rest of the message lowercase + bullet_points = [point[0].upper() + point[1:] for point in bullet_points] + message += ". Valid values are:\n\n" + message += "\n".join([f"- {point}" for point in bullet_points]) + message += "\n\n" + + # Add unformatted messages of any remaining errors which were not + # considered so far. This is not expected to be used but more exists + # as a fallback for cases which were not known during development. + for validator, errors in errors_by_validator.items(): + if validator not in ("enum", "type"): + message += "\n".join([e.message for e in errors]) + + return message class UndefinedType:
diff --git a/tests/utils/test_schemapi.py b/tests/utils/test_schemapi.py --- a/tests/utils/test_schemapi.py +++ b/tests/utils/test_schemapi.py @@ -393,7 +393,8 @@ def test_schema_validation_error(): assert the_err.message in message -def chart_example_layer(): +def chart_error_example__layer(): + # Error: Width is not a valid property of a VConcatChart points = ( alt.Chart(data.cars.url) .mark_point() @@ -405,7 +406,8 @@ def chart_example_layer(): return (points & points).properties(width=400) -def chart_example_hconcat(): +def chart_error_example__hconcat(): + # Error: Invalid value for title in Text source = data.cars() points = ( alt.Chart(source) @@ -418,7 +420,7 @@ def chart_example_hconcat(): text = ( alt.Chart(source) - .mark_text(align="right") + .mark_text() .encode( alt.Text("Horsepower:N", title={"text": "Horsepower", "align": "right"}) ) @@ -427,7 +429,10 @@ def chart_example_hconcat(): return points | text -def chart_example_invalid_channel_and_condition(): +def chart_error_example__invalid_channel(): + # Error: invalidChannel is an invalid encoding channel. Condition is correct + # but is added below as in previous implementations of Altair this interfered + # with finding the invalidChannel error selection = alt.selection_point() return ( alt.Chart(data.barley()) @@ -440,7 +445,9 @@ def chart_example_invalid_channel_and_condition(): ) -def chart_example_invalid_y_option(): +def chart_error_example__invalid_y_option_value_unknown_x_option(): + # Error 1: unknown is an invalid channel option for X + # Error 2: Invalid Y option value "asdf" and unknown option "unknown" for X return ( alt.Chart(data.barley()) .mark_bar() @@ -451,7 +458,8 @@ def chart_example_invalid_y_option(): ) -def chart_example_invalid_y_option_value(): +def chart_error_example__invalid_y_option_value(): + # Error: Invalid Y option value "asdf" return ( alt.Chart(data.barley()) .mark_bar() @@ -462,7 +470,10 @@ def chart_example_invalid_y_option_value(): ) -def chart_example_invalid_y_option_value_with_condition(): +def chart_error_example__invalid_y_option_value_with_condition(): + # Error: Invalid Y option value "asdf". Condition is correct + # but is added below as in previous implementations of Altair this interfered + # with finding the invalidChannel error return ( alt.Chart(data.barley()) .mark_bar() @@ -474,15 +485,18 @@ def chart_example_invalid_y_option_value_with_condition(): ) -def chart_example_invalid_timeunit_value(): +def chart_error_example__invalid_timeunit_value(): + # Error: Invalid value for Angle.timeUnit return alt.Chart().encode(alt.Angle().timeUnit("invalid_value")) -def chart_example_invalid_sort_value(): +def chart_error_example__invalid_sort_value(): + # Error: Invalid value for Angle.sort return alt.Chart().encode(alt.Angle().sort("invalid_value")) -def chart_example_invalid_bandposition_value(): +def chart_error_example__invalid_bandposition_value(): + # Error: Invalid value for Text.bandPosition return ( alt.Chart(data.cars()) .mark_text(align="right") @@ -490,25 +504,261 @@ def chart_example_invalid_bandposition_value(): ) +def chart_error_example__invalid_type(): + # Error: Invalid value for type + return alt.Chart().encode(alt.X(type="unknown")) + + +def chart_error_example__additional_datum_argument(): + # Error: wrong_argument is not a valid argument to datum + return alt.Chart().mark_point().encode(x=alt.datum(1, wrong_argument=1)) + + +def chart_error_example__invalid_value_type(): + # Error: Value cannot be an integer in this case + return ( + alt.Chart(data.cars()) + .mark_point() + .encode( + x="Acceleration:Q", + y="Horsepower:Q", + color=alt.value(1), # should be eg. alt.value('red') + ) + ) + + +def chart_error_example__wrong_tooltip_type_in_faceted_chart(): + # Error: Wrong data type to pass to tooltip + return ( + alt.Chart(pd.DataFrame({"a": [1]})) + .mark_point() + .encode(tooltip=[{"wrong"}]) + .facet() + ) + + +def chart_error_example__wrong_tooltip_type_in_layered_chart(): + # Error: Wrong data type to pass to tooltip + return alt.layer( + alt.Chart().mark_point().encode(tooltip=[{"wrong"}]), + ) + + +def chart_error_example__two_errors_in_layered_chart(): + # Error 1: Wrong data type to pass to tooltip + # Error 2: invalidChannel is not a valid encoding channel + return alt.layer( + alt.Chart().mark_point().encode(tooltip=[{"wrong"}]), + alt.Chart().mark_line().encode(invalidChannel="unknown"), + ) + + +def chart_error_example__two_errors_in_complex_concat_layered_chart(): + # Error 1: Wrong data type to pass to tooltip + # Error 2: Invalid value for bandPosition + return ( + chart_error_example__wrong_tooltip_type_in_layered_chart() + | chart_error_example__invalid_bandposition_value() + ) + + +def chart_error_example__three_errors_in_complex_concat_layered_chart(): + # Error 1: Wrong data type to pass to tooltip + # Error 2: invalidChannel is not a valid encoding channel + # Error 3: Invalid value for bandPosition + return ( + chart_error_example__two_errors_in_layered_chart() + | chart_error_example__invalid_bandposition_value() + ) + + +def chart_error_example__two_errors_with_one_in_nested_layered_chart(): + # Error 1: invalidOption is not a valid option for Scale + # Error 2: invalidChannel is not a valid encoding channel + + # In the final chart object, the `layer` attribute will look like this: + # [alt.Chart(...), alt.Chart(...), alt.LayerChart(...)] + # We can therefore use this example to test if an error is also + # spotted in a layered chart within another layered chart + source = pd.DataFrame( + [ + {"Day": 1, "Value": 103.3}, + {"Day": 2, "Value": 394.8}, + {"Day": 3, "Value": 199.5}, + ] + ) + + blue_bars = ( + alt.Chart(source) + .encode(alt.X("Day:O").scale(invalidOption=10), alt.Y("Value:Q")) + .mark_bar() + ) + red_bars = ( + alt.Chart(source) + .transform_filter(alt.datum.Value >= 300) + .transform_calculate(as_="baseline", calculate="300") + .encode( + alt.X("Day:O"), + alt.Y("baseline:Q"), + alt.Y2("Value:Q"), + color=alt.value("#e45755"), + ) + .mark_bar() + ) + + bars = blue_bars + red_bars + + base = alt.Chart().encode(y=alt.datum(300)) + + rule = base.mark_rule().encode(invalidChannel=2) + text = base.mark_text(text="hazardous") + rule_text = rule + text + + chart = bars + rule_text + return chart + + +def chart_error_example__four_errors(): + # Error 1: unknown is not a valid encoding channel option + # Error 2: Invalid Y option value "asdf". + # Error 3: another_unknown is not a valid encoding channel option + # Error 4: fourth_error is not a valid encoding channel option <- this error + # should not show up in the final error message as it is capped at showing + # 3 errors + return ( + alt.Chart(data.barley()) + .mark_bar() + .encode( + x=alt.X("variety", unknown=2), + y=alt.Y("sum(yield)", stack="asdf"), + color=alt.Color("variety", another_unknown=2), + opacity=alt.Opacity("variety", fourth_error=1), + ) + ) + + @pytest.mark.parametrize( "chart_func, expected_error_message", [ ( - chart_example_invalid_y_option, + chart_error_example__invalid_y_option_value_unknown_x_option, inspect.cleandoc( - r"""`X` has no parameter named 'unknown' + r"""Multiple errors were found. - Existing parameter names are: - shorthand bin scale timeUnit - aggregate field sort title - axis impute stack type - bandPosition + Error 1: `X` has no parameter named 'unknown' - See the help for `X` to read the full description of these parameters$""" # noqa: W291 + Existing parameter names are: + shorthand bin scale timeUnit + aggregate field sort title + axis impute stack type + bandPosition + + See the help for `X` to read the full description of these parameters + + Error 2: 'asdf' is an invalid value for `stack`. Valid values are: + + - One of \['zero', 'center', 'normalize'\] + - Of type 'null' or 'boolean'$""" # noqa: W291 + ), + ), + ( + chart_error_example__wrong_tooltip_type_in_faceted_chart, + inspect.cleandoc( + r"""'{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'.$""" ), ), ( - chart_example_layer, + chart_error_example__wrong_tooltip_type_in_layered_chart, + inspect.cleandoc( + r"""'{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'.$""" + ), + ), + ( + chart_error_example__two_errors_in_layered_chart, + inspect.cleandoc( + r"""Multiple errors were found. + + Error 1: '{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'. + + Error 2: `Encoding` has no parameter named 'invalidChannel' + + Existing parameter names are: + angle key order strokeDash tooltip xOffset + color latitude radius strokeOpacity url y + description latitude2 radius2 strokeWidth x y2 + detail longitude shape text x2 yError + fill longitude2 size theta xError yError2 + fillOpacity opacity stroke theta2 xError2 yOffset + href + + See the help for `Encoding` to read the full description of these parameters$""" # noqa: W291 + ), + ), + ( + chart_error_example__two_errors_in_complex_concat_layered_chart, + inspect.cleandoc( + r"""Multiple errors were found. + + Error 1: '{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'. + + Error 2: '4' is an invalid value for `bandPosition`. Valid values are of type 'number'.$""" + ), + ), + ( + chart_error_example__three_errors_in_complex_concat_layered_chart, + inspect.cleandoc( + r"""Multiple errors were found. + + Error 1: '{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'. + + Error 2: `Encoding` has no parameter named 'invalidChannel' + + Existing parameter names are: + angle key order strokeDash tooltip xOffset + color latitude radius strokeOpacity url y + description latitude2 radius2 strokeWidth x y2 + detail longitude shape text x2 yError + fill longitude2 size theta xError yError2 + fillOpacity opacity stroke theta2 xError2 yOffset + href + + See the help for `Encoding` to read the full description of these parameters + + Error 3: '4' is an invalid value for `bandPosition`. Valid values are of type 'number'.$""" # noqa: W291 + ), + ), + ( + chart_error_example__two_errors_with_one_in_nested_layered_chart, + inspect.cleandoc( + r"""Multiple errors were found. + + Error 1: `Scale` has no parameter named 'invalidOption' + + Existing parameter names are: + align domain interpolate range round + base domainMax nice rangeMax scheme + bins domainMid padding rangeMin type + clamp domainMin paddingInner reverse zero + constant exponent paddingOuter + + See the help for `Scale` to read the full description of these parameters + + Error 2: `Encoding` has no parameter named 'invalidChannel' + + Existing parameter names are: + angle key order strokeDash tooltip xOffset + color latitude radius strokeOpacity url y + description latitude2 radius2 strokeWidth x y2 + detail longitude shape text x2 yError + fill longitude2 size theta xError yError2 + fillOpacity opacity stroke theta2 xError2 yOffset + href + + See the help for `Encoding` to read the full description of these parameters$""" # noqa: W291 + ), + ), + ( + chart_error_example__layer, inspect.cleandoc( r"""`VConcatChart` has no parameter named 'width' @@ -522,36 +772,31 @@ def chart_example_invalid_bandposition_value(): ), ), ( - chart_example_invalid_y_option_value, + chart_error_example__invalid_y_option_value, inspect.cleandoc( - r"""'asdf' is an invalid value for `stack`: + r"""'asdf' is an invalid value for `stack`. Valid values are: - 'asdf' is not one of \['zero', 'center', 'normalize'\] - 'asdf' is not of type 'null' - 'asdf' is not of type 'boolean'$""" + - One of \['zero', 'center', 'normalize'\] + - Of type 'null' or 'boolean'$""" ), ), ( - chart_example_invalid_y_option_value_with_condition, + chart_error_example__invalid_y_option_value_with_condition, inspect.cleandoc( - r"""'asdf' is an invalid value for `stack`: + r"""'asdf' is an invalid value for `stack`. Valid values are: - 'asdf' is not one of \['zero', 'center', 'normalize'\] - 'asdf' is not of type 'null' - 'asdf' is not of type 'boolean'$""" + - One of \['zero', 'center', 'normalize'\] + - Of type 'null' or 'boolean'$""" ), ), ( - chart_example_hconcat, + chart_error_example__hconcat, inspect.cleandoc( - r"""'{'text': 'Horsepower', 'align': 'right'}' is an invalid value for `title`: - - {'text': 'Horsepower', 'align': 'right'} is not of type 'string' - {'text': 'Horsepower', 'align': 'right'} is not of type 'array'$""" + r"""'{'text': 'Horsepower', 'align': 'right'}' is an invalid value for `title`. Valid values are of type 'string', 'array', or 'null'.$""" ), ), ( - chart_example_invalid_channel_and_condition, + chart_error_example__invalid_channel, inspect.cleandoc( r"""`Encoding` has no parameter named 'invalidChannel' @@ -568,35 +813,92 @@ def chart_example_invalid_bandposition_value(): ), ), ( - chart_example_invalid_timeunit_value, + chart_error_example__invalid_timeunit_value, inspect.cleandoc( - r"""'invalid_value' is an invalid value for `timeUnit`: + r"""'invalid_value' is an invalid value for `timeUnit`. Valid values are: - 'invalid_value' is not one of \['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'\] - 'invalid_value' is not one of \['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'\] - 'invalid_value' is not one of \['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'\] - 'invalid_value' is not one of \['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'\]$""" + - One of \['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'\] + - One of \['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'\] + - One of \['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'\] + - One of \['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'\] + - Of type 'object'$""" ), ), ( - chart_example_invalid_sort_value, - # Previuosly, the line - # "'invalid_value' is not of type 'array'" appeared multiple times in - # the error message. This test should prevent a regression. + chart_error_example__invalid_sort_value, inspect.cleandoc( - r"""'invalid_value' is an invalid value for `sort`: + r"""'invalid_value' is an invalid value for `sort`. Valid values are: - 'invalid_value' is not of type 'array'$""" + - One of \['ascending', 'descending'\] + - One of \['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'\] + - One of \['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'\] + - Of type 'array', 'object', or 'null'$""" + ), + ), + ( + chart_error_example__invalid_bandposition_value, + inspect.cleandoc( + r"""'4' is an invalid value for `bandPosition`. Valid values are of type 'number'.$""" + ), + ), + ( + chart_error_example__invalid_type, + inspect.cleandoc( + r"""'unknown' is an invalid value for `type`. Valid values are one of \['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'\].$""" ), ), ( - chart_example_invalid_bandposition_value, + chart_error_example__additional_datum_argument, inspect.cleandoc( - r"""'4' is an invalid value for `bandPosition`: + r"""`X` has no parameter named 'wrong_argument' + + Existing parameter names are: + shorthand bin scale timeUnit + aggregate field sort title + axis impute stack type + bandPosition + + See the help for `X` to read the full description of these parameters$""" # noqa: W291 + ), + ), + ( + chart_error_example__invalid_value_type, + inspect.cleandoc( + r"""'1' is an invalid value for `value`. Valid values are of type 'object', 'string', or 'null'.$""" + ), + ), + ( + chart_error_example__four_errors, + inspect.cleandoc( + r"""Multiple errors were found. + + Error 1: `Color` has no parameter named 'another_unknown' + + Existing parameter names are: + shorthand bin legend timeUnit + aggregate condition scale title + bandPosition field sort type + + See the help for `Color` to read the full description of these parameters + + Error 2: `Opacity` has no parameter named 'fourth_error' + + Existing parameter names are: + shorthand bin legend timeUnit + aggregate condition scale title + bandPosition field sort type + + See the help for `Opacity` to read the full description of these parameters + + Error 3: `X` has no parameter named 'unknown' + + Existing parameter names are: + shorthand bin scale timeUnit + aggregate field sort title + axis impute stack type + bandPosition - '4' is not of type 'number' - Additional properties are not allowed \('field' was unexpected\) - Additional properties are not allowed \('bandPosition', 'field', 'type' were unexpected\)$""" + See the help for `X` to read the full description of these parameters$""" # noqa: W291 ), ), ],
Improve messages for multiple errors Based on feedback from @joelostblom in https://github.com/altair-viz/altair/pull/2842#issuecomment-1405578872: > On brief comment now, do you think it is confusing to see three error messages like in your example above? I don't know what would be a feasible solution technically here, but I am thinking that instead of > > ``` > 'asdf' is not one of ['zero', 'center', 'normalize'] > 'asdf' is not of type 'null' > 'asdf' is not of type 'boolean' > ``` > > the message would be clearer as: > > ``` > 'asdf' needs to be one of ['zero', 'center', 'normalize'] or of type 'null' or boolean' > ``` Also see subsequent comments in that thread. https://github.com/altair-viz/altair/pull/2842#discussion_r1089687484 is also relevant.
`alt.Chart().encode(alt.Angle().sort("invalid_value"))` gives: ```python 'invalid_value' is not of type 'array' 'invalid_value' is not of type 'array' 'invalid_value' is not of type 'array' 'invalid_value' is not of type 'array' ``` Error messages should be deduplicated based on `.message` attribute. Furthermore, this should ideally show all literal values which are acceptable such as ["x", "y", ...]. Maybe one for the long list but we could investigate if it make sense to show the error messages of all leaves in this error tree that we're traversing to get the relevant error messages. Or should it be dependent on what kind of object the user provided as a value, e.g. if a string such as `"invalid_value"` is provided then it should show acceptable string values but if an unsupported type is passed then it should show which types are accepted? I also saw some duplicated rounds of messages in https://github.com/altair-viz/altair/issues/2896
2023-04-02T15:48:43Z
[]
[]
vega/altair
3,022
vega__altair-3022
[ "3020" ]
4103f322f48fa52ffa560697b0266e54a01a3b6a
diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -3172,7 +3172,7 @@ def _needs_name(subchart): return False # Variable parameters won't receive a views property. - if all([isinstance(p, core.VariableParameter) for p in subchart.params]): + if all(isinstance(p, core.VariableParameter) for p in subchart.params): return False return True @@ -3328,7 +3328,7 @@ def _repeat_names(params, repeat): views = [] repeat_strings = _get_repeat_strings(repeat) for v in param.views: - if any([v.endswith(f"child__{r}") for r in repeat_strings]): + if any(v.endswith(f"child__{r}") for r in repeat_strings): views.append(v) else: views += [_extend_view_name(v, r) for r in repeat_strings] diff --git a/altair/vegalite/v5/schema/__init__.py b/altair/vegalite/v5/schema/__init__.py --- a/altair/vegalite/v5/schema/__init__.py +++ b/altair/vegalite/v5/schema/__init__.py @@ -1,5 +1,5 @@ # ruff: noqa from .core import * from .channels import * -SCHEMA_VERSION = 'v5.6.1' -SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.6.1.json' +SCHEMA_VERSION = 'v5.7.1' +SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.7.1.json' diff --git a/altair/vegalite/v5/schema/core.py b/altair/vegalite/v5/schema/core.py --- a/altair/vegalite/v5/schema/core.py +++ b/altair/vegalite/v5/schema/core.py @@ -16754,7 +16754,7 @@ class LayerRepeatSpec(RepeatSpec): ``"column"`` to the listed fields to be repeated along the particular orientations. The objects ``{"repeat": "row"}`` and ``{"repeat": "column"}`` can be used to refer to the repeated field respectively. - spec : anyOf(:class:`LayerSpec`, :class:`UnitSpec`) + spec : anyOf(:class:`LayerSpec`, :class:`UnitSpecWithFrame`) A specification of the view that gets repeated. align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) The alignment to apply to grid rows and columns. The supported string values are @@ -18978,7 +18978,7 @@ class TopLevelSelectionParameter(TopLevelParameter): **See also:** `init <https://vega.github.io/vega-lite/docs/value.html>`__ documentation. - views : List(anyOf(string, List(string))) + views : List(string) By default, top-level selections are applied to every view in the visualization. If this property is specified, selections will only be applied to views with the given names. diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -30,7 +30,7 @@ # Map of version name to github branch name. SCHEMA_VERSION = { - "vega-lite": {"v5": "v5.6.1"}, + "vega-lite": {"v5": "v5.7.1"}, } reLink = re.compile(r"(?<=\[)([^\]]+)(?=\]\([^\)]+\))", re.M)
diff --git a/tests/examples_arguments_syntax/interactive_layered_crossfilter.py b/tests/examples_arguments_syntax/_interactive_layered_crossfilter.py similarity index 100% rename from tests/examples_arguments_syntax/interactive_layered_crossfilter.py rename to tests/examples_arguments_syntax/_interactive_layered_crossfilter.py diff --git a/tests/examples_methods_syntax/interactive_layered_crossfilter.py b/tests/examples_methods_syntax/_interactive_layered_crossfilter.py similarity index 100% rename from tests/examples_methods_syntax/interactive_layered_crossfilter.py rename to tests/examples_methods_syntax/_interactive_layered_crossfilter.py
Update to Vega-Lite 5.7 VL 5.7 just got released. Updating Altair should be straight-forward as the changes to the schema itself are very small but haven't done yet as we need to wait for https://github.com/vega/schema/issues/8 to be resolved. Before that, we can't run the schema generation for 5.7 as there is no 5.7 schema file yet available under https://vega.github.io/schema
I fixed the schema release.
2023-04-15T18:07:42Z
[]
[]
vega/altair
3,068
vega__altair-3068
[ "3067" ]
d47f13b118534771c54fffa829a8458793b0448e
diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -3395,9 +3395,12 @@ def remove_prop(subchart, prop): else: raise ValueError(f"There are inconsistent values {values} for {prop}") else: - # Top level has this prop; subchart props must be either - # Undefined or identical to proceed. - if all(c[prop] is Undefined or c[prop] == chart[prop] for c in subcharts): + # Top level has this prop; subchart must either not have the prop + # or it must be Undefined or identical to proceed. + if all( + getattr(c, prop, Undefined) is Undefined or c[prop] == chart[prop] + for c in subcharts + ): output_dict[prop] = chart[prop] else: raise ValueError(f"There are inconsistent values {values} for {prop}")
diff --git a/tests/test_examples.py b/tests/test_examples.py --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -3,6 +3,7 @@ import pytest +import altair as alt from altair.utils.execeval import eval_block from tests import examples_arguments_syntax from tests import examples_methods_syntax @@ -48,6 +49,39 @@ def test_render_examples_to_chart(syntax_module): ) from err [email protected]( + "syntax_module", [examples_arguments_syntax, examples_methods_syntax] +) +def test_from_and_to_json_roundtrip(syntax_module): + """Tests if the to_json and from_json (and by extension to_dict and from_dict) + work for all examples in the Example Gallery. + """ + for filename in iter_examples_filenames(syntax_module): + source = pkgutil.get_data(syntax_module.__name__, filename) + chart = eval_block(source) + + if chart is None: + raise ValueError( + f"Example file {filename} should define chart in its final " + "statement." + ) + + try: + first_json = chart.to_json() + reconstructed_chart = alt.Chart.from_json(first_json) + # As the chart objects are not + # necessarily the same - they could use different objects to encode the same + # information - we do not test for equality of the chart objects, but rather + # for equality of the json strings. + second_json = reconstructed_chart.to_json() + assert first_json == second_json + except Exception as err: + raise AssertionError( + f"Example file {filename} raised an exception when " + f"doing a json conversion roundtrip: {err}" + ) from err + + # We do not apply the save_engine mark to this test. This mark is used in # the build GitHub Action workflow to select the tests which should be rerun # with some of the saving engines uninstalled. This would not make sense for this test
JSON to Chart failure in v5.0.0 As part of a larger application, we're moving chart content around in JSON format via `Chart.to_json` and `Chart.from_json`. However, I'm encountering an error after updating to Altair v5.0.0. An example that used to work previously - based on the layered chart in https://altair-viz.github.io/altair-tutorial/notebooks/09-Geographic-plots.html ```python import altair as alt from vega_datasets import data states = alt.topo_feature(data.us_10m.url, feature='states') airports = data.airports() background = alt.Chart(states).mark_geoshape( fill='lightgray', stroke='white' ).project('albersUsa').properties( width=500, height=300 ) points = alt.Chart(airports).mark_circle().encode( longitude='longitude:Q', latitude='latitude:Q', size=alt.value(10), tooltip='name' ) chart = background + points json = chart.to_json() chart = alt.Chart.from_json(json) ``` In v4.2.2 this runs without any errors. In v5.0.0 this results in ``` Traceback (most recent call last): File "altair_scratchpad.py", line 25, in <module> chart = alt.Chart.from_json(json) File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\utils\schemapi.py", line 914, in from_json return cls.from_dict(dct, validate=validate) File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\vegalite\v5\api.py", line 2497, in from_dict return class_.from_dict(dct, validate=validate) # type: ignore[attr-defined] File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\utils\schemapi.py", line 893, in from_dict return converter.from_dict(dct, cls) File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\utils\schemapi.py", line 1058, in from_dict return cls(**kwds) File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\vegalite\v5\api.py", line 2982, in __init__ combined_dict, self.layer = _remove_layer_props(self, self.layer, layer_props) File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\vegalite\v5\api.py", line 3393, in _remove_layer_props if all(c[prop] is Undefined or c[prop] == chart[prop] for c in subcharts): File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\vegalite\v5\api.py", line 3393, in <genexpr> if all(c[prop] is Undefined or c[prop] == chart[prop] for c in subcharts): File "C:\Users\romesh\miniconda3\envs\atomica38\lib\site-packages\altair\utils\schemapi.py", line 711, in __getitem__ return self._kwds[item] KeyError: 'height' ```
Thank you @RomeshA for reporting this! I can replicate the error and will look into it in the coming days. I'll also consider using the example gallery for automated tests for the `from_json` functionality to prevent future regressions.
2023-05-25T17:24:07Z
[]
[]
vega/altair
3,076
vega__altair-3076
[ "3050" ]
601ae167a66d77cd6b5f154a53c63a364afc7c16
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -397,6 +397,31 @@ def to_list_if_array(val): return df +def sanitize_arrow_table(pa_table): + """Sanitize arrow table for JSON serialization""" + import pyarrow as pa + import pyarrow.compute as pc + + arrays = [] + schema = pa_table.schema + for name in schema.names: + array = pa_table[name] + dtype = schema.field(name).type + if str(dtype).startswith("timestamp"): + arrays.append(pc.strftime(array)) + elif str(dtype).startswith("duration"): + raise ValueError( + 'Field "{col_name}" has type "{dtype}" which is ' + "not supported by Altair. Please convert to " + "either a timestamp or a numerical value." + "".format(col_name=name, dtype=dtype) + ) + else: + arrays.append(array) + + return pa.Table.from_arrays(arrays, names=schema.names) + + def parse_shorthand( shorthand, data=None, diff --git a/altair/utils/data.py b/altair/utils/data.py --- a/altair/utils/data.py +++ b/altair/utils/data.py @@ -8,7 +8,7 @@ from toolz import curried from typing import Callable -from .core import sanitize_dataframe +from .core import sanitize_dataframe, sanitize_arrow_table from .core import sanitize_geo_interface from .deprecation import AltairDeprecationWarning from .plugin_registry import PluginRegistry @@ -166,7 +166,7 @@ def to_values(data): elif hasattr(data, "__dataframe__"): # experimental interchange dataframe support pi = import_pyarrow_interchange() - pa_table = pi.from_dataframe(data) + pa_table = sanitize_arrow_table(pi.from_dataframe(data)) return {"values": pa_table.to_pylist()} @@ -185,8 +185,6 @@ def check_data_type(data): # ============================================================================== # Private utilities # ============================================================================== - - def _compute_data_hash(data_str): return hashlib.md5(data_str.encode()).hexdigest()
diff --git a/tests/utils/test_dataframe_interchange.py b/tests/utils/test_dataframe_interchange.py new file mode 100644 --- /dev/null +++ b/tests/utils/test_dataframe_interchange.py @@ -0,0 +1,57 @@ +from datetime import datetime +import pyarrow as pa +import pandas as pd +import pytest +import sys +import os + +from altair.utils.data import to_values + + +def windows_has_tzdata(): + """ + From PyArrow: python/pyarrow/tests/util.py + + This is the default location where tz.cpp will look for (until we make + this configurable at run-time) + """ + tzdata_path = os.path.expandvars(r"%USERPROFILE%\Downloads\tzdata") + return os.path.exists(tzdata_path) + + +# Skip test on Windows when the tz database is not configured. +# See https://github.com/altair-viz/altair/issues/3050. [email protected]( + sys.platform == "win32" and not windows_has_tzdata(), + reason="Timezone database is not installed on Windows", +) +def test_arrow_timestamp_conversion(): + """Test that arrow timestamp values are converted to ISO-8601 strings""" + data = { + "date": [datetime(2004, 8, 1), datetime(2004, 9, 1), None], + "value": [102, 129, 139], + } + pa_table = pa.table(data) + + values = to_values(pa_table) + expected_values = { + "values": [ + {"date": "2004-08-01T00:00:00.000000", "value": 102}, + {"date": "2004-09-01T00:00:00.000000", "value": 129}, + {"date": None, "value": 139}, + ] + } + assert values == expected_values + + +def test_duration_raises(): + td = pd.timedelta_range(0, periods=3, freq="h") + df = pd.DataFrame(td).reset_index() + df.columns = ["id", "timedelta"] + pa_table = pa.table(df) + with pytest.raises(ValueError) as e: + to_values(pa_table) + + # Check that exception mentions the duration[ns] type, + # which is what the pandas timedelta is converted into + assert "duration[ns]" in e.value.args[0]
pyarrow datetime is not supported using altair 5.0 I created an altair chart from a duckdb dataframe exported as an arrow table, but I get this error TypeError: Object of type datetime is not JSON serializable when I cast the field to string everything works fine.
Thanks for the report! I can reproduce it with the following: ```python from datetime import datetime import pyarrow as pa import altair as alt data = { 'date': [datetime(2004, 8, 1), datetime(2004, 9, 1)], 'value': [102, 129] } pa_table = pa.table(data) alt.Chart(pa_table).mark_line().encode( x='date', y='value' ) ``` > ```cmd > TypeError: Object of type datetime is not JSON serializable > ``` Trying to narrow it down a bit further. The `pa_table` is a `pyarrow.Table` that contains two columns of type `timestamp[us]` and `int64`: ``` pa_table ```` > ```cmd > pyarrow.Table > date: timestamp[us] > value: int64 > ---- > date: [[2004-08-01 00:00:00.000000,2004-09-01 00:00:00.000000]] > value: [[102,129]] > ``` The serialization of the arrow table is done using the dataframe interchange protocol available in `pyarrow`. ```python import pyarrow.interchange as pi pi_table = pi.from_dataframe(pa_table) pi_table ``` > ```cmd > pyarrow.Table > date: timestamp[us] > price: int64 > ---- > date: [[2004-08-01 00:00:00.000000,2004-09-01 00:00:00.000000]] > price: [[102,129]] > ``` Where this object is converted into a pylist before inserted as values within the generated vega-lite specification: ```python pi_table.to_pylist() ``` > ```cmd > [{'date': datetime.datetime(2004, 8, 1, 0, 0), 'price': 102}, > {'date': datetime.datetime(2004, 9, 1, 0, 0), 'price': 129}] > ``` As can be seen, the `date` has become a `datetime.datetime()` timestamp. And this is problematic as this is not JSON serializable. In Altair this happens around here: https://github.com/altair-viz/altair/blob/master/altair/utils/data.py#L168-L170 ```python elif hasattr(data, "__dataframe__"): # experimental interchange dataframe support pi = import_pyarrow_interchange() pa_table = pi.from_dataframe(data) return {"values": pa_table.to_pylist()} ``` Currently we do not run the `pi_table` through [`sanitize_dataframe`](https://github.com/altair-viz/altair/blob/master/altair/utils/core.py#L287), something that does happen for pandas.DataFrames, In this process of sanitation we serialize type [`datetime`](https://github.com/altair-viz/altair/blob/master/altair/utils/core.py#L347-L356) as such: ```python elif str(dtype).startswith("datetime"): # Convert datetimes to strings. This needs to be a full ISO string # with time, which is why we cannot use ``col.astype(str)``. # This is because Javascript parses date-only times in UTC, but # parses full ISO-8601 dates as local time, and dates in Vega and # Vega-Lite are displayed in local time by default. # (see https://github.com/altair-viz/altair/issues/1027) df[col_name] = ( df[col_name].apply(lambda x: x.isoformat()).replace("NaT", "") ) ``` Not sure if we should sanitize interchange dataframes on the Python side or if it is better to push the `pyarrow.Table` using Arrow IPC serialization to the JavaScript side and construct valid objects there. Probably easier to include sanitation on the Python side. I think you can also explore the idea of extending the JSON serialiser with support for datetimes. For example that's what we have done in TurboGears ( https://github.com/TurboGears/tg2/blob/development/tg/jsonify.py#L94-L98 ). That way you don't have to care about sanitising types explicitly because the json dumper will take care of it for you independently from where that value came from. If you decide to sanitize interchange dataframes on the Python side, you could use `cast` function (as @djouallah mentioned) and cast Timestamp to string to get the correct ISO format, for example: ```python >>> from datetime import datetime >>> import pyarrow as pa >>> arr = pa.array([datetime(2010, 1, 1), datetime(2015, 1, 1)]) >>> arr <pyarrow.lib.TimestampArray object at 0x12f37a020> [ 2010-01-01 00:00:00.000000, 2015-01-01 00:00:00.000000 ] >>> import pyarrow.compute as pc >>> pc.cast(arr, pa.string()) <pyarrow.lib.StringArray object at 0x12f37a0e0> [ "2010-01-01 00:00:00.000000", "2015-01-01 00:00:00.000000" ] ``` Note: in case of duration, the error should be raised.
2023-06-02T15:54:25Z
[]
[]
vega/altair
3,114
vega__altair-3114
[ "3112" ]
139c86a84197f8faba387dc1e9d41db1d5d0deea
diff --git a/altair/utils/_dfi_types.py b/altair/utils/_dfi_types.py new file mode 100644 --- /dev/null +++ b/altair/utils/_dfi_types.py @@ -0,0 +1,508 @@ +# DataFrame Interchange Protocol Types +# Copied from https://data-apis.org/dataframe-protocol/latest/API.html +# +# These classes are only for use in type signatures +from abc import ( + ABC, + abstractmethod, +) +import enum +from typing import ( + Any, + Dict, + Iterable, + Optional, + Sequence, + Tuple, + TypedDict, +) + + +class DlpackDeviceType(enum.IntEnum): + """Integer enum for device type codes matching DLPack.""" + + CPU = 1 + CUDA = 2 + CPU_PINNED = 3 + OPENCL = 4 + VULKAN = 7 + METAL = 8 + VPI = 9 + ROCM = 10 + + +class DtypeKind(enum.IntEnum): + """ + Integer enum for data types. + + Attributes + ---------- + INT : int + Matches to signed integer data type. + UINT : int + Matches to unsigned integer data type. + FLOAT : int + Matches to floating point data type. + BOOL : int + Matches to boolean data type. + STRING : int + Matches to string data type (UTF-8 encoded). + DATETIME : int + Matches to datetime data type. + CATEGORICAL : int + Matches to categorical data type. + """ + + INT = 0 + UINT = 1 + FLOAT = 2 + BOOL = 20 + STRING = 21 # UTF-8 + DATETIME = 22 + CATEGORICAL = 23 + + +Dtype = Tuple[DtypeKind, int, str, str] # see Column.dtype + + +class ColumnNullType(enum.IntEnum): + """ + Integer enum for null type representation. + + Attributes + ---------- + NON_NULLABLE : int + Non-nullable column. + USE_NAN : int + Use explicit float NaN value. + USE_SENTINEL : int + Sentinel value besides NaN. + USE_BITMASK : int + The bit is set/unset representing a null on a certain position. + USE_BYTEMASK : int + The byte is set/unset representing a null on a certain position. + """ + + NON_NULLABLE = 0 + USE_NAN = 1 + USE_SENTINEL = 2 + USE_BITMASK = 3 + USE_BYTEMASK = 4 + + +class ColumnBuffers(TypedDict): + # first element is a buffer containing the column data; + # second element is the data buffer's associated dtype + data: Tuple["Buffer", Dtype] + + # first element is a buffer containing mask values indicating missing data; + # second element is the mask value buffer's associated dtype. + # None if the null representation is not a bit or byte mask + validity: Optional[Tuple["Buffer", Dtype]] + + # first element is a buffer containing the offset values for + # variable-size binary data (e.g., variable-length strings); + # second element is the offsets buffer's associated dtype. + # None if the data buffer does not have an associated offsets buffer + offsets: Optional[Tuple["Buffer", Dtype]] + + +class CategoricalDescription(TypedDict): + # whether the ordering of dictionary indices is semantically meaningful + is_ordered: bool + # whether a dictionary-style mapping of categorical values to other objects exists + is_dictionary: bool + # Python-level only (e.g. ``{int: str}``). + # None if not a dictionary-style categorical. + categories: "Optional[Column]" + + +class Buffer(ABC): + """ + Data in the buffer is guaranteed to be contiguous in memory. + + Note that there is no dtype attribute present, a buffer can be thought of + as simply a block of memory. However, if the column that the buffer is + attached to has a dtype that's supported by DLPack and ``__dlpack__`` is + implemented, then that dtype information will be contained in the return + value from ``__dlpack__``. + + This distinction is useful to support both data exchange via DLPack on a + buffer and (b) dtypes like variable-length strings which do not have a + fixed number of bytes per element. + """ + + @property + @abstractmethod + def bufsize(self) -> int: + """ + Buffer size in bytes. + """ + pass + + @property + @abstractmethod + def ptr(self) -> int: + """ + Pointer to start of the buffer as an integer. + """ + pass + + @abstractmethod + def __dlpack__(self): + """ + Produce DLPack capsule (see array API standard). + + Raises: + + - TypeError : if the buffer contains unsupported dtypes. + - NotImplementedError : if DLPack support is not implemented + + Useful to have to connect to array libraries. Support optional because + it's not completely trivial to implement for a Python-only library. + """ + raise NotImplementedError("__dlpack__") + + @abstractmethod + def __dlpack_device__(self) -> Tuple[DlpackDeviceType, Optional[int]]: + """ + Device type and device ID for where the data in the buffer resides. + Uses device type codes matching DLPack. + Note: must be implemented even if ``__dlpack__`` is not. + """ + pass + + +class Column(ABC): + """ + A column object, with only the methods and properties required by the + interchange protocol defined. + + A column can contain one or more chunks. Each chunk can contain up to three + buffers - a data buffer, a mask buffer (depending on null representation), + and an offsets buffer (if variable-size binary; e.g., variable-length + strings). + + TBD: Arrow has a separate "null" dtype, and has no separate mask concept. + Instead, it seems to use "children" for both columns with a bit mask, + and for nested dtypes. Unclear whether this is elegant or confusing. + This design requires checking the null representation explicitly. + + The Arrow design requires checking: + 1. the ARROW_FLAG_NULLABLE (for sentinel values) + 2. if a column has two children, combined with one of those children + having a null dtype. + + Making the mask concept explicit seems useful. One null dtype would + not be enough to cover both bit and byte masks, so that would mean + even more checking if we did it the Arrow way. + + TBD: there's also the "chunk" concept here, which is implicit in Arrow as + multiple buffers per array (= column here). Semantically it may make + sense to have both: chunks were meant for example for lazy evaluation + of data which doesn't fit in memory, while multiple buffers per column + could also come from doing a selection operation on a single + contiguous buffer. + + Given these concepts, one would expect chunks to be all of the same + size (say a 10,000 row dataframe could have 10 chunks of 1,000 rows), + while multiple buffers could have data-dependent lengths. Not an issue + in pandas if one column is backed by a single NumPy array, but in + Arrow it seems possible. + Are multiple chunks *and* multiple buffers per column necessary for + the purposes of this interchange protocol, or must producers either + reuse the chunk concept for this or copy the data? + + Note: this Column object can only be produced by ``__dataframe__``, so + doesn't need its own version or ``__column__`` protocol. + """ + + @abstractmethod + def size(self) -> int: + """ + Size of the column, in elements. + + Corresponds to DataFrame.num_rows() if column is a single chunk; + equal to size of this current chunk otherwise. + + Is a method rather than a property because it may cause a (potentially + expensive) computation for some dataframe implementations. + """ + pass + + @property + @abstractmethod + def offset(self) -> int: + """ + Offset of first element. + + May be > 0 if using chunks; for example for a column with N chunks of + equal size M (only the last chunk may be shorter), + ``offset = n * M``, ``n = 0 .. N-1``. + """ + pass + + @property + @abstractmethod + def dtype(self) -> Dtype: + """ + Dtype description as a tuple ``(kind, bit-width, format string, endianness)``. + + Bit-width : the number of bits as an integer + Format string : data type description format string in Apache Arrow C + Data Interface format. + Endianness : current only native endianness (``=``) is supported + + Notes: + - Kind specifiers are aligned with DLPack where possible (hence the + jump to 20, leave enough room for future extension) + - Masks must be specified as boolean with either bit width 1 (for bit + masks) or 8 (for byte masks). + - Dtype width in bits was preferred over bytes + - Endianness isn't too useful, but included now in case in the future + we need to support non-native endianness + - Went with Apache Arrow format strings over NumPy format strings + because they're more complete from a dataframe perspective + - Format strings are mostly useful for datetime specification, and + for categoricals. + - For categoricals, the format string describes the type of the + categorical in the data buffer. In case of a separate encoding of + the categorical (e.g. an integer to string mapping), this can + be derived from ``self.describe_categorical``. + - Data types not included: complex, Arrow-style null, binary, decimal, + and nested (list, struct, map, union) dtypes. + """ + pass + + @property + @abstractmethod + def describe_categorical(self) -> CategoricalDescription: + """ + If the dtype is categorical, there are two options: + - There are only values in the data buffer. + - There is a separate non-categorical Column encoding categorical values. + + Raises TypeError if the dtype is not categorical + + Returns the dictionary with description on how to interpret the data buffer: + - "is_ordered" : bool, whether the ordering of dictionary indices is + semantically meaningful. + - "is_dictionary" : bool, whether a mapping of + categorical values to other objects exists + - "categories" : Column representing the (implicit) mapping of indices to + category values (e.g. an array of cat1, cat2, ...). + None if not a dictionary-style categorical. + + TBD: are there any other in-memory representations that are needed? + """ + pass + + @property + @abstractmethod + def describe_null(self) -> Tuple[ColumnNullType, Any]: + """ + Return the missing value (or "null") representation the column dtype + uses, as a tuple ``(kind, value)``. + + Value : if kind is "sentinel value", the actual value. If kind is a bit + mask or a byte mask, the value (0 or 1) indicating a missing value. None + otherwise. + """ + pass + + @property + @abstractmethod + def null_count(self) -> Optional[int]: + """ + Number of null elements, if known. + + Note: Arrow uses -1 to indicate "unknown", but None seems cleaner. + """ + pass + + @property + @abstractmethod + def metadata(self) -> Dict[str, Any]: + """ + The metadata for the column. See `DataFrame.metadata` for more details. + """ + pass + + @abstractmethod + def num_chunks(self) -> int: + """ + Return the number of chunks the column consists of. + """ + pass + + @abstractmethod + def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable["Column"]: + """ + Return an iterator yielding the chunks. + + See `DataFrame.get_chunks` for details on ``n_chunks``. + """ + pass + + @abstractmethod + def get_buffers(self) -> ColumnBuffers: + """ + Return a dictionary containing the underlying buffers. + + The returned dictionary has the following contents: + + - "data": a two-element tuple whose first element is a buffer + containing the data and whose second element is the data + buffer's associated dtype. + - "validity": a two-element tuple whose first element is a buffer + containing mask values indicating missing data and + whose second element is the mask value buffer's + associated dtype. None if the null representation is + not a bit or byte mask. + - "offsets": a two-element tuple whose first element is a buffer + containing the offset values for variable-size binary + data (e.g., variable-length strings) and whose second + element is the offsets buffer's associated dtype. None + if the data buffer does not have an associated offsets + buffer. + """ + pass + + +# def get_children(self) -> Iterable[Column]: +# """ +# Children columns underneath the column, each object in this iterator +# must adhere to the column specification. +# """ +# pass + + +class DataFrame(ABC): + """ + A data frame class, with only the methods required by the interchange + protocol defined. + + A "data frame" represents an ordered collection of named columns. + A column's "name" must be a unique string. + Columns may be accessed by name or by position. + + This could be a public data frame class, or an object with the methods and + attributes defined on this DataFrame class could be returned from the + ``__dataframe__`` method of a public data frame class in a library adhering + to the dataframe interchange protocol specification. + """ + + version = 0 # version of the protocol + + @abstractmethod + def __dataframe__( + self, nan_as_null: bool = False, allow_copy: bool = True + ) -> "DataFrame": + """ + Construct a new exchange object, potentially changing the parameters. + + ``nan_as_null`` is a keyword intended for the consumer to tell the + producer to overwrite null values in the data with ``NaN``. + It is intended for cases where the consumer does not support the bit + mask or byte mask that is the producer's native representation. + ``allow_copy`` is a keyword that defines whether or not the library is + allowed to make a copy of the data. For example, copying data would be + necessary if a library supports strided buffers, given that this protocol + specifies contiguous buffers. + """ + pass + + @property + @abstractmethod + def metadata(self) -> Dict[str, Any]: + """ + The metadata for the data frame, as a dictionary with string keys. The + contents of `metadata` may be anything, they are meant for a library + to store information that it needs to, e.g., roundtrip losslessly or + for two implementations to share data that is not (yet) part of the + interchange protocol specification. For avoiding collisions with other + entries, please add name the keys with the name of the library + followed by a period and the desired name, e.g, ``pandas.indexcol``. + """ + pass + + @abstractmethod + def num_columns(self) -> int: + """ + Return the number of columns in the DataFrame. + """ + pass + + @abstractmethod + def num_rows(self) -> Optional[int]: + # TODO: not happy with Optional, but need to flag it may be expensive + # why include it if it may be None - what do we expect consumers + # to do here? + """ + Return the number of rows in the DataFrame, if available. + """ + pass + + @abstractmethod + def num_chunks(self) -> int: + """ + Return the number of chunks the DataFrame consists of. + """ + pass + + @abstractmethod + def column_names(self) -> Iterable[str]: + """ + Return an iterator yielding the column names. + """ + pass + + @abstractmethod + def get_column(self, i: int) -> Column: + """ + Return the column at the indicated position. + """ + pass + + @abstractmethod + def get_column_by_name(self, name: str) -> Column: + """ + Return the column whose name is the indicated name. + """ + pass + + @abstractmethod + def get_columns(self) -> Iterable[Column]: + """ + Return an iterator yielding the columns. + """ + pass + + @abstractmethod + def select_columns(self, indices: Sequence[int]) -> "DataFrame": + """ + Create a new DataFrame by selecting a subset of columns by index. + """ + pass + + @abstractmethod + def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame": + """ + Create a new DataFrame by selecting a subset of columns by name. + """ + pass + + @abstractmethod + def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable["DataFrame"]: + """ + Return an iterator yielding the chunks. + + By default (None), yields the chunks that the data is stored as by the + producer. If given, ``n_chunks`` must be a multiple of + ``self.num_chunks()``, meaning the producer must subdivide each chunk + before yielding it. + + Note that the producer must ensure that all columns are chunked the + same way. + """ + pass diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -15,8 +15,10 @@ import jsonschema import pandas as pd import numpy as np +from pandas.core.interchange.dataframe_protocol import Column as PandasColumn from altair.utils.schemapi import SchemaBase +from altair.utils._dfi_types import Column, DtypeKind, DataFrame as DfiDataFrame if sys.version_info >= (3, 10): from typing import ParamSpec @@ -36,7 +38,7 @@ class _DataFrameLike(Protocol): - def __dataframe__(self, *args, **kwargs): + def __dataframe__(self, *args, **kwargs) -> DfiDataFrame: ... @@ -436,7 +438,7 @@ def sanitize_arrow_table(pa_table): def parse_shorthand( shorthand: Union[Dict[str, Any], str], - data: Optional[pd.DataFrame] = None, + data: Optional[Union[pd.DataFrame, _DataFrameLike]] = None, parse_aggregates: bool = True, parse_window_ops: bool = False, parse_timeunits: bool = True, @@ -516,6 +518,8 @@ def parse_shorthand( >>> parse_shorthand('count()', data) == {'aggregate': 'count', 'type': 'quantitative'} True """ + from altair.utils.data import pyarrow_available + if not shorthand: return {} @@ -574,14 +578,29 @@ def parse_shorthand( attrs["type"] = "temporal" # if data is specified and type is not, infer type from data - if isinstance(data, pd.DataFrame) and "type" not in attrs: - # Remove escape sequences so that types can be inferred for columns with special characters - if "field" in attrs and attrs["field"].replace("\\", "") in data.columns: - attrs["type"] = infer_vegalite_type(data[attrs["field"].replace("\\", "")]) - # ordered categorical dataframe columns return the type and sort order as a tuple - if isinstance(attrs["type"], tuple): - attrs["sort"] = attrs["type"][1] - attrs["type"] = attrs["type"][0] + if "type" not in attrs: + if pyarrow_available() and data is not None and hasattr(data, "__dataframe__"): + dfi = data.__dataframe__() + if "field" in attrs: + unescaped_field = attrs["field"].replace("\\", "") + if unescaped_field in dfi.column_names(): + column = dfi.get_column_by_name(unescaped_field) + attrs["type"] = infer_vegalite_type_for_dfi_column(column) + if isinstance(attrs["type"], tuple): + attrs["sort"] = attrs["type"][1] + attrs["type"] = attrs["type"][0] + elif isinstance(data, pd.DataFrame): + # Fallback if pyarrow is not installed or if pandas is older than 1.5 + # + # Remove escape sequences so that types can be inferred for columns with special characters + if "field" in attrs and attrs["field"].replace("\\", "") in data.columns: + attrs["type"] = infer_vegalite_type( + data[attrs["field"].replace("\\", "")] + ) + # ordered categorical dataframe columns return the type and sort order as a tuple + if isinstance(attrs["type"], tuple): + attrs["sort"] = attrs["type"][1] + attrs["type"] = attrs["type"][0] # If an unescaped colon is still present, it's often due to an incorrect data type specification # but could also be due to using a column name with ":" in it. @@ -602,6 +621,43 @@ def parse_shorthand( return attrs +def infer_vegalite_type_for_dfi_column( + column: Union[Column, PandasColumn], +) -> Union[_InferredVegaLiteType, Tuple[_InferredVegaLiteType, list]]: + from pyarrow.interchange.from_dataframe import column_to_array + + try: + kind = column.dtype[0] + except NotImplementedError as e: + # Edge case hack: + # dtype access fails for pandas column with datetime64[ns, UTC] type, + # but all we need to know is that its temporal, so check the + # error message for the presence of datetime64. + # + # See https://github.com/pandas-dev/pandas/issues/54239 + if "datetime64" in e.args[0]: + return "temporal" + raise e + + if ( + kind == DtypeKind.CATEGORICAL + and column.describe_categorical["is_ordered"] + and column.describe_categorical["categories"] is not None + ): + # Treat ordered categorical column as Vega-Lite ordinal + categories_column = column.describe_categorical["categories"] + categories_array = column_to_array(categories_column) + return "ordinal", categories_array.to_pylist() + if kind in (DtypeKind.STRING, DtypeKind.CATEGORICAL, DtypeKind.BOOL): + return "nominal" + elif kind in (DtypeKind.INT, DtypeKind.UINT, DtypeKind.FLOAT): + return "quantitative" + elif kind == DtypeKind.DATETIME: + return "temporal" + else: + raise ValueError(f"Unexpected DtypeKind: {kind}") + + def use_signature(Obj: Callable[_P, Any]): """Apply call signature and documentation of Obj to the decorated method""" diff --git a/altair/utils/data.py b/altair/utils/data.py --- a/altair/utils/data.py +++ b/altair/utils/data.py @@ -368,3 +368,11 @@ def import_pyarrow_interchange() -> ModuleType: "The installed version of 'pyarrow' does not meet the minimum requirement of version 11.0.0. " "Please update 'pyarrow' to use the DataFrame Interchange Protocol." ) from err + + +def pyarrow_available() -> bool: + try: + import_pyarrow_interchange() + return True + except ImportError: + return False
diff --git a/tests/test_transformed_data.py b/tests/test_transformed_data.py --- a/tests/test_transformed_data.py +++ b/tests/test_transformed_data.py @@ -5,7 +5,13 @@ import pkgutil import pytest +try: + import vegafusion as vf # type: ignore +except ImportError: + vf = None + [email protected](vf is None, reason="vegafusion not installed") # fmt: off @pytest.mark.parametrize("filename,rows,cols", [ ("annual_weather_heatmap.py", 366, ["monthdate_date_end", "max_temp_max"]), @@ -72,6 +78,7 @@ def test_primitive_chart_examples(filename, rows, cols, to_reconstruct): assert set(cols).issubset(set(df.columns)) [email protected](vf is None, reason="vegafusion not installed") # fmt: off @pytest.mark.parametrize("filename,all_rows,all_cols", [ ("errorbars_with_std.py", [10, 10], [["upper_yield"], ["extent_yield"]]), @@ -124,6 +131,7 @@ def test_compound_chart_examples(filename, all_rows, all_cols, to_reconstruct): assert set(cols).issubset(set(df.columns)) [email protected](vf is None, reason="vegafusion not installed") @pytest.mark.parametrize("to_reconstruct", [True, False]) def test_transformed_data_exclude(to_reconstruct): source = data.wheat() diff --git a/tests/utils/test_dataframe_interchange.py b/tests/utils/test_dataframe_interchange.py --- a/tests/utils/test_dataframe_interchange.py +++ b/tests/utils/test_dataframe_interchange.py @@ -1,10 +1,14 @@ from datetime import datetime -import pyarrow as pa import pandas as pd import pytest import sys import os +try: + import pyarrow as pa +except ImportError: + pa = None + from altair.utils.data import to_values @@ -25,6 +29,7 @@ def windows_has_tzdata(): sys.platform == "win32" and not windows_has_tzdata(), reason="Timezone database is not installed on Windows", ) [email protected](pa is None, reason="pyarrow not installed") def test_arrow_timestamp_conversion(): """Test that arrow timestamp values are converted to ISO-8601 strings""" data = { @@ -44,6 +49,7 @@ def test_arrow_timestamp_conversion(): assert values == expected_values [email protected](pa is None, reason="pyarrow not installed") def test_duration_raises(): td = pd.timedelta_range(0, periods=3, freq="h") df = pd.DataFrame(td).reset_index() diff --git a/tests/utils/test_mimebundle.py b/tests/utils/test_mimebundle.py --- a/tests/utils/test_mimebundle.py +++ b/tests/utils/test_mimebundle.py @@ -14,6 +14,11 @@ except ImportError: vlc = None +try: + import vegafusion as vf # type: ignore +except ImportError: + vf = None + @pytest.fixture def vegalite_spec(): @@ -242,6 +247,7 @@ def check_pre_transformed_vega_spec(vega_spec): assert len(data_0.get("transform", [])) == 0 [email protected](vf is None, reason="vegafusion is not installed") def test_vegafusion_spec_to_vega_mime_bundle(vegalite_spec): with alt.data_transformers.enable("vegafusion"): bundle = spec_to_mimebundle( @@ -254,6 +260,7 @@ def test_vegafusion_spec_to_vega_mime_bundle(vegalite_spec): check_pre_transformed_vega_spec(vega_spec) [email protected](vf is None, reason="vegafusion is not installed") def test_vegafusion_chart_to_vega_mime_bundle(vegalite_spec): chart = alt.Chart.from_dict(vegalite_spec) with alt.data_transformers.enable("vegafusion"), alt.renderers.enable("json"):
Support for type inference of dataframes using the DataFrame Interchange Protocol As was was raised in https://github.com/altair-viz/altair/issues/3109, the DataFrame Interchange Protocol is still experimental and it currently lacks features as type inference. The current type inference for pandas dataframes can not be used for all dataframes (that are parsed through the dataframe interchange protocol). Altair has adopted pyarrow for support of the DataFrame Interchange Protocol, so there will be a need to infer [these pyarrow datatypes](https://arrow.apache.org/docs/python/api/datatypes.html) to the [available ](https://altair-viz.github.io/user_guide/encodings/index.html#encoding-data-types) encoding data types of Altair. The current implementation of type inference for columns in Pandas DataFrames happens around [here](https://github.com/altair-viz/altair/blob/master/altair/utils/core.py#L577), which calls this [`infer_vegalite_type`](https://github.com/altair-viz/altair/blob/master/altair/utils/core.py#L204) function. This function needs expansion. Initially it is probably best to do it side-by-side so we keep the current implementation for pandas dataframes and a new implementation for dataframes that are parsed through the DataFrame Interchange Protocol. Some example data of a pyarrow table that can be used during development of this feature request: ```python import pyarrow as pa from datetime import datetime dt_quantitiative = pa.array([2, 4, 5]) dt_nominal = pa.array(["flamingo", "horse", "centipede"]) dt_temporal = pa.array([datetime(2004, 8, 1), datetime(2004, 9, 1), datetime(2004, 10, 1)]) dt_categorical = pa.array(['A', 'B', 'A'], pa.string()).dictionary_encode() names = ["q", "n", "t", "c"] pa_table = pa.Table.from_arrays([dt_quantitiative, dt_nominal, dt_temporal, dt_categorical], names=names) for col in pa_table.columns: print(col.type) ``` > ```cmd > int64 > string > timestamp[us] > dictionary<values=string, indices=int32, ordered=0> > ```
One thing to be careful about here. I don't want to force the evaluation of lazy dataframe-like objects just to get the schema. For example, we don't want the trigger a full Ibis query just to get the schema info out. For plain Altair, this isn't a big deal as long as we convert to Arrow at the same time as extracting the schema info. But for the "vegafusion" data transformer to have the chance to push computation down to the native data structure (e.g. into Ibis eventually) we don't want to convert the whole thing to arrow up front. @jcrist, do you know if there's a way to get schema info from the DataFrame interchange protocol without triggering a Ibis query? If not, we might need to add some specialized schema extraction logic (which doesn't trigger full evaluation) for the backends that VegaFusion supports. > @jcrist, do you know if there's a way to get schema info from the DataFrame interchange protocol without triggering a Ibis query? Not with the way we currently implement the `__dataframe__` protocol. With a small-ish amount of work we could change that though, if given a motivating use case (e.g. `altair` making use of those APIs). In that case we'd implement our own shim layer to make extracting certain query information possible without executing the query (schema, column names, ...). If you think this is the best way forward I'd be happy to add this feature. If vegafusion has its own abstract layer though (as written about in https://github.com/hex-inc/vegafusion/discussions/355), wouldn't you immediately convert to that wrapper class and use the generic apis described there instead? Or does altair still need access to the schema separately? > If vegafusion has its own abstract layer though (as written about in https://github.com/hex-inc/vegafusion/discussions/355), wouldn't you immediately convert to that wrapper class and use the generic apis described there instead? Or does altair still need access to the schema separately? VegaFusion will always be optional for Altair, so we do need a way to support this in Altair core. I think the ideal situation is that core Altair only knows about the `__dataframe__` protocol. And all of the specialization logic (e.g. automatically wrapping an Ibis table in a VegaFusion `IbisDataset`) is in VegaFusion. I need to read the spec in more detail, do you know of any examples of using `__dataframe__` to pull out column type info? Or is the shim approach you mentioned something separate from the spec? If there's a path to libraries providing the type through `__dataframe__` without materialization, I'd be very interested in updating Altair to use this approach for schema inference. Oh, never mind. Just playing with pandas and pyarrow this does look straightforward from the Altair side: ```python import pandas as pd df = pd.DataFrame({"a": [1, 2, 3], "b": ["A", "BB", "CCC"]}) dfi = df.__dataframe__() dfi.column_names() ``` ``` Index(['a', 'b'], dtype='object') ``` ```python dt = dfi.get_column_by_name('b').dtype dt[0].name ``` ``` STRING ``` @mattijn, it looks like we don't need pyarrow to use the `__dataframe__` protocol to get the column type info. So we may be able to use this approach all the time (at least with new enough pandas versions, I haven't looked into when it was added to pandas). I'll give this a try soon. Nice! Good find👍 > I need to read the spec in more detail, do you know of any examples of using __dataframe__ to pull out column type info? Or is the shim approach you mentioned something separate from the spec? The spec makes this possible (as you found in a later comment), but I don't know of any libraries _currently_ consuming this in a way where making this lazy on ibis's side would be useful. The `altair` use case here would be the first one. If y'all want to go down this path I'll push up a patch to `ibis` so that calling these methods won't require executing the query.
2023-07-19T23:14:17Z
[]
[]
vega/altair
3,118
vega__altair-3118
[ "3097" ]
935e4e84828860e91c3f67999353ee290c2b17c0
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -2,6 +2,7 @@ # tools/generate_schema_wrapper.py. Do not modify directly. import collections import contextlib +import copy import inspect import json import sys @@ -23,13 +24,19 @@ TypeVar, ) from itertools import zip_longest +from importlib.metadata import version as importlib_version +from typing import Final import jsonschema import jsonschema.exceptions import jsonschema.validators import numpy as np import pandas as pd +from packaging.version import Version +# This leads to circular imports with the vegalite module. Currently, this works +# but be aware that when you access it in this script, the vegalite module might +# not yet be fully instantiated in case your code is being executed during import time from altair import vegalite if sys.version_info >= (3, 11): @@ -42,6 +49,20 @@ ValidationErrorList = List[jsonschema.exceptions.ValidationError] GroupedValidationErrors = Dict[str, ValidationErrorList] +# This URI is arbitrary and could be anything else. It just cannot be an empty +# string as we need to reference the schema registered in +# the referencing.Registry. +_VEGA_LITE_ROOT_URI: Final = "urn:vega-lite-schema" + +# Ideally, jsonschema specification would be parsed from the current Vega-Lite +# schema instead of being hardcoded here as a default value. +# However, due to circular imports between this module and the altair.vegalite +# modules, this information is not yet available at this point as altair.vegalite +# is only partially loaded. The draft version which is used is unlikely to +# change often so it's ok to keep this. There is also a test which validates +# that this value is always the same as in the Vega-Lite schema. +_DEFAULT_JSON_SCHEMA_DRAFT_URL: Final = "http://json-schema.org/draft-07/schema#" + # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for @@ -149,22 +170,102 @@ def _get_errors_from_spec( # e.g. '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef, # (Gradient|string|null)>' would be a valid $ref in a Vega-Lite schema but # it is not a valid URI reference due to the characters such as '<'. - if rootschema is not None: - validator_cls = jsonschema.validators.validator_for(rootschema) - resolver = jsonschema.RefResolver.from_schema(rootschema) - else: - validator_cls = jsonschema.validators.validator_for(schema) - # No resolver is necessary if the schema is already the full schema - resolver = None - validator_kwargs = {"resolver": resolver} + json_schema_draft_url = _get_json_schema_draft_url(rootschema or schema) + validator_cls = jsonschema.validators.validator_for( + {"$schema": json_schema_draft_url} + ) + validator_kwargs: Dict[str, Any] = {} if hasattr(validator_cls, "FORMAT_CHECKER"): validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER + + if _use_referencing_library(): + schema = _prepare_references_in_schema(schema) + validator_kwargs["registry"] = _get_referencing_registry( + rootschema or schema, json_schema_draft_url + ) + + else: + # No resolver is necessary if the schema is already the full schema + validator_kwargs["resolver"] = ( + jsonschema.RefResolver.from_schema(rootschema) + if rootschema is not None + else None + ) + validator = validator_cls(schema, **validator_kwargs) errors = list(validator.iter_errors(spec)) return errors +def _get_json_schema_draft_url(schema: dict) -> str: + return schema.get("$schema", _DEFAULT_JSON_SCHEMA_DRAFT_URL) + + +def _use_referencing_library() -> bool: + """In version 4.18.0, the jsonschema package deprecated RefResolver in + favor of the referencing library.""" + jsonschema_version_str = importlib_version("jsonschema") + return Version(jsonschema_version_str) >= Version("4.18") + + +def _prepare_references_in_schema(schema: Dict[str, Any]) -> Dict[str, Any]: + # Create a copy so that $ref is not modified in the original schema in case + # that it would still reference a dictionary which might be attached to + # an Altair class _schema attribute + schema = copy.deepcopy(schema) + + def _prepare_refs(d: Dict[str, Any]) -> Dict[str, Any]: + """Add _VEGA_LITE_ROOT_URI in front of all $ref values. This function + recursively iterates through the whole dictionary.""" + for key, value in d.items(): + if key == "$ref": + d[key] = _VEGA_LITE_ROOT_URI + d[key] + else: + # $ref values can only be nested in dictionaries or lists + # as the passed in `d` dictionary comes from the Vega-Lite json schema + # and in json we only have arrays (-> lists in Python) and objects + # (-> dictionaries in Python) which we need to iterate through. + if isinstance(value, dict): + d[key] = _prepare_refs(value) + elif isinstance(value, list): + prepared_values = [] + for v in value: + if isinstance(v, dict): + v = _prepare_refs(v) + prepared_values.append(v) + d[key] = prepared_values + return d + + schema = _prepare_refs(schema) + return schema + + +# We do not annotate the return value here as the referencing library is not always +# available and this function is only executed in those cases. +def _get_referencing_registry( + rootschema: Dict[str, Any], json_schema_draft_url: Optional[str] = None +): + # Referencing is a dependency of newer jsonschema versions, starting with the + # version that is specified in _use_referencing_library and we therefore + # can expect that it is installed if the function returns True. + # We ignore 'import' mypy errors which happen when the referencing library + # is not installed. That's ok as in these cases this function is not called. + # We also have to ignore 'unused-ignore' errors as mypy raises those in case + # referencing is installed. + import referencing # type: ignore[import,unused-ignore] + import referencing.jsonschema # type: ignore[import,unused-ignore] + + if json_schema_draft_url is None: + json_schema_draft_url = _get_json_schema_draft_url(rootschema) + + specification = referencing.jsonschema.specification_with(json_schema_draft_url) + resource = specification.create_resource(rootschema) + return referencing.Registry().with_resource( + uri=_VEGA_LITE_ROOT_URI, resource=resource + ) + + def _json_path(err: jsonschema.exceptions.ValidationError) -> str: """Drop in replacement for the .json_path property of the jsonschema ValidationError class, which is not available as property for @@ -384,12 +485,27 @@ def _todict(obj: Any, context: Optional[Dict[str, Any]]) -> Any: return obj -def _resolve_references(schema: dict, root: Optional[dict] = None) -> dict: - """Resolve schema references.""" - resolver = jsonschema.RefResolver.from_schema(root or schema) - while "$ref" in schema: - with resolver.resolving(schema["$ref"]) as resolved: - schema = resolved +def _resolve_references( + schema: Dict[str, Any], rootschema: Optional[Dict[str, Any]] = None +) -> Dict[str, Any]: + """Resolve schema references until there is no $ref anymore + in the top-level of the dictionary. + """ + if _use_referencing_library(): + registry = _get_referencing_registry(rootschema or schema) + # Using a different variable name to show that this is not the + # jsonschema.RefResolver but instead a Resolver from the referencing + # library + referencing_resolver = registry.resolver() + while "$ref" in schema: + schema = referencing_resolver.lookup( + _VEGA_LITE_ROOT_URI + schema["$ref"] + ).contents + else: + resolver = jsonschema.RefResolver.from_schema(rootschema or schema) + while "$ref" in schema: + with resolver.resolving(schema["$ref"]) as resolved: + schema = resolved return schema @@ -1010,7 +1126,7 @@ def resolve_references(cls, schema: Optional[dict] = None) -> dict: assert schema_to_pass is not None return _resolve_references( schema=schema_to_pass, - root=(cls._rootschema or cls._schema or schema), + rootschema=(cls._rootschema or cls._schema or schema), ) @classmethod diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -1,5 +1,6 @@ import collections import contextlib +import copy import inspect import json import sys @@ -21,13 +22,19 @@ TypeVar, ) from itertools import zip_longest +from importlib.metadata import version as importlib_version +from typing import Final import jsonschema import jsonschema.exceptions import jsonschema.validators import numpy as np import pandas as pd +from packaging.version import Version +# This leads to circular imports with the vegalite module. Currently, this works +# but be aware that when you access it in this script, the vegalite module might +# not yet be fully instantiated in case your code is being executed during import time from altair import vegalite if sys.version_info >= (3, 11): @@ -40,6 +47,20 @@ ValidationErrorList = List[jsonschema.exceptions.ValidationError] GroupedValidationErrors = Dict[str, ValidationErrorList] +# This URI is arbitrary and could be anything else. It just cannot be an empty +# string as we need to reference the schema registered in +# the referencing.Registry. +_VEGA_LITE_ROOT_URI: Final = "urn:vega-lite-schema" + +# Ideally, jsonschema specification would be parsed from the current Vega-Lite +# schema instead of being hardcoded here as a default value. +# However, due to circular imports between this module and the altair.vegalite +# modules, this information is not yet available at this point as altair.vegalite +# is only partially loaded. The draft version which is used is unlikely to +# change often so it's ok to keep this. There is also a test which validates +# that this value is always the same as in the Vega-Lite schema. +_DEFAULT_JSON_SCHEMA_DRAFT_URL: Final = "http://json-schema.org/draft-07/schema#" + # If DEBUG_MODE is True, then schema objects are converted to dict and # validated at creation time. This slows things down, particularly for @@ -147,22 +168,102 @@ def _get_errors_from_spec( # e.g. '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef, # (Gradient|string|null)>' would be a valid $ref in a Vega-Lite schema but # it is not a valid URI reference due to the characters such as '<'. - if rootschema is not None: - validator_cls = jsonschema.validators.validator_for(rootschema) - resolver = jsonschema.RefResolver.from_schema(rootschema) - else: - validator_cls = jsonschema.validators.validator_for(schema) - # No resolver is necessary if the schema is already the full schema - resolver = None - validator_kwargs = {"resolver": resolver} + json_schema_draft_url = _get_json_schema_draft_url(rootschema or schema) + validator_cls = jsonschema.validators.validator_for( + {"$schema": json_schema_draft_url} + ) + validator_kwargs: Dict[str, Any] = {} if hasattr(validator_cls, "FORMAT_CHECKER"): validator_kwargs["format_checker"] = validator_cls.FORMAT_CHECKER + + if _use_referencing_library(): + schema = _prepare_references_in_schema(schema) + validator_kwargs["registry"] = _get_referencing_registry( + rootschema or schema, json_schema_draft_url + ) + + else: + # No resolver is necessary if the schema is already the full schema + validator_kwargs["resolver"] = ( + jsonschema.RefResolver.from_schema(rootschema) + if rootschema is not None + else None + ) + validator = validator_cls(schema, **validator_kwargs) errors = list(validator.iter_errors(spec)) return errors +def _get_json_schema_draft_url(schema: dict) -> str: + return schema.get("$schema", _DEFAULT_JSON_SCHEMA_DRAFT_URL) + + +def _use_referencing_library() -> bool: + """In version 4.18.0, the jsonschema package deprecated RefResolver in + favor of the referencing library.""" + jsonschema_version_str = importlib_version("jsonschema") + return Version(jsonschema_version_str) >= Version("4.18") + + +def _prepare_references_in_schema(schema: Dict[str, Any]) -> Dict[str, Any]: + # Create a copy so that $ref is not modified in the original schema in case + # that it would still reference a dictionary which might be attached to + # an Altair class _schema attribute + schema = copy.deepcopy(schema) + + def _prepare_refs(d: Dict[str, Any]) -> Dict[str, Any]: + """Add _VEGA_LITE_ROOT_URI in front of all $ref values. This function + recursively iterates through the whole dictionary.""" + for key, value in d.items(): + if key == "$ref": + d[key] = _VEGA_LITE_ROOT_URI + d[key] + else: + # $ref values can only be nested in dictionaries or lists + # as the passed in `d` dictionary comes from the Vega-Lite json schema + # and in json we only have arrays (-> lists in Python) and objects + # (-> dictionaries in Python) which we need to iterate through. + if isinstance(value, dict): + d[key] = _prepare_refs(value) + elif isinstance(value, list): + prepared_values = [] + for v in value: + if isinstance(v, dict): + v = _prepare_refs(v) + prepared_values.append(v) + d[key] = prepared_values + return d + + schema = _prepare_refs(schema) + return schema + + +# We do not annotate the return value here as the referencing library is not always +# available and this function is only executed in those cases. +def _get_referencing_registry( + rootschema: Dict[str, Any], json_schema_draft_url: Optional[str] = None +): + # Referencing is a dependency of newer jsonschema versions, starting with the + # version that is specified in _use_referencing_library and we therefore + # can expect that it is installed if the function returns True. + # We ignore 'import' mypy errors which happen when the referencing library + # is not installed. That's ok as in these cases this function is not called. + # We also have to ignore 'unused-ignore' errors as mypy raises those in case + # referencing is installed. + import referencing # type: ignore[import,unused-ignore] + import referencing.jsonschema # type: ignore[import,unused-ignore] + + if json_schema_draft_url is None: + json_schema_draft_url = _get_json_schema_draft_url(rootschema) + + specification = referencing.jsonschema.specification_with(json_schema_draft_url) + resource = specification.create_resource(rootschema) + return referencing.Registry().with_resource( + uri=_VEGA_LITE_ROOT_URI, resource=resource + ) + + def _json_path(err: jsonschema.exceptions.ValidationError) -> str: """Drop in replacement for the .json_path property of the jsonschema ValidationError class, which is not available as property for @@ -382,12 +483,27 @@ def _todict(obj: Any, context: Optional[Dict[str, Any]]) -> Any: return obj -def _resolve_references(schema: dict, root: Optional[dict] = None) -> dict: - """Resolve schema references.""" - resolver = jsonschema.RefResolver.from_schema(root or schema) - while "$ref" in schema: - with resolver.resolving(schema["$ref"]) as resolved: - schema = resolved +def _resolve_references( + schema: Dict[str, Any], rootschema: Optional[Dict[str, Any]] = None +) -> Dict[str, Any]: + """Resolve schema references until there is no $ref anymore + in the top-level of the dictionary. + """ + if _use_referencing_library(): + registry = _get_referencing_registry(rootschema or schema) + # Using a different variable name to show that this is not the + # jsonschema.RefResolver but instead a Resolver from the referencing + # library + referencing_resolver = registry.resolver() + while "$ref" in schema: + schema = referencing_resolver.lookup( + _VEGA_LITE_ROOT_URI + schema["$ref"] + ).contents + else: + resolver = jsonschema.RefResolver.from_schema(rootschema or schema) + while "$ref" in schema: + with resolver.resolving(schema["$ref"]) as resolved: + schema = resolved return schema @@ -1008,7 +1124,7 @@ def resolve_references(cls, schema: Optional[dict] = None) -> dict: assert schema_to_pass is not None return _resolve_references( schema=schema_to_pass, - root=(cls._rootschema or cls._schema or schema), + rootschema=(cls._rootschema or cls._schema or schema), ) @classmethod diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -5,21 +5,12 @@ import textwrap import urllib -import jsonschema +from .schemapi import _resolve_references as resolve_references EXCLUDE_KEYS = ("definitions", "title", "description", "$schema", "id") -def resolve_references(schema, root=None): - """Resolve References within a JSON schema""" - resolver = jsonschema.RefResolver.from_schema(root or schema) - while "$ref" in schema: - with resolver.resolving(schema["$ref"]) as resolved: - schema = resolved - return schema - - def get_valid_identifier( prop, replacement_character="", allow_unicode=False, url_decode=True ):
diff --git a/tests/utils/test_core.py b/tests/utils/test_core.py --- a/tests/utils/test_core.py +++ b/tests/utils/test_core.py @@ -8,13 +8,16 @@ from altair.utils.core import parse_shorthand, update_nested, infer_encoding_types from altair.utils.core import infer_dtype +json_schema_specification = alt.load_schema()["$schema"] +json_schema_dict_str = f'{{"$schema": "{json_schema_specification}"}}' + try: import pyarrow as pa except ImportError: pa = None -FAKE_CHANNELS_MODULE = ''' +FAKE_CHANNELS_MODULE = f''' """Fake channels module for utility tests.""" from altair.utils import schemapi @@ -33,32 +36,32 @@ def __init__(self, value, **kwargs): class X(FieldChannel, schemapi.SchemaBase): - _schema = {} + _schema = {json_schema_dict_str} _encoding_name = "x" class XValue(ValueChannel, schemapi.SchemaBase): - _schema = {} + _schema = {json_schema_dict_str} _encoding_name = "x" class Y(FieldChannel, schemapi.SchemaBase): - _schema = {} + _schema = {json_schema_dict_str} _encoding_name = "y" class YValue(ValueChannel, schemapi.SchemaBase): - _schema = {} + _schema = {json_schema_dict_str} _encoding_name = "y" class StrokeWidth(FieldChannel, schemapi.SchemaBase): - _schema = {} + _schema = {json_schema_dict_str} _encoding_name = "strokeWidth" class StrokeWidthValue(ValueChannel, schemapi.SchemaBase): - _schema = {} + _schema = {json_schema_dict_str} _encoding_name = "strokeWidth" ''' diff --git a/tests/utils/test_schemapi.py b/tests/utils/test_schemapi.py --- a/tests/utils/test_schemapi.py +++ b/tests/utils/test_schemapi.py @@ -20,13 +20,24 @@ Undefined, _FromDict, SchemaValidationError, + _DEFAULT_JSON_SCHEMA_DRAFT_URL, ) -_JSONSCHEMA_DRAFT = load_schema()["$schema"] +_JSON_SCHEMA_DRAFT_URL = load_schema()["$schema"] # Make tests inherit from _TestSchema, so that when we test from_dict it won't # try to use SchemaBase objects defined elsewhere as wrappers. +def test_actual_json_schema_draft_is_same_as_hardcoded_default(): + # See comments next to definition of _DEFAULT_JSON_SCHEMA_DRAFT_URL + # for details why we need this test + assert _DEFAULT_JSON_SCHEMA_DRAFT_URL == _JSON_SCHEMA_DRAFT_URL, ( + "The default json schema URL, which is hardcoded," + + " is not the same as the one used in the Vega-Lite schema." + + " You need to update the default value." + ) + + class _TestSchema(SchemaBase): @classmethod def _default_wrapper_classes(cls): @@ -35,7 +46,7 @@ def _default_wrapper_classes(cls): class MySchema(_TestSchema): _schema = { - "$schema": _JSONSCHEMA_DRAFT, + "$schema": _JSON_SCHEMA_DRAFT_URL, "definitions": { "StringMapping": { "type": "object", @@ -72,7 +83,7 @@ class StringArray(_TestSchema): class Derived(_TestSchema): _schema = { - "$schema": _JSONSCHEMA_DRAFT, + "$schema": _JSON_SCHEMA_DRAFT_URL, "definitions": { "Foo": {"type": "object", "properties": {"d": {"type": "string"}}}, "Bar": {"type": "string", "enum": ["A", "B"]}, @@ -99,7 +110,7 @@ class Bar(_TestSchema): class SimpleUnion(_TestSchema): _schema = { - "$schema": _JSONSCHEMA_DRAFT, + "$schema": _JSON_SCHEMA_DRAFT_URL, "anyOf": [{"type": "integer"}, {"type": "string"}], } @@ -111,7 +122,7 @@ class DefinitionUnion(_TestSchema): class SimpleArray(_TestSchema): _schema = { - "$schema": _JSONSCHEMA_DRAFT, + "$schema": _JSON_SCHEMA_DRAFT_URL, "type": "array", "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, } @@ -119,7 +130,7 @@ class SimpleArray(_TestSchema): class InvalidProperties(_TestSchema): _schema = { - "$schema": _JSONSCHEMA_DRAFT, + "$schema": _JSON_SCHEMA_DRAFT_URL, "type": "object", "properties": {"for": {}, "as": {}, "vega-lite": {}, "$schema": {}}, }
Code path in utils emits `jsonschema` deprecation warning [jsonschema](https://pypi.org/project/jsonschema/) recently released a new version and introduced a new deprecation warning around `jsonschema.RefResolver` - this is utilized in `altair/utils/schemapi.py`. You can replicate with the following code: ```python import altair as alt alt.StandardType("...") ``` ``` /opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/site-packages/altair/vegalite/v4/schema/core.py:15771: in __init__ super(StandardType, self).__init__(*args) /opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/site-packages/altair/utils/schemapi.py:197: in __init__ self.to_dict(validate=True) /opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/site-packages/altair/utils/schemapi.py:358: in to_dict self.validate(result) /opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/site-packages/altair/utils/schemapi.py:462: in validate resolver = jsonschema.RefResolver.from_schema(cls._rootschema or cls._schema) /opt/hostedtoolcache/Python/3.8.17/x64/lib/python3.8/site-packages/jsonschema/__init__.py:42: in __getattr__ warnings.warn( E DeprecationWarning: jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need. ``` --- Please follow these steps to make it more efficient to solve your issue: - [x] Since Altair is a Python wrapper around the Vega-Lite visualization grammar, [most bugs should be reported directly to Vega-Lite](https://github.com/vega/vega-lite/issues). You can click the Action Button of your Altair chart and "Open in Vega Editor" to create a reproducible Vega-Lite example and see if you get the same error in the Vega Editor. - [x] Search for duplicate issues. - [x] Use the latest version of Altair. - [x] Describe how to reproduce the bug and include the full code and data to reproduce it, ideally using a sample data set from `vega_datasets`.
Thank you @cdkini for letting us know! I'll look into this. I've been looking into how we can replace `RefResolver` with the new `referencing` library, spending quite some time reading the `referencing` and `jsonschema` docs (including [Migrating from RefResolver](https://python-jsonschema.readthedocs.io/en/stable/referencing/#migrating-from-refresolver)) but I'm somehow stuck. @Julian if you have a few minutes I'd highly appreciate your input. To make it easier, I slimmed it down to a minimal example. # Setup ```python import altair as alt import jsonschema.validators import referencing # alt.load_schema returns the Vega-Lite schema as a dictionary. # You can also view it at https://vega.github.io/schema/vega-lite/v5.json rootschema = alt.load_schema() schema = {'$ref': '#/definitions/PositionFieldDef'} spec = {'field': 'x', 'type': 'temporal'} ``` # Our current approach (working) ```python validator_cls = jsonschema.validators.validator_for(rootschema) resolver = jsonschema.RefResolver.from_schema(rootschema) validator = validator_cls(schema, resolver=resolver) # This passes as expected validator.validate(spec) # This raises a ValidationError as expected: `Additional properties are not allowed ('test' was unexpected)` validator.validate({**spec, "test": 3}) ``` # Attempt to replace RefResolver with referencing library ```python resource = referencing.Resource.from_contents(rootschema) # The root schema does not have an ID and so I assumed that I can use "" but maybe this is # where I'm wrong? registry = referencing.Registry().with_resource(uri="", resource=resource) validator_cls = jsonschema.validators.validator_for(rootschema) validator = validator_cls(schema, registry=registry) # This gives me the traceback below validator.validate(spec) ``` ```python --------------------------------------------------------------------------- KeyError Traceback (most recent call last) File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/referencing/_core.py:186](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/referencing/_core.py:186), in Resource.pointer(self, pointer, resolver) 185 try: --> 186 contents = contents[segment] # type: ignore[reportUnknownArgumentType] # noqa: E501 187 except LookupError: KeyError: 'definitions' During handling of the above exception, another exception occurred: PointerToNowhere Traceback (most recent call last) File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:439](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:439), in create..Validator._validate_reference(self, ref, instance) 438 try: --> 439 resolved = self._resolver.lookup(ref) 440 except referencing.exceptions.Unresolvable as err: File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/referencing/_core.py:594](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/referencing/_core.py:594), in Resolver.lookup(self, ref) 593 resolver = self._evolve(registry=retrieved.registry, base_uri=uri) --> 594 return retrieved.value.pointer(pointer=fragment, resolver=resolver) 596 if fragment: File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/referencing/_core.py:188](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/referencing/_core.py:188), in Resource.pointer(self, pointer, resolver) 187 except LookupError: --> 188 raise exceptions.PointerToNowhere(ref=pointer, resource=self) 190 segments.append(segment) PointerToNowhere: '/definitions/PositionFieldDef' does not exist within {'$ref': '#/definitions/PositionFieldDef'} During handling of the above exception, another exception occurred: _WrappedReferencingError Traceback (most recent call last) Cell In[10], line 2 1 # Works as expected ----> 2 validator.validate(spec) File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:427](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:427), in create..Validator.validate(self, *args, **kwargs) 426 def validate(self, *args, **kwargs): --> 427 for error in self.iter_errors(*args, **kwargs): 428 raise error File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:361](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:361), in create..Validator.iter_errors(self, instance, _schema) 358 continue 360 errors = validator(self, v, instance, _schema) or () --> 361 for error in errors: 362 # set details if not already set by the called fn 363 error._set( 364 validator=k, 365 validator_value=v, (...) 368 type_checker=self.TYPE_CHECKER, 369 ) 370 if k not in {"if", "$ref"}: File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/_validators.py:284](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/_validators.py:284), in ref(validator, ref, instance, schema) 283 def ref(validator, ref, instance, schema): --> 284 yield from validator._validate_reference(ref=ref, instance=instance) File [~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:441](https://file+.vscode-resource.vscode-cdn.net/Users/stefanbinder/Library/CloudStorage/Dropbox/Programming/altair/~/Library/CloudStorage/Dropbox/Programming/altair/.venv/lib/python3.10/site-packages/jsonschema/validators.py:441), in create..Validator._validate_reference(self, ref, instance) 439 resolved = self._resolver.lookup(ref) 440 except referencing.exceptions.Unresolvable as err: --> 441 raise exceptions._WrappedReferencingError(err) 443 return self.descend( 444 instance, 445 resolved.contents, 446 resolver=resolved.resolver, 447 ) 448 else: _WrappedReferencingError: PointerToNowhere: '/definitions/PositionFieldDef' does not exist within {'$ref': '#/definitions/PositionFieldDef'} ``` # Where Altair currently uses RefResolver Just for reference: * https://github.com/altair-viz/altair/blob/b7ae4867a5c015a98a30cbe948d7ed35dad58ad1/altair/utils/schemapi.py#L118 * https://github.com/altair-viz/altair/blob/b7ae4867a5c015a98a30cbe948d7ed35dad58ad1/altair/utils/schemapi.py#L353 * https://github.com/altair-viz/altair/blob/b7ae4867a5c015a98a30cbe948d7ed35dad58ad1/tools/schemapi/utils.py#L16 Happy to have a look - will probably be Monday! TL;DR: Yes you should assign some "real" URI to the Vega Lite schema I think (probably the one that already is the URL where it lives), and then use that URI to refer to your subschemas. Using the existing pointers in the Vega schema might be enough there, I'll try to show an example below. Slightly less short: When you say "`#/foo/bar`" you are saying "in the current schema resource is a key called foo with a key called bar inside it" -- so if you have a schema saying `{"$ref": "#/foo/bar"}` that's saying "in this schema is a `foo` key" as above -- but of course that isn't true -- there's just one key in that schema. The fact that what you had previously worked was sort of an "abuse" of the empty string doing some special stuff inside `RefResolver` which happened to use `""` as some internal fallback URI if it couldn't come up with one inside your root schema (which was outside the spec and wouldn't work if you tried it in some other JSON Schema implementation) -- so the error is trying to tell you exactly the above (there's no `definitions` key in the schema you're calling `""`.) More specifically, some code that should do what your original code does: ```python import warnings with warnings.catch_warnings(): warnings.simplefilter("ignore") import altair as alt import jsonschema.validators import referencing rooturi = "https://vega.github.io/schema/vega-lite/v5.json" rootschema = alt.load_schema() schema = {'$ref': f"{rooturi}#/definitions/PositionFieldDef"} spec = {'field': 'x', 'type': 'temporal'} # It looks like you were previously picking a subschema of the "real" schema # that lives at this URL -- I'll point out you don't really need to do that at # this point, you should be able to take the "real" root schema as-is and use # fragments to reference inside of it. But I'm keeping things as-is in this # snippet, other than adding a URI -- you can of course also pick another URI, # like `urn:example:vega-lite-altair-schema` to refer to things! registry = referencing.Registry().with_contents([(rooturi, rootschema)]) validator_cls = jsonschema.validators.validator_for(rootschema) validator = validator_cls(schema, registry=registry) validator.validate(spec) validator.validate({**spec, "test": 3}) # gives your traceback as expected ``` Let me know if the above helps, and/or if you have suggestions. I can't commit fully to sending a PR making the changes to altair but I highly value the project so if there's help I can offer I can certainly say I'd like to help in any way I can, whether that's just a review of a PR, more comments, or sending a partial PR. Thank you @Julian, this is already very helpful and makes a lot more sense now, especially with the code example. I'm at the EuroPython conference for the rest of the week and will pick this up again next week. Thank you for the offer, I appreciate it! I think I can get a PR started but I'd reach out in case I have any follow-up questions.
2023-07-22T20:28:58Z
[]
[]
vega/altair
3,128
vega__altair-3128
[ "3127" ]
72a361c68731212d8aa042f4c73d5070aa110a9a
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -298,6 +298,13 @@ def sanitize_geo_interface(geo: MutableMapping) -> dict: return geo_dct +def numpy_is_subtype(dtype: Any, subtype: Any) -> bool: + try: + return np.issubdtype(dtype, subtype) + except (NotImplementedError, TypeError): + return False + + def sanitize_dataframe(df: pd.DataFrame) -> pd.DataFrame: # noqa: C901 """Sanitize a DataFrame to prepare it for serialization. @@ -339,26 +346,27 @@ def to_list_if_array(val): return val for col_name, dtype in df.dtypes.items(): - if str(dtype) == "category": + dtype_name = str(dtype) + if dtype_name == "category": # Work around bug in to_json for categorical types in older versions of pandas # https://github.com/pydata/pandas/issues/10778 # https://github.com/altair-viz/altair/pull/2170 col = df[col_name].astype(object) df[col_name] = col.where(col.notnull(), None) - elif str(dtype) == "string": + elif dtype_name == "string": # dedicated string datatype (since 1.0) # https://pandas.pydata.org/pandas-docs/version/1.0.0/whatsnew/v1.0.0.html#dedicated-string-data-type col = df[col_name].astype(object) df[col_name] = col.where(col.notnull(), None) - elif str(dtype) == "bool": + elif dtype_name == "bool": # convert numpy bools to objects; np.bool is not JSON serializable df[col_name] = df[col_name].astype(object) - elif str(dtype) == "boolean": + elif dtype_name == "boolean": # dedicated boolean datatype (since 1.0) # https://pandas.io/docs/user_guide/boolean.html col = df[col_name].astype(object) df[col_name] = col.where(col.notnull(), None) - elif str(dtype).startswith("datetime"): + elif dtype_name.startswith("datetime") or dtype_name.startswith("timestamp"): # Convert datetimes to strings. This needs to be a full ISO string # with time, which is why we cannot use ``col.astype(str)``. # This is because Javascript parses date-only times in UTC, but @@ -368,18 +376,18 @@ def to_list_if_array(val): df[col_name] = ( df[col_name].apply(lambda x: x.isoformat()).replace("NaT", "") ) - elif str(dtype).startswith("timedelta"): + elif dtype_name.startswith("timedelta"): raise ValueError( 'Field "{col_name}" has type "{dtype}" which is ' "not supported by Altair. Please convert to " "either a timestamp or a numerical value." "".format(col_name=col_name, dtype=dtype) ) - elif str(dtype).startswith("geometry"): + elif dtype_name.startswith("geometry"): # geopandas >=0.6.1 uses the dtype geometry. Continue here # otherwise it will give an error on np.issubdtype(dtype, np.integer) continue - elif str(dtype) in { + elif dtype_name in { "Int8", "Int16", "Int32", @@ -394,10 +402,10 @@ def to_list_if_array(val): # https://pandas.pydata.org/pandas-docs/version/0.25/whatsnew/v0.24.0.html#optional-integer-na-support col = df[col_name].astype(object) df[col_name] = col.where(col.notnull(), None) - elif np.issubdtype(dtype, np.integer): + elif numpy_is_subtype(dtype, np.integer): # convert integers to objects; np.int is not JSON serializable df[col_name] = df[col_name].astype(object) - elif np.issubdtype(dtype, np.floating): + elif numpy_is_subtype(dtype, np.floating): # For floats, convert to Python float: np.float is not JSON serializable # Also convert NaN/inf values to null, as they are not JSON serializable col = df[col_name] @@ -635,7 +643,7 @@ def infer_vegalite_type_for_dfi_column( # error message for the presence of datetime64. # # See https://github.com/pandas-dev/pandas/issues/54239 - if "datetime64" in e.args[0]: + if "datetime64" in e.args[0] or "timestamp" in e.args[0]: return "temporal" raise e
diff --git a/tests/utils/test_core.py b/tests/utils/test_core.py --- a/tests/utils/test_core.py +++ b/tests/utils/test_core.py @@ -8,6 +8,12 @@ from altair.utils.core import parse_shorthand, update_nested, infer_encoding_types from altair.utils.core import infer_dtype +try: + import pyarrow as pa +except ImportError: + pa = None + + FAKE_CHANNELS_MODULE = ''' """Fake channels module for utility tests.""" @@ -148,6 +154,20 @@ def check(s, data, **kwargs): check("month(t)", data, timeUnit="month", field="t", type="temporal") [email protected](pa is None, reason="pyarrow not installed") +def test_parse_shorthand_for_arrow_timestamp(): + data = pd.DataFrame( + { + "z": pd.date_range("2018-01-01", periods=5, freq="D"), + "t": pd.date_range("2018-01-01", periods=5, freq="D").tz_localize("UTC"), + } + ) + # Convert to arrow-packed dtypes + data = pa.Table.from_pandas(data).to_pandas(types_mapper=pd.ArrowDtype) + assert parse_shorthand("z", data) == {"field": "z", "type": "temporal"} + assert parse_shorthand("z", data) == {"field": "z", "type": "temporal"} + + def test_parse_shorthand_all_aggregates(): aggregates = alt.Root._schema["definitions"]["AggregateOp"]["enum"] for aggregate in aggregates: diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -7,6 +7,11 @@ from altair.utils import infer_vegalite_type, sanitize_dataframe +try: + import pyarrow as pa +except ImportError: + pa = None + def test_infer_vegalite_type(): def _check(arr, typ): @@ -83,6 +88,37 @@ def test_sanitize_dataframe(): assert df.equals(df2) [email protected](pa is None, reason="pyarrow not installed") +def test_sanitize_dataframe_arrow_columns(): + # create a dataframe with various types + df = pd.DataFrame( + { + "s": list("abcde"), + "f": np.arange(5, dtype=float), + "i": np.arange(5, dtype=int), + "b": np.array([True, False, True, True, False]), + "d": pd.date_range("2012-01-01", periods=5, freq="H"), + "c": pd.Series(list("ababc"), dtype="category"), + "p": pd.date_range("2012-01-01", periods=5, freq="H").tz_localize("UTC"), + } + ) + df_arrow = pa.Table.from_pandas(df).to_pandas(types_mapper=pd.ArrowDtype) + df_clean = sanitize_dataframe(df_arrow) + records = df_clean.to_dict(orient="records") + assert records[0] == { + "s": "a", + "f": 0.0, + "i": 0, + "b": True, + "d": "2012-01-01T00:00:00", + "c": "a", + "p": "2012-01-01T00:00:00+00:00", + } + + # Make sure we can serialize to JSON without error + json.dumps(records) + + def test_sanitize_dataframe_colnames(): df = pd.DataFrame(np.arange(12).reshape(4, 3))
Pandas 2.0 with pyarrow backend: "TypeError: Cannot interpret 'timestamp[ms][pyarrow]' as a data type" * Vega-Altair 5.0.1 * Pandas 2.0.3 * PyArrow 12.0.1 Essential outline of what I'm doing: ``` import pandas as pd arrow_table = [make an Arrow table] pandas_df = arrow_table.to_pandas(types_mapper=pd.ArrowDtype) ``` <details> <summary>Stack trace from my actual app</summary> ``` File "/usr/local/lib/python3.11/site-packages/altair/vegalite/v5/api.py", line 948, in save result = save(**kwds) ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/altair/utils/save.py", line 131, in save spec = chart.to_dict() ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/altair/vegalite/v5/api.py", line 838, in to_dict copy.data = _prepare_data(original_data, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/altair/vegalite/v5/api.py", line 100, in _prepare_data data = _pipe(data, data_transformers.get()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/toolz/functoolz.py", line 628, in pipe data = func(data) ^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/toolz/functoolz.py", line 304, in __call__ return self._partial(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/altair/vegalite/data.py", line 19, in default_data_transformer return curried.pipe(data, limit_rows(max_rows=max_rows), to_values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/toolz/functoolz.py", line 628, in pipe data = func(data) ^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/toolz/functoolz.py", line 304, in __call__ return self._partial(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/altair/utils/data.py", line 160, in to_values data = sanitize_dataframe(data) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/altair/utils/core.py", line 383, in sanitize_dataframe elif np.issubdtype(dtype, np.integer): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/numpy/core/numerictypes.py", line 417, in issubdtype arg1 = dtype(arg1).type ^^^^^^^^^^^ TypeError: Cannot interpret 'timestamp[ms][pyarrow]' as a data type ``` </details>
I just tried it with this in my app's `pyproject.toml` and same failure: ``` [tool.poetry.dependencies] altair = { git = "https://github.com/altair-viz/altair.git", rev = "72a361c" } ``` Thanks for raising @sacundim! Can you check if the issue you are describing is a duplicate of #3050, recently fixed by PR #3076? > Can you check if the issue you are describing is a duplicate of https://github.com/altair-viz/altair/issues/3050, recently fixed by PR https://github.com/altair-viz/altair/pull/3076? I don't think it is, #3076 was about fixing a sanitization issue for `pyarrow` / `__dataframe__` objects. This issue is about pandas sanitization logic failing for Pandas 2.0 series that are backed by pyarrow. I'll try to take a look soon, this might be another motivation for unifying the sanitization logic to operate on the DataFrame interchange protocol like we've talked about in the past (https://github.com/altair-viz/altair/pull/3076#issuecomment-1574185194). @mattijn The commit I mention in my second comment (72a361c) was the most recent state of the main branch when I made that comment, and later than the merge of #3076. I was also recently playing with Polars and indeed I had type-related problems with Vega-Altair 5.0.1, I saw PR #3076, and I got over those problems [precisely by using commit 427d5679, the one that merged #3076](https://github.com/sacundim/covid-19-puerto-rico/blob/800f503884639ae606c3afe390bb3faa4cad4f6c/website/pyproject.toml#L15). So with commits that have #3076 I have indeed observed this app working with Polars frames but not with Arrow-backed Pandas 2.0 frames. @jonmmease I'm obviously not nearly as deep into this as you are but given how central Arrow is becoming to the whole ecosystem and various comments I read about how support for this dataframe interchange protocol is still experimental, I wonder if just building first-class support for Arrow might be wise. Hi @sacundim, yeah we totally agree. We're working on moving various parts of Altair from depending directly on the pandas API to working with the combination of the DataFrame Interchange Protocol and pyarrow. One recent example was https://github.com/altair-viz/altair/pull/3114, where I updated the encoding type inference to rely on the DataFrame interchange protocol when available. One note is that we'll need to keep the pandas-centric logic around for a while because we still support versions of pandas before the DataFrame Interchange Protocol was introduced, and we want Altair to work in environments like Pyodide where pyarrow isn't available yet. Just to make things a bit clearer; (1) I've got two experimental branches in [my project in question](https://github.com/sacundim/covid-19-puerto-rico): * polars-try2 * pandas-2.0 (2) I've just now got both using Vega-Altair from the GitHub main branch: ``` [tool.poetry.dependencies] altair = { git = "https://github.com/altair-viz/altair.git", rev = "72a361c" } ``` (3) The following function in my polars-try2 branch uses PyAthena 3.0.6 to produce pyarrow tables, wraps them into Polars dataframes, and Vega-Altair understands the latter just fine: ``` def execute_polars(athena, sql, params={}): with athena.cursor(ArrowCursor) as cursor: return pl.from_arrow(cursor.execute(sql, params).as_arrow()) ``` (4) But the following function in my pandas-2.0 branch uses PyAthena 3.0.6 to produce pyarrow tables the exact way, differs only in that it packages them into Pandas 2.0 dataframes, and gets the error that this ticket reports: ``` def execute_pandas(athena, query, params={}): """Execute a query with PyAthena, return the result set as Pandas""" with athena.cursor(ArrowCursor) as cursor: arrow = cursor.execute(query, params).as_arrow() return arrow.to_pandas(types_mapper=pd.ArrowDtype) ```
2023-07-28T22:02:13Z
[]
[]
vega/altair
3,208
vega__altair-3208
[ "2854" ]
e5fb1f0c2f2faaff3ba6158dbcb1ebc8a53682a5
diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -44,7 +44,7 @@ else: from typing_extensions import Self -_TSchemaBase = TypeVar("_TSchemaBase", bound="SchemaBase") +_TSchemaBase = TypeVar("_TSchemaBase", bound=Type["SchemaBase"]) ValidationErrorList = List[jsonschema.exceptions.ValidationError] GroupedValidationErrors = Dict[str, ValidationErrorList] diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -18,6 +18,7 @@ from .data import data_transformers from ... import utils, expr +from ...expr import core as _expr_core from .display import renderers, VEGALITE_VERSION, VEGAEMBED_VERSION, VEGA_VERSION from .theme import themes from .compiler import vegalite_compilers @@ -186,9 +187,12 @@ def _get_channels_mapping() -> TypingDict[TypingType[core.SchemaBase], str]: # ------------------------------------------------------------------------- # Tools for working with parameters -class Parameter(expr.core.OperatorMixin, object): +class Parameter(_expr_core.OperatorMixin): """A Parameter object""" + # NOTE: If you change this class, make sure that the protocol in + # altair/vegalite/v5/schema/core.py is updated accordingly if needed. + _counter: int = 0 @classmethod @@ -238,7 +242,7 @@ def __invert__(self): if self.param_type == "selection": return SelectionPredicateComposition({"not": {"param": self.name}}) else: - return expr.core.OperatorMixin.__invert__(self) + return _expr_core.OperatorMixin.__invert__(self) def __and__(self, other): if self.param_type == "selection": @@ -246,7 +250,7 @@ def __and__(self, other): other = {"param": other.name} return SelectionPredicateComposition({"and": [{"param": self.name}, other]}) else: - return expr.core.OperatorMixin.__and__(self, other) + return _expr_core.OperatorMixin.__and__(self, other) def __or__(self, other): if self.param_type == "selection": @@ -254,7 +258,7 @@ def __or__(self, other): other = {"param": other.name} return SelectionPredicateComposition({"or": [{"param": self.name}, other]}) else: - return expr.core.OperatorMixin.__or__(self, other) + return _expr_core.OperatorMixin.__or__(self, other) def __repr__(self) -> str: return "Parameter({0!r}, {1})".format(self.name, self.param) @@ -267,20 +271,20 @@ def _from_expr(self, expr) -> "ParameterExpression": def __getattr__( self, field_name: str - ) -> Union[expr.core.GetAttrExpression, "SelectionExpression"]: + ) -> Union[_expr_core.GetAttrExpression, "SelectionExpression"]: if field_name.startswith("__") and field_name.endswith("__"): raise AttributeError(field_name) - _attrexpr = expr.core.GetAttrExpression(self.name, field_name) + _attrexpr = _expr_core.GetAttrExpression(self.name, field_name) # If self is a SelectionParameter and field_name is in its # fields or encodings list, then we want to return an expression. if check_fields_and_encodings(self, field_name): return SelectionExpression(_attrexpr) - return expr.core.GetAttrExpression(self.name, field_name) + return _expr_core.GetAttrExpression(self.name, field_name) # TODO: Are there any special cases to consider for __getitem__? # This was copied from v4. - def __getitem__(self, field_name: str) -> expr.core.GetItemExpression: - return expr.core.GetItemExpression(self.name, field_name) + def __getitem__(self, field_name: str) -> _expr_core.GetItemExpression: + return _expr_core.GetItemExpression(self.name, field_name) # Enables use of ~, &, | with compositions of selection objects. @@ -295,7 +299,7 @@ def __or__(self, other): return SelectionPredicateComposition({"or": [self.to_dict(), other.to_dict()]}) -class ParameterExpression(expr.core.OperatorMixin, object): +class ParameterExpression(_expr_core.OperatorMixin, object): def __init__(self, expr) -> None: self.expr = expr @@ -309,7 +313,7 @@ def _from_expr(self, expr) -> "ParameterExpression": return ParameterExpression(expr=expr) -class SelectionExpression(expr.core.OperatorMixin, object): +class SelectionExpression(_expr_core.OperatorMixin, object): def __init__(self, expr) -> None: self.expr = expr @@ -346,9 +350,9 @@ def value(value, **kwargs) -> dict: def param( name: Optional[str] = None, value: Union[Any, UndefinedType] = Undefined, - bind: Union[core.Binding, str, UndefinedType] = Undefined, + bind: Union[core.Binding, UndefinedType] = Undefined, empty: Union[bool, UndefinedType] = Undefined, - expr: Union[str, core.Expr, expr.core.Expression, UndefinedType] = Undefined, + expr: Union[str, core.Expr, _expr_core.Expression, UndefinedType] = Undefined, **kwds, ) -> Parameter: """Create a named parameter. @@ -365,7 +369,7 @@ def param( value : any (optional) The default value of the parameter. If not specified, the parameter will be created without a default value. - bind : :class:`Binding`, str (optional) + bind : :class:`Binding` (optional) Binds the parameter to an external input element such as a slider, selection list or radio button group. empty : boolean (optional) @@ -421,9 +425,14 @@ def param( # If both 'value' and 'init' are set, we ignore 'init'. kwds.pop("init") + # ignore[arg-type] comment is needed because we can also pass _expr_core.Expression if "select" not in kwds: parameter.param = core.VariableParameter( - name=parameter.name, bind=bind, value=value, expr=expr, **kwds + name=parameter.name, + bind=bind, + value=value, + expr=expr, # type: ignore[arg-type] + **kwds, ) parameter.param_type = "variable" elif "views" in kwds: @@ -503,7 +512,7 @@ def selection_interval( value: Union[Any, UndefinedType] = Undefined, bind: Union[core.Binding, str, UndefinedType] = Undefined, empty: Union[bool, UndefinedType] = Undefined, - expr: Union[str, core.Expr, expr.core.Expression, UndefinedType] = Undefined, + expr: Union[str, core.Expr, _expr_core.Expression, UndefinedType] = Undefined, encodings: Union[List[str], UndefinedType] = Undefined, on: Union[str, UndefinedType] = Undefined, clear: Union[str, bool, UndefinedType] = Undefined, @@ -807,7 +816,7 @@ def condition( test_predicates = (str, expr.Expression, core.PredicateComposition) condition: TypingDict[ - str, Union[bool, str, expr.core.Expression, core.PredicateComposition] + str, Union[bool, str, _expr_core.Expression, core.PredicateComposition] ] if isinstance(predicate, Parameter): if ( @@ -1376,7 +1385,9 @@ def project( spacing=spacing, tilt=tilt, translate=translate, - type=type, + # Ignore as we type here `type` as a str but in core.Projection + # it's a Literal with all options + type=type, # type: ignore[arg-type] **kwds, ) return self.properties(projection=projection) @@ -1537,9 +1548,9 @@ def transform_calculate( self, as_: Union[str, core.FieldName, UndefinedType] = Undefined, calculate: Union[ - str, core.Expr, expr.core.Expression, UndefinedType + str, core.Expr, _expr_core.Expression, UndefinedType ] = Undefined, - **kwargs: Union[str, core.Expr, expr.core.Expression], + **kwargs: Union[str, core.Expr, _expr_core.Expression], ) -> Self: """ Add a :class:`CalculateTransform` to the schema. @@ -1600,10 +1611,10 @@ def transform_calculate( ) if as_ is not Undefined or calculate is not Undefined: dct = {"as": as_, "calculate": calculate} - self = self._add_transform(core.CalculateTransform(**dct)) + self = self._add_transform(core.CalculateTransform(**dct)) # type: ignore[arg-type] for as_, calculate in kwargs.items(): dct = {"as": as_, "calculate": calculate} - self = self._add_transform(core.CalculateTransform(**dct)) + self = self._add_transform(core.CalculateTransform(**dct)) # type: ignore[arg-type] return self def transform_density( @@ -1832,7 +1843,7 @@ def transform_filter( filter: Union[ str, core.Expr, - expr.core.Expression, + _expr_core.Expression, core.Predicate, Parameter, core.PredicateComposition, @@ -1866,7 +1877,7 @@ def transform_filter( elif isinstance(filter.empty, bool): new_filter["empty"] = filter.empty filter = new_filter # type: ignore[assignment] - return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) + return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) # type: ignore[arg-type] def transform_flatten( self, @@ -2068,7 +2079,13 @@ def transform_pivot( """ return self._add_transform( core.PivotTransform( - pivot=pivot, value=value, groupby=groupby, limit=limit, op=op + # Ignore as we type here `op` as a str but in core.PivotTransform + # it's a Literal with all options + pivot=pivot, + value=value, + groupby=groupby, + limit=limit, + op=op, # type: ignore[arg-type] ) ) @@ -2318,7 +2335,7 @@ def transform_timeunit( ) if as_ is not Undefined: dct = {"as": as_, "timeUnit": timeUnit, "field": field} - self = self._add_transform(core.TimeUnitTransform(**dct)) + self = self._add_transform(core.TimeUnitTransform(**dct)) # type: ignore[arg-type] for as_, shorthand in kwargs.items(): dct = utils.parse_shorthand( shorthand, @@ -2330,7 +2347,7 @@ def transform_timeunit( dct["as"] = as_ if "timeUnit" not in dct: raise ValueError("'{}' must include a valid timeUnit".format(shorthand)) - self = self._add_transform(core.TimeUnitTransform(**dct)) + self = self._add_transform(core.TimeUnitTransform(**dct)) # type: ignore[arg-type] return self def transform_window( @@ -2426,7 +2443,8 @@ def transform_window( ) ) assert not isinstance(window, UndefinedType) # For mypy - window.append(core.WindowFieldDef(**kwds)) + # Ignore as core.WindowFieldDef has a Literal type hint with all options + window.append(core.WindowFieldDef(**kwds)) # type: ignore[arg-type] return self._add_transform( core.WindowTransform( @@ -2607,7 +2625,7 @@ def resolve_scale(self, *args, **kwargs) -> Self: class _EncodingMixin: - @utils.use_signature(core.FacetedEncoding) + @utils.use_signature(channels._encode_signature) def encode(self, *args, **kwargs) -> Self: # Convert args to kwargs based on their types. kwargs = utils.infer_encoding_types(args, kwargs, channels) @@ -2760,7 +2778,10 @@ def __init__( **kwargs, ) -> None: super(Chart, self).__init__( - data=data, + # Data type hints won't match with what TopLevelUnitSpec expects + # as there is some data processing happening when converting to + # a VL spec + data=data, # type: ignore[arg-type] encoding=encoding, mark=mark, width=width, diff --git a/altair/vegalite/v5/schema/__init__.py b/altair/vegalite/v5/schema/__init__.py --- a/altair/vegalite/v5/schema/__init__.py +++ b/altair/vegalite/v5/schema/__init__.py @@ -1,5 +1,8 @@ # ruff: noqa + from .core import * -from .channels import * -SCHEMA_VERSION = 'v5.15.1' -SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.15.1.json' +from .channels import * # type: ignore[assignment] + +SCHEMA_VERSION = "v5.15.1" + +SCHEMA_URL = "https://vega.github.io/schema/vega-lite/v5.15.1.json" diff --git a/altair/vegalite/v5/schema/channels.py b/altair/vegalite/v5/schema/channels.py --- a/altair/vegalite/v5/schema/channels.py +++ b/altair/vegalite/v5/schema/channels.py @@ -1,112 +1,146 @@ # The contents of this file are automatically written by # tools/generate_schema_wrapper.py. Do not modify directly. +# These errors need to be ignored as they come from the overload methods +# which trigger two kind of errors in mypy: +# * all of them do not have an implementation in this file +# * some of them are the only overload methods -> overloads usually only make +# sense if there are multiple ones +# However, we need these overloads due to how the propertysetter works +# mypy: disable-error-code="no-overload-impl, empty-body, misc" + import sys from . import core import pandas as pd -from altair.utils.schemapi import Undefined, with_property_setters +from altair.utils.schemapi import Undefined, UndefinedType, with_property_setters from altair.utils import parse_shorthand -from typing import overload, List - -from typing import Literal +from typing import Any, overload, Sequence, List, Literal, Union, Optional +from typing import Dict as TypingDict class FieldChannelMixin: - def to_dict(self, validate=True, ignore=(), context=None): + def to_dict( + self, + validate: bool = True, + ignore: Optional[List[str]] = None, + context: Optional[TypingDict[str, Any]] = None, + ) -> Union[dict, List[dict]]: context = context or {} - shorthand = self._get('shorthand') - field = self._get('field') + ignore = ignore or [] + shorthand = self._get("shorthand") # type: ignore[attr-defined] + field = self._get("field") # type: ignore[attr-defined] if shorthand is not Undefined and field is not Undefined: - raise ValueError("{} specifies both shorthand={} and field={}. " - "".format(self.__class__.__name__, shorthand, field)) + raise ValueError( + "{} specifies both shorthand={} and field={}. " "".format( + self.__class__.__name__, shorthand, field + ) + ) if isinstance(shorthand, (tuple, list)): # If given a list of shorthands, then transform it to a list of classes - kwds = self._kwds.copy() - kwds.pop('shorthand') - return [self.__class__(sh, **kwds).to_dict(validate=validate, ignore=ignore, context=context) - for sh in shorthand] + kwds = self._kwds.copy() # type: ignore[attr-defined] + kwds.pop("shorthand") + return [ + self.__class__(sh, **kwds).to_dict( # type: ignore[call-arg] + validate=validate, ignore=ignore, context=context + ) + for sh in shorthand + ] if shorthand is Undefined: parsed = {} elif isinstance(shorthand, str): - parsed = parse_shorthand(shorthand, data=context.get('data', None)) - type_required = 'type' in self._kwds - type_in_shorthand = 'type' in parsed - type_defined_explicitly = self._get('type') is not Undefined + parsed = parse_shorthand(shorthand, data=context.get("data", None)) + type_required = "type" in self._kwds # type: ignore[attr-defined] + type_in_shorthand = "type" in parsed + type_defined_explicitly = self._get("type") is not Undefined # type: ignore[attr-defined] if not type_required: # Secondary field names don't require a type argument in VegaLite 3+. # We still parse it out of the shorthand, but drop it here. - parsed.pop('type', None) + parsed.pop("type", None) elif not (type_in_shorthand or type_defined_explicitly): - if isinstance(context.get('data', None), pd.DataFrame): + if isinstance(context.get("data", None), pd.DataFrame): raise ValueError( 'Unable to determine data type for the field "{}";' " verify that the field name is not misspelled." " If you are referencing a field from a transform," - " also confirm that the data type is specified correctly.".format(shorthand) + " also confirm that the data type is specified correctly.".format( + shorthand + ) ) else: - raise ValueError("{} encoding field is specified without a type; " - "the type cannot be automatically inferred because " - "the data is not specified as a pandas.DataFrame." - "".format(shorthand)) + raise ValueError( + "{} encoding field is specified without a type; " + "the type cannot be automatically inferred because " + "the data is not specified as a pandas.DataFrame." + "".format(shorthand) + ) else: # Shorthand is not a string; we pass the definition to field, # and do not do any parsing. - parsed = {'field': shorthand} + parsed = {"field": shorthand} context["parsed_shorthand"] = parsed return super(FieldChannelMixin, self).to_dict( - validate=validate, - ignore=ignore, - context=context + validate=validate, ignore=ignore, context=context ) class ValueChannelMixin: - def to_dict(self, validate=True, ignore=(), context=None): + def to_dict( + self, + validate: bool = True, + ignore: Optional[List[str]] = None, + context: Optional[TypingDict[str, Any]] = None, + ) -> dict: context = context or {} - condition = self._get('condition', Undefined) + ignore = ignore or [] + condition = self._get("condition", Undefined) # type: ignore[attr-defined] copy = self # don't copy unless we need to if condition is not Undefined: if isinstance(condition, core.SchemaBase): pass - elif 'field' in condition and 'type' not in condition: - kwds = parse_shorthand(condition['field'], context.get('data', None)) - copy = self.copy(deep=['condition']) - copy['condition'].update(kwds) - return super(ValueChannelMixin, copy).to_dict(validate=validate, - ignore=ignore, - context=context) + elif "field" in condition and "type" not in condition: + kwds = parse_shorthand(condition["field"], context.get("data", None)) + copy = self.copy(deep=["condition"]) # type: ignore[attr-defined] + copy["condition"].update(kwds) # type: ignore[index] + return super(ValueChannelMixin, copy).to_dict( + validate=validate, ignore=ignore, context=context + ) class DatumChannelMixin: - def to_dict(self, validate=True, ignore=(), context=None): + def to_dict( + self, + validate: bool = True, + ignore: Optional[List[str]] = None, + context: Optional[TypingDict[str, Any]] = None, + ) -> dict: context = context or {} - datum = self._get('datum', Undefined) + ignore = ignore or [] + datum = self._get("datum", Undefined) # type: ignore[attr-defined] copy = self # don't copy unless we need to if datum is not Undefined: if isinstance(datum, core.SchemaBase): pass - return super(DatumChannelMixin, copy).to_dict(validate=validate, - ignore=ignore, - context=context) + return super(DatumChannelMixin, copy).to_dict( + validate=validate, ignore=ignore, context=context + ) @with_property_setters class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): """Angle schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -118,7 +152,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -139,14 +173,14 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -161,7 +195,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -170,7 +204,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -183,7 +217,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -222,7 +256,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -231,7 +265,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -251,7 +285,7 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -321,170 +355,2934 @@ class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "angle" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Angle': - ... - - def bandPosition(self, _: float, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Angle': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Angle': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Angle': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Angle, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, legend=legend, - scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, - **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Angle": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Angle": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def bin(self, _: None, **kwds) -> "Angle": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "Angle": + ... + + @overload + def field(self, _: str, **kwds) -> "Angle": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def legend(self, _: None, **kwds) -> "Angle": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def scale(self, _: None, **kwds) -> "Angle": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Angle": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Angle": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Angle": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Angle": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Angle": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def sort(self, _: None, **kwds) -> "Angle": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Angle": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Angle": + ... + + @overload + def title(self, _: str, **kwds) -> "Angle": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Angle": + ... + + @overload + def title(self, _: None, **kwds) -> "Angle": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Angle": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Angle, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): """AngleDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict Parameters ---------- @@ -493,16 +3291,16 @@ class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnum Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -522,7 +3320,7 @@ class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnum 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -592,110 +3390,881 @@ class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnum **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "angle" - def bandPosition(self, _: float, **kwds) -> 'AngleDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'AngleDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'AngleDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'AngleDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'AngleDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'AngleDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'AngleDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'AngleDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(AngleDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "AngleDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "AngleDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "AngleDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "AngleDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "AngleDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "AngleDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "AngleDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "AngleDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(AngleDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class AngleValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): +class AngleValue( + ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber +): """AngleValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "angle" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'AngleValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'AngleValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'AngleValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'AngleValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'AngleValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'AngleValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'AngleValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "AngleValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "AngleValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "AngleValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "AngleValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "AngleValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "AngleValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "AngleValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(AngleValue, self).__init__(value=value, condition=condition, **kwds) @with_property_setters -class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): +class Color( + FieldChannelMixin, + core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, +): """Color schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -707,7 +4276,7 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -728,14 +4297,14 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -750,7 +4319,7 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -759,7 +4328,7 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -772,7 +4341,7 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -811,7 +4380,7 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -820,7 +4389,7 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -840,7 +4409,7 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -910,170 +4479,2966 @@ class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "color" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Color': - ... - - def bandPosition(self, _: float, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Color': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Color': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Color': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Color, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, legend=legend, - scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, - **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Color": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Color": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Color": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def bin(self, _: None, **kwds) -> "Color": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "Color": + ... + + @overload + def field(self, _: str, **kwds) -> "Color": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def legend(self, _: None, **kwds) -> "Color": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def scale(self, _: None, **kwds) -> "Color": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Color": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Color": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Color": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Color": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Color": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Color": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Color": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def sort(self, _: None, **kwds) -> "Color": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Color": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Color": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Color": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Color": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Color": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Color": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Color": + ... + + @overload + def title(self, _: str, **kwds) -> "Color": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Color": + ... + + @overload + def title(self, _: None, **kwds) -> "Color": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Color": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Color, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class ColorDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): +class ColorDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull +): """ColorDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict Parameters ---------- @@ -1082,16 +7447,16 @@ class ColorDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGra Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -1111,7 +7476,7 @@ class ColorDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGra 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -1181,95 +7546,923 @@ class ColorDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGra **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "color" - def bandPosition(self, _: float, **kwds) -> 'ColorDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'ColorDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'ColorDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'ColorDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'ColorDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'ColorDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'ColorDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'ColorDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(ColorDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "ColorDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "ColorDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "ColorDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "ColorDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "ColorDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "ColorDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ColorDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class ColorValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): +class ColorValue( + ValueChannelMixin, + core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, +): """ColorValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "color" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ColorValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ColorValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ColorValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ColorValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'ColorValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'ColorValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'ColorValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ColorValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "ColorValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(ColorValue, self).__init__(value=value, condition=condition, **kwds) @@ -1277,14 +8470,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): """Column schema wrapper - Mapping(required=[shorthand]) + :class:`RowColumnEncodingFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -1292,7 +8485,7 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - align : :class:`LayoutAlign` + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'] The alignment to apply to row/column facet's subplot. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -1310,7 +8503,7 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -1331,12 +8524,12 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - center : boolean + center : bool Boolean flag indicating if facet's subviews should be centered relative to their respective rows or columns. **Default value:** ``false`` - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -1351,9 +8544,9 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - header : anyOf(:class:`Header`, None) + header : :class:`Header`, Dict, None An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + sort : :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortOrder`, Literal['ascending', 'descending'], None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -1386,7 +8579,7 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -1395,7 +8588,7 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -1415,7 +8608,7 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -1485,159 +8678,1244 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "column" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Column': - ... - - def align(self, _: Literal["all", "each", "none"], **kwds) -> 'Column': - ... - - def bandPosition(self, _: float, **kwds) -> 'Column': - ... + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Column": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Column": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Column": + ... + + @overload + def align(self, _: Literal["all", "each", "none"], **kwds) -> "Column": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Column": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Column": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Column": + ... + + @overload + def bin(self, _: None, **kwds) -> "Column": + ... + + @overload + def center(self, _: bool, **kwds) -> "Column": + ... + + @overload + def field(self, _: str, **kwds) -> "Column": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Column": + ... + + @overload + def header( + self, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAnchor: Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + UndefinedType, + ] = Undefined, + labelAngle: Union[float, UndefinedType] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOrient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + orient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + UndefinedType, + ] = Undefined, + titleAngle: Union[float, UndefinedType] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Column": + ... + + @overload + def header(self, _: None, **kwds) -> "Column": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Column": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Column": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Column": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Column": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Column": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Column": + ... + + @overload + def sort(self, _: None, **kwds) -> "Column": + ... + + @overload + def spacing(self, _: float, **kwds) -> "Column": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Column": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Column": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Column": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Column": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Column": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Column": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Column": + ... + + @overload + def title(self, _: str, **kwds) -> "Column": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Column": + ... + + @overload + def title(self, _: None, **kwds) -> "Column": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Column": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], UndefinedType + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + center: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + header: Union[Union[None, Union[core.Header, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[core.EncodingSortField, dict], + ], + UndefinedType, + ] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Column, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + align=align, + bandPosition=bandPosition, + bin=bin, + center=center, + field=field, + header=header, + sort=sort, + spacing=spacing, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Column': - ... - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Column': - ... +@with_property_setters +class Description(FieldChannelMixin, core.StringFieldDefWithCondition): + """Description schema wrapper - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Column': - ... + :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]] - def center(self, _: bool, **kwds) -> 'Column': - ... + Parameters + ---------- - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Column': - ... + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def header(self, format=Undefined, formatType=Undefined, labelAlign=Undefined, labelAnchor=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOrient=Undefined, labelPadding=Undefined, labels=Undefined, orient=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOrient=Undefined, titlePadding=Undefined, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def header(self, _: None, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Column': - ... - - def spacing(self, _: float, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Column': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Column': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Column': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, - bandPosition=Undefined, bin=Undefined, center=Undefined, field=Undefined, - header=Undefined, sort=Undefined, spacing=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(Column, self).__init__(shorthand=shorthand, aggregate=aggregate, align=align, - bandPosition=bandPosition, bin=bin, center=center, field=field, - header=header, sort=sort, spacing=spacing, timeUnit=timeUnit, - title=title, type=type, **kwds) - - -@with_property_setters -class Description(FieldChannelMixin, core.StringFieldDefWithCondition): - """Description schema wrapper - - Mapping(required=[shorthand]) - - Parameters - ---------- - - shorthand : string - shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` - Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, - ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) + **Default value:** ``undefined`` (None) **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. @@ -1645,7 +9923,7 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -1666,14 +9944,14 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringExprRef`, List(:class:`ConditionalValueDefstringExprRef`)) + condition : :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`, Sequence[:class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -1688,7 +9966,7 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -1711,7 +9989,7 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -1722,7 +10000,7 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -1731,7 +10009,7 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -1751,7 +10029,7 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -1821,173 +10099,1452 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "description" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Description': - ... - - def bandPosition(self, _: float, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringExprRef], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: str, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: dict, **kwds) -> 'Description': - ... - - def formatType(self, _: str, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Description': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Description': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Description': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Description, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, format=format, formatType=formatType, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Description": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Description": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Description": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Description": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Description": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Description": + ... + + @overload + def bin(self, _: str, **kwds) -> "Description": + ... + + @overload + def bin(self, _: None, **kwds) -> "Description": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Description": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Description": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringExprRef], **kwds + ) -> "Description": + ... + + @overload + def field(self, _: str, **kwds) -> "Description": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Description": + ... + + @overload + def format(self, _: str, **kwds) -> "Description": + ... + + @overload + def format(self, _: dict, **kwds) -> "Description": + ... + + @overload + def formatType(self, _: str, **kwds) -> "Description": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Description": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Description": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Description": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Description": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Description": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Description": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Description": + ... + + @overload + def title(self, _: str, **kwds) -> "Description": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Description": + ... + + @overload + def title(self, _: None, **kwds) -> "Description": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Description": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Description, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class DescriptionValue(ValueChannelMixin, core.StringValueDefWithCondition): """DescriptionValue schema wrapper - Mapping(required=[]) + :class:`StringValueDefWithCondition`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "description" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'DescriptionValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'DescriptionValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'DescriptionValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'DescriptionValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'DescriptionValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'DescriptionValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds) -> 'DescriptionValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "DescriptionValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "DescriptionValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "DescriptionValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "DescriptionValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "DescriptionValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "DescriptionValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds + ) -> "DescriptionValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(DescriptionValue, self).__init__(value=value, condition=condition, **kwds) @@ -1995,15 +11552,15 @@ def __init__(self, value, condition=Undefined, **kwds): class Detail(FieldChannelMixin, core.FieldDefWithoutScale): """Detail schema wrapper - Mapping(required=[shorthand]) + :class:`FieldDefWithoutScale`, Dict[required=[shorthand]] Definition object for a data field, its type and transformation of an encoding channel. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -2015,7 +11572,7 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -2036,7 +11593,7 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -2051,7 +11608,7 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -2060,7 +11617,7 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -2080,7 +11637,7 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -2150,111 +11707,647 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "detail" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Detail': - ... - - def bandPosition(self, _: float, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Detail': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Detail': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Detail': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Detail, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, - title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Detail": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Detail": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Detail": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Detail": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Detail": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Detail": + ... + + @overload + def bin(self, _: str, **kwds) -> "Detail": + ... + + @overload + def bin(self, _: None, **kwds) -> "Detail": + ... + + @overload + def field(self, _: str, **kwds) -> "Detail": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Detail": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Detail": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Detail": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Detail": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Detail": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Detail": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Detail": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Detail": + ... + + @overload + def title(self, _: str, **kwds) -> "Detail": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Detail": + ... + + @overload + def title(self, _: None, **kwds) -> "Detail": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Detail": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Detail, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): """Facet schema wrapper - Mapping(required=[shorthand]) + :class:`FacetEncodingFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -2262,7 +12355,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -2283,7 +12376,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -2304,7 +12397,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -2316,7 +12409,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -2342,7 +12435,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -2357,9 +12450,9 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - header : anyOf(:class:`Header`, None) + header : :class:`Header`, Dict, None An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + sort : :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortOrder`, Literal['ascending', 'descending'], None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -2386,7 +12479,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): **Default value:** ``"ascending"`` **Note:** ``null`` is not supported for ``row`` and ``column``. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -2394,7 +12487,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -2403,7 +12496,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -2423,7 +12516,7 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -2493,176 +12586,1295 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "facet" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def align(self, _: Literal["all", "each", "none"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def align(self, column=Undefined, row=Undefined, **kwds) -> 'Facet': - ... - - def bandPosition(self, _: float, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Facet': - ... - - def bounds(self, _: Literal["full", "flush"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def center(self, _: bool, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def center(self, column=Undefined, row=Undefined, **kwds) -> 'Facet': - ... - - def columns(self, _: float, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def header(self, format=Undefined, formatType=Undefined, labelAlign=Undefined, labelAnchor=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOrient=Undefined, labelPadding=Undefined, labels=Undefined, orient=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOrient=Undefined, titlePadding=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def header(self, _: None, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def spacing(self, _: float, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def spacing(self, column=Undefined, row=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Facet': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Facet': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Facet': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, - bandPosition=Undefined, bin=Undefined, bounds=Undefined, center=Undefined, - columns=Undefined, field=Undefined, header=Undefined, sort=Undefined, - spacing=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Facet, self).__init__(shorthand=shorthand, aggregate=aggregate, align=align, - bandPosition=bandPosition, bin=bin, bounds=bounds, center=center, - columns=columns, field=field, header=header, sort=sort, - spacing=spacing, timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Facet": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def align(self, _: Literal["all", "each", "none"], **kwds) -> "Facet": + ... + + @overload + def align( + self, + column: Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], UndefinedType + ] = Undefined, + row: Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], UndefinedType + ] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Facet": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Facet": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def bin(self, _: None, **kwds) -> "Facet": + ... + + @overload + def bounds(self, _: Literal["full", "flush"], **kwds) -> "Facet": + ... + + @overload + def center(self, _: bool, **kwds) -> "Facet": + ... + + @overload + def center( + self, + column: Union[bool, UndefinedType] = Undefined, + row: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def columns(self, _: float, **kwds) -> "Facet": + ... + + @overload + def field(self, _: str, **kwds) -> "Facet": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def header( + self, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAnchor: Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + UndefinedType, + ] = Undefined, + labelAngle: Union[float, UndefinedType] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOrient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + orient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + UndefinedType, + ] = Undefined, + titleAngle: Union[float, UndefinedType] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def header(self, _: None, **kwds) -> "Facet": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Facet": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Facet": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Facet": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Facet": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Facet": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def sort(self, _: None, **kwds) -> "Facet": + ... + + @overload + def spacing(self, _: float, **kwds) -> "Facet": + ... + + @overload + def spacing( + self, + column: Union[float, UndefinedType] = Undefined, + row: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Facet": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Facet": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Facet": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Facet": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Facet": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Facet": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Facet": + ... + + @overload + def title(self, _: str, **kwds) -> "Facet": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Facet": + ... + + @overload + def title(self, _: None, **kwds) -> "Facet": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Facet": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.RowColLayoutAlign, dict], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union[core.RowColboolean, dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + header: Union[Union[None, Union[core.Header, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[core.EncodingSortField, dict], + ], + UndefinedType, + ] = Undefined, + spacing: Union[ + Union[Union[core.RowColnumber, dict], float], UndefinedType + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Facet, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + align=align, + bandPosition=bandPosition, + bin=bin, + bounds=bounds, + center=center, + columns=columns, + field=field, + header=header, + sort=sort, + spacing=spacing, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): +class Fill( + FieldChannelMixin, + core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, +): """Fill schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -2674,7 +13886,7 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -2695,14 +13907,14 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -2717,7 +13929,7 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -2726,7 +13938,7 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -2739,7 +13951,7 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -2778,7 +13990,7 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -2787,7 +13999,7 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -2807,7 +14019,7 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -2877,170 +14089,2966 @@ class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefG **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "fill" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Fill': - ... - - def bandPosition(self, _: float, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Fill': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Fill': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Fill': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Fill, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, legend=legend, - scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, - **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Fill": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Fill": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def bin(self, _: None, **kwds) -> "Fill": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "Fill": + ... + + @overload + def field(self, _: str, **kwds) -> "Fill": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def legend(self, _: None, **kwds) -> "Fill": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def scale(self, _: None, **kwds) -> "Fill": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Fill": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Fill": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Fill": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Fill": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Fill": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def sort(self, _: None, **kwds) -> "Fill": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Fill": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Fill": + ... + + @overload + def title(self, _: str, **kwds) -> "Fill": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Fill": + ... + + @overload + def title(self, _: None, **kwds) -> "Fill": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Fill": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Fill, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class FillDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): +class FillDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull +): """FillDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict Parameters ---------- @@ -3049,16 +17057,16 @@ class FillDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGrad Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -3078,7 +17086,7 @@ class FillDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGrad 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -3148,110 +17156,940 @@ class FillDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGrad **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "fill" - def bandPosition(self, _: float, **kwds) -> 'FillDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'FillDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'FillDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'FillDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'FillDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'FillDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'FillDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'FillDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(FillDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "FillDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "FillDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "FillDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "FillDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "FillDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "FillDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FillDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class FillValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): +class FillValue( + ValueChannelMixin, + core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, +): """FillValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "fill" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'FillValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'FillValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'FillValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "FillValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(FillValue, self).__init__(value=value, condition=condition, **kwds) @with_property_setters -class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): +class FillOpacity( + FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber +): """FillOpacity schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -3263,7 +18101,7 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -3284,14 +18122,14 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -3306,7 +18144,7 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -3315,7 +18153,7 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -3328,7 +18166,7 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -3367,7 +18205,7 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -3376,7 +18214,7 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -3396,7 +18234,7 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -3466,170 +18304,2936 @@ class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "fillOpacity" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'FillOpacity': - ... - - def bandPosition(self, _: float, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'FillOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'FillOpacity': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'FillOpacity': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(FillOpacity, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "FillOpacity": + ... + + @overload + def bin(self, _: bool, **kwds) -> "FillOpacity": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def bin(self, _: None, **kwds) -> "FillOpacity": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "FillOpacity": + ... + + @overload + def field(self, _: str, **kwds) -> "FillOpacity": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def legend(self, _: None, **kwds) -> "FillOpacity": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def scale(self, _: None, **kwds) -> "FillOpacity": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "FillOpacity": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "FillOpacity": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "FillOpacity": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "FillOpacity": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "FillOpacity": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def sort(self, _: None, **kwds) -> "FillOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "FillOpacity": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "FillOpacity": + ... + + @overload + def title(self, _: str, **kwds) -> "FillOpacity": + ... + + @overload + def title(self, _: List[str], **kwds) -> "FillOpacity": + ... + + @overload + def title(self, _: None, **kwds) -> "FillOpacity": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "FillOpacity": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FillOpacity, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class FillOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): +class FillOpacityDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber +): """FillOpacityDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict Parameters ---------- @@ -3638,16 +21242,16 @@ class FillOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatum Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -3667,7 +21271,7 @@ class FillOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatum 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -3737,95 +21341,862 @@ class FillOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatum **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "fillOpacity" - def bandPosition(self, _: float, **kwds) -> 'FillOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'FillOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'FillOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'FillOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'FillOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'FillOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'FillOpacityDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'FillOpacityDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(FillOpacityDatum, self).__init__(datum=datum, bandPosition=bandPosition, - condition=condition, title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "FillOpacityDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacityDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacityDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "FillOpacityDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "FillOpacityDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "FillOpacityDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "FillOpacityDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "FillOpacityDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FillOpacityDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class FillOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): +class FillOpacityValue( + ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber +): """FillOpacityValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "fillOpacity" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'FillOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'FillOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'FillOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'FillOpacityValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillOpacityValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillOpacityValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillOpacityValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "FillOpacityValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacityValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "FillOpacityValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "FillOpacityValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(FillOpacityValue, self).__init__(value=value, condition=condition, **kwds) @@ -3833,14 +22204,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Href(FieldChannelMixin, core.StringFieldDefWithCondition): """Href schema wrapper - Mapping(required=[shorthand]) + :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -3852,7 +22223,7 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -3873,14 +22244,14 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringExprRef`, List(:class:`ConditionalValueDefstringExprRef`)) + condition : :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`, Sequence[:class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -3895,7 +22266,7 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -3918,7 +22289,7 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -3929,7 +22300,7 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -3938,7 +22309,7 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -3958,7 +22329,7 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -4028,189 +22399,1468 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "href" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Href': - ... + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Href": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Href": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Href": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Href": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Href": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Href": + ... + + @overload + def bin(self, _: str, **kwds) -> "Href": + ... + + @overload + def bin(self, _: None, **kwds) -> "Href": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Href": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Href": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringExprRef], **kwds + ) -> "Href": + ... + + @overload + def field(self, _: str, **kwds) -> "Href": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Href": + ... + + @overload + def format(self, _: str, **kwds) -> "Href": + ... + + @overload + def format(self, _: dict, **kwds) -> "Href": + ... + + @overload + def formatType(self, _: str, **kwds) -> "Href": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Href": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Href": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Href": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Href": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Href": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Href": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Href": + ... + + @overload + def title(self, _: str, **kwds) -> "Href": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Href": + ... + + @overload + def title(self, _: None, **kwds) -> "Href": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Href": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Href, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Href': - ... - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Href': - ... +@with_property_setters +class HrefValue(ValueChannelMixin, core.StringValueDefWithCondition): + """HrefValue schema wrapper - def bandPosition(self, _: float, **kwds) -> 'Href': - ... + :class:`StringValueDefWithCondition`, Dict - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Href': - ... + Parameters + ---------- - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Href': - ... + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] + A field definition or one or more value definition(s) with a parameter predicate. + value : :class:`ExprRef`, Dict[required=[expr]], None, str + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, + values between ``0`` to ``1`` for opacity). + """ - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Href': - ... + _class_is_valid_at_instantiation = False + _encoding_name = "href" - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Href': - ... + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "HrefValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "HrefValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "HrefValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "HrefValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "HrefValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "HrefValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds + ) -> "HrefValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(HrefValue, self).__init__(value=value, condition=condition, **kwds) - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Href': - ... - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Href': - ... +@with_property_setters +class Key(FieldChannelMixin, core.FieldDefWithoutScale): + """Key schema wrapper - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringExprRef], **kwds) -> 'Href': - ... + :class:`FieldDefWithoutScale`, Dict[required=[shorthand]] + Definition object for a data field, its type and transformation of an encoding channel. - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Href': - ... + Parameters + ---------- - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: str, **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: dict, **kwds) -> 'Href': - ... - - def formatType(self, _: str, **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Href': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Href': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Href': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Href, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, format=format, - formatType=formatType, timeUnit=timeUnit, title=title, type=type, - **kwds) - - -@with_property_setters -class HrefValue(ValueChannelMixin, core.StringValueDefWithCondition): - """HrefValue schema wrapper - - Mapping(required=[]) - - Parameters - ---------- - - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) - A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, - values between ``0`` to ``1`` for opacity). - """ - _class_is_valid_at_instantiation = False - _encoding_name = "href" - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'HrefValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'HrefValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'HrefValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'HrefValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'HrefValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'HrefValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds) -> 'HrefValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): - super(HrefValue, self).__init__(value=value, condition=condition, **kwds) - - -@with_property_setters -class Key(FieldChannelMixin, core.FieldDefWithoutScale): - """Key schema wrapper - - Mapping(required=[shorthand]) - Definition object for a data field, its type and transformation of an encoding channel. - - Parameters - ---------- - - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -4222,7 +23872,7 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -4243,7 +23893,7 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -4258,7 +23908,7 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -4267,7 +23917,7 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -4287,7 +23937,7 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -4357,111 +24007,647 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "key" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Key': - ... - - def bandPosition(self, _: float, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Key': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Key': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Key': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Key, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, field=field, timeUnit=timeUnit, title=title, type=type, - **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Key": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Key": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Key": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Key": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Key": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Key": + ... + + @overload + def bin(self, _: str, **kwds) -> "Key": + ... + + @overload + def bin(self, _: None, **kwds) -> "Key": + ... + + @overload + def field(self, _: str, **kwds) -> "Key": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Key": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Key": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Key": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Key": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Key": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Key": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Key": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Key": + ... + + @overload + def title(self, _: str, **kwds) -> "Key": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Key": + ... + + @overload + def title(self, _: None, **kwds) -> "Key": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Key": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Key, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class Latitude(FieldChannelMixin, core.LatLongFieldDef): """Latitude schema wrapper - Mapping(required=[shorthand]) + :class:`LatLongFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -4494,7 +24680,7 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -4509,7 +24695,7 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -4518,7 +24704,7 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -4538,7 +24724,7 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : string + type : str The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -4608,91 +24794,598 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "latitude" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Latitude': - ... - - def bandPosition(self, _: float, **kwds) -> 'Latitude': - ... - - def bin(self, _: None, **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Latitude': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Latitude': - ... - - def type(self, _: str, **kwds) -> 'Latitude': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Latitude, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Latitude": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Latitude": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Latitude": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Latitude": + ... + + @overload + def bin(self, _: None, **kwds) -> "Latitude": + ... + + @overload + def field(self, _: str, **kwds) -> "Latitude": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Latitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Latitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Latitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Latitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Latitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Latitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Latitude": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Latitude": + ... + + @overload + def title(self, _: str, **kwds) -> "Latitude": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Latitude": + ... + + @overload + def title(self, _: None, **kwds) -> "Latitude": + ... + + @overload + def type(self, _: str, **kwds) -> "Latitude": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(Latitude, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class LatitudeDatum(DatumChannelMixin, core.DatumDef): """LatitudeDatum schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -4701,9 +25394,9 @@ class LatitudeDatum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -4723,7 +25416,7 @@ class LatitudeDatum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -4793,47 +25486,69 @@ class LatitudeDatum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "latitude" - def bandPosition(self, _: float, **kwds) -> 'LatitudeDatum': + @overload + def bandPosition(self, _: float, **kwds) -> "LatitudeDatum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'LatitudeDatum': + @overload + def title(self, _: str, **kwds) -> "LatitudeDatum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'LatitudeDatum': + @overload + def title(self, _: List[str], **kwds) -> "LatitudeDatum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'LatitudeDatum': + @overload + def title(self, _: None, **kwds) -> "LatitudeDatum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'LatitudeDatum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "LatitudeDatum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(LatitudeDatum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, - type=type, **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(LatitudeDatum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): """Latitude2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -4866,7 +25581,7 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -4881,7 +25596,7 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -4890,7 +25605,7 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -4911,88 +25626,592 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "latitude2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Latitude2': - ... - - def bandPosition(self, _: float, **kwds) -> 'Latitude2': - ... - - def bin(self, _: None, **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Latitude2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Latitude2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(Latitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Latitude2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Latitude2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Latitude2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Latitude2": + ... + + @overload + def bin(self, _: None, **kwds) -> "Latitude2": + ... + + @overload + def field(self, _: str, **kwds) -> "Latitude2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Latitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Latitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Latitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Latitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Latitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Latitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Latitude2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Latitude2": + ... + + @overload + def title(self, _: str, **kwds) -> "Latitude2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Latitude2": + ... + + @overload + def title(self, _: None, **kwds) -> "Latitude2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(Latitude2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class Latitude2Datum(DatumChannelMixin, core.DatumDef): """Latitude2Datum schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -5001,9 +26220,9 @@ class Latitude2Datum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5023,7 +26242,7 @@ class Latitude2Datum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -5093,54 +26312,75 @@ class Latitude2Datum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "latitude2" - def bandPosition(self, _: float, **kwds) -> 'Latitude2Datum': + @overload + def bandPosition(self, _: float, **kwds) -> "Latitude2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Latitude2Datum': + @overload + def title(self, _: str, **kwds) -> "Latitude2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Latitude2Datum': + @overload + def title(self, _: List[str], **kwds) -> "Latitude2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Latitude2Datum': + @overload + def title(self, _: None, **kwds) -> "Latitude2Datum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'Latitude2Datum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "Latitude2Datum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(Latitude2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, - type=type, **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Latitude2Datum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class Latitude2Value(ValueChannelMixin, core.PositionValueDef): """Latitude2Value schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "latitude2" - - def __init__(self, value, **kwds): super(Latitude2Value, self).__init__(value=value, **kwds) @@ -5149,14 +26389,14 @@ def __init__(self, value, **kwds): class Longitude(FieldChannelMixin, core.LatLongFieldDef): """Longitude schema wrapper - Mapping(required=[shorthand]) + :class:`LatLongFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -5189,7 +26429,7 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -5204,7 +26444,7 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -5213,7 +26453,7 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5233,7 +26473,7 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : string + type : str The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -5303,91 +26543,598 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "longitude" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Longitude': - ... - - def bandPosition(self, _: float, **kwds) -> 'Longitude': - ... - - def bin(self, _: None, **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Longitude': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Longitude': - ... - - def type(self, _: str, **kwds) -> 'Longitude': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Longitude, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Longitude": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Longitude": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Longitude": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Longitude": + ... + + @overload + def bin(self, _: None, **kwds) -> "Longitude": + ... + + @overload + def field(self, _: str, **kwds) -> "Longitude": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Longitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Longitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Longitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Longitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Longitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Longitude": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Longitude": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Longitude": + ... + + @overload + def title(self, _: str, **kwds) -> "Longitude": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Longitude": + ... + + @overload + def title(self, _: None, **kwds) -> "Longitude": + ... + + @overload + def type(self, _: str, **kwds) -> "Longitude": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(Longitude, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class LongitudeDatum(DatumChannelMixin, core.DatumDef): """LongitudeDatum schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -5396,9 +27143,9 @@ class LongitudeDatum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5418,7 +27165,7 @@ class LongitudeDatum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -5488,47 +27235,69 @@ class LongitudeDatum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "longitude" - def bandPosition(self, _: float, **kwds) -> 'LongitudeDatum': + @overload + def bandPosition(self, _: float, **kwds) -> "LongitudeDatum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'LongitudeDatum': + @overload + def title(self, _: str, **kwds) -> "LongitudeDatum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'LongitudeDatum': + @overload + def title(self, _: List[str], **kwds) -> "LongitudeDatum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'LongitudeDatum': + @overload + def title(self, _: None, **kwds) -> "LongitudeDatum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'LongitudeDatum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "LongitudeDatum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(LongitudeDatum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, - type=type, **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(LongitudeDatum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): """Longitude2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -5561,7 +27330,7 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -5576,7 +27345,7 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -5585,7 +27354,7 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5606,88 +27375,592 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "longitude2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Longitude2': - ... + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Longitude2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Longitude2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Longitude2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Longitude2": + ... + + @overload + def bin(self, _: None, **kwds) -> "Longitude2": + ... + + @overload + def field(self, _: str, **kwds) -> "Longitude2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Longitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Longitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Longitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Longitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Longitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Longitude2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Longitude2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Longitude2": + ... + + @overload + def title(self, _: str, **kwds) -> "Longitude2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Longitude2": + ... + + @overload + def title(self, _: None, **kwds) -> "Longitude2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(Longitude2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Longitude2': - ... - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Longitude2': - ... +@with_property_setters +class Longitude2Datum(DatumChannelMixin, core.DatumDef): + """Longitude2Datum schema wrapper - def bandPosition(self, _: float, **kwds) -> 'Longitude2': - ... - - def bin(self, _: None, **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Longitude2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Longitude2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(Longitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) - - -@with_property_setters -class Longitude2Datum(DatumChannelMixin, core.DatumDef): - """Longitude2Datum schema wrapper - - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -5696,9 +27969,9 @@ class Longitude2Datum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5718,7 +27991,7 @@ class Longitude2Datum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -5788,70 +28061,93 @@ class Longitude2Datum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "longitude2" - def bandPosition(self, _: float, **kwds) -> 'Longitude2Datum': + @overload + def bandPosition(self, _: float, **kwds) -> "Longitude2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Longitude2Datum': + @overload + def title(self, _: str, **kwds) -> "Longitude2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Longitude2Datum': + @overload + def title(self, _: List[str], **kwds) -> "Longitude2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Longitude2Datum': + @overload + def title(self, _: None, **kwds) -> "Longitude2Datum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'Longitude2Datum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "Longitude2Datum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(Longitude2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, - type=type, **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Longitude2Datum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class Longitude2Value(ValueChannelMixin, core.PositionValueDef): """Longitude2Value schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "longitude2" - - def __init__(self, value, **kwds): super(Longitude2Value, self).__init__(value=value, **kwds) @with_property_setters -class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): +class Opacity( + FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber +): """Opacity schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -5863,7 +28159,7 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -5884,14 +28180,14 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -5906,7 +28202,7 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -5915,7 +28211,7 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -5928,7 +28224,7 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -5967,7 +28263,7 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -5976,7 +28272,7 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5996,7 +28292,7 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -6066,170 +28362,2934 @@ class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldD **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "opacity" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Opacity': - ... - - def bandPosition(self, _: float, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Opacity': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Opacity': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Opacity': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Opacity, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Opacity": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Opacity": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def bin(self, _: None, **kwds) -> "Opacity": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "Opacity": + ... + + @overload + def field(self, _: str, **kwds) -> "Opacity": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def legend(self, _: None, **kwds) -> "Opacity": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def scale(self, _: None, **kwds) -> "Opacity": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Opacity": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Opacity": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Opacity": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Opacity": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Opacity": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def sort(self, _: None, **kwds) -> "Opacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Opacity": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Opacity": + ... + + @overload + def title(self, _: str, **kwds) -> "Opacity": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Opacity": + ... + + @overload + def title(self, _: None, **kwds) -> "Opacity": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Opacity": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Opacity, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): """OpacityDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict Parameters ---------- @@ -6238,16 +31298,16 @@ class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefn Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -6267,7 +31327,7 @@ class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefn 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -6337,95 +31397,862 @@ class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefn **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "opacity" - def bandPosition(self, _: float, **kwds) -> 'OpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'OpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'OpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'OpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'OpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'OpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'OpacityDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'OpacityDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(OpacityDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "OpacityDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "OpacityDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "OpacityDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "OpacityDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "OpacityDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "OpacityDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "OpacityDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "OpacityDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(OpacityDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class OpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): +class OpacityValue( + ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber +): """OpacityValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "opacity" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'OpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'OpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'OpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'OpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'OpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'OpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'OpacityValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "OpacityValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "OpacityValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "OpacityValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "OpacityValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "OpacityValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "OpacityValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "OpacityValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(OpacityValue, self).__init__(value=value, condition=condition, **kwds) @@ -6433,14 +32260,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Order(FieldChannelMixin, core.OrderFieldDef): """Order schema wrapper - Mapping(required=[shorthand]) + :class:`OrderFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -6452,7 +32279,7 @@ class Order(FieldChannelMixin, core.OrderFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -6473,7 +32300,7 @@ class Order(FieldChannelMixin, core.OrderFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -6488,9 +32315,9 @@ class Order(FieldChannelMixin, core.OrderFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - sort : :class:`SortOrder` + sort : :class:`SortOrder`, Literal['ascending', 'descending'] The sort order. One of ``"ascending"`` (default) or ``"descending"``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -6499,7 +32326,7 @@ class Order(FieldChannelMixin, core.OrderFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -6519,7 +32346,7 @@ class Order(FieldChannelMixin, core.OrderFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -6589,117 +32416,657 @@ class Order(FieldChannelMixin, core.OrderFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "order" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Order': - ... - - def bandPosition(self, _: float, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Order': - ... - - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Order': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Order': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Order': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, - **kwds): - super(Order, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, field=field, sort=sort, timeUnit=timeUnit, title=title, - type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Order": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Order": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Order": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Order": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Order": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Order": + ... + + @overload + def bin(self, _: str, **kwds) -> "Order": + ... + + @overload + def bin(self, _: None, **kwds) -> "Order": + ... + + @overload + def field(self, _: str, **kwds) -> "Order": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Order": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Order": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Order": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Order": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Order": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Order": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Order": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Order": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Order": + ... + + @overload + def title(self, _: str, **kwds) -> "Order": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Order": + ... + + @overload + def title(self, _: None, **kwds) -> "Order": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Order": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + sort: Union[ + Union[Literal["ascending", "descending"], core.SortOrder], UndefinedType + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Order, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class OrderValue(ValueChannelMixin, core.OrderValueDef): """OrderValue schema wrapper - Mapping(required=[value]) + :class:`OrderValueDef`, Dict[required=[value]] Parameters ---------- - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - condition : anyOf(:class:`ConditionalValueDefnumber`, List(:class:`ConditionalValueDefnumber`)) + condition : :class:`ConditionalParameterValueDefnumber`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumber`, Dict[required=[test, value]], :class:`ConditionalValueDefnumber`, Sequence[:class:`ConditionalParameterValueDefnumber`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumber`, Dict[required=[test, value]], :class:`ConditionalValueDefnumber`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. @@ -6707,23 +33074,78 @@ class OrderValue(ValueChannelMixin, core.OrderValueDef): value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. """ + _class_is_valid_at_instantiation = False _encoding_name = "order" - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'OrderValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'OrderValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumber], **kwds) -> 'OrderValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "OrderValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "OrderValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumber], **kwds + ) -> "OrderValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumber, dict], + Union[core.ConditionalPredicateValueDefnumber, dict], + core.ConditionalValueDefnumber, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumber, dict], + Union[core.ConditionalPredicateValueDefnumber, dict], + core.ConditionalValueDefnumber, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(OrderValue, self).__init__(value=value, condition=condition, **kwds) @@ -6731,14 +33153,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Radius(FieldChannelMixin, core.PositionFieldDefBase): """Radius schema wrapper - Mapping(required=[shorthand]) + :class:`PositionFieldDefBase`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -6750,7 +33172,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -6771,7 +33193,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -6786,7 +33208,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -6799,7 +33221,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -6838,7 +33260,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -6869,7 +33291,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -6878,7 +33300,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -6898,7 +33320,7 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -6968,196 +33390,1438 @@ class Radius(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "radius" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Radius': - ... - - def bandPosition(self, _: float, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Radius': - ... + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Radius": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Radius": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def bin(self, _: str, **kwds) -> "Radius": + ... + + @overload + def bin(self, _: None, **kwds) -> "Radius": + ... + + @overload + def field(self, _: str, **kwds) -> "Radius": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def scale(self, _: None, **kwds) -> "Radius": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Radius": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Radius": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Radius": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Radius": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Radius": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def sort(self, _: None, **kwds) -> "Radius": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "Radius": + ... + + @overload + def stack(self, _: None, **kwds) -> "Radius": + ... + + @overload + def stack(self, _: bool, **kwds) -> "Radius": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Radius": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Radius": + ... + + @overload + def title(self, _: str, **kwds) -> "Radius": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Radius": + ... + + @overload + def title(self, _: None, **kwds) -> "Radius": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Radius": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Radius, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + scale=scale, + sort=sort, + stack=stack, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Radius': - ... - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Radius': - ... +@with_property_setters +class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): + """RadiusDatum schema wrapper - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Radius': - ... + :class:`PositionDatumDefBase`, Dict - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Radius': - ... + Parameters + ---------- - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Radius': - ... + bandPosition : float + Relative position on a band of a stacked, binned, time unit, or band scale. For + example, the marks will be positioned at the beginning of the band if set to ``0``, + and at the middle of the band if set to ``0.5``. + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] + A constant value in data domain. + scale : :class:`Scale`, Dict, None + An object defining properties of the channel's scale, which is the function that + transforms values in the data domain (numbers, dates, strings, etc) to visual values + (pixels, colors, sizes) of the encoding channels. - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Radius': - ... + If ``null``, the scale will be `disabled and the data value will be directly encoded + <https://vega.github.io/vega-lite/docs/scale.html#disable>`__. - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Radius': - ... + **Default value:** If undefined, default `scale properties + <https://vega.github.io/vega-lite/docs/scale.html>`__ are applied. - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Radius': - ... + **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ + documentation. + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Radius': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Radius': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Radius': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(Radius, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, scale=scale, - sort=sort, stack=stack, timeUnit=timeUnit, title=title, type=type, - **kwds) - - -@with_property_setters -class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): - """RadiusDatum schema wrapper - - Mapping(required=[]) - - Parameters - ---------- - - bandPosition : float - Relative position on a band of a stacked, binned, time unit, or band scale. For - example, the marks will be positioned at the beginning of the band if set to ``0``, - and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) - A constant value in data domain. - scale : anyOf(:class:`Scale`, None) - An object defining properties of the channel's scale, which is the function that - transforms values in the data domain (numbers, dates, strings, etc) to visual values - (pixels, colors, sizes) of the encoding channels. - - If ``null``, the scale will be `disabled and the data value will be directly encoded - <https://vega.github.io/vega-lite/docs/scale.html#disable>`__. - - **Default value:** If undefined, default `scale properties - <https://vega.github.io/vega-lite/docs/scale.html>`__ are applied. - - **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ - documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) - Type of stacking offset if the field should be stacked. ``stack`` is only applicable - for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For - example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar - chart. - - ``stack`` can be one of the following values: + ``stack`` can be one of the following values: * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale @@ -7182,7 +34846,7 @@ class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -7202,7 +34866,7 @@ class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -7272,75 +34936,651 @@ class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "radius" - def bandPosition(self, _: float, **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'RadiusDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'RadiusDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'RadiusDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, scale=Undefined, stack=Undefined, title=Undefined, - type=Undefined, **kwds): - super(RadiusDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, - stack=stack, title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "RadiusDatum": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "RadiusDatum": + ... + + @overload + def scale(self, _: None, **kwds) -> "RadiusDatum": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "RadiusDatum": + ... + + @overload + def stack(self, _: None, **kwds) -> "RadiusDatum": + ... + + @overload + def stack(self, _: bool, **kwds) -> "RadiusDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "RadiusDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "RadiusDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "RadiusDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "RadiusDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(RadiusDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + scale=scale, + stack=stack, + title=title, + type=type, + **kwds, + ) @with_property_setters class RadiusValue(ValueChannelMixin, core.PositionValueDef): """RadiusValue schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "radius" - - def __init__(self, value, **kwds): super(RadiusValue, self).__init__(value=value, **kwds) @@ -7349,16 +35589,16 @@ def __init__(self, value, **kwds): class Radius2(FieldChannelMixin, core.SecondaryFieldDef): """Radius2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -7391,7 +35631,7 @@ class Radius2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -7406,7 +35646,7 @@ class Radius2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -7415,7 +35655,7 @@ class Radius2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -7436,88 +35676,592 @@ class Radius2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "radius2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Radius2': - ... - - def bandPosition(self, _: float, **kwds) -> 'Radius2': - ... - - def bin(self, _: None, **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Radius2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Radius2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(Radius2, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Radius2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Radius2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Radius2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Radius2": + ... + + @overload + def bin(self, _: None, **kwds) -> "Radius2": + ... + + @overload + def field(self, _: str, **kwds) -> "Radius2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Radius2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Radius2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Radius2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Radius2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Radius2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Radius2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Radius2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Radius2": + ... + + @overload + def title(self, _: str, **kwds) -> "Radius2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Radius2": + ... + + @overload + def title(self, _: None, **kwds) -> "Radius2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(Radius2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class Radius2Datum(DatumChannelMixin, core.DatumDef): """Radius2Datum schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -7526,9 +36270,9 @@ class Radius2Datum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -7548,7 +36292,7 @@ class Radius2Datum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -7618,54 +36362,75 @@ class Radius2Datum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "radius2" - def bandPosition(self, _: float, **kwds) -> 'Radius2Datum': + @overload + def bandPosition(self, _: float, **kwds) -> "Radius2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Radius2Datum': + @overload + def title(self, _: str, **kwds) -> "Radius2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Radius2Datum': + @overload + def title(self, _: List[str], **kwds) -> "Radius2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Radius2Datum': + @overload + def title(self, _: None, **kwds) -> "Radius2Datum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'Radius2Datum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "Radius2Datum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(Radius2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, - type=type, **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Radius2Datum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class Radius2Value(ValueChannelMixin, core.PositionValueDef): """Radius2Value schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "radius2" - - def __init__(self, value, **kwds): super(Radius2Value, self).__init__(value=value, **kwds) @@ -7674,14 +36439,14 @@ def __init__(self, value, **kwds): class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): """Row schema wrapper - Mapping(required=[shorthand]) + :class:`RowColumnEncodingFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -7689,7 +36454,7 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - align : :class:`LayoutAlign` + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'] The alignment to apply to row/column facet's subplot. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -7707,7 +36472,7 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -7728,12 +36493,12 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - center : boolean + center : bool Boolean flag indicating if facet's subviews should be centered relative to their respective rows or columns. **Default value:** ``false`` - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -7748,9 +36513,9 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - header : anyOf(:class:`Header`, None) + header : :class:`Header`, Dict, None An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + sort : :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortOrder`, Literal['ascending', 'descending'], None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -7783,7 +36548,7 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -7792,7 +36557,7 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -7812,7 +36577,7 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -7882,155 +36647,1244 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "row" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Row': - ... - - def align(self, _: Literal["all", "each", "none"], **kwds) -> 'Row': - ... - - def bandPosition(self, _: float, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Row': - ... - - def center(self, _: bool, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def header(self, format=Undefined, formatType=Undefined, labelAlign=Undefined, labelAnchor=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOrient=Undefined, labelPadding=Undefined, labels=Undefined, orient=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOrient=Undefined, titlePadding=Undefined, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def header(self, _: None, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Row': - ... - - def spacing(self, _: float, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Row': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Row': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Row': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, - bandPosition=Undefined, bin=Undefined, center=Undefined, field=Undefined, - header=Undefined, sort=Undefined, spacing=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(Row, self).__init__(shorthand=shorthand, aggregate=aggregate, align=align, - bandPosition=bandPosition, bin=bin, center=center, field=field, - header=header, sort=sort, spacing=spacing, timeUnit=timeUnit, - title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Row": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Row": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Row": + ... + + @overload + def align(self, _: Literal["all", "each", "none"], **kwds) -> "Row": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Row": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Row": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Row": + ... + + @overload + def bin(self, _: None, **kwds) -> "Row": + ... + + @overload + def center(self, _: bool, **kwds) -> "Row": + ... + + @overload + def field(self, _: str, **kwds) -> "Row": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Row": + ... + + @overload + def header( + self, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAnchor: Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + UndefinedType, + ] = Undefined, + labelAngle: Union[float, UndefinedType] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOrient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + orient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + UndefinedType, + ] = Undefined, + titleAngle: Union[float, UndefinedType] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Row": + ... + + @overload + def header(self, _: None, **kwds) -> "Row": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Row": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Row": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Row": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Row": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Row": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Row": + ... + + @overload + def sort(self, _: None, **kwds) -> "Row": + ... + + @overload + def spacing(self, _: float, **kwds) -> "Row": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Row": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Row": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Row": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Row": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Row": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Row": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Row": + ... + + @overload + def title(self, _: str, **kwds) -> "Row": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Row": + ... + + @overload + def title(self, _: None, **kwds) -> "Row": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Row": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], UndefinedType + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + center: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + header: Union[Union[None, Union[core.Header, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[core.EncodingSortField, dict], + ], + UndefinedType, + ] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Row, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + align=align, + bandPosition=bandPosition, + bin=bin, + center=center, + field=field, + header=header, + sort=sort, + spacing=spacing, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull): +class Shape( + FieldChannelMixin, + core.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull, +): """Shape schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -8042,7 +37896,7 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -8063,14 +37917,14 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -8085,7 +37939,7 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -8094,7 +37948,7 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -8107,7 +37961,7 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -8146,7 +38000,7 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -8155,7 +38009,7 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -8175,7 +38029,7 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`TypeForShape` + type : :class:`TypeForShape`, Literal['nominal', 'ordinal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -8245,212 +38099,2973 @@ class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDef **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "shape" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Shape': - ... + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Shape": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Shape": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def bin(self, _: None, **kwds) -> "Shape": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds + ) -> "Shape": + ... + + @overload + def field(self, _: str, **kwds) -> "Shape": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def legend(self, _: None, **kwds) -> "Shape": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def scale(self, _: None, **kwds) -> "Shape": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Shape": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Shape": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Shape": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Shape": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Shape": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def sort(self, _: None, **kwds) -> "Shape": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Shape": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Shape": + ... + + @overload + def title(self, _: str, **kwds) -> "Shape": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Shape": + ... + + @overload + def title(self, _: None, **kwds) -> "Shape": + ... + + @overload + def type(self, _: Literal["nominal", "ordinal", "geojson"], **kwds) -> "Shape": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[Literal["nominal", "ordinal", "geojson"], core.TypeForShape], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Shape, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) - def bandPosition(self, _: float, **kwds) -> 'Shape': - ... - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Shape': - ... +@with_property_setters +class ShapeDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefstringnull +): + """ShapeDatum schema wrapper - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Shape': - ... + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, Dict - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Shape': - ... + Parameters + ---------- - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Shape': - ... + bandPosition : float + Relative position on a band of a stacked, binned, time unit, or band scale. For + example, the marks will be positioned at the beginning of the band if set to ``0``, + and at the middle of the band if set to ``0.5``. + condition : :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] + One or more value definition(s) with `a parameter or a test predicate + <https://vega.github.io/vega-lite/docs/condition.html>`__. - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Shape': - ... + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] + A constant value in data domain. + title : :class:`Text`, Sequence[str], str, None + A title for the field. If ``null``, the title will be removed. - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds) -> 'Shape': - ... + **Default value:** derived from the field's name and transformation function ( + ``aggregate``, ``bin`` and ``timeUnit`` ). If the field has an aggregate function, + the function is displayed as part of the title (e.g., ``"Sum of Profit"`` ). If the + field is binned or has a time unit applied, the applied function is shown in + parentheses (e.g., ``"Profit (binned)"``, ``"Transaction Date (year-month)"`` ). + Otherwise, the title is simply the field name. - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Shape': - ... + **Notes** : - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Shape': - ... + 1) You can customize the default field title format by providing the `fieldTitle + <https://vega.github.io/vega-lite/docs/config.html#top-level-config>`__ property in + the `config <https://vega.github.io/vega-lite/docs/config.html>`__ or `fieldTitle + function via the compile function's options + <https://vega.github.io/vega-lite/usage/compile.html#field-title>`__. - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Shape': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Shape': - ... - - def type(self, _: Literal["nominal", "ordinal", "geojson"], **kwds) -> 'Shape': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Shape, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, legend=legend, - scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, - **kwds) - - -@with_property_setters -class ShapeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefstringnull): - """ShapeDatum schema wrapper - - Mapping(required=[]) - - Parameters - ---------- - - bandPosition : float - Relative position on a band of a stacked, binned, time unit, or band scale. For - example, the marks will be positioned at the beginning of the band if set to ``0``, - and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) - One or more value definition(s) with `a parameter or a test predicate - <https://vega.github.io/vega-lite/docs/condition.html>`__. - - **Note:** A field definition's ``condition`` property can only contain `conditional - value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ - since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) - A constant value in data domain. - title : anyOf(:class:`Text`, None) - A title for the field. If ``null``, the title will be removed. - - **Default value:** derived from the field's name and transformation function ( - ``aggregate``, ``bin`` and ``timeUnit`` ). If the field has an aggregate function, - the function is displayed as part of the title (e.g., ``"Sum of Profit"`` ). If the - field is binned or has a time unit applied, the applied function is shown in - parentheses (e.g., ``"Profit (binned)"``, ``"Transaction Date (year-month)"`` ). - Otherwise, the title is simply the field name. - - **Notes** : - - 1) You can customize the default field title format by providing the `fieldTitle - <https://vega.github.io/vega-lite/docs/config.html#top-level-config>`__ property in - the `config <https://vega.github.io/vega-lite/docs/config.html>`__ or `fieldTitle - function via the compile function's options - <https://vega.github.io/vega-lite/usage/compile.html#field-title>`__. - - 2) If both field definition's ``title`` and axis, header, or legend ``title`` are - defined, axis/header/legend title will be used. - type : :class:`Type` - The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or - ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also - be a ``"geojson"`` type for encoding `'geoshape' - <https://vega.github.io/vega-lite/docs/geoshape.html>`__. + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] + The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or + ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also + be a ``"geojson"`` type for encoding `'geoshape' + <https://vega.github.io/vega-lite/docs/geoshape.html>`__. Vega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding @@ -8516,95 +41131,863 @@ class ShapeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefstr **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "shape" - def bandPosition(self, _: float, **kwds) -> 'ShapeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'ShapeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'ShapeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds) -> 'ShapeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'ShapeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'ShapeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'ShapeDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'ShapeDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(ShapeDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "ShapeDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "ShapeDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "ShapeDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds + ) -> "ShapeDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "ShapeDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "ShapeDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "ShapeDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "ShapeDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ShapeDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class ShapeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull): +class ShapeValue( + ValueChannelMixin, + core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull, +): """ShapeValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "shape" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ShapeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ShapeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ShapeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'ShapeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'ShapeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'ShapeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds) -> 'ShapeValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[Literal["nominal", "ordinal", "geojson"], core.TypeForShape], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ShapeValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ShapeValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[Literal["nominal", "ordinal", "geojson"], core.TypeForShape], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ShapeValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "ShapeValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "ShapeValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "ShapeValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds + ) -> "ShapeValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ] + ], + Union[ + Union[ + core.ConditionalParameterMarkPropFieldOrDatumDefTypeForShape, + dict, + ], + Union[ + core.ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape, + dict, + ], + core.ConditionalMarkPropFieldOrDatumDefTypeForShape, + ], + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(ShapeValue, self).__init__(value=value, condition=condition, **kwds) @@ -8612,14 +41995,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): """Size schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -8631,7 +42014,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -8652,14 +42035,14 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -8674,7 +42057,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -8683,7 +42066,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -8696,7 +42079,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -8735,7 +42118,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -8744,7 +42127,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -8764,7 +42147,7 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -8834,170 +42217,2934 @@ class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefn **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "size" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Size': - ... - - def bandPosition(self, _: float, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Size': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Size': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Size': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Size, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, legend=legend, - scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, - **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Size": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Size": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Size": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def bin(self, _: None, **kwds) -> "Size": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "Size": + ... + + @overload + def field(self, _: str, **kwds) -> "Size": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def legend(self, _: None, **kwds) -> "Size": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def scale(self, _: None, **kwds) -> "Size": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Size": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Size": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Size": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Size": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Size": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Size": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Size": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def sort(self, _: None, **kwds) -> "Size": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Size": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Size": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Size": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Size": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Size": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Size": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Size": + ... + + @overload + def title(self, _: str, **kwds) -> "Size": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Size": + ... + + @overload + def title(self, _: None, **kwds) -> "Size": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Size": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Size, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): """SizeDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict Parameters ---------- @@ -9006,16 +45153,16 @@ class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumb Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -9035,7 +45182,7 @@ class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumb 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -9105,110 +45252,881 @@ class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumb **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "size" - def bandPosition(self, _: float, **kwds) -> 'SizeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'SizeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'SizeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'SizeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'SizeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'SizeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'SizeDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'SizeDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(SizeDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "SizeDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "SizeDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "SizeDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "SizeDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "SizeDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "SizeDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "SizeDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "SizeDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(SizeDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class SizeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): +class SizeValue( + ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber +): """SizeValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "size" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'SizeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'SizeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'SizeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'SizeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'SizeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'SizeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'SizeValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "SizeValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "SizeValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "SizeValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "SizeValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "SizeValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "SizeValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "SizeValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(SizeValue, self).__init__(value=value, condition=condition, **kwds) @with_property_setters -class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): +class Stroke( + FieldChannelMixin, + core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, +): """Stroke schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -9220,7 +46138,7 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -9241,14 +46159,14 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -9263,7 +46181,7 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -9272,7 +46190,7 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -9285,7 +46203,7 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -9324,7 +46242,7 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -9333,7 +46251,7 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -9353,7 +46271,7 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -9423,188 +46341,2984 @@ class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDe **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "stroke" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Stroke': - ... + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Stroke": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Stroke": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def bin(self, _: None, **kwds) -> "Stroke": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "Stroke": + ... + + @overload + def field(self, _: str, **kwds) -> "Stroke": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def legend(self, _: None, **kwds) -> "Stroke": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def scale(self, _: None, **kwds) -> "Stroke": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Stroke": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Stroke": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Stroke": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Stroke": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Stroke": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def sort(self, _: None, **kwds) -> "Stroke": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Stroke": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Stroke": + ... + + @overload + def title(self, _: str, **kwds) -> "Stroke": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Stroke": + ... + + @overload + def title(self, _: None, **kwds) -> "Stroke": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Stroke": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Stroke, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) - def bandPosition(self, _: float, **kwds) -> 'Stroke': - ... - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Stroke': - ... +@with_property_setters +class StrokeDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull +): + """StrokeDatum schema wrapper - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Stroke': - ... + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Stroke': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Stroke': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Stroke': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Stroke, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, type=type, **kwds) - - -@with_property_setters -class StrokeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): - """StrokeDatum schema wrapper - - Mapping(required=[]) - - Parameters - ---------- + Parameters + ---------- bandPosition : float Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -9624,7 +49338,7 @@ class StrokeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGr 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -9694,110 +49408,940 @@ class StrokeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGr **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "stroke" - def bandPosition(self, _: float, **kwds) -> 'StrokeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'StrokeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'StrokeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'StrokeDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'StrokeDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'StrokeDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(StrokeDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "StrokeDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "StrokeDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "StrokeDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "StrokeDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "StrokeDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "StrokeDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class StrokeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): +class StrokeValue( + ValueChannelMixin, + core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, +): """StrokeValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "stroke" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds) -> 'StrokeValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefGradientstringnullExprRef], **kwds + ) -> "StrokeValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, + dict, + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, + dict, + ], + core.ConditionalValueDefGradientstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[ + core.ConditionalParameterValueDefGradientstringnullExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefGradientstringnullExprRef, dict + ], + core.ConditionalValueDefGradientstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(StrokeValue, self).__init__(value=value, condition=condition, **kwds) @with_property_setters -class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray): +class StrokeDash( + FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray +): """StrokeDash schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -9809,7 +50353,7 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -9830,14 +50374,14 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, List(:class:`ConditionalValueDefnumberArrayExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -9852,7 +50396,7 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -9861,7 +50405,7 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -9874,7 +50418,7 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -9913,7 +50457,7 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -9922,7 +50466,7 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -9942,7 +50486,7 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10012,170 +50556,2942 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeDash" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'StrokeDash': - ... - - def bandPosition(self, _: float, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberArrayExprRef], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'StrokeDash': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'StrokeDash': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'StrokeDash': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(StrokeDash, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "StrokeDash": + ... + + @overload + def bin(self, _: bool, **kwds) -> "StrokeDash": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def bin(self, _: None, **kwds) -> "StrokeDash": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberArrayExprRef], **kwds + ) -> "StrokeDash": + ... + + @overload + def field(self, _: str, **kwds) -> "StrokeDash": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def legend(self, _: None, **kwds) -> "StrokeDash": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def scale(self, _: None, **kwds) -> "StrokeDash": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "StrokeDash": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "StrokeDash": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "StrokeDash": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "StrokeDash": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "StrokeDash": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def sort(self, _: None, **kwds) -> "StrokeDash": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "StrokeDash": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "StrokeDash": + ... + + @overload + def title(self, _: str, **kwds) -> "StrokeDash": + ... + + @overload + def title(self, _: List[str], **kwds) -> "StrokeDash": + ... + + @overload + def title(self, _: None, **kwds) -> "StrokeDash": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "StrokeDash": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefnumberArrayExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefnumberArrayExprRef, dict + ], + core.ConditionalValueDefnumberArrayExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberArrayExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberArrayExprRef, dict], + core.ConditionalValueDefnumberArrayExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeDash, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumberArray): +class StrokeDashDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumberArray +): """StrokeDashDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, Dict Parameters ---------- @@ -10184,16 +53500,16 @@ class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumD Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, List(:class:`ConditionalValueDefnumberArrayExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -10213,7 +53529,7 @@ class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumD 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10283,110 +53599,891 @@ class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumD **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeDash" - def bandPosition(self, _: float, **kwds) -> 'StrokeDashDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeDashDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeDashDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberArrayExprRef], **kwds) -> 'StrokeDashDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'StrokeDashDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'StrokeDashDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'StrokeDashDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'StrokeDashDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(StrokeDashDatum, self).__init__(datum=datum, bandPosition=bandPosition, - condition=condition, title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "StrokeDashDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberArrayExprRef], **kwds + ) -> "StrokeDashDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "StrokeDashDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "StrokeDashDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "StrokeDashDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "StrokeDashDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefnumberArrayExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefnumberArrayExprRef, dict + ], + core.ConditionalValueDefnumberArrayExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberArrayExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberArrayExprRef, dict], + core.ConditionalValueDefnumberArrayExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeDashDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class StrokeDashValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray): +class StrokeDashValue( + ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray +): """StrokeDashValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberArrayExprRef`, List(:class:`ConditionalValueDefnumberArrayExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(List(float), :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeDash" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeDashValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeDashValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeDashValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeDashValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeDashValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeDashValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberArrayExprRef], **kwds) -> 'StrokeDashValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeDashValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberArrayExprRef], **kwds + ) -> "StrokeDashValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[ + core.ConditionalParameterValueDefnumberArrayExprRef, dict + ], + Union[ + core.ConditionalPredicateValueDefnumberArrayExprRef, dict + ], + core.ConditionalValueDefnumberArrayExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefnumberArrayExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberArrayExprRef, dict], + core.ConditionalValueDefnumberArrayExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(StrokeDashValue, self).__init__(value=value, condition=condition, **kwds) @with_property_setters -class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): +class StrokeOpacity( + FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber +): """StrokeOpacity schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -10398,7 +54495,7 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -10419,14 +54516,14 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -10441,7 +54538,7 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -10450,7 +54547,7 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -10463,7 +54560,7 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -10502,7 +54599,7 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -10511,7 +54608,7 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -10531,7 +54628,7 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10562,209 +54659,2975 @@ class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkProp (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is ``order``. - 2) For a constant value in data domain ( ``datum`` ): - - - * ``"quantitative"`` if the datum is a number - * ``"nominal"`` if the datum is a string - * ``"temporal"`` if the datum is `a date time object - <https://vega.github.io/vega-lite/docs/datetime.html>`__ - - **Note:** - - - * Data ``type`` describes the semantics of the data rather than the primitive data - types (number, string, etc.). The same primitive data type can have different - types of measurement. For example, numeric data can represent quantitative, - ordinal, or nominal data. - * Data values for a temporal field can be either a date-time string (e.g., - ``"2015-03-07 12:32:17"``, ``"17:01"``, ``"2015-03-16"``. ``"2015"`` ) or a - timestamp number (e.g., ``1552199579097`` ). - * When using with `bin <https://vega.github.io/vega-lite/docs/bin.html>`__, the - ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) - or `"ordinal" (for using an ordinal bin scale) - <https://vega.github.io/vega-lite/docs/type.html#cast-bin>`__. - * When using with `timeUnit - <https://vega.github.io/vega-lite/docs/timeunit.html>`__, the ``type`` property - can be either ``"temporal"`` (default, for using a temporal scale) or `"ordinal" - (for using an ordinal scale) - <https://vega.github.io/vega-lite/docs/type.html#cast-bin>`__. - * When using with `aggregate - <https://vega.github.io/vega-lite/docs/aggregate.html>`__, the ``type`` property - refers to the post-aggregation data type. For example, we can calculate count - ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", - "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they must have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ - documentation. - """ - _class_is_valid_at_instantiation = False - _encoding_name = "strokeOpacity" - - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'StrokeOpacity': - ... - - def bandPosition(self, _: float, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'StrokeOpacity': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'StrokeOpacity': - ... + 2) For a constant value in data domain ( ``datum`` ): - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'StrokeOpacity': - ... - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'StrokeOpacity': - ... + * ``"quantitative"`` if the datum is a number + * ``"nominal"`` if the datum is a string + * ``"temporal"`` if the datum is `a date time object + <https://vega.github.io/vega-lite/docs/datetime.html>`__ - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'StrokeOpacity': - ... + **Note:** - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'StrokeOpacity': - ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'StrokeOpacity': - ... + * Data ``type`` describes the semantics of the data rather than the primitive data + types (number, string, etc.). The same primitive data type can have different + types of measurement. For example, numeric data can represent quantitative, + ordinal, or nominal data. + * Data values for a temporal field can be either a date-time string (e.g., + ``"2015-03-07 12:32:17"``, ``"17:01"``, ``"2015-03-16"``. ``"2015"`` ) or a + timestamp number (e.g., ``1552199579097`` ). + * When using with `bin <https://vega.github.io/vega-lite/docs/bin.html>`__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + <https://vega.github.io/vega-lite/docs/type.html#cast-bin>`__. + * When using with `timeUnit + <https://vega.github.io/vega-lite/docs/timeunit.html>`__, the ``type`` property + can be either ``"temporal"`` (default, for using a temporal scale) or `"ordinal" + (for using an ordinal scale) + <https://vega.github.io/vega-lite/docs/type.html#cast-bin>`__. + * When using with `aggregate + <https://vega.github.io/vega-lite/docs/aggregate.html>`__, the ``type`` property + refers to the post-aggregation data type. For example, we can calculate count + ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", + "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they must have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'StrokeOpacity': - ... + **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(StrokeOpacity, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "StrokeOpacity": + ... + + @overload + def bin(self, _: bool, **kwds) -> "StrokeOpacity": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def bin(self, _: None, **kwds) -> "StrokeOpacity": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "StrokeOpacity": + ... + + @overload + def field(self, _: str, **kwds) -> "StrokeOpacity": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def legend(self, _: None, **kwds) -> "StrokeOpacity": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def scale(self, _: None, **kwds) -> "StrokeOpacity": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "StrokeOpacity": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "StrokeOpacity": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "StrokeOpacity": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "StrokeOpacity": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "StrokeOpacity": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def sort(self, _: None, **kwds) -> "StrokeOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "StrokeOpacity": + ... + + @overload + def title(self, _: str, **kwds) -> "StrokeOpacity": + ... + + @overload + def title(self, _: List[str], **kwds) -> "StrokeOpacity": + ... + + @overload + def title(self, _: None, **kwds) -> "StrokeOpacity": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "StrokeOpacity": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeOpacity, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class StrokeOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): +class StrokeOpacityDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber +): """StrokeOpacityDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict Parameters ---------- @@ -10773,16 +57636,16 @@ class StrokeOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDat Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -10802,7 +57665,7 @@ class StrokeOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDat 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10872,110 +57735,881 @@ class StrokeOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDat **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeOpacity" - def bandPosition(self, _: float, **kwds) -> 'StrokeOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'StrokeOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'StrokeOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'StrokeOpacityDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'StrokeOpacityDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'StrokeOpacityDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(StrokeOpacityDatum, self).__init__(datum=datum, bandPosition=bandPosition, - condition=condition, title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "StrokeOpacityDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacityDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacityDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "StrokeOpacityDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "StrokeOpacityDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "StrokeOpacityDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "StrokeOpacityDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "StrokeOpacityDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeOpacityDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class StrokeOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): +class StrokeOpacityValue( + ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber +): """StrokeOpacityValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeOpacity" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeOpacityValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'StrokeOpacityValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): - super(StrokeOpacityValue, self).__init__(value=value, condition=condition, **kwds) + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeOpacityValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeOpacityValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeOpacityValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeOpacityValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacityValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeOpacityValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "StrokeOpacityValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeOpacityValue, self).__init__( + value=value, condition=condition, **kwds + ) @with_property_setters -class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): +class StrokeWidth( + FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber +): """StrokeWidth schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -10987,7 +58621,7 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -11008,14 +58642,14 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -11030,7 +58664,7 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -11039,7 +58673,7 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -11052,7 +58686,7 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -11091,7 +58725,7 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -11100,7 +58734,7 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -11120,7 +58754,7 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -11190,170 +58824,2936 @@ class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFi **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeWidth" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'StrokeWidth': - ... - - def bandPosition(self, _: float, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def legend(self, _: None, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'StrokeWidth': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'StrokeWidth': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'StrokeWidth': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(StrokeWidth, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "StrokeWidth": + ... + + @overload + def bin(self, _: bool, **kwds) -> "StrokeWidth": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def bin(self, _: None, **kwds) -> "StrokeWidth": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "StrokeWidth": + ... + + @overload + def field(self, _: str, **kwds) -> "StrokeWidth": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def legend( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union[Literal["all", "each", "none"], core.LayoutAlign], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + core.LegendOrient, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + symbolDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.SymbolShape, str] + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.TimeIntervalStep, dict], + core.TickCount, + float, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union[Literal["left", "right", "top", "bottom"], core.Orient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def legend(self, _: None, **kwds) -> "StrokeWidth": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def scale(self, _: None, **kwds) -> "StrokeWidth": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "StrokeWidth": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "StrokeWidth": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "StrokeWidth": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "StrokeWidth": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "StrokeWidth": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def sort(self, _: None, **kwds) -> "StrokeWidth": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "StrokeWidth": + ... + + @overload + def title(self, _: str, **kwds) -> "StrokeWidth": + ... + + @overload + def title(self, _: List[str], **kwds) -> "StrokeWidth": + ... + + @overload + def title(self, _: None, **kwds) -> "StrokeWidth": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "StrokeWidth": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeWidth, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters -class StrokeWidthDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): +class StrokeWidthDatum( + DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber +): """StrokeWidthDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict Parameters ---------- @@ -11362,16 +61762,16 @@ class StrokeWidthDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatum Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -11391,7 +61791,7 @@ class StrokeWidthDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatum 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -11461,95 +61861,862 @@ class StrokeWidthDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatum **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeWidth" - def bandPosition(self, _: float, **kwds) -> 'StrokeWidthDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeWidthDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeWidthDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'StrokeWidthDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'StrokeWidthDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'StrokeWidthDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'StrokeWidthDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'StrokeWidthDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, - type=Undefined, **kwds): - super(StrokeWidthDatum, self).__init__(datum=datum, bandPosition=bandPosition, - condition=condition, title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "StrokeWidthDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidthDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidthDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "StrokeWidthDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "StrokeWidthDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "StrokeWidthDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "StrokeWidthDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "StrokeWidthDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StrokeWidthDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + title=title, + type=type, + **kwds, + ) @with_property_setters -class StrokeWidthValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): +class StrokeWidthValue( + ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber +): """StrokeWidthValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "strokeWidth" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeWidthValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeWidthValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeWidthValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'StrokeWidthValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'StrokeWidthValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'StrokeWidthValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefnumberExprRef], **kwds) -> 'StrokeWidthValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeWidthValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeWidthValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeWidthValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "StrokeWidthValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidthValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> "StrokeWidthValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefnumberExprRef], **kwds + ) -> "StrokeWidthValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefnumberExprRef, dict], + Union[core.ConditionalPredicateValueDefnumberExprRef, dict], + core.ConditionalValueDefnumberExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(StrokeWidthValue, self).__init__(value=value, condition=condition, **kwds) @@ -11557,14 +62724,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefText): """Text schema wrapper - Mapping(required=[shorthand]) + :class:`FieldOrDatumDefWithConditionStringFieldDefText`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -11576,7 +62743,7 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -11597,14 +62764,14 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + condition : :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`, Sequence[:class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -11619,7 +62786,7 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -11642,7 +62809,7 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -11653,7 +62820,7 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -11662,7 +62829,7 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -11682,7 +62849,7 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -11741,140 +62908,741 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex (for using an ordinal scale) <https://vega.github.io/vega-lite/docs/type.html#cast-bin>`__. * When using with `aggregate - <https://vega.github.io/vega-lite/docs/aggregate.html>`__, the ``type`` property - refers to the post-aggregation data type. For example, we can calculate count - ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", - "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they must have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ - documentation. - """ - _class_is_valid_at_instantiation = False - _encoding_name = "text" - - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Text': - ... - - def bandPosition(self, _: float, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefTextExprRef], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: str, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: dict, **kwds) -> 'Text': - ... - - def formatType(self, _: str, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Text': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Text': - ... + <https://vega.github.io/vega-lite/docs/aggregate.html>`__, the ``type`` property + refers to the post-aggregation data type. For example, we can calculate count + ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", + "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they must have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Text': - ... + **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "text" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Text, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, format=format, - formatType=formatType, timeUnit=timeUnit, title=title, type=type, - **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Text": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Text": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Text": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Text": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Text": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Text": + ... + + @overload + def bin(self, _: str, **kwds) -> "Text": + ... + + @overload + def bin(self, _: None, **kwds) -> "Text": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Text": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Text": + ... + + @overload + def condition(self, _: List[core.ConditionalValueDefTextExprRef], **kwds) -> "Text": + ... + + @overload + def field(self, _: str, **kwds) -> "Text": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Text": + ... + + @overload + def format(self, _: str, **kwds) -> "Text": + ... + + @overload + def format(self, _: dict, **kwds) -> "Text": + ... + + @overload + def formatType(self, _: str, **kwds) -> "Text": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Text": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Text": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Text": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Text": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Text": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Text": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Text": + ... + + @overload + def title(self, _: str, **kwds) -> "Text": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Text": + ... + + @overload + def title(self, _: None, **kwds) -> "Text": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Text": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefTextExprRef, dict], + Union[core.ConditionalPredicateValueDefTextExprRef, dict], + core.ConditionalValueDefTextExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefTextExprRef, dict], + Union[core.ConditionalPredicateValueDefTextExprRef, dict], + core.ConditionalValueDefTextExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Text, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumDefText): """TextDatum schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionStringDatumDefText`, Dict Parameters ---------- @@ -11883,16 +63651,16 @@ class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumD Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + condition : :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`, Sequence[:class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -11915,7 +63683,7 @@ class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumD format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -11926,7 +63694,7 @@ class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumD * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -11946,7 +63714,7 @@ class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumD 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -12016,99 +63784,702 @@ class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumD **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "text" - def bandPosition(self, _: float, **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefTextExprRef], **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: str, **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: dict, **kwds) -> 'TextDatum': - ... - - def formatType(self, _: str, **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'TextDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'TextDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'TextDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, condition=Undefined, format=Undefined, - formatType=Undefined, title=Undefined, type=Undefined, **kwds): - super(TextDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, - format=format, formatType=formatType, title=title, type=type, - **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "TextDatum": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TextDatum": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TextDatum": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefTextExprRef], **kwds + ) -> "TextDatum": + ... + + @overload + def format(self, _: str, **kwds) -> "TextDatum": + ... + + @overload + def format(self, _: dict, **kwds) -> "TextDatum": + ... + + @overload + def formatType(self, _: str, **kwds) -> "TextDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "TextDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "TextDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "TextDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "TextDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefTextExprRef, dict], + Union[core.ConditionalPredicateValueDefTextExprRef, dict], + core.ConditionalValueDefTextExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefTextExprRef, dict], + Union[core.ConditionalPredicateValueDefTextExprRef, dict], + core.ConditionalValueDefTextExprRef, + ], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(TextDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + condition=condition, + format=format, + formatType=formatType, + title=title, + type=type, + **kwds, + ) @with_property_setters class TextValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDefText): """TextValue schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionStringFieldDefText`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalStringFieldDef`, :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + condition : :class:`ConditionalParameterStringFieldDef`, Dict[required=[param]], :class:`ConditionalPredicateStringFieldDef`, Dict[required=[test]], :class:`ConditionalStringFieldDef`, :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`, Sequence[:class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(:class:`Text`, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "text" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, format=Undefined, formatType=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'TextValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, format=Undefined, formatType=Undefined, param=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'TextValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'TextValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'TextValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefTextExprRef], **kwds) -> 'TextValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TextValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TextValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TextValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TextValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefTextExprRef], **kwds + ) -> "TextValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefTextExprRef, dict], + Union[core.ConditionalPredicateValueDefTextExprRef, dict], + core.ConditionalValueDefTextExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterStringFieldDef, dict], + Union[core.ConditionalPredicateStringFieldDef, dict], + core.ConditionalStringFieldDef, + ], + Union[ + Union[core.ConditionalParameterValueDefTextExprRef, dict], + Union[core.ConditionalPredicateValueDefTextExprRef, dict], + core.ConditionalValueDefTextExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(TextValue, self).__init__(value=value, condition=condition, **kwds) @@ -12116,14 +64487,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Theta(FieldChannelMixin, core.PositionFieldDefBase): """Theta schema wrapper - Mapping(required=[shorthand]) + :class:`PositionFieldDefBase`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -12135,7 +64506,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -12156,7 +64527,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -12171,7 +64542,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -12184,7 +64555,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -12223,7 +64594,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -12254,7 +64625,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -12263,7 +64634,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12283,7 +64654,7 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -12353,165 +64724,1408 @@ class Theta(FieldChannelMixin, core.PositionFieldDefBase): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "theta" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Theta': - ... - - def bandPosition(self, _: float, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Theta': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Theta': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Theta': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(Theta, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, field=field, scale=scale, sort=sort, stack=stack, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Theta": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Theta": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def bin(self, _: str, **kwds) -> "Theta": + ... + + @overload + def bin(self, _: None, **kwds) -> "Theta": + ... + + @overload + def field(self, _: str, **kwds) -> "Theta": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def scale(self, _: None, **kwds) -> "Theta": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Theta": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Theta": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Theta": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Theta": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Theta": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def sort(self, _: None, **kwds) -> "Theta": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "Theta": + ... + + @overload + def stack(self, _: None, **kwds) -> "Theta": + ... + + @overload + def stack(self, _: bool, **kwds) -> "Theta": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Theta": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Theta": + ... + + @overload + def title(self, _: str, **kwds) -> "Theta": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Theta": + ... + + @overload + def title(self, _: None, **kwds) -> "Theta": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Theta": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Theta, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + scale=scale, + sort=sort, + stack=stack, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): """ThetaDatum schema wrapper - Mapping(required=[]) + :class:`PositionDatumDefBase`, Dict Parameters ---------- @@ -12520,9 +66134,9 @@ class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -12535,7 +66149,7 @@ class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -12566,7 +66180,7 @@ class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12586,7 +66200,7 @@ class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -12656,75 +66270,651 @@ class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "theta" - def bandPosition(self, _: float, **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'ThetaDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'ThetaDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'ThetaDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, scale=Undefined, stack=Undefined, title=Undefined, - type=Undefined, **kwds): - super(ThetaDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, - stack=stack, title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "ThetaDatum": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "ThetaDatum": + ... + + @overload + def scale(self, _: None, **kwds) -> "ThetaDatum": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "ThetaDatum": + ... + + @overload + def stack(self, _: None, **kwds) -> "ThetaDatum": + ... + + @overload + def stack(self, _: bool, **kwds) -> "ThetaDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "ThetaDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "ThetaDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "ThetaDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "ThetaDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ThetaDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + scale=scale, + stack=stack, + title=title, + type=type, + **kwds, + ) @with_property_setters class ThetaValue(ValueChannelMixin, core.PositionValueDef): """ThetaValue schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "theta" - - def __init__(self, value, **kwds): super(ThetaValue, self).__init__(value=value, **kwds) @@ -12733,16 +66923,16 @@ def __init__(self, value, **kwds): class Theta2(FieldChannelMixin, core.SecondaryFieldDef): """Theta2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -12775,7 +66965,7 @@ class Theta2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -12790,7 +66980,7 @@ class Theta2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -12799,7 +66989,7 @@ class Theta2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12820,88 +67010,592 @@ class Theta2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "theta2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Theta2': - ... - - def bandPosition(self, _: float, **kwds) -> 'Theta2': - ... - - def bin(self, _: None, **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Theta2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Theta2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(Theta2, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, - title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Theta2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Theta2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Theta2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Theta2": + ... + + @overload + def bin(self, _: None, **kwds) -> "Theta2": + ... + + @overload + def field(self, _: str, **kwds) -> "Theta2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Theta2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Theta2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Theta2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Theta2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Theta2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Theta2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Theta2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Theta2": + ... + + @overload + def title(self, _: str, **kwds) -> "Theta2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Theta2": + ... + + @overload + def title(self, _: None, **kwds) -> "Theta2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(Theta2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class Theta2Datum(DatumChannelMixin, core.DatumDef): """Theta2Datum schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -12910,9 +67604,9 @@ class Theta2Datum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12932,7 +67626,7 @@ class Theta2Datum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -13002,54 +67696,75 @@ class Theta2Datum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "theta2" - def bandPosition(self, _: float, **kwds) -> 'Theta2Datum': + @overload + def bandPosition(self, _: float, **kwds) -> "Theta2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Theta2Datum': + @overload + def title(self, _: str, **kwds) -> "Theta2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Theta2Datum': + @overload + def title(self, _: List[str], **kwds) -> "Theta2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Theta2Datum': + @overload + def title(self, _: None, **kwds) -> "Theta2Datum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'Theta2Datum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "Theta2Datum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(Theta2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, - type=type, **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Theta2Datum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class Theta2Value(ValueChannelMixin, core.PositionValueDef): """Theta2Value schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "theta2" - - def __init__(self, value, **kwds): super(Theta2Value, self).__init__(value=value, **kwds) @@ -13058,14 +67773,14 @@ def __init__(self, value, **kwds): class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): """Tooltip schema wrapper - Mapping(required=[shorthand]) + :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -13077,7 +67792,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -13098,14 +67813,14 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringExprRef`, List(:class:`ConditionalValueDefstringExprRef`)) + condition : :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`, Sequence[:class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -13120,7 +67835,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -13143,7 +67858,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -13154,7 +67869,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -13163,7 +67878,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -13183,7 +67898,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -13244,182 +67959,1461 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): * When using with `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__, the ``type`` property refers to the post-aggregation data type. For example, we can calculate count - ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", - "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they must have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ - documentation. - """ - _class_is_valid_at_instantiation = False - _encoding_name = "tooltip" - - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Tooltip': - ... - - def bandPosition(self, _: float, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringExprRef], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: str, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: dict, **kwds) -> 'Tooltip': - ... - - def formatType(self, _: str, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Tooltip': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Tooltip': - ... + ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", + "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they must have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Tooltip': - ... + **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "tooltip" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Tooltip, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, condition=condition, - field=field, format=format, formatType=formatType, - timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Tooltip": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Tooltip": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Tooltip": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Tooltip": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Tooltip": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Tooltip": + ... + + @overload + def bin(self, _: str, **kwds) -> "Tooltip": + ... + + @overload + def bin(self, _: None, **kwds) -> "Tooltip": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Tooltip": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Tooltip": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringExprRef], **kwds + ) -> "Tooltip": + ... + + @overload + def field(self, _: str, **kwds) -> "Tooltip": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Tooltip": + ... + + @overload + def format(self, _: str, **kwds) -> "Tooltip": + ... + + @overload + def format(self, _: dict, **kwds) -> "Tooltip": + ... + + @overload + def formatType(self, _: str, **kwds) -> "Tooltip": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Tooltip": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Tooltip": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Tooltip": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Tooltip": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Tooltip": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Tooltip": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Tooltip": + ... + + @overload + def title(self, _: str, **kwds) -> "Tooltip": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Tooltip": + ... + + @overload + def title(self, _: None, **kwds) -> "Tooltip": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Tooltip": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Tooltip, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class TooltipValue(ValueChannelMixin, core.StringValueDefWithCondition): """TooltipValue schema wrapper - Mapping(required=[]) + :class:`StringValueDefWithCondition`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "tooltip" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'TooltipValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'TooltipValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'TooltipValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'TooltipValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'TooltipValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'TooltipValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds) -> 'TooltipValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TooltipValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TooltipValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TooltipValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "TooltipValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "TooltipValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "TooltipValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds + ) -> "TooltipValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(TooltipValue, self).__init__(value=value, condition=condition, **kwds) @@ -13427,14 +69421,14 @@ def __init__(self, value, condition=Undefined, **kwds): class Url(FieldChannelMixin, core.StringFieldDefWithCondition): """Url schema wrapper - Mapping(required=[shorthand]) + :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -13446,7 +69440,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -13467,14 +69461,14 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringExprRef`, List(:class:`ConditionalValueDefstringExprRef`)) + condition : :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`, Sequence[:class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -13489,7 +69483,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -13512,7 +69506,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -13523,7 +69517,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -13532,7 +69526,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -13552,7 +69546,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -13622,173 +69616,1452 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "url" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Url': - ... - - def bandPosition(self, _: float, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringExprRef], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: str, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def format(self, _: dict, **kwds) -> 'Url': - ... - - def formatType(self, _: str, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Url': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Url': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Url': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Url, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, condition=condition, field=field, format=format, - formatType=formatType, timeUnit=timeUnit, title=title, type=type, - **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Url": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Url": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Url": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Url": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Url": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Url": + ... + + @overload + def bin(self, _: str, **kwds) -> "Url": + ... + + @overload + def bin(self, _: None, **kwds) -> "Url": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Url": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "Url": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringExprRef], **kwds + ) -> "Url": + ... + + @overload + def field(self, _: str, **kwds) -> "Url": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Url": + ... + + @overload + def format(self, _: str, **kwds) -> "Url": + ... + + @overload + def format(self, _: dict, **kwds) -> "Url": + ... + + @overload + def formatType(self, _: str, **kwds) -> "Url": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Url": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Url": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Url": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Url": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Url": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Url": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Url": + ... + + @overload + def title(self, _: str, **kwds) -> "Url": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Url": + ... + + @overload + def title(self, _: None, **kwds) -> "Url": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Url": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterValueDefstringExprRef, dict], + Union[core.ConditionalPredicateValueDefstringExprRef, dict], + core.ConditionalValueDefstringExprRef, + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Url, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class UrlValue(ValueChannelMixin, core.StringValueDefWithCondition): """UrlValue schema wrapper - Mapping(required=[]) + :class:`StringValueDefWithCondition`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "url" - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, test=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'UrlValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, legend=Undefined, scale=Undefined, test=Undefined, title=Undefined, type=Undefined, **kwds) -> 'UrlValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, empty=Undefined, field=Undefined, legend=Undefined, param=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds) -> 'UrlValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, bandPosition=Undefined, datum=Undefined, empty=Undefined, legend=Undefined, param=Undefined, scale=Undefined, title=Undefined, type=Undefined, **kwds) -> 'UrlValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, test=Undefined, value=Undefined, **kwds) -> 'UrlValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, empty=Undefined, param=Undefined, value=Undefined, **kwds) -> 'UrlValue': - ... - - @overload # type: ignore[no-overload-impl] - def condition(self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds) -> 'UrlValue': - ... - - - def __init__(self, value, condition=Undefined, **kwds): + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "UrlValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "UrlValue": + ... + + @overload + def condition( + self, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "UrlValue": + ... + + @overload + def condition( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union[None, bool, core.PrimitiveValue, float, str], + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.RepeatRef, dict], + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + legend: Union[Union[None, Union[core.Legend, dict]], UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "UrlValue": + ... + + @overload + def condition( + self, + test: Union[ + Union[ + Union[ + Union[core.FieldEqualPredicate, dict], + Union[core.FieldGTEPredicate, dict], + Union[core.FieldGTPredicate, dict], + Union[core.FieldLTEPredicate, dict], + Union[core.FieldLTPredicate, dict], + Union[core.FieldOneOfPredicate, dict], + Union[core.FieldRangePredicate, dict], + Union[core.FieldValidPredicate, dict], + Union[core.ParameterPredicate, dict], + core.Predicate, + str, + ], + Union[core.LogicalAndPredicate, dict], + Union[core.LogicalNotPredicate, dict], + Union[core.LogicalOrPredicate, dict], + core.PredicateComposition, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "UrlValue": + ... + + @overload + def condition( + self, + empty: Union[bool, UndefinedType] = Undefined, + param: Union[Union[core.ParameterName, str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + **kwds, + ) -> "UrlValue": + ... + + @overload + def condition( + self, _: List[core.ConditionalValueDefstringnullExprRef], **kwds + ) -> "UrlValue": + ... + + def __init__( + self, + value, + condition: Union[ + Union[ + Sequence[ + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ] + ], + Union[ + Union[core.ConditionalParameterMarkPropFieldOrDatumDef, dict], + Union[core.ConditionalPredicateMarkPropFieldOrDatumDef, dict], + core.ConditionalMarkPropFieldOrDatumDef, + ], + Union[ + Union[core.ConditionalParameterValueDefstringnullExprRef, dict], + Union[core.ConditionalPredicateValueDefstringnullExprRef, dict], + core.ConditionalValueDefstringnullExprRef, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(UrlValue, self).__init__(value=value, condition=condition, **kwds) @@ -13796,14 +71069,14 @@ def __init__(self, value, condition=Undefined, **kwds): class X(FieldChannelMixin, core.PositionFieldDef): """X schema wrapper - Mapping(required=[shorthand]) + :class:`PositionFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -13811,7 +71084,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - axis : anyOf(:class:`Axis`, None) + axis : :class:`Axis`, Dict, None An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -13824,7 +71097,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -13845,7 +71118,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -13860,7 +71133,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - impute : anyOf(:class:`ImputeParams`, None) + impute : :class:`ImputeParams`, Dict, None An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as ``key`` of the ``Impute`` Operation. The field of the ``color`` channel if specified is used as ``groupby`` of @@ -13868,7 +71141,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `impute <https://vega.github.io/vega-lite/docs/impute.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -13881,7 +71154,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -13920,7 +71193,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -13951,7 +71224,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -13960,7 +71233,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -13980,7 +71253,7 @@ class X(FieldChannelMixin, core.PositionFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -14050,187 +71323,2684 @@ class X(FieldChannelMixin, core.PositionFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "x" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def axis(self, aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, translate=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def axis(self, _: None, **kwds) -> 'X': - ... - - def bandPosition(self, _: float, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, frame=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, _: None, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'X': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'X': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'X': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bandPosition=Undefined, - bin=Undefined, field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, - stack=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(X, self).__init__(shorthand=shorthand, aggregate=aggregate, axis=axis, - bandPosition=bandPosition, bin=bin, field=field, impute=impute, - scale=scale, sort=sort, stack=stack, timeUnit=timeUnit, title=title, - type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "X": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def axis( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandPosition: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + domain: Union[bool, UndefinedType] = Undefined, + domainCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + domainDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + grid: Union[bool, UndefinedType] = Undefined, + gridCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ConditionalAxisLabelAlign, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ConditionalAxisLabelBaseline, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBound: Union[ + Union[Union[bool, float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFlush: Union[Union[bool, float], UndefinedType] = Undefined, + labelFlushOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFont: Union[ + Union[ + Union[core.ConditionalAxisString, dict], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + labelFontSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ConditionalAxisLabelFontStyle, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.FontStyle, str], + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ConditionalAxisLabelFontWeight, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + maxExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union[Literal["top", "bottom", "left", "right"], core.AxisOrient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + position: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tickBand: Union[ + Union[ + Literal["center", "extent"], Union[core.ExprRef, core._Parameter, dict] + ], + UndefinedType, + ] = Undefined, + tickCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickExtra: Union[bool, UndefinedType] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickRound: Union[bool, UndefinedType] = Undefined, + tickSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + ticks: Union[bool, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def axis(self, _: None, **kwds) -> "X": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "X": + ... + + @overload + def bin(self, _: bool, **kwds) -> "X": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def bin(self, _: str, **kwds) -> "X": + ... + + @overload + def bin(self, _: None, **kwds) -> "X": + ... + + @overload + def field(self, _: str, **kwds) -> "X": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def impute( + self, + frame: Union[Sequence[Union[None, float]], UndefinedType] = Undefined, + keyvals: Union[ + Union[Sequence[Any], Union[core.ImputeSequence, dict]], UndefinedType + ] = Undefined, + method: Union[ + Union[Literal["value", "median", "max", "min", "mean"], core.ImputeMethod], + UndefinedType, + ] = Undefined, + value: Union[Any, UndefinedType] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def impute(self, _: None, **kwds) -> "X": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def scale(self, _: None, **kwds) -> "X": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "X": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "X": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "X": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "X": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "X": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "X": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "X": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def sort(self, _: None, **kwds) -> "X": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "X": + ... + + @overload + def stack(self, _: None, **kwds) -> "X": + ... + + @overload + def stack(self, _: bool, **kwds) -> "X": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "X": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "X": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "X": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "X": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "X": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "X": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "X": + ... + + @overload + def title(self, _: str, **kwds) -> "X": + ... + + @overload + def title(self, _: List[str], **kwds) -> "X": + ... + + @overload + def title(self, _: None, **kwds) -> "X": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "X": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + axis: Union[Union[None, Union[core.Axis, dict]], UndefinedType] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + impute: Union[ + Union[None, Union[core.ImputeParams, dict]], UndefinedType + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(X, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + axis=axis, + bandPosition=bandPosition, + bin=bin, + field=field, + impute=impute, + scale=scale, + sort=sort, + stack=stack, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class XDatum(DatumChannelMixin, core.PositionDatumDef): """XDatum schema wrapper - Mapping(required=[]) + :class:`PositionDatumDef`, Dict Parameters ---------- - axis : anyOf(:class:`Axis`, None) + axis : :class:`Axis`, Dict, None An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -14243,9 +74013,9 @@ class XDatum(DatumChannelMixin, core.PositionDatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - impute : anyOf(:class:`ImputeParams`, None) + impute : :class:`ImputeParams`, Dict, None An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as ``key`` of the ``Impute`` Operation. The field of the ``color`` channel if specified is used as ``groupby`` of @@ -14253,7 +74023,7 @@ class XDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `impute <https://vega.github.io/vega-lite/docs/impute.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -14266,7 +74036,7 @@ class XDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -14297,7 +74067,7 @@ class XDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -14317,7 +74087,7 @@ class XDatum(DatumChannelMixin, core.PositionDatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -14387,91 +74157,1922 @@ class XDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "x" - @overload # type: ignore[no-overload-impl] - def axis(self, aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, translate=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def axis(self, _: None, **kwds) -> 'XDatum': - ... - - def bandPosition(self, _: float, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, frame=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, _: None, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'XDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'XDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'XDatum': - ... - - - def __init__(self, datum, axis=Undefined, bandPosition=Undefined, impute=Undefined, scale=Undefined, - stack=Undefined, title=Undefined, type=Undefined, **kwds): - super(XDatum, self).__init__(datum=datum, axis=axis, bandPosition=bandPosition, impute=impute, - scale=scale, stack=stack, title=title, type=type, **kwds) + @overload + def axis( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandPosition: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + domain: Union[bool, UndefinedType] = Undefined, + domainCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + domainDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + grid: Union[bool, UndefinedType] = Undefined, + gridCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ConditionalAxisLabelAlign, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ConditionalAxisLabelBaseline, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBound: Union[ + Union[Union[bool, float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFlush: Union[Union[bool, float], UndefinedType] = Undefined, + labelFlushOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFont: Union[ + Union[ + Union[core.ConditionalAxisString, dict], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + labelFontSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ConditionalAxisLabelFontStyle, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.FontStyle, str], + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ConditionalAxisLabelFontWeight, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + maxExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union[Literal["top", "bottom", "left", "right"], core.AxisOrient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + position: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tickBand: Union[ + Union[ + Literal["center", "extent"], Union[core.ExprRef, core._Parameter, dict] + ], + UndefinedType, + ] = Undefined, + tickCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickExtra: Union[bool, UndefinedType] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickRound: Union[bool, UndefinedType] = Undefined, + tickSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + ticks: Union[bool, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "XDatum": + ... + + @overload + def axis(self, _: None, **kwds) -> "XDatum": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "XDatum": + ... + + @overload + def impute( + self, + frame: Union[Sequence[Union[None, float]], UndefinedType] = Undefined, + keyvals: Union[ + Union[Sequence[Any], Union[core.ImputeSequence, dict]], UndefinedType + ] = Undefined, + method: Union[ + Union[Literal["value", "median", "max", "min", "mean"], core.ImputeMethod], + UndefinedType, + ] = Undefined, + value: Union[Any, UndefinedType] = Undefined, + **kwds, + ) -> "XDatum": + ... + + @overload + def impute(self, _: None, **kwds) -> "XDatum": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "XDatum": + ... + + @overload + def scale(self, _: None, **kwds) -> "XDatum": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "XDatum": + ... + + @overload + def stack(self, _: None, **kwds) -> "XDatum": + ... + + @overload + def stack(self, _: bool, **kwds) -> "XDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "XDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "XDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "XDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "XDatum": + ... + + def __init__( + self, + datum, + axis: Union[Union[None, Union[core.Axis, dict]], UndefinedType] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + impute: Union[ + Union[None, Union[core.ImputeParams, dict]], UndefinedType + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(XDatum, self).__init__( + datum=datum, + axis=axis, + bandPosition=bandPosition, + impute=impute, + scale=scale, + stack=stack, + title=title, + type=type, + **kwds, + ) @with_property_setters class XValue(ValueChannelMixin, core.PositionValueDef): """XValue schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "x" - - def __init__(self, value, **kwds): super(XValue, self).__init__(value=value, **kwds) @@ -14480,16 +76081,16 @@ def __init__(self, value, **kwds): class X2(FieldChannelMixin, core.SecondaryFieldDef): """X2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -14522,7 +76123,7 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -14537,7 +76138,7 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -14546,7 +76147,7 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -14567,87 +76168,592 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "x2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'X2': - ... - - def bandPosition(self, _: float, **kwds) -> 'X2': - ... - - def bin(self, _: None, **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'X2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'X2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(X2, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, field=field, timeUnit=timeUnit, title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "X2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "X2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "X2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "X2": + ... + + @overload + def bin(self, _: None, **kwds) -> "X2": + ... + + @overload + def field(self, _: str, **kwds) -> "X2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "X2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "X2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "X2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "X2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "X2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "X2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "X2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "X2": + ... + + @overload + def title(self, _: str, **kwds) -> "X2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "X2": + ... + + @overload + def title(self, _: None, **kwds) -> "X2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(X2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class X2Datum(DatumChannelMixin, core.DatumDef): """X2Datum schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -14656,9 +76762,9 @@ class X2Datum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -14678,7 +76784,7 @@ class X2Datum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -14748,54 +76854,75 @@ class X2Datum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "x2" - def bandPosition(self, _: float, **kwds) -> 'X2Datum': + @overload + def bandPosition(self, _: float, **kwds) -> "X2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'X2Datum': + @overload + def title(self, _: str, **kwds) -> "X2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'X2Datum': + @overload + def title(self, _: List[str], **kwds) -> "X2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'X2Datum': + @overload + def title(self, _: None, **kwds) -> "X2Datum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'X2Datum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "X2Datum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(X2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, type=type, - **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(X2Datum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class X2Value(ValueChannelMixin, core.PositionValueDef): """X2Value schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "x2" - - def __init__(self, value, **kwds): super(X2Value, self).__init__(value=value, **kwds) @@ -14804,16 +76931,16 @@ def __init__(self, value, **kwds): class XError(FieldChannelMixin, core.SecondaryFieldDef): """XError schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -14846,7 +76973,7 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -14861,7 +76988,7 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -14870,7 +76997,7 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -14891,88 +77018,592 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "xError" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'XError': - ... - - def bandPosition(self, _: float, **kwds) -> 'XError': - ... - - def bin(self, _: None, **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'XError': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'XError': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(XError, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, - title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "XError": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "XError": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "XError": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "XError": + ... + + @overload + def bin(self, _: None, **kwds) -> "XError": + ... + + @overload + def field(self, _: str, **kwds) -> "XError": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "XError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "XError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "XError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "XError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "XError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "XError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "XError": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "XError": + ... + + @overload + def title(self, _: str, **kwds) -> "XError": + ... + + @overload + def title(self, _: List[str], **kwds) -> "XError": + ... + + @overload + def title(self, _: None, **kwds) -> "XError": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(XError, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class XErrorValue(ValueChannelMixin, core.ValueDefnumber): """XErrorValue schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumber`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. @@ -14984,11 +77615,10 @@ class XErrorValue(ValueChannelMixin, core.ValueDefnumber): definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "xError" - - def __init__(self, value, **kwds): super(XErrorValue, self).__init__(value=value, **kwds) @@ -14997,16 +77627,16 @@ def __init__(self, value, **kwds): class XError2(FieldChannelMixin, core.SecondaryFieldDef): """XError2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -15039,7 +77669,7 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -15054,7 +77684,7 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -15063,7 +77693,7 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -15084,88 +77714,592 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "xError2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'XError2': - ... - - def bandPosition(self, _: float, **kwds) -> 'XError2': - ... - - def bin(self, _: None, **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'XError2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'XError2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(XError2, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "XError2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "XError2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "XError2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "XError2": + ... + + @overload + def bin(self, _: None, **kwds) -> "XError2": + ... + + @overload + def field(self, _: str, **kwds) -> "XError2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "XError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "XError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "XError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "XError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "XError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "XError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "XError2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "XError2": + ... + + @overload + def title(self, _: str, **kwds) -> "XError2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "XError2": + ... + + @overload + def title(self, _: None, **kwds) -> "XError2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(XError2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class XError2Value(ValueChannelMixin, core.ValueDefnumber): """XError2Value schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumber`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. @@ -15177,11 +78311,10 @@ class XError2Value(ValueChannelMixin, core.ValueDefnumber): definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "xError2" - - def __init__(self, value, **kwds): super(XError2Value, self).__init__(value=value, **kwds) @@ -15190,14 +78323,14 @@ def __init__(self, value, **kwds): class XOffset(FieldChannelMixin, core.ScaleFieldDef): """XOffset schema wrapper - Mapping(required=[shorthand]) + :class:`ScaleFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -15209,7 +78342,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -15230,7 +78363,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -15245,7 +78378,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -15258,7 +78391,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -15297,7 +78430,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -15306,7 +78439,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -15326,7 +78459,7 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -15396,149 +78529,1383 @@ class XOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "xOffset" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'XOffset': - ... - - def bandPosition(self, _: float, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'XOffset': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'XOffset': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'XOffset': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, - type=Undefined, **kwds): - super(XOffset, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "XOffset": + ... + + @overload + def bin(self, _: bool, **kwds) -> "XOffset": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def bin(self, _: None, **kwds) -> "XOffset": + ... + + @overload + def field(self, _: str, **kwds) -> "XOffset": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def scale(self, _: None, **kwds) -> "XOffset": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "XOffset": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "XOffset": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "XOffset": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "XOffset": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "XOffset": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def sort(self, _: None, **kwds) -> "XOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "XOffset": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "XOffset": + ... + + @overload + def title(self, _: str, **kwds) -> "XOffset": + ... + + @overload + def title(self, _: List[str], **kwds) -> "XOffset": + ... + + @overload + def title(self, _: None, **kwds) -> "XOffset": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "XOffset": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(XOffset, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class XOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): """XOffsetDatum schema wrapper - Mapping(required=[]) + :class:`ScaleDatumDef`, Dict Parameters ---------- @@ -15547,9 +79914,9 @@ class XOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -15562,7 +79929,7 @@ class XOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -15582,7 +79949,7 @@ class XOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -15652,47 +80019,615 @@ class XOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "xOffset" - def bandPosition(self, _: float, **kwds) -> 'XOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'XOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'XOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'XOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'XOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'XOffsetDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'XOffsetDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, scale=Undefined, title=Undefined, type=Undefined, - **kwds): - super(XOffsetDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "XOffsetDatum": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "XOffsetDatum": + ... + + @overload + def scale(self, _: None, **kwds) -> "XOffsetDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "XOffsetDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "XOffsetDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "XOffsetDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "XOffsetDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(XOffsetDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + scale=scale, + title=title, + type=type, + **kwds, + ) @with_property_setters class XOffsetValue(ValueChannelMixin, core.ValueDefnumber): """XOffsetValue schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumber`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. @@ -15704,11 +80639,10 @@ class XOffsetValue(ValueChannelMixin, core.ValueDefnumber): definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "xOffset" - - def __init__(self, value, **kwds): super(XOffsetValue, self).__init__(value=value, **kwds) @@ -15717,14 +80651,14 @@ def __init__(self, value, **kwds): class Y(FieldChannelMixin, core.PositionFieldDef): """Y schema wrapper - Mapping(required=[shorthand]) + :class:`PositionFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -15732,7 +80666,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - axis : anyOf(:class:`Axis`, None) + axis : :class:`Axis`, Dict, None An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -15745,7 +80679,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -15766,7 +80700,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -15781,7 +80715,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - impute : anyOf(:class:`ImputeParams`, None) + impute : :class:`ImputeParams`, Dict, None An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as ``key`` of the ``Impute`` Operation. The field of the ``color`` channel if specified is used as ``groupby`` of @@ -15789,7 +80723,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **See also:** `impute <https://vega.github.io/vega-lite/docs/impute.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -15802,7 +80736,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -15841,7 +80775,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -15872,7 +80806,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -15881,7 +80815,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -15901,7 +80835,7 @@ class Y(FieldChannelMixin, core.PositionFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -15962,196 +80896,2693 @@ class Y(FieldChannelMixin, core.PositionFieldDef): * When using with `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__, the ``type`` property refers to the post-aggregation data type. For example, we can calculate count - ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", - "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they must have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ - documentation. - """ - _class_is_valid_at_instantiation = False - _encoding_name = "y" - - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def axis(self, aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, translate=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def axis(self, _: None, **kwds) -> 'Y': - ... - - def bandPosition(self, _: float, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: str, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, frame=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, _: None, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Y': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Y': - ... + ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", + "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they must have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'Y': - ... + **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "y" - def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bandPosition=Undefined, - bin=Undefined, field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, - stack=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Y, self).__init__(shorthand=shorthand, aggregate=aggregate, axis=axis, - bandPosition=bandPosition, bin=bin, field=field, impute=impute, - scale=scale, sort=sort, stack=stack, timeUnit=timeUnit, title=title, - type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Y": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def axis( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandPosition: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + domain: Union[bool, UndefinedType] = Undefined, + domainCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + domainDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + grid: Union[bool, UndefinedType] = Undefined, + gridCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ConditionalAxisLabelAlign, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ConditionalAxisLabelBaseline, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBound: Union[ + Union[Union[bool, float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFlush: Union[Union[bool, float], UndefinedType] = Undefined, + labelFlushOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFont: Union[ + Union[ + Union[core.ConditionalAxisString, dict], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + labelFontSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ConditionalAxisLabelFontStyle, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.FontStyle, str], + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ConditionalAxisLabelFontWeight, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + maxExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union[Literal["top", "bottom", "left", "right"], core.AxisOrient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + position: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tickBand: Union[ + Union[ + Literal["center", "extent"], Union[core.ExprRef, core._Parameter, dict] + ], + UndefinedType, + ] = Undefined, + tickCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickExtra: Union[bool, UndefinedType] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickRound: Union[bool, UndefinedType] = Undefined, + tickSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + ticks: Union[bool, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def axis(self, _: None, **kwds) -> "Y": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Y": + ... + + @overload + def bin(self, _: bool, **kwds) -> "Y": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def bin(self, _: str, **kwds) -> "Y": + ... + + @overload + def bin(self, _: None, **kwds) -> "Y": + ... + + @overload + def field(self, _: str, **kwds) -> "Y": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def impute( + self, + frame: Union[Sequence[Union[None, float]], UndefinedType] = Undefined, + keyvals: Union[ + Union[Sequence[Any], Union[core.ImputeSequence, dict]], UndefinedType + ] = Undefined, + method: Union[ + Union[Literal["value", "median", "max", "min", "mean"], core.ImputeMethod], + UndefinedType, + ] = Undefined, + value: Union[Any, UndefinedType] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def impute(self, _: None, **kwds) -> "Y": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def scale(self, _: None, **kwds) -> "Y": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "Y": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "Y": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "Y": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "Y": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "Y": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "Y": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "Y": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def sort(self, _: None, **kwds) -> "Y": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "Y": + ... + + @overload + def stack(self, _: None, **kwds) -> "Y": + ... + + @overload + def stack(self, _: bool, **kwds) -> "Y": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Y": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Y": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Y": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Y": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Y": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Y": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Y": + ... + + @overload + def title(self, _: str, **kwds) -> "Y": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Y": + ... + + @overload + def title(self, _: None, **kwds) -> "Y": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "Y": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + axis: Union[Union[None, Union[core.Axis, dict]], UndefinedType] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + impute: Union[ + Union[None, Union[core.ImputeParams, dict]], UndefinedType + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Y, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + axis=axis, + bandPosition=bandPosition, + bin=bin, + field=field, + impute=impute, + scale=scale, + sort=sort, + stack=stack, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class YDatum(DatumChannelMixin, core.PositionDatumDef): """YDatum schema wrapper - Mapping(required=[]) + :class:`PositionDatumDef`, Dict Parameters ---------- - axis : anyOf(:class:`Axis`, None) + axis : :class:`Axis`, Dict, None An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -16164,9 +83595,9 @@ class YDatum(DatumChannelMixin, core.PositionDatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - impute : anyOf(:class:`ImputeParams`, None) + impute : :class:`ImputeParams`, Dict, None An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as ``key`` of the ``Impute`` Operation. The field of the ``color`` channel if specified is used as ``groupby`` of @@ -16174,7 +83605,7 @@ class YDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `impute <https://vega.github.io/vega-lite/docs/impute.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -16187,7 +83618,7 @@ class YDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -16218,7 +83649,7 @@ class YDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -16238,7 +83669,7 @@ class YDatum(DatumChannelMixin, core.PositionDatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -16308,91 +83739,1922 @@ class YDatum(DatumChannelMixin, core.PositionDatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "y" - @overload # type: ignore[no-overload-impl] - def axis(self, aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, translate=Undefined, values=Undefined, zindex=Undefined, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def axis(self, _: None, **kwds) -> 'YDatum': - ... - - def bandPosition(self, _: float, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, frame=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def impute(self, _: None, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: None, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def stack(self, _: bool, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'YDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'YDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'YDatum': - ... - - - def __init__(self, datum, axis=Undefined, bandPosition=Undefined, impute=Undefined, scale=Undefined, - stack=Undefined, title=Undefined, type=Undefined, **kwds): - super(YDatum, self).__init__(datum=datum, axis=axis, bandPosition=bandPosition, impute=impute, - scale=scale, stack=stack, title=title, type=type, **kwds) + @overload + def axis( + self, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandPosition: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + domain: Union[bool, UndefinedType] = Undefined, + domainCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + domainDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + domainDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + format: Union[Union[Union[core.Dict, dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + grid: Union[bool, UndefinedType] = Undefined, + gridCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + gridDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + gridWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ConditionalAxisLabelAlign, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ConditionalAxisLabelBaseline, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelBound: Union[ + Union[Union[bool, float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFlush: Union[Union[bool, float], UndefinedType] = Undefined, + labelFlushOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelFont: Union[ + Union[ + Union[core.ConditionalAxisString, dict], + Union[core.ExprRef, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + labelFontSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union[core.ConditionalAxisLabelFontStyle, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.FontStyle, str], + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ConditionalAxisLabelFontWeight, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOverlap: Union[ + Union[ + Union[bool, core.LabelOverlap, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + labelSeparation: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + maxExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minExtent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union[Literal["top", "bottom", "left", "right"], core.AxisOrient], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + position: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tickBand: Union[ + Union[ + Literal["center", "extent"], Union[core.ExprRef, core._Parameter, dict] + ], + UndefinedType, + ] = Undefined, + tickCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ConditionalAxisColor, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickDash: Union[ + Union[ + Sequence[float], + Union[core.ConditionalAxisNumberArray, dict], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + tickDashOffset: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickExtra: Union[bool, UndefinedType] = Undefined, + tickMinStep: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + tickOpacity: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickRound: Union[bool, UndefinedType] = Undefined, + tickSize: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + tickWidth: Union[ + Union[ + Union[core.ConditionalAxisNumber, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + ticks: Union[bool, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union[Literal[None, "start", "middle", "end"], core.TitleAnchor], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleBaseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleX: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + titleY: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + values: Union[ + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> "YDatum": + ... + + @overload + def axis(self, _: None, **kwds) -> "YDatum": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "YDatum": + ... + + @overload + def impute( + self, + frame: Union[Sequence[Union[None, float]], UndefinedType] = Undefined, + keyvals: Union[ + Union[Sequence[Any], Union[core.ImputeSequence, dict]], UndefinedType + ] = Undefined, + method: Union[ + Union[Literal["value", "median", "max", "min", "mean"], core.ImputeMethod], + UndefinedType, + ] = Undefined, + value: Union[Any, UndefinedType] = Undefined, + **kwds, + ) -> "YDatum": + ... + + @overload + def impute(self, _: None, **kwds) -> "YDatum": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "YDatum": + ... + + @overload + def scale(self, _: None, **kwds) -> "YDatum": + ... + + @overload + def stack(self, _: Literal["zero", "center", "normalize"], **kwds) -> "YDatum": + ... + + @overload + def stack(self, _: None, **kwds) -> "YDatum": + ... + + @overload + def stack(self, _: bool, **kwds) -> "YDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "YDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "YDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "YDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "YDatum": + ... + + def __init__( + self, + datum, + axis: Union[Union[None, Union[core.Axis, dict]], UndefinedType] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + impute: Union[ + Union[None, Union[core.ImputeParams, dict]], UndefinedType + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + stack: Union[ + Union[ + None, + Union[Literal["zero", "center", "normalize"], core.StackOffset], + bool, + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(YDatum, self).__init__( + datum=datum, + axis=axis, + bandPosition=bandPosition, + impute=impute, + scale=scale, + stack=stack, + title=title, + type=type, + **kwds, + ) @with_property_setters class YValue(ValueChannelMixin, core.PositionValueDef): """YValue schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "y" - - def __init__(self, value, **kwds): super(YValue, self).__init__(value=value, **kwds) @@ -16401,16 +85663,16 @@ def __init__(self, value, **kwds): class Y2(FieldChannelMixin, core.SecondaryFieldDef): """Y2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -16443,7 +85705,7 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -16458,7 +85720,7 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -16467,7 +85729,7 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -16488,87 +85750,592 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "y2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'Y2': - ... - - def bandPosition(self, _: float, **kwds) -> 'Y2': - ... - - def bin(self, _: None, **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Y2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Y2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(Y2, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, - bin=bin, field=field, timeUnit=timeUnit, title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "Y2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Y2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "Y2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "Y2": + ... + + @overload + def bin(self, _: None, **kwds) -> "Y2": + ... + + @overload + def field(self, _: str, **kwds) -> "Y2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "Y2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "Y2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "Y2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "Y2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "Y2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "Y2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "Y2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "Y2": + ... + + @overload + def title(self, _: str, **kwds) -> "Y2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "Y2": + ... + + @overload + def title(self, _: None, **kwds) -> "Y2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(Y2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class Y2Datum(DatumChannelMixin, core.DatumDef): """Y2Datum schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -16577,9 +86344,9 @@ class Y2Datum(DatumChannelMixin, core.DatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -16599,7 +86366,7 @@ class Y2Datum(DatumChannelMixin, core.DatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -16669,54 +86436,75 @@ class Y2Datum(DatumChannelMixin, core.DatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "y2" - def bandPosition(self, _: float, **kwds) -> 'Y2Datum': + @overload + def bandPosition(self, _: float, **kwds) -> "Y2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'Y2Datum': + @overload + def title(self, _: str, **kwds) -> "Y2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'Y2Datum': + @overload + def title(self, _: List[str], **kwds) -> "Y2Datum": ... - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'Y2Datum': + @overload + def title(self, _: None, **kwds) -> "Y2Datum": ... - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'Y2Datum': + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "Y2Datum": ... - - def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): - super(Y2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, type=type, - **kwds) + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Y2Datum, self).__init__( + datum=datum, bandPosition=bandPosition, title=title, type=type, **kwds + ) @with_property_setters class Y2Value(ValueChannelMixin, core.PositionValueDef): """Y2Value schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "y2" - - def __init__(self, value, **kwds): super(Y2Value, self).__init__(value=value, **kwds) @@ -16725,16 +86513,16 @@ def __init__(self, value, **kwds): class YError(FieldChannelMixin, core.SecondaryFieldDef): """YError schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -16767,7 +86555,7 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -16782,7 +86570,7 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -16791,7 +86579,7 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -16812,88 +86600,592 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "yError" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'YError': - ... - - def bandPosition(self, _: float, **kwds) -> 'YError': - ... - - def bin(self, _: None, **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'YError': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'YError': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(YError, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, - title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "YError": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "YError": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "YError": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "YError": + ... + + @overload + def bin(self, _: None, **kwds) -> "YError": + ... + + @overload + def field(self, _: str, **kwds) -> "YError": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "YError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "YError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "YError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "YError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "YError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "YError": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "YError": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "YError": + ... + + @overload + def title(self, _: str, **kwds) -> "YError": + ... + + @overload + def title(self, _: List[str], **kwds) -> "YError": + ... + + @overload + def title(self, _: None, **kwds) -> "YError": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(YError, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class YErrorValue(ValueChannelMixin, core.ValueDefnumber): """YErrorValue schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumber`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. @@ -16905,11 +87197,10 @@ class YErrorValue(ValueChannelMixin, core.ValueDefnumber): definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "yError" - - def __init__(self, value, **kwds): super(YErrorValue, self).__init__(value=value, **kwds) @@ -16918,16 +87209,16 @@ def __init__(self, value, **kwds): class YError2(FieldChannelMixin, core.SecondaryFieldDef): """YError2 schema wrapper - Mapping(required=[shorthand]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -16960,7 +87251,7 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -16975,7 +87266,7 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -16984,7 +87275,7 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -17005,88 +87296,592 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ + _class_is_valid_at_instantiation = False _encoding_name = "yError2" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'YError2': - ... - - def bandPosition(self, _: float, **kwds) -> 'YError2': - ... - - def bin(self, _: None, **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'YError2': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'YError2': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(YError2, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "YError2": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "YError2": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "YError2": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "YError2": + ... + + @overload + def bin(self, _: None, **kwds) -> "YError2": + ... + + @overload + def field(self, _: str, **kwds) -> "YError2": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "YError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "YError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "YError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "YError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "YError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "YError2": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "YError2": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "YError2": + ... + + @overload + def title(self, _: str, **kwds) -> "YError2": + ... + + @overload + def title(self, _: List[str], **kwds) -> "YError2": + ... + + @overload + def title(self, _: None, **kwds) -> "YError2": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(YError2, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) @with_property_setters class YError2Value(ValueChannelMixin, core.ValueDefnumber): """YError2Value schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumber`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. @@ -17098,11 +87893,10 @@ class YError2Value(ValueChannelMixin, core.ValueDefnumber): definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "yError2" - - def __init__(self, value, **kwds): super(YError2Value, self).__init__(value=value, **kwds) @@ -17111,14 +87905,14 @@ def __init__(self, value, **kwds): class YOffset(FieldChannelMixin, core.ScaleFieldDef): """YOffset schema wrapper - Mapping(required=[shorthand]) + :class:`ScaleFieldDef`, Dict[required=[shorthand]] Parameters ---------- - shorthand : string + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str shorthand for field, aggregate, and type - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -17130,7 +87924,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -17151,7 +87945,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -17166,7 +87960,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -17179,7 +87973,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -17218,7 +88012,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -17227,7 +88021,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -17247,7 +88041,7 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -17317,149 +88111,1383 @@ class YOffset(FieldChannelMixin, core.ScaleFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "yOffset" - @overload # type: ignore[no-overload-impl] - def aggregate(self, _: Literal["average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmax=Undefined, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def aggregate(self, argmin=Undefined, **kwds) -> 'YOffset': - ... - - def bandPosition(self, _: float, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: bool, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, steps=Undefined, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def bin(self, _: None, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, _: str, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def field(self, repeat=Undefined, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[float], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[str], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[bool], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: List[core.DateTime], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["ascending", "descending"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: Literal["-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, field=Undefined, op=Undefined, order=Undefined, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, encoding=Undefined, order=Undefined, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def sort(self, _: None, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weeksdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweeksdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, _: Literal["binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear"], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def timeUnit(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'YOffset': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'YOffset': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds) -> 'YOffset': - ... - - - def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, - type=Undefined, **kwds): - super(YOffset, self).__init__(shorthand=shorthand, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, field=field, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + @overload + def aggregate( + self, + _: Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def aggregate( + self, + argmax: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def aggregate( + self, + argmin: Union[Union[core.FieldName, str], UndefinedType] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def bandPosition(self, _: float, **kwds) -> "YOffset": + ... + + @overload + def bin(self, _: bool, **kwds) -> "YOffset": + ... + + @overload + def bin( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + Sequence[float], + Union[core.ParameterExtent, core._Parameter, dict], + core.BinExtent, + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def bin(self, _: None, **kwds) -> "YOffset": + ... + + @overload + def field(self, _: str, **kwds) -> "YOffset": + ... + + @overload + def field( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def scale(self, _: None, **kwds) -> "YOffset": + ... + + @overload + def sort(self, _: List[float], **kwds) -> "YOffset": + ... + + @overload + def sort(self, _: List[str], **kwds) -> "YOffset": + ... + + @overload + def sort(self, _: List[bool], **kwds) -> "YOffset": + ... + + @overload + def sort(self, _: List[core.DateTime], **kwds) -> "YOffset": + ... + + @overload + def sort(self, _: Literal["ascending", "descending"], **kwds) -> "YOffset": + ... + + @overload + def sort( + self, + _: Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def sort( + self, + _: Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def sort( + self, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def sort( + self, + encoding: Union[ + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union[Literal["ascending", "descending"], core.SortOrder]], + UndefinedType, + ] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def sort(self, _: None, **kwds) -> "YOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def timeUnit( + self, + _: Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + **kwds, + ) -> "YOffset": + ... + + @overload + def timeUnit( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ) -> "YOffset": + ... + + @overload + def title(self, _: str, **kwds) -> "YOffset": + ... + + @overload + def title(self, _: List[str], **kwds) -> "YOffset": + ... + + @overload + def title(self, _: None, **kwds) -> "YOffset": + ... + + @overload + def type( + self, _: Literal["quantitative", "ordinal", "temporal", "nominal"], **kwds + ) -> "YOffset": + ... + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union[core.RepeatRef, dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + Union[ + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + core.NonArgAggregateOp, + ], + Union[core.ArgmaxDef, dict], + Union[core.ArgminDef, dict], + core.Aggregate, + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union[core.BinParams, dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union[Union[core.FieldName, str], Union[core.RepeatRef, dict], core.Field], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union[ + Sequence[Union[core.DateTime, dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + core.SortArray, + ], + Union[ + Union[ + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + core.SortByChannelDesc, + ], + Union[Literal["ascending", "descending"], core.SortOrder], + Union[ + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + core.SortByChannel, + ], + core.AllSortString, + ], + Union[core.EncodingSortField, dict], + Union[core.SortByEncoding, dict], + core.Sort, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + core.BinnedTimeUnit, + ], + Union[ + Union[ + Union[ + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + core.UtcSingleTimeUnit, + ], + Union[ + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + core.LocalSingleTimeUnit, + ], + core.SingleTimeUnit, + ], + Union[ + Union[ + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + core.UtcMultiTimeUnit, + ], + Union[ + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + core.LocalMultiTimeUnit, + ], + core.MultiTimeUnit, + ], + core.TimeUnit, + ], + Union[core.TimeUnitParams, dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal"], + core.StandardType, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(YOffset, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) @with_property_setters class YOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): """YOffsetDatum schema wrapper - Mapping(required=[]) + :class:`ScaleDatumDef`, Dict Parameters ---------- @@ -17468,9 +89496,9 @@ class YOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -17483,7 +89511,7 @@ class YOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -17503,7 +89531,7 @@ class YOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -17573,47 +89601,615 @@ class YOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ + _class_is_valid_at_instantiation = False _encoding_name = "yOffset" - def bandPosition(self, _: float, **kwds) -> 'YOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds) -> 'YOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def scale(self, _: None, **kwds) -> 'YOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: str, **kwds) -> 'YOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: List[str], **kwds) -> 'YOffsetDatum': - ... - - @overload # type: ignore[no-overload-impl] - def title(self, _: None, **kwds) -> 'YOffsetDatum': - ... - - def type(self, _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], **kwds) -> 'YOffsetDatum': - ... - - - def __init__(self, datum, bandPosition=Undefined, scale=Undefined, title=Undefined, type=Undefined, - **kwds): - super(YOffsetDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, - title=title, type=type, **kwds) + @overload + def bandPosition(self, _: float, **kwds) -> "YOffsetDatum": + ... + + @overload + def scale( + self, + align: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union[Sequence[float], Union[core.ScaleBinParams, dict], core.ScaleBins], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + bool, + float, + str, + ] + ], + Union[core.DomainUnionWith, dict], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ParameterExtent, core._Parameter, dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[ + Union[core.DateTime, dict], + Union[core.ExprRef, core._Parameter, dict], + float, + ], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union[core.ExprRef, core._Parameter, dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + core.ScaleInterpolateEnum, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.ScaleInterpolateParams, dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union[ + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + core.TimeInterval, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.TimeIntervalStep, dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union[core.ExprRef, core._Parameter, dict], + float, + str, + ] + ], + Union[ + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + core.RangeEnum, + ], + Union[core.FieldRange, dict], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + Union[ + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + core.Categorical, + ], + Union[ + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + core.Diverging, + ], + Union[ + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + core.SequentialSingleHue, + ], + Union[Literal["rainbow", "sinebow"], core.Cyclical], + Union[ + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + core.SequentialMultiHue, + ], + core.ColorScheme, + ], + Union[core.ExprRef, core._Parameter, dict], + Union[core.SchemeParams, dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + core.ScaleType, + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + **kwds, + ) -> "YOffsetDatum": + ... + + @overload + def scale(self, _: None, **kwds) -> "YOffsetDatum": + ... + + @overload + def title(self, _: str, **kwds) -> "YOffsetDatum": + ... + + @overload + def title(self, _: List[str], **kwds) -> "YOffsetDatum": + ... + + @overload + def title(self, _: None, **kwds) -> "YOffsetDatum": + ... + + @overload + def type( + self, + _: Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + **kwds, + ) -> "YOffsetDatum": + ... + + def __init__( + self, + datum, + bandPosition: Union[float, UndefinedType] = Undefined, + scale: Union[Union[None, Union[core.Scale, dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union[Sequence[str], core.Text, str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + core.Type, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(YOffsetDatum, self).__init__( + datum=datum, + bandPosition=bandPosition, + scale=scale, + title=title, + type=type, + **kwds, + ) @with_property_setters class YOffsetValue(ValueChannelMixin, core.ValueDefnumber): """YOffsetValue schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumber`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. @@ -17625,10 +90221,284 @@ class YOffsetValue(ValueChannelMixin, core.ValueDefnumber): definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ + _class_is_valid_at_instantiation = False _encoding_name = "yOffset" - - def __init__(self, value, **kwds): super(YOffsetValue, self).__init__(value=value, **kwds) + + +def _encode_signature( + self, + angle: Union[str, Angle, dict, AngleDatum, AngleValue, UndefinedType] = Undefined, + color: Union[str, Color, dict, ColorDatum, ColorValue, UndefinedType] = Undefined, + column: Union[str, Column, dict, UndefinedType] = Undefined, + description: Union[ + str, Description, dict, DescriptionValue, UndefinedType + ] = Undefined, + detail: Union[str, Detail, dict, list, UndefinedType] = Undefined, + facet: Union[str, Facet, dict, UndefinedType] = Undefined, + fill: Union[str, Fill, dict, FillDatum, FillValue, UndefinedType] = Undefined, + fillOpacity: Union[ + str, FillOpacity, dict, FillOpacityDatum, FillOpacityValue, UndefinedType + ] = Undefined, + href: Union[str, Href, dict, HrefValue, UndefinedType] = Undefined, + key: Union[str, Key, dict, UndefinedType] = Undefined, + latitude: Union[str, Latitude, dict, LatitudeDatum, UndefinedType] = Undefined, + latitude2: Union[ + str, Latitude2, dict, Latitude2Datum, Latitude2Value, UndefinedType + ] = Undefined, + longitude: Union[str, Longitude, dict, LongitudeDatum, UndefinedType] = Undefined, + longitude2: Union[ + str, Longitude2, dict, Longitude2Datum, Longitude2Value, UndefinedType + ] = Undefined, + opacity: Union[ + str, Opacity, dict, OpacityDatum, OpacityValue, UndefinedType + ] = Undefined, + order: Union[str, Order, dict, list, OrderValue, UndefinedType] = Undefined, + radius: Union[ + str, Radius, dict, RadiusDatum, RadiusValue, UndefinedType + ] = Undefined, + radius2: Union[ + str, Radius2, dict, Radius2Datum, Radius2Value, UndefinedType + ] = Undefined, + row: Union[str, Row, dict, UndefinedType] = Undefined, + shape: Union[str, Shape, dict, ShapeDatum, ShapeValue, UndefinedType] = Undefined, + size: Union[str, Size, dict, SizeDatum, SizeValue, UndefinedType] = Undefined, + stroke: Union[ + str, Stroke, dict, StrokeDatum, StrokeValue, UndefinedType + ] = Undefined, + strokeDash: Union[ + str, StrokeDash, dict, StrokeDashDatum, StrokeDashValue, UndefinedType + ] = Undefined, + strokeOpacity: Union[ + str, StrokeOpacity, dict, StrokeOpacityDatum, StrokeOpacityValue, UndefinedType + ] = Undefined, + strokeWidth: Union[ + str, StrokeWidth, dict, StrokeWidthDatum, StrokeWidthValue, UndefinedType + ] = Undefined, + text: Union[str, Text, dict, TextDatum, TextValue, UndefinedType] = Undefined, + theta: Union[str, Theta, dict, ThetaDatum, ThetaValue, UndefinedType] = Undefined, + theta2: Union[ + str, Theta2, dict, Theta2Datum, Theta2Value, UndefinedType + ] = Undefined, + tooltip: Union[str, Tooltip, dict, list, TooltipValue, UndefinedType] = Undefined, + url: Union[str, Url, dict, UrlValue, UndefinedType] = Undefined, + x: Union[str, X, dict, XDatum, XValue, UndefinedType] = Undefined, + x2: Union[str, X2, dict, X2Datum, X2Value, UndefinedType] = Undefined, + xError: Union[str, XError, dict, XErrorValue, UndefinedType] = Undefined, + xError2: Union[str, XError2, dict, XError2Value, UndefinedType] = Undefined, + xOffset: Union[ + str, XOffset, dict, XOffsetDatum, XOffsetValue, UndefinedType + ] = Undefined, + y: Union[str, Y, dict, YDatum, YValue, UndefinedType] = Undefined, + y2: Union[str, Y2, dict, Y2Datum, Y2Value, UndefinedType] = Undefined, + yError: Union[str, YError, dict, YErrorValue, UndefinedType] = Undefined, + yError2: Union[str, YError2, dict, YError2Value, UndefinedType] = Undefined, + yOffset: Union[ + str, YOffset, dict, YOffsetDatum, YOffsetValue, UndefinedType + ] = Undefined, +): + """Parameters + ---------- + + angle : str, :class:`Angle`, Dict, :class:`AngleDatum`, :class:`AngleValue` + Rotation angle of point and text marks. + color : str, :class:`Color`, Dict, :class:`ColorDatum`, :class:`ColorValue` + Color of the marks – either fill or stroke color based on the ``filled`` property + of mark definition. By default, ``color`` represents fill color for ``"area"``, + ``"bar"``, ``"tick"``, ``"text"``, ``"trail"``, ``"circle"``, and ``"square"`` / + stroke color for ``"line"`` and ``"point"``. + + **Default value:** If undefined, the default color depends on `mark config + <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``color`` + property. + + *Note:* 1) For fine-grained control over both fill and stroke colors of the marks, + please use the ``fill`` and ``stroke`` channels. The ``fill`` or ``stroke`` + encodings have higher precedence than ``color``, thus may override the ``color`` + encoding if conflicting encodings are specified. 2) See the scale documentation for + more information about customizing `color scheme + <https://vega.github.io/vega-lite/docs/scale.html#scheme>`__. + column : str, :class:`Column`, Dict + A field definition for the horizontal facet of trellis plots. + description : str, :class:`Description`, Dict, :class:`DescriptionValue` + A text description of this mark for ARIA accessibility (SVG output only). For SVG + output the ``"aria-label"`` attribute will be set to this description. + detail : str, :class:`Detail`, Dict, List + Additional levels of detail for grouping data in aggregate views and in line, trail, + and area marks without mapping data to a specific visual channel. + facet : str, :class:`Facet`, Dict + A field definition for the (flexible) facet of trellis plots. + + If either ``row`` or ``column`` is specified, this channel will be ignored. + fill : str, :class:`Fill`, Dict, :class:`FillDatum`, :class:`FillValue` + Fill color of the marks. **Default value:** If undefined, the default color depends + on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ + 's ``color`` property. + + *Note:* The ``fill`` encoding has higher precedence than ``color``, thus may + override the ``color`` encoding if conflicting encodings are specified. + fillOpacity : str, :class:`FillOpacity`, Dict, :class:`FillOpacityDatum`, :class:`FillOpacityValue` + Fill opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's + ``fillOpacity`` property. + href : str, :class:`Href`, Dict, :class:`HrefValue` + A URL to load upon mouse click. + key : str, :class:`Key`, Dict + A data field to use as a unique key for data binding. When a visualization’s data is + updated, the key value will be used to match data elements to existing mark + instances. Use a key channel to enable object constancy for transitions over dynamic + data. + latitude : str, :class:`Latitude`, Dict, :class:`LatitudeDatum` + Latitude position of geographically projected marks. + latitude2 : str, :class:`Latitude2`, Dict, :class:`Latitude2Datum`, :class:`Latitude2Value` + Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + longitude : str, :class:`Longitude`, Dict, :class:`LongitudeDatum` + Longitude position of geographically projected marks. + longitude2 : str, :class:`Longitude2`, Dict, :class:`Longitude2Datum`, :class:`Longitude2Value` + Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + opacity : str, :class:`Opacity`, Dict, :class:`OpacityDatum`, :class:`OpacityValue` + Opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``opacity`` + property. + order : str, :class:`Order`, Dict, List, :class:`OrderValue` + Order of the marks. + + + * For stacked marks, this ``order`` channel encodes `stack order + <https://vega.github.io/vega-lite/docs/stack.html#order>`__. + * For line and trail marks, this ``order`` channel encodes order of data points in + the lines. This can be useful for creating `a connected scatterplot + <https://vega.github.io/vega-lite/examples/connected_scatterplot.html>`__. Setting + ``order`` to ``{"value": null}`` makes the line marks use the original order in + the data sources. + * Otherwise, this ``order`` channel encodes layer order of the marks. + + **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid + creating additional aggregation grouping. + radius : str, :class:`Radius`, Dict, :class:`RadiusDatum`, :class:`RadiusValue` + The outer radius in pixels of arc marks. + radius2 : str, :class:`Radius2`, Dict, :class:`Radius2Datum`, :class:`Radius2Value` + The inner radius in pixels of arc marks. + row : str, :class:`Row`, Dict + A field definition for the vertical facet of trellis plots. + shape : str, :class:`Shape`, Dict, :class:`ShapeDatum`, :class:`ShapeValue` + Shape of the mark. + + + #. + For ``point`` marks the supported values include: - plotting shapes: ``"circle"``, + ``"square"``, ``"cross"``, ``"diamond"``, ``"triangle-up"``, ``"triangle-down"``, + ``"triangle-right"``, or ``"triangle-left"``. - the line symbol ``"stroke"`` - + centered directional shapes ``"arrow"``, ``"wedge"``, or ``"triangle"`` - a custom + `SVG path string + <https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths>`__ (For correct + sizing, custom shape paths should be defined within a square bounding box with + coordinates ranging from -1 to 1 along both the x and y dimensions.) + + #. + For ``geoshape`` marks it should be a field definition of the geojson data + + **Default value:** If undefined, the default shape depends on `mark config + <https://vega.github.io/vega-lite/docs/config.html#point-config>`__ 's ``shape`` + property. ( ``"circle"`` if unset.) + size : str, :class:`Size`, Dict, :class:`SizeDatum`, :class:`SizeValue` + Size of the mark. + + + * For ``"point"``, ``"square"`` and ``"circle"``, – the symbol size, or pixel area + of the mark. + * For ``"bar"`` and ``"tick"`` – the bar and tick's size. + * For ``"text"`` – the text's font size. + * Size is unsupported for ``"line"``, ``"area"``, and ``"rect"``. (Use ``"trail"`` + instead of line with varying size) + stroke : str, :class:`Stroke`, Dict, :class:`StrokeDatum`, :class:`StrokeValue` + Stroke color of the marks. **Default value:** If undefined, the default color + depends on `mark config + <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``color`` + property. + + *Note:* The ``stroke`` encoding has higher precedence than ``color``, thus may + override the ``color`` encoding if conflicting encodings are specified. + strokeDash : str, :class:`StrokeDash`, Dict, :class:`StrokeDashDatum`, :class:`StrokeDashValue` + Stroke dash of the marks. + + **Default value:** ``[1,0]`` (No dash). + strokeOpacity : str, :class:`StrokeOpacity`, Dict, :class:`StrokeOpacityDatum`, :class:`StrokeOpacityValue` + Stroke opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's + ``strokeOpacity`` property. + strokeWidth : str, :class:`StrokeWidth`, Dict, :class:`StrokeWidthDatum`, :class:`StrokeWidthValue` + Stroke width of the marks. + + **Default value:** If undefined, the default stroke width depends on `mark config + <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's + ``strokeWidth`` property. + text : str, :class:`Text`, Dict, :class:`TextDatum`, :class:`TextValue` + Text of the ``text`` mark. + theta : str, :class:`Theta`, Dict, :class:`ThetaDatum`, :class:`ThetaValue` + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : str, :class:`Theta2`, Dict, :class:`Theta2Datum`, :class:`Theta2Value` + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + tooltip : str, :class:`Tooltip`, Dict, List, :class:`TooltipValue` + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides + `the tooltip property in the mark definition + <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. + + See the `tooltip <https://vega.github.io/vega-lite/docs/tooltip.html>`__ + documentation for a detailed discussion about tooltip in Vega-Lite. + url : str, :class:`Url`, Dict, :class:`UrlValue` + The URL of an image mark. + x : str, :class:`X`, Dict, :class:`XDatum`, :class:`XValue` + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : str, :class:`X2`, Dict, :class:`X2Datum`, :class:`X2Value` + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + xError : str, :class:`XError`, Dict, :class:`XErrorValue` + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : str, :class:`XError2`, Dict, :class:`XError2Value` + Secondary error value of x coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + xOffset : str, :class:`XOffset`, Dict, :class:`XOffsetDatum`, :class:`XOffsetValue` + Offset of x-position of the marks + y : str, :class:`Y`, Dict, :class:`YDatum`, :class:`YValue` + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : str, :class:`Y2`, Dict, :class:`Y2Datum`, :class:`Y2Value` + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + yError : str, :class:`YError`, Dict, :class:`YErrorValue` + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : str, :class:`YError2`, Dict, :class:`YError2Value` + Secondary error value of y coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + yOffset : str, :class:`YOffset`, Dict, :class:`YOffsetDatum`, :class:`YOffsetValue` + Offset of y-position of the marks + """ + ... diff --git a/altair/vegalite/v5/schema/core.py b/altair/vegalite/v5/schema/core.py --- a/altair/vegalite/v5/schema/core.py +++ b/altair/vegalite/v5/schema/core.py @@ -1,32 +1,63 @@ # The contents of this file are automatically written by # tools/generate_schema_wrapper.py. Do not modify directly. +from typing import Any, Literal, Union, Protocol, Sequence, List +from typing import Dict as TypingDict +from typing import Generator as TypingGenerator from altair.utils.schemapi import SchemaBase, Undefined, UndefinedType, _subclasses import pkgutil import json -def load_schema(): + +def load_schema() -> dict: """Load the json schema associated with this module's functions""" - return json.loads(pkgutil.get_data(__name__, 'vega-lite-schema.json').decode('utf-8')) + schema_bytes = pkgutil.get_data(__name__, "vega-lite-schema.json") + if schema_bytes is None: + raise ValueError("Unable to load vega-lite-schema.json") + return json.loads(schema_bytes.decode("utf-8")) + + +class _Parameter(Protocol): + # This protocol represents a Parameter as defined in api.py + # It would be better if we could directly use the Parameter class, + # but that would create a circular import. + # The protocol does not need to have all the attributes and methods of this + # class but the actual api.Parameter just needs to pass a type check + # as a core._Parameter. + + _counter: int + + def _get_name(cls) -> str: + ... + + def to_dict(self) -> TypingDict[str, Union[str, dict]]: + ... + + def _to_expr(self) -> str: + ... class VegaLiteSchema(SchemaBase): _rootschema = load_schema() + @classmethod - def _default_wrapper_classes(cls): + def _default_wrapper_classes(cls) -> TypingGenerator[type, None, None]: return _subclasses(VegaLiteSchema) class Root(VegaLiteSchema): """Root schema wrapper - anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, - :class:`TopLevelRepeatSpec`, :class:`TopLevelConcatSpec`, :class:`TopLevelVConcatSpec`, - :class:`TopLevelHConcatSpec`) + :class:`TopLevelConcatSpec`, Dict[required=[concat]], :class:`TopLevelFacetSpec`, + Dict[required=[data, facet, spec]], :class:`TopLevelHConcatSpec`, Dict[required=[hconcat]], + :class:`TopLevelLayerSpec`, Dict[required=[layer]], :class:`TopLevelRepeatSpec`, + Dict[required=[repeat, spec]], :class:`TopLevelSpec`, :class:`TopLevelUnitSpec`, + Dict[required=[data, mark]], :class:`TopLevelVConcatSpec`, Dict[required=[vconcat]] A Vega-Lite top-level specification. This is the root class for all Vega-Lite specifications. (The json schema is generated from this type.) """ + _schema = VegaLiteSchema._rootschema def __init__(self, *args, **kwds): @@ -36,9 +67,13 @@ def __init__(self, *args, **kwds): class Aggregate(VegaLiteSchema): """Aggregate schema wrapper - anyOf(:class:`NonArgAggregateOp`, :class:`ArgmaxDef`, :class:`ArgminDef`) + :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, + Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', + 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', + 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] """ - _schema = {'$ref': '#/definitions/Aggregate'} + + _schema = {"$ref": "#/definitions/Aggregate"} def __init__(self, *args, **kwds): super(Aggregate, self).__init__(*args, **kwds) @@ -47,11 +82,12 @@ def __init__(self, *args, **kwds): class AggregateOp(VegaLiteSchema): """AggregateOp schema wrapper - enum('argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', - 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', - 'values', 'variance', 'variancep') + :class:`AggregateOp`, Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', + 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', + 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] """ - _schema = {'$ref': '#/definitions/AggregateOp'} + + _schema = {"$ref": "#/definitions/AggregateOp"} def __init__(self, *args): super(AggregateOp, self).__init__(*args) @@ -60,33 +96,70 @@ def __init__(self, *args): class AggregatedFieldDef(VegaLiteSchema): """AggregatedFieldDef schema wrapper - Mapping(required=[op, as]) + :class:`AggregatedFieldDef`, Dict[required=[op, as]] Parameters ---------- - op : :class:`AggregateOp` + op : :class:`AggregateOp`, Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] The aggregation operation to apply to the fields (e.g., ``"sum"``, ``"average"``, or ``"count"`` ). See the `full list of supported aggregation operations <https://vega.github.io/vega-lite/docs/aggregate.html#ops>`__ for more information. - field : :class:`FieldName` + field : :class:`FieldName`, str The data field for which to compute aggregate function. This is required for all aggregation operations except ``"count"``. - as : :class:`FieldName` + as : :class:`FieldName`, str The output field names to use for each aggregated field. """ - _schema = {'$ref': '#/definitions/AggregatedFieldDef'} - def __init__(self, op=Undefined, field=Undefined, **kwds): + _schema = {"$ref": "#/definitions/AggregatedFieldDef"} + + def __init__( + self, + op: Union[ + Union[ + "AggregateOp", + Literal[ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + UndefinedType, + ] = Undefined, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + **kwds, + ): super(AggregatedFieldDef, self).__init__(op=op, field=field, **kwds) class Align(VegaLiteSchema): """Align schema wrapper - enum('left', 'center', 'right') + :class:`Align`, Literal['left', 'center', 'right'] """ - _schema = {'$ref': '#/definitions/Align'} + + _schema = {"$ref": "#/definitions/Align"} def __init__(self, *args): super(Align, self).__init__(*args) @@ -95,9 +168,15 @@ def __init__(self, *args): class AnyMark(VegaLiteSchema): """AnyMark schema wrapper - anyOf(:class:`CompositeMark`, :class:`CompositeMarkDef`, :class:`Mark`, :class:`MarkDef`) + :class:`AnyMark`, :class:`BoxPlotDef`, Dict[required=[type]], :class:`CompositeMarkDef`, + :class:`ErrorBandDef`, Dict[required=[type]], :class:`ErrorBarDef`, Dict[required=[type]], + :class:`BoxPlot`, str, :class:`CompositeMark`, :class:`ErrorBand`, str, :class:`ErrorBar`, + str, :class:`MarkDef`, Dict[required=[type]], :class:`Mark`, Literal['arc', 'area', 'bar', + 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', + 'geoshape'] """ - _schema = {'$ref': '#/definitions/AnyMark'} + + _schema = {"$ref": "#/definitions/AnyMark"} def __init__(self, *args, **kwds): super(AnyMark, self).__init__(*args, **kwds) @@ -106,10 +185,12 @@ def __init__(self, *args, **kwds): class AnyMarkConfig(VegaLiteSchema): """AnyMarkConfig schema wrapper - anyOf(:class:`MarkConfig`, :class:`AreaConfig`, :class:`BarConfig`, :class:`RectConfig`, - :class:`LineConfig`, :class:`TickConfig`) + :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, + :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, + :class:`TickConfig`, Dict """ - _schema = {'$ref': '#/definitions/AnyMarkConfig'} + + _schema = {"$ref": "#/definitions/AnyMarkConfig"} def __init__(self, *args, **kwds): super(AnyMarkConfig, self).__init__(*args, **kwds) @@ -118,37 +199,37 @@ def __init__(self, *args, **kwds): class AreaConfig(AnyMarkConfig): """AreaConfig schema wrapper - Mapping(required=[]) + :class:`AreaConfig`, Dict Parameters ---------- - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -159,13 +240,13 @@ class AreaConfig(AnyMarkConfig): ``"middle"``, ``"bottom"``. **Note:** Expression reference is *not* supported for range marks. - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -178,63 +259,63 @@ class AreaConfig(AnyMarkConfig): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - endAngle : anyOf(float, :class:`ExprRef`) + endAngle : :class:`ExprRef`, Dict[required=[expr]], float The end angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -244,28 +325,28 @@ class AreaConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`) + height : :class:`ExprRef`, Dict[required=[expr]], float Height of the marks. - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -287,7 +368,7 @@ class AreaConfig(AnyMarkConfig): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -296,12 +377,12 @@ class AreaConfig(AnyMarkConfig): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - line : anyOf(boolean, :class:`OverlayMarkDef`) + line : :class:`OverlayMarkDef`, Dict, bool A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines. @@ -312,21 +393,21 @@ class AreaConfig(AnyMarkConfig): If this value is ``false``, no lines would be automatically added to area marks. **Default value:** ``false``. - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -338,13 +419,13 @@ class AreaConfig(AnyMarkConfig): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - point : anyOf(boolean, :class:`OverlayMarkDef`, string) + point : :class:`OverlayMarkDef`, Dict, bool, str A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points. @@ -359,18 +440,18 @@ class AreaConfig(AnyMarkConfig): area marks. **Default value:** ``false``. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -385,7 +466,7 @@ class AreaConfig(AnyMarkConfig): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -402,56 +483,56 @@ class AreaConfig(AnyMarkConfig): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - startAngle : anyOf(float, :class:`ExprRef`) + startAngle : :class:`ExprRef`, Dict[required=[expr]], float The start angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. timeUnitBandPosition : float @@ -462,7 +543,7 @@ class AreaConfig(AnyMarkConfig): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -477,126 +558,1022 @@ class AreaConfig(AnyMarkConfig): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`) + width : :class:`ExprRef`, Dict[required=[expr]], float Width of the marks. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. """ - _schema = {'$ref': '#/definitions/AreaConfig'} - - def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, - color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, - dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, - fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, - fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, - innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, - line=Undefined, lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, - order=Undefined, orient=Undefined, outerRadius=Undefined, padAngle=Undefined, - point=Undefined, radius=Undefined, radius2=Undefined, shape=Undefined, size=Undefined, - smooth=Undefined, startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, - strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, - strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, - strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, - theta2=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, - tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, - y=Undefined, y2=Undefined, **kwds): - super(AreaConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - baseline=baseline, blend=blend, color=color, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, dx=dx, dy=dy, - ellipsis=ellipsis, endAngle=endAngle, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, - interpolate=interpolate, invalid=invalid, limit=limit, - line=line, lineBreak=lineBreak, lineHeight=lineHeight, - opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, - radius=radius, radius2=radius2, shape=shape, size=size, - smooth=smooth, startAngle=startAngle, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - tension=tension, text=text, theta=theta, theta2=theta2, - timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + _schema = {"$ref": "#/definitions/AreaConfig"} + + def __init__( + self, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + endAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union["OverlayMarkDef", dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union["OverlayMarkDef", dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + startAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): + super(AreaConfig, self).__init__( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + baseline=baseline, + blend=blend, + color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + dx=dx, + dy=dy, + ellipsis=ellipsis, + endAngle=endAngle, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + smooth=smooth, + startAngle=startAngle, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + y=y, + y2=y2, + **kwds, + ) class ArgmaxDef(Aggregate): """ArgmaxDef schema wrapper - Mapping(required=[argmax]) + :class:`ArgmaxDef`, Dict[required=[argmax]] Parameters ---------- - argmax : :class:`FieldName` + argmax : :class:`FieldName`, str """ - _schema = {'$ref': '#/definitions/ArgmaxDef'} - def __init__(self, argmax=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ArgmaxDef"} + + def __init__( + self, argmax: Union[Union["FieldName", str], UndefinedType] = Undefined, **kwds + ): super(ArgmaxDef, self).__init__(argmax=argmax, **kwds) class ArgminDef(Aggregate): """ArgminDef schema wrapper - Mapping(required=[argmin]) + :class:`ArgminDef`, Dict[required=[argmin]] Parameters ---------- - argmin : :class:`FieldName` + argmin : :class:`FieldName`, str """ - _schema = {'$ref': '#/definitions/ArgminDef'} - def __init__(self, argmin=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ArgminDef"} + + def __init__( + self, argmin: Union[Union["FieldName", str], UndefinedType] = Undefined, **kwds + ): super(ArgminDef, self).__init__(argmin=argmin, **kwds) class AutoSizeParams(VegaLiteSchema): """AutoSizeParams schema wrapper - Mapping(required=[]) + :class:`AutoSizeParams`, Dict Parameters ---------- - contains : enum('content', 'padding') + contains : Literal['content', 'padding'] Determines how size calculation should be performed, one of ``"content"`` or ``"padding"``. The default setting ( ``"content"`` ) interprets the width and height settings as the data rectangle (plotting) dimensions, to which padding is then @@ -605,12 +1582,12 @@ class AutoSizeParams(VegaLiteSchema): intended size of the view. **Default value** : ``"content"`` - resize : boolean + resize : bool A boolean flag indicating if autosize layout should be re-calculated on every view update. **Default value** : ``false`` - type : :class:`AutosizeType` + type : :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] The sizing format type. One of ``"pad"``, ``"fit"``, ``"fit-x"``, ``"fit-y"``, or ``"none"``. See the `autosize type <https://vega.github.io/vega-lite/docs/size.html#autosize>`__ documentation for @@ -618,18 +1595,31 @@ class AutoSizeParams(VegaLiteSchema): **Default value** : ``"pad"`` """ - _schema = {'$ref': '#/definitions/AutoSizeParams'} - def __init__(self, contains=Undefined, resize=Undefined, type=Undefined, **kwds): - super(AutoSizeParams, self).__init__(contains=contains, resize=resize, type=type, **kwds) + _schema = {"$ref": "#/definitions/AutoSizeParams"} + + def __init__( + self, + contains: Union[Literal["content", "padding"], UndefinedType] = Undefined, + resize: Union[bool, UndefinedType] = Undefined, + type: Union[ + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(AutoSizeParams, self).__init__( + contains=contains, resize=resize, type=type, **kwds + ) class AutosizeType(VegaLiteSchema): """AutosizeType schema wrapper - enum('pad', 'none', 'fit', 'fit-x', 'fit-y') + :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] """ - _schema = {'$ref': '#/definitions/AutosizeType'} + + _schema = {"$ref": "#/definitions/AutosizeType"} def __init__(self, *args): super(AutosizeType, self).__init__(*args) @@ -638,56 +1628,56 @@ def __init__(self, *args): class Axis(VegaLiteSchema): """Axis schema wrapper - Mapping(required=[]) + :class:`Axis`, Dict Parameters ---------- - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG group, removing the axis from the ARIA accessibility tree. **Default value:** ``true`` - bandPosition : anyOf(float, :class:`ExprRef`) + bandPosition : :class:`ExprRef`, Dict[required=[expr]], float An interpolation fraction indicating where, for ``band`` scales, axis ticks should be positioned. A value of ``0`` places ticks at the left edge of their bands. A value of ``0.5`` places ticks in the middle of their bands. **Default value:** ``0.5`` - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of this axis for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If the ``aria`` property is true, for SVG output the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__ will be set to this description. If the description is unspecified it will be automatically generated. - domain : boolean + domain : bool A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis. **Default value:** ``true`` - domainCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + domainCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for the domain line's ending style. One of ``"butt"``, ``"round"`` or ``"square"``. **Default value:** ``"butt"`` - domainColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + domainColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Color of axis domain line. **Default value:** ``"gray"``. - domainDash : anyOf(List(float), :class:`ExprRef`) + domainDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed domain lines. - domainDashOffset : anyOf(float, :class:`ExprRef`) + domainDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the domain dash array. - domainOpacity : anyOf(float, :class:`ExprRef`) + domainOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the axis domain line. - domainWidth : anyOf(float, :class:`ExprRef`) + domainWidth : :class:`ExprRef`, Dict[required=[expr]], float Stroke width of axis domain line **Default value:** ``1`` - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -710,7 +1700,7 @@ class Axis(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -721,47 +1711,47 @@ class Axis(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - grid : boolean + grid : bool A boolean flag indicating if grid lines should be included as part of the axis **Default value:** ``true`` for `continuous scales <https://vega.github.io/vega-lite/docs/scale.html#continuous>`__ that are not binned; otherwise, ``false``. - gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + gridCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for grid lines' ending style. One of ``"butt"``, ``"round"`` or ``"square"``. **Default value:** ``"butt"`` - gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, :class:`ConditionalAxisColor`) + gridColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ConditionalAxisColor`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] Color of gridlines. **Default value:** ``"lightGray"``. - gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + gridDash : :class:`ConditionalAxisNumberArray`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed grid lines. - gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + gridDashOffset : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the grid dash array. - gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + gridOpacity : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity of grid (value between [0,1]) **Default value:** ``1`` - gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + gridWidth : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The grid width, in pixels. **Default value:** ``1`` - labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) + labelAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ConditionalAxisLabelAlign`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation. - labelAngle : anyOf(float, :class:`ExprRef`) + labelAngle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the axis labels. **Default value:** ``-90`` for nominal and ordinal fields; ``0`` otherwise. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, :class:`ConditionalAxisLabelBaseline`) + labelBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ConditionalAxisLabelBaseline`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* rather than *fontSize* alone. - labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + labelBound : :class:`ExprRef`, Dict[required=[expr]], bool, float Indicates if labels should be hidden if they exceed the axis range. If ``false`` (the default) no bounds overlap analysis is performed. If ``true``, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a @@ -769,15 +1759,15 @@ class Axis(VegaLiteSchema): bounding box may exceed the axis range. **Default value:** ``false``. - labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, :class:`ConditionalAxisColor`) + labelColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ConditionalAxisColor`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] The color of the tick label, can be in hex color code or regular color name. - labelExpr : string + labelExpr : str `Vega expression <https://vega.github.io/vega/docs/expressions/>`__ for customizing labels. **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the axis's backing ``datum`` object. - labelFlush : anyOf(boolean, float) + labelFlush : bool, float Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are @@ -788,35 +1778,35 @@ class Axis(VegaLiteSchema): visually group with corresponding axis ticks. **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. - labelFlushOffset : anyOf(float, :class:`ExprRef`) + labelFlushOffset : :class:`ExprRef`, Dict[required=[expr]], float Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of ``2`` will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks. **Default value:** ``0``. - labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) + labelFont : :class:`ConditionalAxisString`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], str The font of the tick label. - labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelFontSize : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The font size of the label, in pixels. - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, :class:`ConditionalAxisLabelFontStyle`) + labelFontStyle : :class:`ConditionalAxisLabelFontStyle`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style of the title. - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, :class:`ConditionalAxisLabelFontWeight`) + labelFontWeight : :class:`ConditionalAxisLabelFontWeight`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight of axis tick labels. - labelLimit : anyOf(float, :class:`ExprRef`) + labelLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of axis tick labels. **Default value:** ``180`` - labelLineHeight : anyOf(float, :class:`ExprRef`) + labelLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line label text or label text with ``"line-top"`` or ``"line-bottom"`` baseline. - labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelOffset : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float Position offset in pixels to apply to labels, in addition to tickOffset. **Default value:** ``0`` - labelOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelOpacity : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The opacity of the labels. - labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + labelOverlap : :class:`ExprRef`, Dict[required=[expr]], :class:`LabelOverlap`, bool, str The strategy to use for resolving overlap of axis labels. If ``false`` (the default), no overlap reduction is attempted. If set to ``true`` or ``"parity"``, a strategy of removing every other label is used (this works well for standard linear @@ -826,48 +1816,48 @@ class Axis(VegaLiteSchema): **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` for log scales; otherwise ``false``. - labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelPadding : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The padding in pixels between labels and ticks. **Default value:** ``2`` - labelSeparation : anyOf(float, :class:`ExprRef`) + labelSeparation : :class:`ExprRef`, Dict[required=[expr]], float The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default ``0`` ). This property is ignored if *labelOverlap* resolution is not enabled. - labels : boolean + labels : bool A boolean flag indicating if labels should be included as part of the axis. **Default value:** ``true``. - maxExtent : anyOf(float, :class:`ExprRef`) + maxExtent : :class:`ExprRef`, Dict[required=[expr]], float The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles. **Default value:** ``undefined``. - minExtent : anyOf(float, :class:`ExprRef`) + minExtent : :class:`ExprRef`, Dict[required=[expr]], float The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles. **Default value:** ``30`` for y-axis; ``undefined`` for x-axis. - offset : anyOf(float, :class:`ExprRef`) + offset : :class:`ExprRef`, Dict[required=[expr]], float The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle. **Default value:** derived from the `axis config <https://vega.github.io/vega-lite/docs/config.html#facet-scale-config>`__ 's ``offset`` ( ``0`` by default) - orient : anyOf(:class:`AxisOrient`, :class:`ExprRef`) + orient : :class:`AxisOrient`, Literal['top', 'bottom', 'left', 'right'], :class:`ExprRef`, Dict[required=[expr]] The orientation of the axis. One of ``"top"``, ``"bottom"``, ``"left"`` or ``"right"``. The orientation can be used to further specialize the axis type (e.g., a y-axis oriented towards the right edge of the chart). **Default value:** ``"bottom"`` for x-axes and ``"left"`` for y-axes. - position : anyOf(float, :class:`ExprRef`) + position : :class:`ExprRef`, Dict[required=[expr]], float The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate. **Default value** : ``0`` - style : anyOf(string, List(string)) + style : Sequence[str], str A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the `style configuration <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. If @@ -876,19 +1866,19 @@ class Axis(VegaLiteSchema): **Default value:** (none) **Note:** Any specified style will augment the default style. For example, an x-axis mark with ``"style": "foo"`` will use ``config.axisX`` and ``config.style.foo`` (the specified style ``"foo"`` has higher precedence). - tickBand : anyOf(enum('center', 'extent'), :class:`ExprRef`) + tickBand : :class:`ExprRef`, Dict[required=[expr]], Literal['center', 'extent'] For band scales, indicates if ticks and grid lines should be placed at the ``"center"`` of a band (default) or at the band ``"extent"`` s to indicate intervals - tickCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + tickCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for the tick lines' ending style. One of ``"butt"``, ``"round"`` or ``"square"``. **Default value:** ``"butt"`` - tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, :class:`ConditionalAxisColor`) + tickColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ConditionalAxisColor`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] The color of the axis's tick. **Default value:** ``"gray"`` - tickCount : anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`, :class:`ExprRef`) + tickCount : :class:`ExprRef`, Dict[required=[expr]], :class:`TimeIntervalStep`, Dict[required=[interval, step]], :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'], float A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are "nice" (multiples of 2, 5, 10) and lie within the underlying scale's range. @@ -902,42 +1892,42 @@ class Axis(VegaLiteSchema): **Default value** : Determine using a formula ``ceil(width/40)`` for x and ``ceil(height/40)`` for y. - tickDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + tickDash : :class:`ConditionalAxisNumberArray`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed tick mark lines. - tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickDashOffset : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the tick mark dash array. - tickExtra : boolean + tickExtra : bool Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for ``band`` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with ``"bandPosition": 1`` and an axis ``"padding"`` value of ``0``. - tickMinStep : anyOf(float, :class:`ExprRef`) + tickMinStep : :class:`ExprRef`, Dict[required=[expr]], float The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of ``1`` indicates that ticks should not be less than 1 unit apart. If ``tickMinStep`` is specified, the ``tickCount`` value will be adjusted, if necessary, to enforce the minimum step value. - tickOffset : anyOf(float, :class:`ExprRef`) + tickOffset : :class:`ExprRef`, Dict[required=[expr]], float Position offset in pixels to apply to ticks, labels, and gridlines. - tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickOpacity : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float Opacity of the ticks. - tickRound : boolean + tickRound : bool Boolean flag indicating if pixel position values should be rounded to the nearest integer. **Default value:** ``true`` - tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickSize : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The size in pixels of axis ticks. **Default value:** ``5`` - tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickWidth : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The width, in pixels, of ticks. **Default value:** ``1`` - ticks : boolean + ticks : bool Boolean value that determines whether the axis should include ticks. **Default value:** ``true`` - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -957,44 +1947,44 @@ class Axis(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + titleAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment of axis titles. - titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + titleAnchor : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] Text anchor position for placing axis titles. - titleAngle : anyOf(float, :class:`ExprRef`) + titleAngle : :class:`ExprRef`, Dict[required=[expr]], float Angle in degrees of axis titles. - titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + titleBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] Vertical text baseline for axis titles. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* rather than *fontSize* alone. - titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + titleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Color of the title, can be in hex color code or regular color name. - titleFont : anyOf(string, :class:`ExprRef`) + titleFont : :class:`ExprRef`, Dict[required=[expr]], str Font of the title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : anyOf(float, :class:`ExprRef`) + titleFontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size of the title. - titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + titleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style of the title. - titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + titleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight of the title. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - titleLimit : anyOf(float, :class:`ExprRef`) + titleLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of axis titles. - titleLineHeight : anyOf(float, :class:`ExprRef`) + titleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - titleOpacity : anyOf(float, :class:`ExprRef`) + titleOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the axis title. - titlePadding : anyOf(float, :class:`ExprRef`) + titlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixels, between title and axis. - titleX : anyOf(float, :class:`ExprRef`) + titleX : :class:`ExprRef`, Dict[required=[expr]], float X-coordinate of the axis title relative to the axis group. - titleY : anyOf(float, :class:`ExprRef`) + titleY : :class:`ExprRef`, Dict[required=[expr]], float Y-coordinate of the axis title relative to the axis group. - translate : anyOf(float, :class:`ExprRef`) + translate : :class:`ExprRef`, Dict[required=[expr]], float Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific @@ -1002,7 +1992,7 @@ class Axis(VegaLiteSchema): to zero). **Default value:** ``0.5`` - values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), :class:`ExprRef`) + values : :class:`ExprRef`, Dict[required=[expr]], Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str] Explicitly set the visible axis tick values. zindex : float A non-negative integer indicating the z-index of the axis. If zindex is 0, axes @@ -1011,120 +2001,1379 @@ class Axis(VegaLiteSchema): **Default value:** ``0`` (behind the marks). """ - _schema = {'$ref': '#/definitions/Axis'} - - def __init__(self, aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, - domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, - domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, - format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, - gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, - gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, - labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, - labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, - labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, - labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, - labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, - labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, - maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, - position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, - tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, - tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, - tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, - ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, - titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, - titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, - titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, - titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, - translate=Undefined, values=Undefined, zindex=Undefined, **kwds): - super(Axis, self).__init__(aria=aria, bandPosition=bandPosition, description=description, - domain=domain, domainCap=domainCap, domainColor=domainColor, - domainDash=domainDash, domainDashOffset=domainDashOffset, - domainOpacity=domainOpacity, domainWidth=domainWidth, format=format, - formatType=formatType, grid=grid, gridCap=gridCap, - gridColor=gridColor, gridDash=gridDash, - gridDashOffset=gridDashOffset, gridOpacity=gridOpacity, - gridWidth=gridWidth, labelAlign=labelAlign, labelAngle=labelAngle, - labelBaseline=labelBaseline, labelBound=labelBound, - labelColor=labelColor, labelExpr=labelExpr, labelFlush=labelFlush, - labelFlushOffset=labelFlushOffset, labelFont=labelFont, - labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, - labelFontWeight=labelFontWeight, labelLimit=labelLimit, - labelLineHeight=labelLineHeight, labelOffset=labelOffset, - labelOpacity=labelOpacity, labelOverlap=labelOverlap, - labelPadding=labelPadding, labelSeparation=labelSeparation, - labels=labels, maxExtent=maxExtent, minExtent=minExtent, - offset=offset, orient=orient, position=position, style=style, - tickBand=tickBand, tickCap=tickCap, tickColor=tickColor, - tickCount=tickCount, tickDash=tickDash, - tickDashOffset=tickDashOffset, tickExtra=tickExtra, - tickMinStep=tickMinStep, tickOffset=tickOffset, - tickOpacity=tickOpacity, tickRound=tickRound, tickSize=tickSize, - tickWidth=tickWidth, ticks=ticks, title=title, titleAlign=titleAlign, - titleAnchor=titleAnchor, titleAngle=titleAngle, - titleBaseline=titleBaseline, titleColor=titleColor, - titleFont=titleFont, titleFontSize=titleFontSize, - titleFontStyle=titleFontStyle, titleFontWeight=titleFontWeight, - titleLimit=titleLimit, titleLineHeight=titleLineHeight, - titleOpacity=titleOpacity, titlePadding=titlePadding, titleX=titleX, - titleY=titleY, translate=translate, values=values, zindex=zindex, - **kwds) + + _schema = {"$ref": "#/definitions/Axis"} + + def __init__( + self, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + bandPosition: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + domain: Union[bool, UndefinedType] = Undefined, + domainCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + domainColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + domainDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + domainDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + domainOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + domainWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + grid: Union[bool, UndefinedType] = Undefined, + gridCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + gridColor: Union[ + Union[ + Union["ConditionalAxisColor", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + gridDash: Union[ + Union[ + Sequence[float], + Union["ConditionalAxisNumberArray", dict], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + gridDashOffset: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + gridOpacity: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + gridWidth: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ConditionalAxisLabelAlign", dict], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelBaseline: Union[ + Union[ + Union["ConditionalAxisLabelBaseline", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + labelBound: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union[bool, float]], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union["ConditionalAxisColor", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFlush: Union[Union[bool, float], UndefinedType] = Undefined, + labelFlushOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelFont: Union[ + Union[ + Union["ConditionalAxisString", dict], + Union["ExprRef", "_Parameter", dict], + str, + ], + UndefinedType, + ] = Undefined, + labelFontSize: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union["ConditionalAxisLabelFontStyle", dict], + Union["ExprRef", "_Parameter", dict], + Union["FontStyle", str], + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union["ConditionalAxisLabelFontWeight", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOpacity: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOverlap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["LabelOverlap", bool, str] + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelSeparation: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + maxExtent: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + minExtent: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union["AxisOrient", Literal["top", "bottom", "left", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + position: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tickBand: Union[ + Union[Literal["center", "extent"], Union["ExprRef", "_Parameter", dict]], + UndefinedType, + ] = Undefined, + tickCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + tickColor: Union[ + Union[ + Union["ConditionalAxisColor", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TimeInterval", + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + ], + Union["TimeIntervalStep", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickDash: Union[ + Union[ + Sequence[float], + Union["ConditionalAxisNumberArray", dict], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + tickDashOffset: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickExtra: Union[bool, UndefinedType] = Undefined, + tickMinStep: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tickOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tickOpacity: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickRound: Union[bool, UndefinedType] = Undefined, + tickSize: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickWidth: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + ticks: Union[bool, UndefinedType] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], + ], + UndefinedType, + ] = Undefined, + titleAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleX: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleY: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + values: Union[ + Union[ + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(Axis, self).__init__( + aria=aria, + bandPosition=bandPosition, + description=description, + domain=domain, + domainCap=domainCap, + domainColor=domainColor, + domainDash=domainDash, + domainDashOffset=domainDashOffset, + domainOpacity=domainOpacity, + domainWidth=domainWidth, + format=format, + formatType=formatType, + grid=grid, + gridCap=gridCap, + gridColor=gridColor, + gridDash=gridDash, + gridDashOffset=gridDashOffset, + gridOpacity=gridOpacity, + gridWidth=gridWidth, + labelAlign=labelAlign, + labelAngle=labelAngle, + labelBaseline=labelBaseline, + labelBound=labelBound, + labelColor=labelColor, + labelExpr=labelExpr, + labelFlush=labelFlush, + labelFlushOffset=labelFlushOffset, + labelFont=labelFont, + labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, + labelLimit=labelLimit, + labelLineHeight=labelLineHeight, + labelOffset=labelOffset, + labelOpacity=labelOpacity, + labelOverlap=labelOverlap, + labelPadding=labelPadding, + labelSeparation=labelSeparation, + labels=labels, + maxExtent=maxExtent, + minExtent=minExtent, + offset=offset, + orient=orient, + position=position, + style=style, + tickBand=tickBand, + tickCap=tickCap, + tickColor=tickColor, + tickCount=tickCount, + tickDash=tickDash, + tickDashOffset=tickDashOffset, + tickExtra=tickExtra, + tickMinStep=tickMinStep, + tickOffset=tickOffset, + tickOpacity=tickOpacity, + tickRound=tickRound, + tickSize=tickSize, + tickWidth=tickWidth, + ticks=ticks, + title=title, + titleAlign=titleAlign, + titleAnchor=titleAnchor, + titleAngle=titleAngle, + titleBaseline=titleBaseline, + titleColor=titleColor, + titleFont=titleFont, + titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, + titleLimit=titleLimit, + titleLineHeight=titleLineHeight, + titleOpacity=titleOpacity, + titlePadding=titlePadding, + titleX=titleX, + titleY=titleY, + translate=translate, + values=values, + zindex=zindex, + **kwds, + ) class AxisConfig(VegaLiteSchema): """AxisConfig schema wrapper - Mapping(required=[]) + :class:`AxisConfig`, Dict Parameters ---------- - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG group, removing the axis from the ARIA accessibility tree. **Default value:** ``true`` - bandPosition : anyOf(float, :class:`ExprRef`) + bandPosition : :class:`ExprRef`, Dict[required=[expr]], float An interpolation fraction indicating where, for ``band`` scales, axis ticks should be positioned. A value of ``0`` places ticks at the left edge of their bands. A value of ``0.5`` places ticks in the middle of their bands. **Default value:** ``0.5`` - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of this axis for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If the ``aria`` property is true, for SVG output the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__ will be set to this description. If the description is unspecified it will be automatically generated. - disable : boolean + disable : bool Disable axis by default. - domain : boolean + domain : bool A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis. **Default value:** ``true`` - domainCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + domainCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for the domain line's ending style. One of ``"butt"``, ``"round"`` or ``"square"``. **Default value:** ``"butt"`` - domainColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + domainColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Color of axis domain line. **Default value:** ``"gray"``. - domainDash : anyOf(List(float), :class:`ExprRef`) + domainDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed domain lines. - domainDashOffset : anyOf(float, :class:`ExprRef`) + domainDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the domain dash array. - domainOpacity : anyOf(float, :class:`ExprRef`) + domainOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the axis domain line. - domainWidth : anyOf(float, :class:`ExprRef`) + domainWidth : :class:`ExprRef`, Dict[required=[expr]], float Stroke width of axis domain line **Default value:** ``1`` - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -1147,7 +3396,7 @@ class AxisConfig(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -1158,47 +3407,47 @@ class AxisConfig(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - grid : boolean + grid : bool A boolean flag indicating if grid lines should be included as part of the axis **Default value:** ``true`` for `continuous scales <https://vega.github.io/vega-lite/docs/scale.html#continuous>`__ that are not binned; otherwise, ``false``. - gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + gridCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for grid lines' ending style. One of ``"butt"``, ``"round"`` or ``"square"``. **Default value:** ``"butt"`` - gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, :class:`ConditionalAxisColor`) + gridColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ConditionalAxisColor`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] Color of gridlines. **Default value:** ``"lightGray"``. - gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + gridDash : :class:`ConditionalAxisNumberArray`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed grid lines. - gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + gridDashOffset : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the grid dash array. - gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + gridOpacity : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity of grid (value between [0,1]) **Default value:** ``1`` - gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + gridWidth : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The grid width, in pixels. **Default value:** ``1`` - labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) + labelAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ConditionalAxisLabelAlign`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation. - labelAngle : anyOf(float, :class:`ExprRef`) + labelAngle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the axis labels. **Default value:** ``-90`` for nominal and ordinal fields; ``0`` otherwise. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, :class:`ConditionalAxisLabelBaseline`) + labelBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ConditionalAxisLabelBaseline`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* rather than *fontSize* alone. - labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + labelBound : :class:`ExprRef`, Dict[required=[expr]], bool, float Indicates if labels should be hidden if they exceed the axis range. If ``false`` (the default) no bounds overlap analysis is performed. If ``true``, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a @@ -1206,15 +3455,15 @@ class AxisConfig(VegaLiteSchema): bounding box may exceed the axis range. **Default value:** ``false``. - labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, :class:`ConditionalAxisColor`) + labelColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ConditionalAxisColor`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] The color of the tick label, can be in hex color code or regular color name. - labelExpr : string + labelExpr : str `Vega expression <https://vega.github.io/vega/docs/expressions/>`__ for customizing labels. **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the axis's backing ``datum`` object. - labelFlush : anyOf(boolean, float) + labelFlush : bool, float Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are @@ -1225,35 +3474,35 @@ class AxisConfig(VegaLiteSchema): visually group with corresponding axis ticks. **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. - labelFlushOffset : anyOf(float, :class:`ExprRef`) + labelFlushOffset : :class:`ExprRef`, Dict[required=[expr]], float Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of ``2`` will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks. **Default value:** ``0``. - labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) + labelFont : :class:`ConditionalAxisString`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], str The font of the tick label. - labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelFontSize : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The font size of the label, in pixels. - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, :class:`ConditionalAxisLabelFontStyle`) + labelFontStyle : :class:`ConditionalAxisLabelFontStyle`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style of the title. - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, :class:`ConditionalAxisLabelFontWeight`) + labelFontWeight : :class:`ConditionalAxisLabelFontWeight`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight of axis tick labels. - labelLimit : anyOf(float, :class:`ExprRef`) + labelLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of axis tick labels. **Default value:** ``180`` - labelLineHeight : anyOf(float, :class:`ExprRef`) + labelLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line label text or label text with ``"line-top"`` or ``"line-bottom"`` baseline. - labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelOffset : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float Position offset in pixels to apply to labels, in addition to tickOffset. **Default value:** ``0`` - labelOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelOpacity : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The opacity of the labels. - labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + labelOverlap : :class:`ExprRef`, Dict[required=[expr]], :class:`LabelOverlap`, bool, str The strategy to use for resolving overlap of axis labels. If ``false`` (the default), no overlap reduction is attempted. If set to ``true`` or ``"parity"``, a strategy of removing every other label is used (this works well for standard linear @@ -1263,48 +3512,48 @@ class AxisConfig(VegaLiteSchema): **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` for log scales; otherwise ``false``. - labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + labelPadding : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The padding in pixels between labels and ticks. **Default value:** ``2`` - labelSeparation : anyOf(float, :class:`ExprRef`) + labelSeparation : :class:`ExprRef`, Dict[required=[expr]], float The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default ``0`` ). This property is ignored if *labelOverlap* resolution is not enabled. - labels : boolean + labels : bool A boolean flag indicating if labels should be included as part of the axis. **Default value:** ``true``. - maxExtent : anyOf(float, :class:`ExprRef`) + maxExtent : :class:`ExprRef`, Dict[required=[expr]], float The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles. **Default value:** ``undefined``. - minExtent : anyOf(float, :class:`ExprRef`) + minExtent : :class:`ExprRef`, Dict[required=[expr]], float The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles. **Default value:** ``30`` for y-axis; ``undefined`` for x-axis. - offset : anyOf(float, :class:`ExprRef`) + offset : :class:`ExprRef`, Dict[required=[expr]], float The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle. **Default value:** derived from the `axis config <https://vega.github.io/vega-lite/docs/config.html#facet-scale-config>`__ 's ``offset`` ( ``0`` by default) - orient : anyOf(:class:`AxisOrient`, :class:`ExprRef`) + orient : :class:`AxisOrient`, Literal['top', 'bottom', 'left', 'right'], :class:`ExprRef`, Dict[required=[expr]] The orientation of the axis. One of ``"top"``, ``"bottom"``, ``"left"`` or ``"right"``. The orientation can be used to further specialize the axis type (e.g., a y-axis oriented towards the right edge of the chart). **Default value:** ``"bottom"`` for x-axes and ``"left"`` for y-axes. - position : anyOf(float, :class:`ExprRef`) + position : :class:`ExprRef`, Dict[required=[expr]], float The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate. **Default value** : ``0`` - style : anyOf(string, List(string)) + style : Sequence[str], str A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the `style configuration <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. If @@ -1313,19 +3562,19 @@ class AxisConfig(VegaLiteSchema): **Default value:** (none) **Note:** Any specified style will augment the default style. For example, an x-axis mark with ``"style": "foo"`` will use ``config.axisX`` and ``config.style.foo`` (the specified style ``"foo"`` has higher precedence). - tickBand : anyOf(enum('center', 'extent'), :class:`ExprRef`) + tickBand : :class:`ExprRef`, Dict[required=[expr]], Literal['center', 'extent'] For band scales, indicates if ticks and grid lines should be placed at the ``"center"`` of a band (default) or at the band ``"extent"`` s to indicate intervals - tickCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + tickCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for the tick lines' ending style. One of ``"butt"``, ``"round"`` or ``"square"``. **Default value:** ``"butt"`` - tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, :class:`ConditionalAxisColor`) + tickColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ConditionalAxisColor`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]] The color of the axis's tick. **Default value:** ``"gray"`` - tickCount : anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`, :class:`ExprRef`) + tickCount : :class:`ExprRef`, Dict[required=[expr]], :class:`TimeIntervalStep`, Dict[required=[interval, step]], :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'], float A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are "nice" (multiples of 2, 5, 10) and lie within the underlying scale's range. @@ -1339,42 +3588,42 @@ class AxisConfig(VegaLiteSchema): **Default value** : Determine using a formula ``ceil(width/40)`` for x and ``ceil(height/40)`` for y. - tickDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + tickDash : :class:`ConditionalAxisNumberArray`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed tick mark lines. - tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickDashOffset : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the tick mark dash array. - tickExtra : boolean + tickExtra : bool Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for ``band`` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with ``"bandPosition": 1`` and an axis ``"padding"`` value of ``0``. - tickMinStep : anyOf(float, :class:`ExprRef`) + tickMinStep : :class:`ExprRef`, Dict[required=[expr]], float The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of ``1`` indicates that ticks should not be less than 1 unit apart. If ``tickMinStep`` is specified, the ``tickCount`` value will be adjusted, if necessary, to enforce the minimum step value. - tickOffset : anyOf(float, :class:`ExprRef`) + tickOffset : :class:`ExprRef`, Dict[required=[expr]], float Position offset in pixels to apply to ticks, labels, and gridlines. - tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickOpacity : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float Opacity of the ticks. - tickRound : boolean + tickRound : bool Boolean flag indicating if pixel position values should be rounded to the nearest integer. **Default value:** ``true`` - tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickSize : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The size in pixels of axis ticks. **Default value:** ``5`` - tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + tickWidth : :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, value]], :class:`ExprRef`, Dict[required=[expr]], float The width, in pixels, of ticks. **Default value:** ``1`` - ticks : boolean + ticks : bool Boolean value that determines whether the axis should include ticks. **Default value:** ``true`` - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -1394,44 +3643,44 @@ class AxisConfig(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + titleAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment of axis titles. - titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + titleAnchor : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] Text anchor position for placing axis titles. - titleAngle : anyOf(float, :class:`ExprRef`) + titleAngle : :class:`ExprRef`, Dict[required=[expr]], float Angle in degrees of axis titles. - titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + titleBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] Vertical text baseline for axis titles. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* rather than *fontSize* alone. - titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + titleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Color of the title, can be in hex color code or regular color name. - titleFont : anyOf(string, :class:`ExprRef`) + titleFont : :class:`ExprRef`, Dict[required=[expr]], str Font of the title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : anyOf(float, :class:`ExprRef`) + titleFontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size of the title. - titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + titleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style of the title. - titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + titleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight of the title. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - titleLimit : anyOf(float, :class:`ExprRef`) + titleLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of axis titles. - titleLineHeight : anyOf(float, :class:`ExprRef`) + titleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - titleOpacity : anyOf(float, :class:`ExprRef`) + titleOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the axis title. - titlePadding : anyOf(float, :class:`ExprRef`) + titlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixels, between title and axis. - titleX : anyOf(float, :class:`ExprRef`) + titleX : :class:`ExprRef`, Dict[required=[expr]], float X-coordinate of the axis title relative to the axis group. - titleY : anyOf(float, :class:`ExprRef`) + titleY : :class:`ExprRef`, Dict[required=[expr]], float Y-coordinate of the axis title relative to the axis group. - translate : anyOf(float, :class:`ExprRef`) + translate : :class:`ExprRef`, Dict[required=[expr]], float Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific @@ -1439,7 +3688,7 @@ class AxisConfig(VegaLiteSchema): to zero). **Default value:** ``0.5`` - values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), :class:`ExprRef`) + values : :class:`ExprRef`, Dict[required=[expr]], Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str] Explicitly set the visible axis tick values. zindex : float A non-negative integer indicating the z-index of the axis. If zindex is 0, axes @@ -1448,73 +3697,1333 @@ class AxisConfig(VegaLiteSchema): **Default value:** ``0`` (behind the marks). """ - _schema = {'$ref': '#/definitions/AxisConfig'} - - def __init__(self, aria=Undefined, bandPosition=Undefined, description=Undefined, disable=Undefined, - domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, - domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, - format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, - gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, - gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, - labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, - labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, - labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, - labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, - labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, - labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, - maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, - position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, - tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, - tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, - tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, - ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, - titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, - titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, - titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, - titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, - translate=Undefined, values=Undefined, zindex=Undefined, **kwds): - super(AxisConfig, self).__init__(aria=aria, bandPosition=bandPosition, description=description, - disable=disable, domain=domain, domainCap=domainCap, - domainColor=domainColor, domainDash=domainDash, - domainDashOffset=domainDashOffset, domainOpacity=domainOpacity, - domainWidth=domainWidth, format=format, formatType=formatType, - grid=grid, gridCap=gridCap, gridColor=gridColor, - gridDash=gridDash, gridDashOffset=gridDashOffset, - gridOpacity=gridOpacity, gridWidth=gridWidth, - labelAlign=labelAlign, labelAngle=labelAngle, - labelBaseline=labelBaseline, labelBound=labelBound, - labelColor=labelColor, labelExpr=labelExpr, - labelFlush=labelFlush, labelFlushOffset=labelFlushOffset, - labelFont=labelFont, labelFontSize=labelFontSize, - labelFontStyle=labelFontStyle, labelFontWeight=labelFontWeight, - labelLimit=labelLimit, labelLineHeight=labelLineHeight, - labelOffset=labelOffset, labelOpacity=labelOpacity, - labelOverlap=labelOverlap, labelPadding=labelPadding, - labelSeparation=labelSeparation, labels=labels, - maxExtent=maxExtent, minExtent=minExtent, offset=offset, - orient=orient, position=position, style=style, - tickBand=tickBand, tickCap=tickCap, tickColor=tickColor, - tickCount=tickCount, tickDash=tickDash, - tickDashOffset=tickDashOffset, tickExtra=tickExtra, - tickMinStep=tickMinStep, tickOffset=tickOffset, - tickOpacity=tickOpacity, tickRound=tickRound, - tickSize=tickSize, tickWidth=tickWidth, ticks=ticks, - title=title, titleAlign=titleAlign, titleAnchor=titleAnchor, - titleAngle=titleAngle, titleBaseline=titleBaseline, - titleColor=titleColor, titleFont=titleFont, - titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, - titleFontWeight=titleFontWeight, titleLimit=titleLimit, - titleLineHeight=titleLineHeight, titleOpacity=titleOpacity, - titlePadding=titlePadding, titleX=titleX, titleY=titleY, - translate=translate, values=values, zindex=zindex, **kwds) + + _schema = {"$ref": "#/definitions/AxisConfig"} + + def __init__( + self, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + bandPosition: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + disable: Union[bool, UndefinedType] = Undefined, + domain: Union[bool, UndefinedType] = Undefined, + domainCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + domainColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + domainDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + domainDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + domainOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + domainWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + grid: Union[bool, UndefinedType] = Undefined, + gridCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + gridColor: Union[ + Union[ + Union["ConditionalAxisColor", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + gridDash: Union[ + Union[ + Sequence[float], + Union["ConditionalAxisNumberArray", dict], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + gridDashOffset: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + gridOpacity: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + gridWidth: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ConditionalAxisLabelAlign", dict], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelBaseline: Union[ + Union[ + Union["ConditionalAxisLabelBaseline", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + labelBound: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union[bool, float]], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union["ConditionalAxisColor", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFlush: Union[Union[bool, float], UndefinedType] = Undefined, + labelFlushOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelFont: Union[ + Union[ + Union["ConditionalAxisString", dict], + Union["ExprRef", "_Parameter", dict], + str, + ], + UndefinedType, + ] = Undefined, + labelFontSize: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelFontStyle: Union[ + Union[ + Union["ConditionalAxisLabelFontStyle", dict], + Union["ExprRef", "_Parameter", dict], + Union["FontStyle", str], + ], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union["ConditionalAxisLabelFontWeight", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOpacity: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelOverlap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["LabelOverlap", bool, str] + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + labelSeparation: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + maxExtent: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + minExtent: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union["AxisOrient", Literal["top", "bottom", "left", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + position: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tickBand: Union[ + Union[Literal["center", "extent"], Union["ExprRef", "_Parameter", dict]], + UndefinedType, + ] = Undefined, + tickCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + tickColor: Union[ + Union[ + Union["ConditionalAxisColor", dict], + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TimeInterval", + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + ], + Union["TimeIntervalStep", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickDash: Union[ + Union[ + Sequence[float], + Union["ConditionalAxisNumberArray", dict], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + tickDashOffset: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickExtra: Union[bool, UndefinedType] = Undefined, + tickMinStep: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tickOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tickOpacity: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickRound: Union[bool, UndefinedType] = Undefined, + tickSize: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + tickWidth: Union[ + Union[ + Union["ConditionalAxisNumber", dict], + Union["ExprRef", "_Parameter", dict], + float, + ], + UndefinedType, + ] = Undefined, + ticks: Union[bool, UndefinedType] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], + ], + UndefinedType, + ] = Undefined, + titleAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleX: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleY: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + values: Union[ + Union[ + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(AxisConfig, self).__init__( + aria=aria, + bandPosition=bandPosition, + description=description, + disable=disable, + domain=domain, + domainCap=domainCap, + domainColor=domainColor, + domainDash=domainDash, + domainDashOffset=domainDashOffset, + domainOpacity=domainOpacity, + domainWidth=domainWidth, + format=format, + formatType=formatType, + grid=grid, + gridCap=gridCap, + gridColor=gridColor, + gridDash=gridDash, + gridDashOffset=gridDashOffset, + gridOpacity=gridOpacity, + gridWidth=gridWidth, + labelAlign=labelAlign, + labelAngle=labelAngle, + labelBaseline=labelBaseline, + labelBound=labelBound, + labelColor=labelColor, + labelExpr=labelExpr, + labelFlush=labelFlush, + labelFlushOffset=labelFlushOffset, + labelFont=labelFont, + labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, + labelLimit=labelLimit, + labelLineHeight=labelLineHeight, + labelOffset=labelOffset, + labelOpacity=labelOpacity, + labelOverlap=labelOverlap, + labelPadding=labelPadding, + labelSeparation=labelSeparation, + labels=labels, + maxExtent=maxExtent, + minExtent=minExtent, + offset=offset, + orient=orient, + position=position, + style=style, + tickBand=tickBand, + tickCap=tickCap, + tickColor=tickColor, + tickCount=tickCount, + tickDash=tickDash, + tickDashOffset=tickDashOffset, + tickExtra=tickExtra, + tickMinStep=tickMinStep, + tickOffset=tickOffset, + tickOpacity=tickOpacity, + tickRound=tickRound, + tickSize=tickSize, + tickWidth=tickWidth, + ticks=ticks, + title=title, + titleAlign=titleAlign, + titleAnchor=titleAnchor, + titleAngle=titleAngle, + titleBaseline=titleBaseline, + titleColor=titleColor, + titleFont=titleFont, + titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, + titleLimit=titleLimit, + titleLineHeight=titleLineHeight, + titleOpacity=titleOpacity, + titlePadding=titlePadding, + titleX=titleX, + titleY=titleY, + translate=translate, + values=values, + zindex=zindex, + **kwds, + ) class AxisOrient(VegaLiteSchema): """AxisOrient schema wrapper - enum('top', 'bottom', 'left', 'right') + :class:`AxisOrient`, Literal['top', 'bottom', 'left', 'right'] """ - _schema = {'$ref': '#/definitions/AxisOrient'} + + _schema = {"$ref": "#/definitions/AxisOrient"} def __init__(self, *args): super(AxisOrient, self).__init__(*args) @@ -1523,29 +5032,40 @@ def __init__(self, *args): class AxisResolveMap(VegaLiteSchema): """AxisResolveMap schema wrapper - Mapping(required=[]) + :class:`AxisResolveMap`, Dict Parameters ---------- - x : :class:`ResolveMode` + x : :class:`ResolveMode`, Literal['independent', 'shared'] - y : :class:`ResolveMode` + y : :class:`ResolveMode`, Literal['independent', 'shared'] """ - _schema = {'$ref': '#/definitions/AxisResolveMap'} - def __init__(self, x=Undefined, y=Undefined, **kwds): + _schema = {"$ref": "#/definitions/AxisResolveMap"} + + def __init__( + self, + x: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + y: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + **kwds, + ): super(AxisResolveMap, self).__init__(x=x, y=y, **kwds) class BBox(VegaLiteSchema): """BBox schema wrapper - anyOf(List(float), List(float)) + :class:`BBox`, Sequence[float] Bounding box https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/BBox'} + + _schema = {"$ref": "#/definitions/BBox"} def __init__(self, *args, **kwds): super(BBox, self).__init__(*args, **kwds) @@ -1554,37 +5074,37 @@ def __init__(self, *args, **kwds): class BarConfig(AnyMarkConfig): """BarConfig schema wrapper - Mapping(required=[]) + :class:`BarConfig`, Dict Parameters ---------- - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -1600,13 +5120,13 @@ class BarConfig(AnyMarkConfig): (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). **Default value:** ``1`` - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -1623,70 +5143,70 @@ class BarConfig(AnyMarkConfig): The default size of the bars on continuous scales. **Default value:** ``5`` - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusEnd : anyOf(float, :class:`ExprRef`) + cornerRadiusEnd : :class:`ExprRef`, Dict[required=[expr]], float For vertical bars, top-left and top-right corner radius. For horizontal bars, top-right and bottom-right corner radius. - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - discreteBandSize : anyOf(float, :class:`RelativeBandSize`) + discreteBandSize : :class:`RelativeBandSize`, Dict[required=[band]], float The default size of the bars with discrete dimensions. If unspecified, the default size is ``step-2``, which provides 2 pixel offset between bars. - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - endAngle : anyOf(float, :class:`ExprRef`) + endAngle : :class:`ExprRef`, Dict[required=[expr]], float The end angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -1696,28 +5216,28 @@ class BarConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`) + height : :class:`ExprRef`, Dict[required=[expr]], float Height of the marks. - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -1739,7 +5259,7 @@ class BarConfig(AnyMarkConfig): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -1748,28 +5268,28 @@ class BarConfig(AnyMarkConfig): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - minBandSize : anyOf(float, :class:`ExprRef`) + minBandSize : :class:`ExprRef`, Dict[required=[expr]], float The minimum band size for bar and rectangle marks. **Default value:** ``0.25`` - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -1781,24 +5301,24 @@ class BarConfig(AnyMarkConfig): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -1813,7 +5333,7 @@ class BarConfig(AnyMarkConfig): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -1830,56 +5350,56 @@ class BarConfig(AnyMarkConfig): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - startAngle : anyOf(float, :class:`ExprRef`) + startAngle : :class:`ExprRef`, Dict[required=[expr]], float The start angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. timeUnitBandPosition : float @@ -1890,7 +5410,7 @@ class BarConfig(AnyMarkConfig): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -1905,200 +5425,1571 @@ class BarConfig(AnyMarkConfig): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`) + width : :class:`ExprRef`, Dict[required=[expr]], float Width of the marks. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. """ - _schema = {'$ref': '#/definitions/BarConfig'} - - def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, color=Undefined, continuousBandSize=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - description=Undefined, dir=Undefined, discreteBandSize=Undefined, dx=Undefined, - dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, - fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, - fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, - innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, - lineBreak=Undefined, lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, - order=Undefined, orient=Undefined, outerRadius=Undefined, padAngle=Undefined, - radius=Undefined, radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, - startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, - timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, - url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, - **kwds): - super(BarConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - baseline=baseline, binSpacing=binSpacing, blend=blend, - color=color, continuousBandSize=continuousBandSize, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, - discreteBandSize=discreteBandSize, dx=dx, dy=dy, - ellipsis=ellipsis, endAngle=endAngle, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, - interpolate=interpolate, invalid=invalid, limit=limit, - lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, - orient=orient, outerRadius=outerRadius, padAngle=padAngle, - radius=radius, radius2=radius2, shape=shape, size=size, - smooth=smooth, startAngle=startAngle, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - tension=tension, text=text, theta=theta, theta2=theta2, - timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + _schema = {"$ref": "#/definitions/BarConfig"} + + def __init__( + self, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union["RelativeBandSize", dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + endAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + startAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): + super(BarConfig, self).__init__( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + endAngle=endAngle, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + smooth=smooth, + startAngle=startAngle, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + y=y, + y2=y2, + **kwds, + ) class BaseTitleNoValueRefs(VegaLiteSchema): """BaseTitleNoValueRefs schema wrapper - Mapping(required=[]) + :class:`BaseTitleNoValueRefs`, Dict Parameters ---------- - align : :class:`Align` + align : :class:`Align`, Literal['left', 'center', 'right'] Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or ``"right"``. - anchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + anchor : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] The anchor position for placing the title and subtitle text. One of ``"start"``, ``"middle"``, or ``"end"``. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float Angle in degrees of title and subtitle text. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree. **Default value:** ``true`` - baseline : :class:`TextBaseline` + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str Vertical text baseline for title and subtitle text. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* rather than *fontSize* alone. - color : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Text color for title text. - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float Delta offset for title and subtitle text x-coordinate. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float Delta offset for title and subtitle text y-coordinate. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str Font name for title text. - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size in pixels for title text. - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style for title text. - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight for title text. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + frame : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleFrame`, Literal['bounds', 'group'], str The reference frame for the anchor position, one of ``"bounds"`` (to anchor relative to the full bounding box) or ``"group"`` (to anchor relative to the group width or height). - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum allowed length in pixels of title and subtitle text. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - offset : anyOf(float, :class:`ExprRef`) + offset : :class:`ExprRef`, Dict[required=[expr]], float The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart. - orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + orient : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleOrient`, Literal['none', 'left', 'right', 'top', 'bottom'] Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) - subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + subtitleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Text color for subtitle text. - subtitleFont : anyOf(string, :class:`ExprRef`) + subtitleFont : :class:`ExprRef`, Dict[required=[expr]], str Font name for subtitle text. - subtitleFontSize : anyOf(float, :class:`ExprRef`) + subtitleFontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size in pixels for subtitle text. - subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + subtitleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style for subtitle text. - subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + subtitleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight for subtitle text. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - subtitleLineHeight : anyOf(float, :class:`ExprRef`) + subtitleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line subtitle text. - subtitlePadding : anyOf(float, :class:`ExprRef`) + subtitlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding in pixels between title and subtitle text. - zindex : anyOf(float, :class:`ExprRef`) + zindex : :class:`ExprRef`, Dict[required=[expr]], float The integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups. **Default value:** ``0``. """ - _schema = {'$ref': '#/definitions/BaseTitleNoValueRefs'} - - def __init__(self, align=Undefined, anchor=Undefined, angle=Undefined, aria=Undefined, - baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, - fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, - limit=Undefined, lineHeight=Undefined, offset=Undefined, orient=Undefined, - subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, - subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, - subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds): - super(BaseTitleNoValueRefs, self).__init__(align=align, anchor=anchor, angle=angle, aria=aria, - baseline=baseline, color=color, dx=dx, dy=dy, - font=font, fontSize=fontSize, fontStyle=fontStyle, - fontWeight=fontWeight, frame=frame, limit=limit, - lineHeight=lineHeight, offset=offset, orient=orient, - subtitleColor=subtitleColor, - subtitleFont=subtitleFont, - subtitleFontSize=subtitleFontSize, - subtitleFontStyle=subtitleFontStyle, - subtitleFontWeight=subtitleFontWeight, - subtitleLineHeight=subtitleLineHeight, - subtitlePadding=subtitlePadding, zindex=zindex, - **kwds) + + _schema = {"$ref": "#/definitions/BaseTitleNoValueRefs"} + + def __init__( + self, + align: Union[ + Union["Align", Literal["left", "center", "right"]], UndefinedType + ] = Undefined, + anchor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + frame: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["TitleFrame", Literal["bounds", "group"]], str], + ], + UndefinedType, + ] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleOrient", Literal["none", "left", "right", "top", "bottom"]], + ], + UndefinedType, + ] = Undefined, + subtitleColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + subtitleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + subtitleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + subtitleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + subtitleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + subtitleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + subtitlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + zindex: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(BaseTitleNoValueRefs, self).__init__( + align=align, + anchor=anchor, + angle=angle, + aria=aria, + baseline=baseline, + color=color, + dx=dx, + dy=dy, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + frame=frame, + limit=limit, + lineHeight=lineHeight, + offset=offset, + orient=orient, + subtitleColor=subtitleColor, + subtitleFont=subtitleFont, + subtitleFontSize=subtitleFontSize, + subtitleFontStyle=subtitleFontStyle, + subtitleFontWeight=subtitleFontWeight, + subtitleLineHeight=subtitleLineHeight, + subtitlePadding=subtitlePadding, + zindex=zindex, + **kwds, + ) class BinExtent(VegaLiteSchema): """BinExtent schema wrapper - anyOf(List(float), :class:`ParameterExtent`) + :class:`BinExtent`, :class:`ParameterExtent`, Dict[required=[param]], Sequence[float] """ - _schema = {'$ref': '#/definitions/BinExtent'} + + _schema = {"$ref": "#/definitions/BinExtent"} def __init__(self, *args, **kwds): super(BinExtent, self).__init__(*args, **kwds) @@ -2107,7 +6998,7 @@ def __init__(self, *args, **kwds): class BinParams(VegaLiteSchema): """BinParams schema wrapper - Mapping(required=[]) + :class:`BinParams`, Dict Binning properties or boolean flag for determining whether to bin data or not. Parameters @@ -2122,9 +7013,9 @@ class BinParams(VegaLiteSchema): The number base to use for automatic bin determination (default is base 10). **Default value:** ``10`` - binned : boolean + binned : bool When set to ``true``, Vega-Lite treats the input data as already binned. - divide : List(float) + divide : Sequence[float] Scale factors indicating allowable subdivisions. The default value is [5, 2], which indicates that for base 10 numbers (the default base), the method may consider dividing bin sizes by 5 and/or 2. For example, for an initial step size of 10, the @@ -2132,7 +7023,7 @@ class BinParams(VegaLiteSchema): also satisfy the given constraints. **Default value:** ``[5, 2]`` - extent : :class:`BinExtent` + extent : :class:`BinExtent`, :class:`ParameterExtent`, Dict[required=[param]], Sequence[float] A two-element ( ``[min, max]`` ) array indicating the range of desired bin values. maxbins : float Maximum number of bins. @@ -2141,7 +7032,7 @@ class BinParams(VegaLiteSchema): other channels minstep : float A minimum allowable step size (particularly useful for integer values). - nice : boolean + nice : bool If true, attempts to make the bin boundaries use human-friendly boundaries, such as multiples of ten. @@ -2150,26 +7041,58 @@ class BinParams(VegaLiteSchema): An exact step size to use between bins. **Note:** If provided, options such as maxbins will be ignored. - steps : List(float) + steps : Sequence[float] An array of allowable step sizes to choose from. """ - _schema = {'$ref': '#/definitions/BinParams'} - def __init__(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, - extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, - steps=Undefined, **kwds): - super(BinParams, self).__init__(anchor=anchor, base=base, binned=binned, divide=divide, - extent=extent, maxbins=maxbins, minstep=minstep, nice=nice, - step=step, steps=steps, **kwds) + _schema = {"$ref": "#/definitions/BinParams"} + + def __init__( + self, + anchor: Union[float, UndefinedType] = Undefined, + base: Union[float, UndefinedType] = Undefined, + binned: Union[bool, UndefinedType] = Undefined, + divide: Union[Sequence[float], UndefinedType] = Undefined, + extent: Union[ + Union[ + "BinExtent", + Sequence[float], + Union["ParameterExtent", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + minstep: Union[float, UndefinedType] = Undefined, + nice: Union[bool, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + steps: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ): + super(BinParams, self).__init__( + anchor=anchor, + base=base, + binned=binned, + divide=divide, + extent=extent, + maxbins=maxbins, + minstep=minstep, + nice=nice, + step=step, + steps=steps, + **kwds, + ) class Binding(VegaLiteSchema): """Binding schema wrapper - anyOf(:class:`BindCheckbox`, :class:`BindRadioSelect`, :class:`BindRange`, - :class:`BindInput`, :class:`BindDirect`) + :class:`BindCheckbox`, Dict[required=[input]], :class:`BindDirect`, + Dict[required=[element]], :class:`BindInput`, Dict, :class:`BindRadioSelect`, + Dict[required=[input, options]], :class:`BindRange`, Dict[required=[input]], + :class:`Binding` """ - _schema = {'$ref': '#/definitions/Binding'} + + _schema = {"$ref": "#/definitions/Binding"} def __init__(self, *args, **kwds): super(Binding, self).__init__(*args, **kwds) @@ -2178,40 +7101,49 @@ def __init__(self, *args, **kwds): class BindCheckbox(Binding): """BindCheckbox schema wrapper - Mapping(required=[input]) + :class:`BindCheckbox`, Dict[required=[input]] Parameters ---------- - input : string + input : str debounce : float If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired. - element : :class:`Element` + element : :class:`Element`, str An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view. - name : string + name : str By default, the signal name is used to label input elements. This ``name`` property can be used instead to specify a custom label for the bound signal. """ - _schema = {'$ref': '#/definitions/BindCheckbox'} - def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, name=Undefined, **kwds): - super(BindCheckbox, self).__init__(input=input, debounce=debounce, element=element, name=name, - **kwds) + _schema = {"$ref": "#/definitions/BindCheckbox"} + + def __init__( + self, + input: Union[str, UndefinedType] = Undefined, + debounce: Union[float, UndefinedType] = Undefined, + element: Union[Union["Element", str], UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(BindCheckbox, self).__init__( + input=input, debounce=debounce, element=element, name=name, **kwds + ) class BindDirect(Binding): """BindDirect schema wrapper - Mapping(required=[element]) + :class:`BindDirect`, Dict[required=[element]] Parameters ---------- - element : anyOf(:class:`Element`, Mapping(required=[])) + element : :class:`Element`, str, Dict An input element that exposes a *value* property and supports the `EventTarget <https://developer.mozilla.org/en-US/docs/Web/API/EventTarget>`__ interface, or a CSS selector string to such an element. When the element updates and dispatches an @@ -2221,101 +7153,142 @@ class BindDirect(Binding): debounce : float If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired. - event : string + event : str The event (default ``"input"`` ) to listen for to track changes on the external element. """ - _schema = {'$ref': '#/definitions/BindDirect'} - def __init__(self, element=Undefined, debounce=Undefined, event=Undefined, **kwds): - super(BindDirect, self).__init__(element=element, debounce=debounce, event=event, **kwds) + _schema = {"$ref": "#/definitions/BindDirect"} + + def __init__( + self, + element: Union[Union[Union["Element", str], dict], UndefinedType] = Undefined, + debounce: Union[float, UndefinedType] = Undefined, + event: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(BindDirect, self).__init__( + element=element, debounce=debounce, event=event, **kwds + ) class BindInput(Binding): """BindInput schema wrapper - Mapping(required=[]) + :class:`BindInput`, Dict Parameters ---------- - autocomplete : string + autocomplete : str A hint for form autofill. See the `HTML autocomplete attribute <https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete>`__ for additional information. debounce : float If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired. - element : :class:`Element` + element : :class:`Element`, str An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view. - input : string + input : str The type of input element to use. The valid values are ``"checkbox"``, ``"radio"``, ``"range"``, ``"select"``, and any other legal `HTML form input type <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input>`__. - name : string + name : str By default, the signal name is used to label input elements. This ``name`` property can be used instead to specify a custom label for the bound signal. - placeholder : string + placeholder : str Text that appears in the form control when it has no value set. """ - _schema = {'$ref': '#/definitions/BindInput'} - def __init__(self, autocomplete=Undefined, debounce=Undefined, element=Undefined, input=Undefined, - name=Undefined, placeholder=Undefined, **kwds): - super(BindInput, self).__init__(autocomplete=autocomplete, debounce=debounce, element=element, - input=input, name=name, placeholder=placeholder, **kwds) + _schema = {"$ref": "#/definitions/BindInput"} + + def __init__( + self, + autocomplete: Union[str, UndefinedType] = Undefined, + debounce: Union[float, UndefinedType] = Undefined, + element: Union[Union["Element", str], UndefinedType] = Undefined, + input: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + placeholder: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(BindInput, self).__init__( + autocomplete=autocomplete, + debounce=debounce, + element=element, + input=input, + name=name, + placeholder=placeholder, + **kwds, + ) class BindRadioSelect(Binding): """BindRadioSelect schema wrapper - Mapping(required=[input, options]) + :class:`BindRadioSelect`, Dict[required=[input, options]] Parameters ---------- - input : enum('radio', 'select') + input : Literal['radio', 'select'] - options : List(Any) + options : Sequence[Any] An array of options to select from. debounce : float If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired. - element : :class:`Element` + element : :class:`Element`, str An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view. - labels : List(string) + labels : Sequence[str] An array of label strings to represent the ``options`` values. If unspecified, the ``options`` value will be coerced to a string and used as the label. - name : string + name : str By default, the signal name is used to label input elements. This ``name`` property can be used instead to specify a custom label for the bound signal. """ - _schema = {'$ref': '#/definitions/BindRadioSelect'} - def __init__(self, input=Undefined, options=Undefined, debounce=Undefined, element=Undefined, - labels=Undefined, name=Undefined, **kwds): - super(BindRadioSelect, self).__init__(input=input, options=options, debounce=debounce, - element=element, labels=labels, name=name, **kwds) + _schema = {"$ref": "#/definitions/BindRadioSelect"} + + def __init__( + self, + input: Union[Literal["radio", "select"], UndefinedType] = Undefined, + options: Union[Sequence[Any], UndefinedType] = Undefined, + debounce: Union[float, UndefinedType] = Undefined, + element: Union[Union["Element", str], UndefinedType] = Undefined, + labels: Union[Sequence[str], UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(BindRadioSelect, self).__init__( + input=input, + options=options, + debounce=debounce, + element=element, + labels=labels, + name=name, + **kwds, + ) class BindRange(Binding): """BindRange schema wrapper - Mapping(required=[input]) + :class:`BindRange`, Dict[required=[input]] Parameters ---------- - input : string + input : str debounce : float If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired. - element : :class:`Element` + element : :class:`Element`, str An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view. @@ -2325,37 +7298,56 @@ class BindRange(Binding): min : float Sets the minimum slider value. Defaults to the smaller of the signal value and ``0``. - name : string + name : str By default, the signal name is used to label input elements. This ``name`` property can be used instead to specify a custom label for the bound signal. step : float Sets the minimum slider increment. If undefined, the step size will be automatically determined based on the ``min`` and ``max`` values. """ - _schema = {'$ref': '#/definitions/BindRange'} - def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, max=Undefined, - min=Undefined, name=Undefined, step=Undefined, **kwds): - super(BindRange, self).__init__(input=input, debounce=debounce, element=element, max=max, - min=min, name=name, step=step, **kwds) + _schema = {"$ref": "#/definitions/BindRange"} + + def __init__( + self, + input: Union[str, UndefinedType] = Undefined, + debounce: Union[float, UndefinedType] = Undefined, + element: Union[Union["Element", str], UndefinedType] = Undefined, + max: Union[float, UndefinedType] = Undefined, + min: Union[float, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(BindRange, self).__init__( + input=input, + debounce=debounce, + element=element, + max=max, + min=min, + name=name, + step=step, + **kwds, + ) class BinnedTimeUnit(VegaLiteSchema): """BinnedTimeUnit schema wrapper - anyOf(enum('binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', - 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', + :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', + 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', + 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', + 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', + 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', + 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', + 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', + 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', - 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'), enum('binnedutcyear', - 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', - 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', - 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', - 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', - 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', - 'binnedutcyeardayofyear')) + 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'] """ - _schema = {'$ref': '#/definitions/BinnedTimeUnit'} + + _schema = {"$ref": "#/definitions/BinnedTimeUnit"} def __init__(self, *args, **kwds): super(BinnedTimeUnit, self).__init__(*args, **kwds) @@ -2364,11 +7356,12 @@ def __init__(self, *args, **kwds): class Blend(VegaLiteSchema): """Blend schema wrapper - enum(None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', - 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', - 'color', 'luminosity') + :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', + 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', + 'saturation', 'color', 'luminosity'] """ - _schema = {'$ref': '#/definitions/Blend'} + + _schema = {"$ref": "#/definitions/Blend"} def __init__(self, *args): super(Blend, self).__init__(*args) @@ -2377,14 +7370,14 @@ def __init__(self, *args): class BoxPlotConfig(VegaLiteSchema): """BoxPlotConfig schema wrapper - Mapping(required=[]) + :class:`BoxPlotConfig`, Dict Parameters ---------- - box : anyOf(boolean, :class:`AnyMarkConfig`) + box : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - extent : anyOf(string, float) + extent : float, str The extent of the whiskers. Available options include: @@ -2396,37 +7389,125 @@ class BoxPlotConfig(VegaLiteSchema): range ( *Q3-Q1* ). **Default value:** ``1.5``. - median : anyOf(boolean, :class:`AnyMarkConfig`) + median : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - outliers : anyOf(boolean, :class:`AnyMarkConfig`) + outliers : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - rule : anyOf(boolean, :class:`AnyMarkConfig`) + rule : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool size : float Size of the box and median tick of a box plot - ticks : anyOf(boolean, :class:`AnyMarkConfig`) - - """ - _schema = {'$ref': '#/definitions/BoxPlotConfig'} - - def __init__(self, box=Undefined, extent=Undefined, median=Undefined, outliers=Undefined, - rule=Undefined, size=Undefined, ticks=Undefined, **kwds): - super(BoxPlotConfig, self).__init__(box=box, extent=extent, median=median, outliers=outliers, - rule=rule, size=size, ticks=ticks, **kwds) + ticks : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool + + """ + + _schema = {"$ref": "#/definitions/BoxPlotConfig"} + + def __init__( + self, + box: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + extent: Union[Union[float, str], UndefinedType] = Undefined, + median: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + outliers: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + rule: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + size: Union[float, UndefinedType] = Undefined, + ticks: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(BoxPlotConfig, self).__init__( + box=box, + extent=extent, + median=median, + outliers=outliers, + rule=rule, + size=size, + ticks=ticks, + **kwds, + ) class BrushConfig(VegaLiteSchema): """BrushConfig schema wrapper - Mapping(required=[]) + :class:`BrushConfig`, Dict Parameters ---------- - cursor : :class:`Cursor` + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'] The mouse cursor used over the interval mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - fill : :class:`Color` + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str The fill color of the interval mark. **Default value:** ``"#333333"`` @@ -2434,11 +7515,11 @@ class BrushConfig(VegaLiteSchema): The fill opacity of the interval mark (a value between ``0`` and ``1`` ). **Default value:** ``0.125`` - stroke : :class:`Color` + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str The stroke color of the interval mark. **Default value:** ``"#ffffff"`` - strokeDash : List(float) + strokeDash : Sequence[float] An array of alternating stroke and space lengths, for creating dashed or dotted lines. strokeDashOffset : float @@ -2448,23 +7529,426 @@ class BrushConfig(VegaLiteSchema): strokeWidth : float The stroke width of the interval mark. """ - _schema = {'$ref': '#/definitions/BrushConfig'} - def __init__(self, cursor=Undefined, fill=Undefined, fillOpacity=Undefined, stroke=Undefined, - strokeDash=Undefined, strokeDashOffset=Undefined, strokeOpacity=Undefined, - strokeWidth=Undefined, **kwds): - super(BrushConfig, self).__init__(cursor=cursor, fill=fill, fillOpacity=fillOpacity, - stroke=stroke, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, **kwds) + _schema = {"$ref": "#/definitions/BrushConfig"} + + def __init__( + self, + cursor: Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + UndefinedType, + ] = Undefined, + fill: Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[float, UndefinedType] = Undefined, + stroke: Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[Sequence[float], UndefinedType] = Undefined, + strokeDashOffset: Union[float, UndefinedType] = Undefined, + strokeOpacity: Union[float, UndefinedType] = Undefined, + strokeWidth: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(BrushConfig, self).__init__( + cursor=cursor, + fill=fill, + fillOpacity=fillOpacity, + stroke=stroke, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + **kwds, + ) class Color(VegaLiteSchema): """Color schema wrapper - anyOf(:class:`ColorName`, :class:`HexColor`, string) + :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', + 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', + 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', + 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', + 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', + 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', + 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', + 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', + 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', + 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', + 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', + 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', + 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', + 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', + 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', + 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', + 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', + 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', + 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', + 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', + 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', + 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', + 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str """ - _schema = {'$ref': '#/definitions/Color'} + + _schema = {"$ref": "#/definitions/Color"} def __init__(self, *args, **kwds): super(Color, self).__init__(*args, **kwds) @@ -2473,11 +7957,13 @@ def __init__(self, *args, **kwds): class ColorDef(VegaLiteSchema): """ColorDef schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, - :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`) + :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + Dict[required=[shorthand]], + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict """ - _schema = {'$ref': '#/definitions/ColorDef'} + + _schema = {"$ref": "#/definitions/ColorDef"} def __init__(self, *args, **kwds): super(ColorDef, self).__init__(*args, **kwds) @@ -2486,15 +7972,15 @@ def __init__(self, *args, **kwds): class ColorName(Color): """ColorName schema wrapper - enum('black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', - 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', - 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', - 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', - 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', - 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', - 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', - 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', - 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', + :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', + 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', + 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', + 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', + 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', + 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', + 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', + 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', + 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', @@ -2508,9 +7994,10 @@ class ColorName(Color): 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', - 'whitesmoke', 'yellowgreen', 'rebeccapurple') + 'whitesmoke', 'yellowgreen', 'rebeccapurple'] """ - _schema = {'$ref': '#/definitions/ColorName'} + + _schema = {"$ref": "#/definitions/ColorName"} def __init__(self, *args): super(ColorName, self).__init__(*args) @@ -2519,10 +8006,74 @@ def __init__(self, *args): class ColorScheme(VegaLiteSchema): """ColorScheme schema wrapper - anyOf(:class:`Categorical`, :class:`SequentialSingleHue`, :class:`SequentialMultiHue`, - :class:`Diverging`, :class:`Cyclical`) + :class:`Categorical`, Literal['accent', 'category10', 'category20', 'category20b', + 'category20c', 'dark2', 'paired', 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', + 'tableau20'], :class:`ColorScheme`, :class:`Cyclical`, Literal['rainbow', 'sinebow'], + :class:`Diverging`, Literal['blueorange', 'blueorange-3', 'blueorange-4', 'blueorange-5', + 'blueorange-6', 'blueorange-7', 'blueorange-8', 'blueorange-9', 'blueorange-10', + 'blueorange-11', 'brownbluegreen', 'brownbluegreen-3', 'brownbluegreen-4', + 'brownbluegreen-5', 'brownbluegreen-6', 'brownbluegreen-7', 'brownbluegreen-8', + 'brownbluegreen-9', 'brownbluegreen-10', 'brownbluegreen-11', 'purplegreen', + 'purplegreen-3', 'purplegreen-4', 'purplegreen-5', 'purplegreen-6', 'purplegreen-7', + 'purplegreen-8', 'purplegreen-9', 'purplegreen-10', 'purplegreen-11', 'pinkyellowgreen', + 'pinkyellowgreen-3', 'pinkyellowgreen-4', 'pinkyellowgreen-5', 'pinkyellowgreen-6', + 'pinkyellowgreen-7', 'pinkyellowgreen-8', 'pinkyellowgreen-9', 'pinkyellowgreen-10', + 'pinkyellowgreen-11', 'purpleorange', 'purpleorange-3', 'purpleorange-4', 'purpleorange-5', + 'purpleorange-6', 'purpleorange-7', 'purpleorange-8', 'purpleorange-9', 'purpleorange-10', + 'purpleorange-11', 'redblue', 'redblue-3', 'redblue-4', 'redblue-5', 'redblue-6', + 'redblue-7', 'redblue-8', 'redblue-9', 'redblue-10', 'redblue-11', 'redgrey', 'redgrey-3', + 'redgrey-4', 'redgrey-5', 'redgrey-6', 'redgrey-7', 'redgrey-8', 'redgrey-9', 'redgrey-10', + 'redgrey-11', 'redyellowblue', 'redyellowblue-3', 'redyellowblue-4', 'redyellowblue-5', + 'redyellowblue-6', 'redyellowblue-7', 'redyellowblue-8', 'redyellowblue-9', + 'redyellowblue-10', 'redyellowblue-11', 'redyellowgreen', 'redyellowgreen-3', + 'redyellowgreen-4', 'redyellowgreen-5', 'redyellowgreen-6', 'redyellowgreen-7', + 'redyellowgreen-8', 'redyellowgreen-9', 'redyellowgreen-10', 'redyellowgreen-11', + 'spectral', 'spectral-3', 'spectral-4', 'spectral-5', 'spectral-6', 'spectral-7', + 'spectral-8', 'spectral-9', 'spectral-10', 'spectral-11'], :class:`SequentialMultiHue`, + Literal['turbo', 'viridis', 'inferno', 'magma', 'plasma', 'cividis', 'bluegreen', + 'bluegreen-3', 'bluegreen-4', 'bluegreen-5', 'bluegreen-6', 'bluegreen-7', 'bluegreen-8', + 'bluegreen-9', 'bluepurple', 'bluepurple-3', 'bluepurple-4', 'bluepurple-5', 'bluepurple-6', + 'bluepurple-7', 'bluepurple-8', 'bluepurple-9', 'goldgreen', 'goldgreen-3', 'goldgreen-4', + 'goldgreen-5', 'goldgreen-6', 'goldgreen-7', 'goldgreen-8', 'goldgreen-9', 'goldorange', + 'goldorange-3', 'goldorange-4', 'goldorange-5', 'goldorange-6', 'goldorange-7', + 'goldorange-8', 'goldorange-9', 'goldred', 'goldred-3', 'goldred-4', 'goldred-5', + 'goldred-6', 'goldred-7', 'goldred-8', 'goldred-9', 'greenblue', 'greenblue-3', + 'greenblue-4', 'greenblue-5', 'greenblue-6', 'greenblue-7', 'greenblue-8', 'greenblue-9', + 'orangered', 'orangered-3', 'orangered-4', 'orangered-5', 'orangered-6', 'orangered-7', + 'orangered-8', 'orangered-9', 'purplebluegreen', 'purplebluegreen-3', 'purplebluegreen-4', + 'purplebluegreen-5', 'purplebluegreen-6', 'purplebluegreen-7', 'purplebluegreen-8', + 'purplebluegreen-9', 'purpleblue', 'purpleblue-3', 'purpleblue-4', 'purpleblue-5', + 'purpleblue-6', 'purpleblue-7', 'purpleblue-8', 'purpleblue-9', 'purplered', 'purplered-3', + 'purplered-4', 'purplered-5', 'purplered-6', 'purplered-7', 'purplered-8', 'purplered-9', + 'redpurple', 'redpurple-3', 'redpurple-4', 'redpurple-5', 'redpurple-6', 'redpurple-7', + 'redpurple-8', 'redpurple-9', 'yellowgreenblue', 'yellowgreenblue-3', 'yellowgreenblue-4', + 'yellowgreenblue-5', 'yellowgreenblue-6', 'yellowgreenblue-7', 'yellowgreenblue-8', + 'yellowgreenblue-9', 'yellowgreen', 'yellowgreen-3', 'yellowgreen-4', 'yellowgreen-5', + 'yellowgreen-6', 'yellowgreen-7', 'yellowgreen-8', 'yellowgreen-9', 'yelloworangebrown', + 'yelloworangebrown-3', 'yelloworangebrown-4', 'yelloworangebrown-5', 'yelloworangebrown-6', + 'yelloworangebrown-7', 'yelloworangebrown-8', 'yelloworangebrown-9', 'yelloworangered', + 'yelloworangered-3', 'yelloworangered-4', 'yelloworangered-5', 'yelloworangered-6', + 'yelloworangered-7', 'yelloworangered-8', 'yelloworangered-9', 'darkblue', 'darkblue-3', + 'darkblue-4', 'darkblue-5', 'darkblue-6', 'darkblue-7', 'darkblue-8', 'darkblue-9', + 'darkgold', 'darkgold-3', 'darkgold-4', 'darkgold-5', 'darkgold-6', 'darkgold-7', + 'darkgold-8', 'darkgold-9', 'darkgreen', 'darkgreen-3', 'darkgreen-4', 'darkgreen-5', + 'darkgreen-6', 'darkgreen-7', 'darkgreen-8', 'darkgreen-9', 'darkmulti', 'darkmulti-3', + 'darkmulti-4', 'darkmulti-5', 'darkmulti-6', 'darkmulti-7', 'darkmulti-8', 'darkmulti-9', + 'darkred', 'darkred-3', 'darkred-4', 'darkred-5', 'darkred-6', 'darkred-7', 'darkred-8', + 'darkred-9', 'lightgreyred', 'lightgreyred-3', 'lightgreyred-4', 'lightgreyred-5', + 'lightgreyred-6', 'lightgreyred-7', 'lightgreyred-8', 'lightgreyred-9', 'lightgreyteal', + 'lightgreyteal-3', 'lightgreyteal-4', 'lightgreyteal-5', 'lightgreyteal-6', + 'lightgreyteal-7', 'lightgreyteal-8', 'lightgreyteal-9', 'lightmulti', 'lightmulti-3', + 'lightmulti-4', 'lightmulti-5', 'lightmulti-6', 'lightmulti-7', 'lightmulti-8', + 'lightmulti-9', 'lightorange', 'lightorange-3', 'lightorange-4', 'lightorange-5', + 'lightorange-6', 'lightorange-7', 'lightorange-8', 'lightorange-9', 'lighttealblue', + 'lighttealblue-3', 'lighttealblue-4', 'lighttealblue-5', 'lighttealblue-6', + 'lighttealblue-7', 'lighttealblue-8', 'lighttealblue-9'], :class:`SequentialSingleHue`, + Literal['blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', + 'reds', 'oranges'] """ - _schema = {'$ref': '#/definitions/ColorScheme'} + + _schema = {"$ref": "#/definitions/ColorScheme"} def __init__(self, *args, **kwds): super(ColorScheme, self).__init__(*args, **kwds) @@ -2531,10 +8082,12 @@ def __init__(self, *args, **kwds): class Categorical(ColorScheme): """Categorical schema wrapper - enum('accent', 'category10', 'category20', 'category20b', 'category20c', 'dark2', 'paired', - 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', 'tableau20') + :class:`Categorical`, Literal['accent', 'category10', 'category20', 'category20b', + 'category20c', 'dark2', 'paired', 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', + 'tableau20'] """ - _schema = {'$ref': '#/definitions/Categorical'} + + _schema = {"$ref": "#/definitions/Categorical"} def __init__(self, *args): super(Categorical, self).__init__(*args) @@ -2543,9 +8096,11 @@ def __init__(self, *args): class CompositeMark(AnyMark): """CompositeMark schema wrapper - anyOf(:class:`BoxPlot`, :class:`ErrorBar`, :class:`ErrorBand`) + :class:`BoxPlot`, str, :class:`CompositeMark`, :class:`ErrorBand`, str, :class:`ErrorBar`, + str """ - _schema = {'$ref': '#/definitions/CompositeMark'} + + _schema = {"$ref": "#/definitions/CompositeMark"} def __init__(self, *args, **kwds): super(CompositeMark, self).__init__(*args, **kwds) @@ -2554,9 +8109,10 @@ def __init__(self, *args, **kwds): class BoxPlot(CompositeMark): """BoxPlot schema wrapper - string + :class:`BoxPlot`, str """ - _schema = {'$ref': '#/definitions/BoxPlot'} + + _schema = {"$ref": "#/definitions/BoxPlot"} def __init__(self, *args): super(BoxPlot, self).__init__(*args) @@ -2565,9 +8121,11 @@ def __init__(self, *args): class CompositeMarkDef(AnyMark): """CompositeMarkDef schema wrapper - anyOf(:class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`) + :class:`BoxPlotDef`, Dict[required=[type]], :class:`CompositeMarkDef`, + :class:`ErrorBandDef`, Dict[required=[type]], :class:`ErrorBarDef`, Dict[required=[type]] """ - _schema = {'$ref': '#/definitions/CompositeMarkDef'} + + _schema = {"$ref": "#/definitions/CompositeMarkDef"} def __init__(self, *args, **kwds): super(CompositeMarkDef, self).__init__(*args, **kwds) @@ -2576,21 +8134,21 @@ def __init__(self, *args, **kwds): class BoxPlotDef(CompositeMarkDef): """BoxPlotDef schema wrapper - Mapping(required=[type]) + :class:`BoxPlotDef`, Dict[required=[type]] Parameters ---------- - type : :class:`BoxPlot` + type : :class:`BoxPlot`, str The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, ``"errorband"``, ``"errorbar"`` ). - box : anyOf(boolean, :class:`AnyMarkConfig`) + box : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - clip : boolean + clip : bool Whether a composite mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -2603,7 +8161,7 @@ class BoxPlotDef(CompositeMarkDef): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - extent : anyOf(string, float) + extent : float, str The extent of the whiskers. Available options include: @@ -2615,7 +8173,7 @@ class BoxPlotDef(CompositeMarkDef): range ( *Q3-Q1* ). **Default value:** ``1.5``. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -2624,39 +8182,307 @@ class BoxPlotDef(CompositeMarkDef): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - median : anyOf(boolean, :class:`AnyMarkConfig`) + median : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool opacity : float The opacity (value between [0,1]) of the mark. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] Orientation of the box plot. This is normally automatically determined based on types of fields on x and y channels. However, an explicit ``orient`` be specified when the orientation is ambiguous. **Default value:** ``"vertical"``. - outliers : anyOf(boolean, :class:`AnyMarkConfig`) + outliers : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - rule : anyOf(boolean, :class:`AnyMarkConfig`) + rule : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool size : float Size of the box and median tick of a box plot - ticks : anyOf(boolean, :class:`AnyMarkConfig`) - - """ - _schema = {'$ref': '#/definitions/BoxPlotDef'} - - def __init__(self, type=Undefined, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, - invalid=Undefined, median=Undefined, opacity=Undefined, orient=Undefined, - outliers=Undefined, rule=Undefined, size=Undefined, ticks=Undefined, **kwds): - super(BoxPlotDef, self).__init__(type=type, box=box, clip=clip, color=color, extent=extent, - invalid=invalid, median=median, opacity=opacity, orient=orient, - outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) + ticks : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool + + """ + + _schema = {"$ref": "#/definitions/BoxPlotDef"} + + def __init__( + self, + type: Union[Union["BoxPlot", str], UndefinedType] = Undefined, + box: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + extent: Union[Union[float, str], UndefinedType] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + median: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + opacity: Union[float, UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outliers: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + rule: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + size: Union[float, UndefinedType] = Undefined, + ticks: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(BoxPlotDef, self).__init__( + type=type, + box=box, + clip=clip, + color=color, + extent=extent, + invalid=invalid, + median=median, + opacity=opacity, + orient=orient, + outliers=outliers, + rule=rule, + size=size, + ticks=ticks, + **kwds, + ) class CompositionConfig(VegaLiteSchema): """CompositionConfig schema wrapper - Mapping(required=[]) + :class:`CompositionConfig`, Dict Parameters ---------- @@ -2684,18 +8510,28 @@ class CompositionConfig(VegaLiteSchema): **Default value** : ``20`` """ - _schema = {'$ref': '#/definitions/CompositionConfig'} - def __init__(self, columns=Undefined, spacing=Undefined, **kwds): - super(CompositionConfig, self).__init__(columns=columns, spacing=spacing, **kwds) + _schema = {"$ref": "#/definitions/CompositionConfig"} + + def __init__( + self, + columns: Union[float, UndefinedType] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(CompositionConfig, self).__init__( + columns=columns, spacing=spacing, **kwds + ) class ConditionalAxisColor(VegaLiteSchema): """ConditionalAxisColor schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisColor`, Dict[required=[condition, expr]], Dict[required=[condition, + value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisColor'} + + _schema = {"$ref": "#/definitions/ConditionalAxisColor"} def __init__(self, *args, **kwds): super(ConditionalAxisColor, self).__init__(*args, **kwds) @@ -2704,9 +8540,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelAlign(VegaLiteSchema): """ConditionalAxisLabelAlign schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisLabelAlign`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisLabelAlign'} + + _schema = {"$ref": "#/definitions/ConditionalAxisLabelAlign"} def __init__(self, *args, **kwds): super(ConditionalAxisLabelAlign, self).__init__(*args, **kwds) @@ -2715,9 +8553,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelBaseline(VegaLiteSchema): """ConditionalAxisLabelBaseline schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisLabelBaseline`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisLabelBaseline'} + + _schema = {"$ref": "#/definitions/ConditionalAxisLabelBaseline"} def __init__(self, *args, **kwds): super(ConditionalAxisLabelBaseline, self).__init__(*args, **kwds) @@ -2726,9 +8566,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelFontStyle(VegaLiteSchema): """ConditionalAxisLabelFontStyle schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisLabelFontStyle`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontStyle'} + + _schema = {"$ref": "#/definitions/ConditionalAxisLabelFontStyle"} def __init__(self, *args, **kwds): super(ConditionalAxisLabelFontStyle, self).__init__(*args, **kwds) @@ -2737,9 +8579,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisLabelFontWeight(VegaLiteSchema): """ConditionalAxisLabelFontWeight schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisLabelFontWeight`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontWeight'} + + _schema = {"$ref": "#/definitions/ConditionalAxisLabelFontWeight"} def __init__(self, *args, **kwds): super(ConditionalAxisLabelFontWeight, self).__init__(*args, **kwds) @@ -2748,9 +8592,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisNumber(VegaLiteSchema): """ConditionalAxisNumber schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisNumber`, Dict[required=[condition, expr]], Dict[required=[condition, + value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisNumber'} + + _schema = {"$ref": "#/definitions/ConditionalAxisNumber"} def __init__(self, *args, **kwds): super(ConditionalAxisNumber, self).__init__(*args, **kwds) @@ -2759,9 +8605,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisNumberArray(VegaLiteSchema): """ConditionalAxisNumberArray schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisNumberArray`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisNumberArray'} + + _schema = {"$ref": "#/definitions/ConditionalAxisNumberArray"} def __init__(self, *args, **kwds): super(ConditionalAxisNumberArray, self).__init__(*args, **kwds) @@ -2770,9 +8618,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyAlignnull(VegaLiteSchema): """ConditionalAxisPropertyAlignnull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertyAlignnull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Align|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(Align|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertyAlignnull, self).__init__(*args, **kwds) @@ -2781,9 +8631,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyColornull(VegaLiteSchema): """ConditionalAxisPropertyColornull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertyColornull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Color|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(Color|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertyColornull, self).__init__(*args, **kwds) @@ -2792,9 +8644,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyFontStylenull(VegaLiteSchema): """ConditionalAxisPropertyFontStylenull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertyFontStylenull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontStyle|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(FontStyle|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertyFontStylenull, self).__init__(*args, **kwds) @@ -2803,9 +8657,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyFontWeightnull(VegaLiteSchema): """ConditionalAxisPropertyFontWeightnull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertyFontWeightnull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontWeight|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(FontWeight|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertyFontWeightnull, self).__init__(*args, **kwds) @@ -2814,9 +8670,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertyTextBaselinenull(VegaLiteSchema): """ConditionalAxisPropertyTextBaselinenull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertyTextBaselinenull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(TextBaseline|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(TextBaseline|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertyTextBaselinenull, self).__init__(*args, **kwds) @@ -2825,9 +8683,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertynumberArraynull(VegaLiteSchema): """ConditionalAxisPropertynumberArraynull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertynumberArraynull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(number[]|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(number[]|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertynumberArraynull, self).__init__(*args, **kwds) @@ -2836,9 +8696,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertynumbernull(VegaLiteSchema): """ConditionalAxisPropertynumbernull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertynumbernull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(number|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(number|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertynumbernull, self).__init__(*args, **kwds) @@ -2847,9 +8709,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisPropertystringnull(VegaLiteSchema): """ConditionalAxisPropertystringnull schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisPropertystringnull`, Dict[required=[condition, expr]], + Dict[required=[condition, value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(string|null)>'} + + _schema = {"$ref": "#/definitions/ConditionalAxisProperty<(string|null)>"} def __init__(self, *args, **kwds): super(ConditionalAxisPropertystringnull, self).__init__(*args, **kwds) @@ -2858,9 +8722,11 @@ def __init__(self, *args, **kwds): class ConditionalAxisString(VegaLiteSchema): """ConditionalAxisString schema wrapper - anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + :class:`ConditionalAxisString`, Dict[required=[condition, expr]], Dict[required=[condition, + value]] """ - _schema = {'$ref': '#/definitions/ConditionalAxisString'} + + _schema = {"$ref": "#/definitions/ConditionalAxisString"} def __init__(self, *args, **kwds): super(ConditionalAxisString, self).__init__(*args, **kwds) @@ -2869,10 +8735,12 @@ def __init__(self, *args, **kwds): class ConditionalMarkPropFieldOrDatumDef(VegaLiteSchema): """ConditionalMarkPropFieldOrDatumDef schema wrapper - anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDef`, - :class:`ConditionalParameterMarkPropFieldOrDatumDef`) + :class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], + :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]] """ - _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef'} + + _schema = {"$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef"} def __init__(self, *args, **kwds): super(ConditionalMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) @@ -2881,143 +8749,207 @@ def __init__(self, *args, **kwds): class ConditionalMarkPropFieldOrDatumDefTypeForShape(VegaLiteSchema): """ConditionalMarkPropFieldOrDatumDefTypeForShape schema wrapper - anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, - :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`) + :class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[param]], + :class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[test]] """ - _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef<TypeForShape>'} + + _schema = {"$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef<TypeForShape>"} def __init__(self, *args, **kwds): - super(ConditionalMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + super(ConditionalMarkPropFieldOrDatumDefTypeForShape, self).__init__( + *args, **kwds + ) class ConditionalParameterMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): """ConditionalParameterMarkPropFieldOrDatumDef schema wrapper - anyOf(Mapping(required=[param]), Mapping(required=[param])) + :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]] """ - _schema = {'$ref': '#/definitions/ConditionalParameter<MarkPropFieldOrDatumDef>'} + + _schema = {"$ref": "#/definitions/ConditionalParameter<MarkPropFieldOrDatumDef>"} def __init__(self, *args, **kwds): super(ConditionalParameterMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) -class ConditionalParameterMarkPropFieldOrDatumDefTypeForShape(ConditionalMarkPropFieldOrDatumDefTypeForShape): +class ConditionalParameterMarkPropFieldOrDatumDefTypeForShape( + ConditionalMarkPropFieldOrDatumDefTypeForShape +): """ConditionalParameterMarkPropFieldOrDatumDefTypeForShape schema wrapper - anyOf(Mapping(required=[param]), Mapping(required=[param])) + :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[param]] """ - _schema = {'$ref': '#/definitions/ConditionalParameter<MarkPropFieldOrDatumDef<TypeForShape>>'} + + _schema = { + "$ref": "#/definitions/ConditionalParameter<MarkPropFieldOrDatumDef<TypeForShape>>" + } def __init__(self, *args, **kwds): - super(ConditionalParameterMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + super(ConditionalParameterMarkPropFieldOrDatumDefTypeForShape, self).__init__( + *args, **kwds + ) class ConditionalPredicateMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): """ConditionalPredicateMarkPropFieldOrDatumDef schema wrapper - anyOf(Mapping(required=[test]), Mapping(required=[test])) + :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<MarkPropFieldOrDatumDef>'} + + _schema = {"$ref": "#/definitions/ConditionalPredicate<MarkPropFieldOrDatumDef>"} def __init__(self, *args, **kwds): super(ConditionalPredicateMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) -class ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape(ConditionalMarkPropFieldOrDatumDefTypeForShape): +class ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape( + ConditionalMarkPropFieldOrDatumDefTypeForShape +): """ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape schema wrapper - anyOf(Mapping(required=[test]), Mapping(required=[test])) + :class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[test]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<MarkPropFieldOrDatumDef<TypeForShape>>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<MarkPropFieldOrDatumDef<TypeForShape>>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + super(ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape, self).__init__( + *args, **kwds + ) class ConditionalPredicateValueDefAlignnullExprRef(VegaLiteSchema): """ConditionalPredicateValueDefAlignnullExprRef schema wrapper - anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + :class:`ConditionalPredicateValueDefAlignnullExprRef`, Dict[required=[expr, test]], + Dict[required=[test, value]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateValueDefAlignnullExprRef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefAlignnullExprRef, self).__init__( + *args, **kwds + ) class ConditionalPredicateValueDefColornullExprRef(VegaLiteSchema): """ConditionalPredicateValueDefColornullExprRef schema wrapper - anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + :class:`ConditionalPredicateValueDefColornullExprRef`, Dict[required=[expr, test]], + Dict[required=[test, value]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateValueDefColornullExprRef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefColornullExprRef, self).__init__( + *args, **kwds + ) class ConditionalPredicateValueDefFontStylenullExprRef(VegaLiteSchema): """ConditionalPredicateValueDefFontStylenullExprRef schema wrapper - anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + :class:`ConditionalPredicateValueDefFontStylenullExprRef`, Dict[required=[expr, test]], + Dict[required=[test, value]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateValueDefFontStylenullExprRef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefFontStylenullExprRef, self).__init__( + *args, **kwds + ) class ConditionalPredicateValueDefFontWeightnullExprRef(VegaLiteSchema): """ConditionalPredicateValueDefFontWeightnullExprRef schema wrapper - anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + :class:`ConditionalPredicateValueDefFontWeightnullExprRef`, Dict[required=[expr, test]], + Dict[required=[test, value]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateValueDefFontWeightnullExprRef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefFontWeightnullExprRef, self).__init__( + *args, **kwds + ) class ConditionalPredicateValueDefTextBaselinenullExprRef(VegaLiteSchema): """ConditionalPredicateValueDefTextBaselinenullExprRef schema wrapper - anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + :class:`ConditionalPredicateValueDefTextBaselinenullExprRef`, Dict[required=[expr, test]], + Dict[required=[test, value]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateValueDefTextBaselinenullExprRef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefTextBaselinenullExprRef, self).__init__( + *args, **kwds + ) class ConditionalPredicateValueDefnumberArraynullExprRef(VegaLiteSchema): """ConditionalPredicateValueDefnumberArraynullExprRef schema wrapper - anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + :class:`ConditionalPredicateValueDefnumberArraynullExprRef`, Dict[required=[expr, test]], + Dict[required=[test, value]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateValueDefnumberArraynullExprRef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefnumberArraynullExprRef, self).__init__( + *args, **kwds + ) class ConditionalPredicateValueDefnumbernullExprRef(VegaLiteSchema): """ConditionalPredicateValueDefnumbernullExprRef schema wrapper - anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + :class:`ConditionalPredicateValueDefnumbernullExprRef`, Dict[required=[expr, test]], + Dict[required=[test, value]] """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalPredicateValueDefnumbernullExprRef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefnumbernullExprRef, self).__init__( + *args, **kwds + ) class ConditionalStringFieldDef(VegaLiteSchema): """ConditionalStringFieldDef schema wrapper - anyOf(:class:`ConditionalPredicateStringFieldDef`, - :class:`ConditionalParameterStringFieldDef`) + :class:`ConditionalParameterStringFieldDef`, Dict[required=[param]], + :class:`ConditionalPredicateStringFieldDef`, Dict[required=[test]], + :class:`ConditionalStringFieldDef` """ - _schema = {'$ref': '#/definitions/ConditionalStringFieldDef'} + + _schema = {"$ref": "#/definitions/ConditionalStringFieldDef"} def __init__(self, *args, **kwds): super(ConditionalStringFieldDef, self).__init__(*args, **kwds) @@ -3026,14 +8958,14 @@ def __init__(self, *args, **kwds): class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): """ConditionalParameterStringFieldDef schema wrapper - Mapping(required=[param]) + :class:`ConditionalParameterStringFieldDef`, Dict[required=[param]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -3045,7 +8977,7 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -3066,10 +8998,10 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -3084,7 +9016,7 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -3107,7 +9039,7 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -3118,7 +9050,7 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -3127,7 +9059,7 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -3147,7 +9079,7 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -3217,30 +9149,246 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<StringFieldDef>'} - def __init__(self, param=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - empty=Undefined, field=Undefined, format=Undefined, formatType=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(ConditionalParameterStringFieldDef, self).__init__(param=param, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, - empty=empty, field=field, - format=format, formatType=formatType, - timeUnit=timeUnit, title=title, - type=type, **kwds) + _schema = {"$ref": "#/definitions/ConditionalParameter<StringFieldDef>"} + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ConditionalParameterStringFieldDef, self).__init__( + param=param, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + empty=empty, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): """ConditionalPredicateStringFieldDef schema wrapper - Mapping(required=[test]) + :class:`ConditionalPredicateStringFieldDef`, Dict[required=[test]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -3252,7 +9400,7 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -3273,7 +9421,7 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -3288,7 +9436,7 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -3311,7 +9459,7 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -3322,7 +9470,7 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -3331,7 +9479,7 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -3351,7 +9499,7 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -3421,86 +9569,397 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<StringFieldDef>'} - def __init__(self, test=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(ConditionalPredicateStringFieldDef, self).__init__(test=test, aggregate=aggregate, - bandPosition=bandPosition, bin=bin, - field=field, format=format, - formatType=formatType, - timeUnit=timeUnit, title=title, - type=type, **kwds) + _schema = {"$ref": "#/definitions/ConditionalPredicate<StringFieldDef>"} + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ConditionalPredicateStringFieldDef, self).__init__( + test=test, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class ConditionalValueDefGradientstringnullExprRef(VegaLiteSchema): """ConditionalValueDefGradientstringnullExprRef schema wrapper - anyOf(:class:`ConditionalPredicateValueDefGradientstringnullExprRef`, - :class:`ConditionalParameterValueDefGradientstringnullExprRef`) + :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, + value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, + Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>'} + + _schema = { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + } def __init__(self, *args, **kwds): - super(ConditionalValueDefGradientstringnullExprRef, self).__init__(*args, **kwds) + super(ConditionalValueDefGradientstringnullExprRef, self).__init__( + *args, **kwds + ) -class ConditionalParameterValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): +class ConditionalParameterValueDefGradientstringnullExprRef( + ConditionalValueDefGradientstringnullExprRef +): """ConditionalParameterValueDefGradientstringnullExprRef schema wrapper - Mapping(required=[param, value]) + :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, + value]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<ValueDef<(Gradient|string|null|ExprRef)>>'} - - def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): - super(ConditionalParameterValueDefGradientstringnullExprRef, self).__init__(param=param, - value=value, - empty=empty, **kwds) - -class ConditionalPredicateValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): + _schema = { + "$ref": "#/definitions/ConditionalParameter<ValueDef<(Gradient|string|null|ExprRef)>>" + } + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + value: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalParameterValueDefGradientstringnullExprRef, self).__init__( + param=param, value=value, empty=empty, **kwds + ) + + +class ConditionalPredicateValueDefGradientstringnullExprRef( + ConditionalValueDefGradientstringnullExprRef +): """ConditionalPredicateValueDefGradientstringnullExprRef schema wrapper - Mapping(required=[test, value]) + :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<ValueDef<(Gradient|string|null|ExprRef)>>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefGradientstringnullExprRef, self).__init__(test=test, - value=value, **kwds) + _schema = { + "$ref": "#/definitions/ConditionalPredicate<ValueDef<(Gradient|string|null|ExprRef)>>" + } + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ConditionalPredicateValueDefGradientstringnullExprRef, self).__init__( + test=test, value=value, **kwds + ) class ConditionalValueDefTextExprRef(VegaLiteSchema): """ConditionalValueDefTextExprRef schema wrapper - anyOf(:class:`ConditionalPredicateValueDefTextExprRef`, - :class:`ConditionalParameterValueDefTextExprRef`) + :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], + :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], + :class:`ConditionalValueDefTextExprRef` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<(Text|ExprRef)>'} + + _schema = {"$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>"} def __init__(self, *args, **kwds): super(ConditionalValueDefTextExprRef, self).__init__(*args, **kwds) @@ -3509,56 +9968,105 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefTextExprRef(ConditionalValueDefTextExprRef): """ConditionalParameterValueDefTextExprRef schema wrapper - Mapping(required=[param, value]) + :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - value : anyOf(:class:`Text`, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<ValueDef<(Text|ExprRef)>>'} - def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): - super(ConditionalParameterValueDefTextExprRef, self).__init__(param=param, value=value, - empty=empty, **kwds) + _schema = {"$ref": "#/definitions/ConditionalParameter<ValueDef<(Text|ExprRef)>>"} + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + value: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalParameterValueDefTextExprRef, self).__init__( + param=param, value=value, empty=empty, **kwds + ) class ConditionalPredicateValueDefTextExprRef(ConditionalValueDefTextExprRef): """ConditionalPredicateValueDefTextExprRef schema wrapper - Mapping(required=[test, value]) + :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(:class:`Text`, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<ValueDef<(Text|ExprRef)>>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefTextExprRef, self).__init__(test=test, value=value, **kwds) + _schema = {"$ref": "#/definitions/ConditionalPredicate<ValueDef<(Text|ExprRef)>>"} + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ConditionalPredicateValueDefTextExprRef, self).__init__( + test=test, value=value, **kwds + ) class ConditionalValueDefnumber(VegaLiteSchema): """ConditionalValueDefnumber schema wrapper - anyOf(:class:`ConditionalPredicateValueDefnumber`, - :class:`ConditionalParameterValueDefnumber`) + :class:`ConditionalParameterValueDefnumber`, Dict[required=[param, value]], + :class:`ConditionalPredicateValueDefnumber`, Dict[required=[test, value]], + :class:`ConditionalValueDefnumber` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<number>'} + + _schema = {"$ref": "#/definitions/ConditionalValueDef<number>"} def __init__(self, *args, **kwds): super(ConditionalValueDefnumber, self).__init__(*args, **kwds) @@ -3567,115 +10075,204 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefnumber(ConditionalValueDefnumber): """ConditionalParameterValueDefnumber schema wrapper - Mapping(required=[param, value]) + :class:`ConditionalParameterValueDefnumber`, Dict[required=[param, value]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<ValueDef<number>>'} - def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): - super(ConditionalParameterValueDefnumber, self).__init__(param=param, value=value, empty=empty, - **kwds) + _schema = {"$ref": "#/definitions/ConditionalParameter<ValueDef<number>>"} + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + value: Union[float, UndefinedType] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalParameterValueDefnumber, self).__init__( + param=param, value=value, empty=empty, **kwds + ) class ConditionalPredicateValueDefnumber(ConditionalValueDefnumber): """ConditionalPredicateValueDefnumber schema wrapper - Mapping(required=[test, value]) + :class:`ConditionalPredicateValueDefnumber`, Dict[required=[test, value]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition value : float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<ValueDef<number>>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefnumber, self).__init__(test=test, value=value, **kwds) + _schema = {"$ref": "#/definitions/ConditionalPredicate<ValueDef<number>>"} + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + value: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalPredicateValueDefnumber, self).__init__( + test=test, value=value, **kwds + ) class ConditionalValueDefnumberArrayExprRef(VegaLiteSchema): """ConditionalValueDefnumberArrayExprRef schema wrapper - anyOf(:class:`ConditionalPredicateValueDefnumberArrayExprRef`, - :class:`ConditionalParameterValueDefnumberArrayExprRef`) + :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], + :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], + :class:`ConditionalValueDefnumberArrayExprRef` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<(number[]|ExprRef)>'} + + _schema = {"$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>"} def __init__(self, *args, **kwds): super(ConditionalValueDefnumberArrayExprRef, self).__init__(*args, **kwds) -class ConditionalParameterValueDefnumberArrayExprRef(ConditionalValueDefnumberArrayExprRef): +class ConditionalParameterValueDefnumberArrayExprRef( + ConditionalValueDefnumberArrayExprRef +): """ConditionalParameterValueDefnumberArrayExprRef schema wrapper - Mapping(required=[param, value]) + :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - value : anyOf(List(float), :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<ValueDef<(number[]|ExprRef)>>'} - def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): - super(ConditionalParameterValueDefnumberArrayExprRef, self).__init__(param=param, value=value, - empty=empty, **kwds) + _schema = { + "$ref": "#/definitions/ConditionalParameter<ValueDef<(number[]|ExprRef)>>" + } + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + value: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalParameterValueDefnumberArrayExprRef, self).__init__( + param=param, value=value, empty=empty, **kwds + ) -class ConditionalPredicateValueDefnumberArrayExprRef(ConditionalValueDefnumberArrayExprRef): +class ConditionalPredicateValueDefnumberArrayExprRef( + ConditionalValueDefnumberArrayExprRef +): """ConditionalPredicateValueDefnumberArrayExprRef schema wrapper - Mapping(required=[test, value]) + :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(List(float), :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<ValueDef<(number[]|ExprRef)>>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefnumberArrayExprRef, self).__init__(test=test, value=value, - **kwds) + _schema = { + "$ref": "#/definitions/ConditionalPredicate<ValueDef<(number[]|ExprRef)>>" + } + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + **kwds, + ): + super(ConditionalPredicateValueDefnumberArrayExprRef, self).__init__( + test=test, value=value, **kwds + ) class ConditionalValueDefnumberExprRef(VegaLiteSchema): """ConditionalValueDefnumberExprRef schema wrapper - anyOf(:class:`ConditionalPredicateValueDefnumberExprRef`, - :class:`ConditionalParameterValueDefnumberExprRef`) + :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], + :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], + :class:`ConditionalValueDefnumberExprRef` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<(number|ExprRef)>'} + + _schema = {"$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>"} def __init__(self, *args, **kwds): super(ConditionalValueDefnumberExprRef, self).__init__(*args, **kwds) @@ -3684,56 +10281,99 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefnumberExprRef(ConditionalValueDefnumberExprRef): """ConditionalParameterValueDefnumberExprRef schema wrapper - Mapping(required=[param, value]) + :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<ValueDef<(number|ExprRef)>>'} - def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): - super(ConditionalParameterValueDefnumberExprRef, self).__init__(param=param, value=value, - empty=empty, **kwds) + _schema = {"$ref": "#/definitions/ConditionalParameter<ValueDef<(number|ExprRef)>>"} + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalParameterValueDefnumberExprRef, self).__init__( + param=param, value=value, empty=empty, **kwds + ) class ConditionalPredicateValueDefnumberExprRef(ConditionalValueDefnumberExprRef): """ConditionalPredicateValueDefnumberExprRef schema wrapper - Mapping(required=[test, value]) + :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<ValueDef<(number|ExprRef)>>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefnumberExprRef, self).__init__(test=test, value=value, **kwds) + _schema = {"$ref": "#/definitions/ConditionalPredicate<ValueDef<(number|ExprRef)>>"} + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(ConditionalPredicateValueDefnumberExprRef, self).__init__( + test=test, value=value, **kwds + ) class ConditionalValueDefstringExprRef(VegaLiteSchema): """ConditionalValueDefstringExprRef schema wrapper - anyOf(:class:`ConditionalPredicateValueDefstringExprRef`, - :class:`ConditionalParameterValueDefstringExprRef`) + :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], + :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], + :class:`ConditionalValueDefstringExprRef` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|ExprRef)>'} + + _schema = {"$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>"} def __init__(self, *args, **kwds): super(ConditionalValueDefstringExprRef, self).__init__(*args, **kwds) @@ -3742,208 +10382,299 @@ def __init__(self, *args, **kwds): class ConditionalParameterValueDefstringExprRef(ConditionalValueDefstringExprRef): """ConditionalParameterValueDefstringExprRef schema wrapper - Mapping(required=[param, value]) + :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - value : anyOf(string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<ValueDef<(string|ExprRef)>>'} - def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): - super(ConditionalParameterValueDefstringExprRef, self).__init__(param=param, value=value, - empty=empty, **kwds) + _schema = {"$ref": "#/definitions/ConditionalParameter<ValueDef<(string|ExprRef)>>"} + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalParameterValueDefstringExprRef, self).__init__( + param=param, value=value, empty=empty, **kwds + ) class ConditionalPredicateValueDefstringExprRef(ConditionalValueDefstringExprRef): """ConditionalPredicateValueDefstringExprRef schema wrapper - Mapping(required=[test, value]) + :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<ValueDef<(string|ExprRef)>>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefstringExprRef, self).__init__(test=test, value=value, **kwds) + _schema = {"$ref": "#/definitions/ConditionalPredicate<ValueDef<(string|ExprRef)>>"} + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + **kwds, + ): + super(ConditionalPredicateValueDefstringExprRef, self).__init__( + test=test, value=value, **kwds + ) class ConditionalValueDefstringnullExprRef(VegaLiteSchema): """ConditionalValueDefstringnullExprRef schema wrapper - anyOf(:class:`ConditionalPredicateValueDefstringnullExprRef`, - :class:`ConditionalParameterValueDefstringnullExprRef`) + :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], + :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], + :class:`ConditionalValueDefstringnullExprRef` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|null|ExprRef)>'} + + _schema = {"$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>"} def __init__(self, *args, **kwds): super(ConditionalValueDefstringnullExprRef, self).__init__(*args, **kwds) -class ConditionalParameterValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): +class ConditionalParameterValueDefstringnullExprRef( + ConditionalValueDefstringnullExprRef +): """ConditionalParameterValueDefstringnullExprRef schema wrapper - Mapping(required=[param, value]) + :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ConditionalParameter<ValueDef<(string|null|ExprRef)>>'} - def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): - super(ConditionalParameterValueDefstringnullExprRef, self).__init__(param=param, value=value, - empty=empty, **kwds) + _schema = { + "$ref": "#/definitions/ConditionalParameter<ValueDef<(string|null|ExprRef)>>" + } + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + value: Union[ + Union[None, Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ConditionalParameterValueDefstringnullExprRef, self).__init__( + param=param, value=value, empty=empty, **kwds + ) -class ConditionalPredicateValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): +class ConditionalPredicateValueDefstringnullExprRef( + ConditionalValueDefstringnullExprRef +): """ConditionalPredicateValueDefstringnullExprRef schema wrapper - Mapping(required=[test, value]) + :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]] Parameters ---------- - test : :class:`PredicateComposition` + test : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ConditionalPredicate<ValueDef<(string|null|ExprRef)>>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefstringnullExprRef, self).__init__(test=test, value=value, - **kwds) + _schema = { + "$ref": "#/definitions/ConditionalPredicate<ValueDef<(string|null|ExprRef)>>" + } + + def __init__( + self, + test: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + **kwds, + ): + super(ConditionalPredicateValueDefstringnullExprRef, self).__init__( + test=test, value=value, **kwds + ) class Config(VegaLiteSchema): """Config schema wrapper - Mapping(required=[]) + :class:`Config`, Dict Parameters ---------- - arc : :class:`RectConfig` + arc : :class:`RectConfig`, Dict Arc-specific Config - area : :class:`AreaConfig` + area : :class:`AreaConfig`, Dict Area-Specific Config - aria : boolean + aria : bool A boolean flag indicating if ARIA default attributes should be included for marks and guides (SVG output only). If false, the ``"aria-hidden"`` attribute will be set for all guides, removing them from the ARIA accessibility tree and Vega-Lite will not generate default descriptions for marks. **Default value:** ``true``. - autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + autosize : :class:`AutoSizeParams`, Dict, :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] How the visualization size should be determined. If a string, should be one of ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify parameters for content sizing and automatic resizing. **Default value** : ``pad`` - axis : :class:`AxisConfig` + axis : :class:`AxisConfig`, Dict Axis configuration, which determines default properties for all ``x`` and ``y`` `axes <https://vega.github.io/vega-lite/docs/axis.html>`__. For a full list of axis configuration options, please see the `corresponding section of the axis documentation <https://vega.github.io/vega-lite/docs/axis.html#config>`__. - axisBand : :class:`AxisConfig` + axisBand : :class:`AxisConfig`, Dict Config for axes with "band" scales. - axisBottom : :class:`AxisConfig` + axisBottom : :class:`AxisConfig`, Dict Config for x-axis along the bottom edge of the chart. - axisDiscrete : :class:`AxisConfig` + axisDiscrete : :class:`AxisConfig`, Dict Config for axes with "point" or "band" scales. - axisLeft : :class:`AxisConfig` + axisLeft : :class:`AxisConfig`, Dict Config for y-axis along the left edge of the chart. - axisPoint : :class:`AxisConfig` + axisPoint : :class:`AxisConfig`, Dict Config for axes with "point" scales. - axisQuantitative : :class:`AxisConfig` + axisQuantitative : :class:`AxisConfig`, Dict Config for quantitative axes. - axisRight : :class:`AxisConfig` + axisRight : :class:`AxisConfig`, Dict Config for y-axis along the right edge of the chart. - axisTemporal : :class:`AxisConfig` + axisTemporal : :class:`AxisConfig`, Dict Config for temporal axes. - axisTop : :class:`AxisConfig` + axisTop : :class:`AxisConfig`, Dict Config for x-axis along the top edge of the chart. - axisX : :class:`AxisConfig` + axisX : :class:`AxisConfig`, Dict X-axis specific config. - axisXBand : :class:`AxisConfig` + axisXBand : :class:`AxisConfig`, Dict Config for x-axes with "band" scales. - axisXDiscrete : :class:`AxisConfig` + axisXDiscrete : :class:`AxisConfig`, Dict Config for x-axes with "point" or "band" scales. - axisXPoint : :class:`AxisConfig` + axisXPoint : :class:`AxisConfig`, Dict Config for x-axes with "point" scales. - axisXQuantitative : :class:`AxisConfig` + axisXQuantitative : :class:`AxisConfig`, Dict Config for x-quantitative axes. - axisXTemporal : :class:`AxisConfig` + axisXTemporal : :class:`AxisConfig`, Dict Config for x-temporal axes. - axisY : :class:`AxisConfig` + axisY : :class:`AxisConfig`, Dict Y-axis specific config. - axisYBand : :class:`AxisConfig` + axisYBand : :class:`AxisConfig`, Dict Config for y-axes with "band" scales. - axisYDiscrete : :class:`AxisConfig` + axisYDiscrete : :class:`AxisConfig`, Dict Config for y-axes with "point" or "band" scales. - axisYPoint : :class:`AxisConfig` + axisYPoint : :class:`AxisConfig`, Dict Config for y-axes with "point" scales. - axisYQuantitative : :class:`AxisConfig` + axisYQuantitative : :class:`AxisConfig`, Dict Config for y-quantitative axes. - axisYTemporal : :class:`AxisConfig` + axisYTemporal : :class:`AxisConfig`, Dict Config for y-temporal axes. - background : anyOf(:class:`Color`, :class:`ExprRef`) + background : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] CSS color property to use as the background of the entire view. **Default value:** ``"white"`` - bar : :class:`BarConfig` + bar : :class:`BarConfig`, Dict Bar-Specific Config - boxplot : :class:`BoxPlotConfig` + boxplot : :class:`BoxPlotConfig`, Dict Box Config - circle : :class:`MarkConfig` + circle : :class:`MarkConfig`, Dict Circle-Specific Config - concat : :class:`CompositionConfig` + concat : :class:`CompositionConfig`, Dict Default configuration for all concatenation and repeat view composition operators ( ``concat``, ``hconcat``, ``vconcat``, and ``repeat`` ) - countTitle : string + countTitle : str Default axis and legend title for count fields. **Default value:** ``'Count of Records``. - customFormatTypes : boolean + customFormatTypes : bool Allow the ``formatType`` property for text marks and guides to accept a custom formatter function `registered as a Vega expression <https://vega.github.io/vega-lite/usage/compile.html#format-type>`__. - errorband : :class:`ErrorBandConfig` + errorband : :class:`ErrorBandConfig`, Dict ErrorBand Config - errorbar : :class:`ErrorBarConfig` + errorbar : :class:`ErrorBarConfig`, Dict ErrorBar Config - facet : :class:`CompositionConfig` + facet : :class:`CompositionConfig`, Dict Default configuration for the ``facet`` view composition operator - fieldTitle : enum('verbal', 'functional', 'plain') + fieldTitle : Literal['verbal', 'functional', 'plain'] Defines how Vega-Lite generates title for fields. There are three possible styles: @@ -3953,62 +10684,62 @@ class Config(VegaLiteSchema): "SUM(field)", "YEARMONTH(date)", "BIN(field)"). * ``"plain"`` - displays only the field name without functions (e.g., "field", "date", "field"). - font : string + font : str Default font for all text marks, titles, and labels. - geoshape : :class:`MarkConfig` + geoshape : :class:`MarkConfig`, Dict Geoshape-Specific Config - header : :class:`HeaderConfig` + header : :class:`HeaderConfig`, Dict Header configuration, which determines default properties for all `headers <https://vega.github.io/vega-lite/docs/header.html>`__. For a full list of header configuration options, please see the `corresponding section of in the header documentation <https://vega.github.io/vega-lite/docs/header.html#config>`__. - headerColumn : :class:`HeaderConfig` + headerColumn : :class:`HeaderConfig`, Dict Header configuration, which determines default properties for column `headers <https://vega.github.io/vega-lite/docs/header.html>`__. For a full list of header configuration options, please see the `corresponding section of in the header documentation <https://vega.github.io/vega-lite/docs/header.html#config>`__. - headerFacet : :class:`HeaderConfig` + headerFacet : :class:`HeaderConfig`, Dict Header configuration, which determines default properties for non-row/column facet `headers <https://vega.github.io/vega-lite/docs/header.html>`__. For a full list of header configuration options, please see the `corresponding section of in the header documentation <https://vega.github.io/vega-lite/docs/header.html#config>`__. - headerRow : :class:`HeaderConfig` + headerRow : :class:`HeaderConfig`, Dict Header configuration, which determines default properties for row `headers <https://vega.github.io/vega-lite/docs/header.html>`__. For a full list of header configuration options, please see the `corresponding section of in the header documentation <https://vega.github.io/vega-lite/docs/header.html#config>`__. - image : :class:`RectConfig` + image : :class:`RectConfig`, Dict Image-specific Config - legend : :class:`LegendConfig` + legend : :class:`LegendConfig`, Dict Legend configuration, which determines default properties for all `legends <https://vega.github.io/vega-lite/docs/legend.html>`__. For a full list of legend configuration options, please see the `corresponding section of in the legend documentation <https://vega.github.io/vega-lite/docs/legend.html#config>`__. - line : :class:`LineConfig` + line : :class:`LineConfig`, Dict Line-Specific Config - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property provides a global default for text marks, which is overridden by mark or style config settings, and by the lineBreak mark encoding channel. If signal-valued, either string or regular expression (regexp) values are valid. - locale : :class:`Locale` + locale : :class:`Locale`, Dict Locale definitions for string parsing and formatting of number and date values. The locale object should contain ``number`` and/or ``time`` properties with `locale definitions <https://vega.github.io/vega/docs/api/locale/>`__. Locale definitions provided in the config block may be overridden by the View constructor locale option. - mark : :class:`MarkConfig` + mark : :class:`MarkConfig`, Dict Mark Config - normalizedNumberFormat : string + normalizedNumberFormat : str If normalizedNumberFormatType is not specified, D3 number format for axis labels, text marks, and tooltips of normalized stacked fields (fields with ``stack: "normalize"`` ). For example ``"s"`` for SI units. Use `D3's number format pattern @@ -4018,7 +10749,7 @@ class Config(VegaLiteSchema): ``config.customFormatTypes`` is ``true``, this value will be passed as ``format`` alongside ``datum.value`` to the ``config.numberFormatType`` function. **Default value:** ``%`` - normalizedNumberFormatType : string + normalizedNumberFormatType : str `Custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__ for ``config.normalizedNumberFormat``. @@ -4027,7 +10758,7 @@ class Config(VegaLiteSchema): exposed as `format in Vega-Expression <https://vega.github.io/vega/docs/expressions/#format>`__. **Note:** You must also set ``customFormatTypes`` to ``true`` to use this feature. - numberFormat : string + numberFormat : str If numberFormatType is not specified, D3 number format for guide labels, text marks, and tooltips of non-normalized fields (fields *without* ``stack: "normalize"`` ). For example ``"s"`` for SI units. Use `D3's number format pattern @@ -4036,7 +10767,7 @@ class Config(VegaLiteSchema): If ``config.numberFormatType`` is specified and ``config.customFormatTypes`` is ``true``, this value will be passed as ``format`` alongside ``datum.value`` to the ``config.numberFormatType`` function. - numberFormatType : string + numberFormatType : str `Custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__ for ``config.numberFormat``. @@ -4045,58 +10776,58 @@ class Config(VegaLiteSchema): exposed as `format in Vega-Expression <https://vega.github.io/vega/docs/expressions/#format>`__. **Note:** You must also set ``customFormatTypes`` to ``true`` to use this feature. - padding : anyOf(:class:`Padding`, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], :class:`Padding`, Dict, float The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format ``{"left": 5, "top": 5, "right": 5, "bottom": 5}`` to specify padding for each side of the visualization. **Default value** : ``5`` - params : List(:class:`TopLevelParameter`) + params : Sequence[:class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, select]], :class:`VariableParameter`, Dict[required=[name]]] Dynamic variables or selections that parameterize a visualization. - point : :class:`MarkConfig` + point : :class:`MarkConfig`, Dict Point-Specific Config - projection : :class:`ProjectionConfig` + projection : :class:`ProjectionConfig`, Dict Projection configuration, which determines default properties for all `projections <https://vega.github.io/vega-lite/docs/projection.html>`__. For a full list of projection configuration options, please see the `corresponding section of the projection documentation <https://vega.github.io/vega-lite/docs/projection.html#config>`__. - range : :class:`RangeConfig` + range : :class:`RangeConfig`, Dict An object hash that defines default range arrays or schemes for using with scales. For a full list of scale range configuration options, please see the `corresponding section of the scale documentation <https://vega.github.io/vega-lite/docs/scale.html#config>`__. - rect : :class:`RectConfig` + rect : :class:`RectConfig`, Dict Rect-Specific Config - rule : :class:`MarkConfig` + rule : :class:`MarkConfig`, Dict Rule-Specific Config - scale : :class:`ScaleConfig` + scale : :class:`ScaleConfig`, Dict Scale configuration determines default properties for all `scales <https://vega.github.io/vega-lite/docs/scale.html>`__. For a full list of scale configuration options, please see the `corresponding section of the scale documentation <https://vega.github.io/vega-lite/docs/scale.html#config>`__. - selection : :class:`SelectionConfig` + selection : :class:`SelectionConfig`, Dict An object hash for defining default properties for each type of selections. - square : :class:`MarkConfig` + square : :class:`MarkConfig`, Dict Square-Specific Config - style : :class:`StyleConfigIndex` + style : :class:`StyleConfigIndex`, Dict An object hash that defines key-value mappings to determine default properties for marks with a given `style <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. The keys represent styles names; the values have to be valid `mark configuration objects <https://vega.github.io/vega-lite/docs/mark.html#config>`__. - text : :class:`MarkConfig` + text : :class:`MarkConfig`, Dict Text-Specific Config - tick : :class:`TickConfig` + tick : :class:`TickConfig`, Dict Tick-Specific Config - timeFormat : string + timeFormat : str Default time format for raw time values (without time units) in text marks, legend labels and header labels. **Default value:** ``"%b %d, %Y"`` **Note:** Axes automatically determine the format for each label automatically so this config does not affect axes. - timeFormatType : string + timeFormatType : str `Custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__ for ``config.timeFormat``. @@ -4106,82 +10837,374 @@ class Config(VegaLiteSchema): <https://vega.github.io/vega/docs/expressions/#timeFormat>`__. **Note:** You must also set ``customFormatTypes`` to ``true`` and there must *not* be a ``timeUnit`` defined to use this feature. - title : :class:`TitleConfig` + title : :class:`TitleConfig`, Dict Title configuration, which determines default properties for all `titles <https://vega.github.io/vega-lite/docs/title.html>`__. For a full list of title configuration options, please see the `corresponding section of the title documentation <https://vega.github.io/vega-lite/docs/title.html#config>`__. - tooltipFormat : :class:`FormatConfig` + tooltipFormat : :class:`FormatConfig`, Dict Define `custom format configuration <https://vega.github.io/vega-lite/docs/config.html#format>`__ for tooltips. If unspecified, default format config will be applied. - trail : :class:`LineConfig` + trail : :class:`LineConfig`, Dict Trail-Specific Config - view : :class:`ViewConfig` + view : :class:`ViewConfig`, Dict Default properties for `single view plots <https://vega.github.io/vega-lite/docs/spec.html#single>`__. """ - _schema = {'$ref': '#/definitions/Config'} - - def __init__(self, arc=Undefined, area=Undefined, aria=Undefined, autosize=Undefined, - axis=Undefined, axisBand=Undefined, axisBottom=Undefined, axisDiscrete=Undefined, - axisLeft=Undefined, axisPoint=Undefined, axisQuantitative=Undefined, - axisRight=Undefined, axisTemporal=Undefined, axisTop=Undefined, axisX=Undefined, - axisXBand=Undefined, axisXDiscrete=Undefined, axisXPoint=Undefined, - axisXQuantitative=Undefined, axisXTemporal=Undefined, axisY=Undefined, - axisYBand=Undefined, axisYDiscrete=Undefined, axisYPoint=Undefined, - axisYQuantitative=Undefined, axisYTemporal=Undefined, background=Undefined, - bar=Undefined, boxplot=Undefined, circle=Undefined, concat=Undefined, - countTitle=Undefined, customFormatTypes=Undefined, errorband=Undefined, - errorbar=Undefined, facet=Undefined, fieldTitle=Undefined, font=Undefined, - geoshape=Undefined, header=Undefined, headerColumn=Undefined, headerFacet=Undefined, - headerRow=Undefined, image=Undefined, legend=Undefined, line=Undefined, - lineBreak=Undefined, locale=Undefined, mark=Undefined, - normalizedNumberFormat=Undefined, normalizedNumberFormatType=Undefined, - numberFormat=Undefined, numberFormatType=Undefined, padding=Undefined, - params=Undefined, point=Undefined, projection=Undefined, range=Undefined, - rect=Undefined, rule=Undefined, scale=Undefined, selection=Undefined, square=Undefined, - style=Undefined, text=Undefined, tick=Undefined, timeFormat=Undefined, - timeFormatType=Undefined, title=Undefined, tooltipFormat=Undefined, trail=Undefined, - view=Undefined, **kwds): - super(Config, self).__init__(arc=arc, area=area, aria=aria, autosize=autosize, axis=axis, - axisBand=axisBand, axisBottom=axisBottom, - axisDiscrete=axisDiscrete, axisLeft=axisLeft, axisPoint=axisPoint, - axisQuantitative=axisQuantitative, axisRight=axisRight, - axisTemporal=axisTemporal, axisTop=axisTop, axisX=axisX, - axisXBand=axisXBand, axisXDiscrete=axisXDiscrete, - axisXPoint=axisXPoint, axisXQuantitative=axisXQuantitative, - axisXTemporal=axisXTemporal, axisY=axisY, axisYBand=axisYBand, - axisYDiscrete=axisYDiscrete, axisYPoint=axisYPoint, - axisYQuantitative=axisYQuantitative, axisYTemporal=axisYTemporal, - background=background, bar=bar, boxplot=boxplot, circle=circle, - concat=concat, countTitle=countTitle, - customFormatTypes=customFormatTypes, errorband=errorband, - errorbar=errorbar, facet=facet, fieldTitle=fieldTitle, font=font, - geoshape=geoshape, header=header, headerColumn=headerColumn, - headerFacet=headerFacet, headerRow=headerRow, image=image, - legend=legend, line=line, lineBreak=lineBreak, locale=locale, - mark=mark, normalizedNumberFormat=normalizedNumberFormat, - normalizedNumberFormatType=normalizedNumberFormatType, - numberFormat=numberFormat, numberFormatType=numberFormatType, - padding=padding, params=params, point=point, projection=projection, - range=range, rect=rect, rule=rule, scale=scale, - selection=selection, square=square, style=style, text=text, - tick=tick, timeFormat=timeFormat, timeFormatType=timeFormatType, - title=title, tooltipFormat=tooltipFormat, trail=trail, view=view, - **kwds) + + _schema = {"$ref": "#/definitions/Config"} + + def __init__( + self, + arc: Union[Union["RectConfig", dict], UndefinedType] = Undefined, + area: Union[Union["AreaConfig", dict], UndefinedType] = Undefined, + aria: Union[bool, UndefinedType] = Undefined, + autosize: Union[ + Union[ + Union["AutoSizeParams", dict], + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + ], + UndefinedType, + ] = Undefined, + axis: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisBand: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisBottom: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisDiscrete: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisLeft: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisPoint: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisQuantitative: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisRight: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisTemporal: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisTop: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisX: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisXBand: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisXDiscrete: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisXPoint: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisXQuantitative: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisXTemporal: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisY: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisYBand: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisYDiscrete: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisYPoint: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisYQuantitative: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + axisYTemporal: Union[Union["AxisConfig", dict], UndefinedType] = Undefined, + background: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + bar: Union[Union["BarConfig", dict], UndefinedType] = Undefined, + boxplot: Union[Union["BoxPlotConfig", dict], UndefinedType] = Undefined, + circle: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + concat: Union[Union["CompositionConfig", dict], UndefinedType] = Undefined, + countTitle: Union[str, UndefinedType] = Undefined, + customFormatTypes: Union[bool, UndefinedType] = Undefined, + errorband: Union[Union["ErrorBandConfig", dict], UndefinedType] = Undefined, + errorbar: Union[Union["ErrorBarConfig", dict], UndefinedType] = Undefined, + facet: Union[Union["CompositionConfig", dict], UndefinedType] = Undefined, + fieldTitle: Union[ + Literal["verbal", "functional", "plain"], UndefinedType + ] = Undefined, + font: Union[str, UndefinedType] = Undefined, + geoshape: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + header: Union[Union["HeaderConfig", dict], UndefinedType] = Undefined, + headerColumn: Union[Union["HeaderConfig", dict], UndefinedType] = Undefined, + headerFacet: Union[Union["HeaderConfig", dict], UndefinedType] = Undefined, + headerRow: Union[Union["HeaderConfig", dict], UndefinedType] = Undefined, + image: Union[Union["RectConfig", dict], UndefinedType] = Undefined, + legend: Union[Union["LegendConfig", dict], UndefinedType] = Undefined, + line: Union[Union["LineConfig", dict], UndefinedType] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + locale: Union[Union["Locale", dict], UndefinedType] = Undefined, + mark: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + normalizedNumberFormat: Union[str, UndefinedType] = Undefined, + normalizedNumberFormatType: Union[str, UndefinedType] = Undefined, + numberFormat: Union[str, UndefinedType] = Undefined, + numberFormatType: Union[str, UndefinedType] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["Padding", dict, float]], + UndefinedType, + ] = Undefined, + params: Union[ + Sequence[ + Union[ + "TopLevelParameter", + Union["TopLevelSelectionParameter", dict], + Union["VariableParameter", dict], + ] + ], + UndefinedType, + ] = Undefined, + point: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + projection: Union[Union["ProjectionConfig", dict], UndefinedType] = Undefined, + range: Union[Union["RangeConfig", dict], UndefinedType] = Undefined, + rect: Union[Union["RectConfig", dict], UndefinedType] = Undefined, + rule: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + scale: Union[Union["ScaleConfig", dict], UndefinedType] = Undefined, + selection: Union[Union["SelectionConfig", dict], UndefinedType] = Undefined, + square: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + style: Union[Union["StyleConfigIndex", dict], UndefinedType] = Undefined, + text: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + tick: Union[Union["TickConfig", dict], UndefinedType] = Undefined, + timeFormat: Union[str, UndefinedType] = Undefined, + timeFormatType: Union[str, UndefinedType] = Undefined, + title: Union[Union["TitleConfig", dict], UndefinedType] = Undefined, + tooltipFormat: Union[Union["FormatConfig", dict], UndefinedType] = Undefined, + trail: Union[Union["LineConfig", dict], UndefinedType] = Undefined, + view: Union[Union["ViewConfig", dict], UndefinedType] = Undefined, + **kwds, + ): + super(Config, self).__init__( + arc=arc, + area=area, + aria=aria, + autosize=autosize, + axis=axis, + axisBand=axisBand, + axisBottom=axisBottom, + axisDiscrete=axisDiscrete, + axisLeft=axisLeft, + axisPoint=axisPoint, + axisQuantitative=axisQuantitative, + axisRight=axisRight, + axisTemporal=axisTemporal, + axisTop=axisTop, + axisX=axisX, + axisXBand=axisXBand, + axisXDiscrete=axisXDiscrete, + axisXPoint=axisXPoint, + axisXQuantitative=axisXQuantitative, + axisXTemporal=axisXTemporal, + axisY=axisY, + axisYBand=axisYBand, + axisYDiscrete=axisYDiscrete, + axisYPoint=axisYPoint, + axisYQuantitative=axisYQuantitative, + axisYTemporal=axisYTemporal, + background=background, + bar=bar, + boxplot=boxplot, + circle=circle, + concat=concat, + countTitle=countTitle, + customFormatTypes=customFormatTypes, + errorband=errorband, + errorbar=errorbar, + facet=facet, + fieldTitle=fieldTitle, + font=font, + geoshape=geoshape, + header=header, + headerColumn=headerColumn, + headerFacet=headerFacet, + headerRow=headerRow, + image=image, + legend=legend, + line=line, + lineBreak=lineBreak, + locale=locale, + mark=mark, + normalizedNumberFormat=normalizedNumberFormat, + normalizedNumberFormatType=normalizedNumberFormatType, + numberFormat=numberFormat, + numberFormatType=numberFormatType, + padding=padding, + params=params, + point=point, + projection=projection, + range=range, + rect=rect, + rule=rule, + scale=scale, + selection=selection, + square=square, + style=style, + text=text, + tick=tick, + timeFormat=timeFormat, + timeFormatType=timeFormatType, + title=title, + tooltipFormat=tooltipFormat, + trail=trail, + view=view, + **kwds, + ) class Cursor(VegaLiteSchema): """Cursor schema wrapper - enum('auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', - 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', - 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', - 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', - 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing') + :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', + 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', + 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', + 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', + 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', + 'grabbing'] """ - _schema = {'$ref': '#/definitions/Cursor'} + + _schema = {"$ref": "#/definitions/Cursor"} def __init__(self, *args): super(Cursor, self).__init__(*args) @@ -4190,9 +11213,10 @@ def __init__(self, *args): class Cyclical(ColorScheme): """Cyclical schema wrapper - enum('rainbow', 'sinebow') + :class:`Cyclical`, Literal['rainbow', 'sinebow'] """ - _schema = {'$ref': '#/definitions/Cyclical'} + + _schema = {"$ref": "#/definitions/Cyclical"} def __init__(self, *args): super(Cyclical, self).__init__(*args) @@ -4201,9 +11225,14 @@ def __init__(self, *args): class Data(VegaLiteSchema): """Data schema wrapper - anyOf(:class:`DataSource`, :class:`Generator`) + :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, + Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, + :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], + :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, + Dict[required=[sphere]] """ - _schema = {'$ref': '#/definitions/Data'} + + _schema = {"$ref": "#/definitions/Data"} def __init__(self, *args, **kwds): super(Data, self).__init__(*args, **kwds) @@ -4212,10 +11241,11 @@ def __init__(self, *args, **kwds): class DataFormat(VegaLiteSchema): """DataFormat schema wrapper - anyOf(:class:`CsvDataFormat`, :class:`DsvDataFormat`, :class:`JsonDataFormat`, - :class:`TopoDataFormat`) + :class:`CsvDataFormat`, Dict, :class:`DataFormat`, :class:`DsvDataFormat`, + Dict[required=[delimiter]], :class:`JsonDataFormat`, Dict, :class:`TopoDataFormat`, Dict """ - _schema = {'$ref': '#/definitions/DataFormat'} + + _schema = {"$ref": "#/definitions/DataFormat"} def __init__(self, *args, **kwds): super(DataFormat, self).__init__(*args, **kwds) @@ -4224,12 +11254,12 @@ def __init__(self, *args, **kwds): class CsvDataFormat(DataFormat): """CsvDataFormat schema wrapper - Mapping(required=[]) + :class:`CsvDataFormat`, Dict Parameters ---------- - parse : anyOf(:class:`Parse`, None) + parse : :class:`Parse`, Dict, None If set to ``null``, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field @@ -4245,24 +11275,32 @@ class CsvDataFormat(DataFormat): UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). See more about `UTC time <https://vega.github.io/vega-lite/docs/timeunit.html#utc>`__ - type : enum('csv', 'tsv') + type : Literal['csv', 'tsv'] Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. **Default value:** The default format type is determined by the extension of the file URL. If no extension is detected, ``"json"`` will be used by default. """ - _schema = {'$ref': '#/definitions/CsvDataFormat'} - def __init__(self, parse=Undefined, type=Undefined, **kwds): + _schema = {"$ref": "#/definitions/CsvDataFormat"} + + def __init__( + self, + parse: Union[Union[None, Union["Parse", dict]], UndefinedType] = Undefined, + type: Union[Literal["csv", "tsv"], UndefinedType] = Undefined, + **kwds, + ): super(CsvDataFormat, self).__init__(parse=parse, type=type, **kwds) class DataSource(Data): """DataSource schema wrapper - anyOf(:class:`UrlData`, :class:`InlineData`, :class:`NamedData`) + :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, + Dict[required=[name]], :class:`UrlData`, Dict[required=[url]] """ - _schema = {'$ref': '#/definitions/DataSource'} + + _schema = {"$ref": "#/definitions/DataSource"} def __init__(self, *args, **kwds): super(DataSource, self).__init__(*args, **kwds) @@ -4271,9 +11309,10 @@ def __init__(self, *args, **kwds): class Datasets(VegaLiteSchema): """Datasets schema wrapper - Mapping(required=[]) + :class:`Datasets`, Dict """ - _schema = {'$ref': '#/definitions/Datasets'} + + _schema = {"$ref": "#/definitions/Datasets"} def __init__(self, **kwds): super(Datasets, self).__init__(**kwds) @@ -4282,9 +11321,10 @@ def __init__(self, **kwds): class Day(VegaLiteSchema): """Day schema wrapper - float + :class:`Day`, float """ - _schema = {'$ref': '#/definitions/Day'} + + _schema = {"$ref": "#/definitions/Day"} def __init__(self, *args): super(Day, self).__init__(*args) @@ -4293,9 +11333,10 @@ def __init__(self, *args): class Dict(VegaLiteSchema): """Dict schema wrapper - Mapping(required=[]) + :class:`Dict`, Dict """ - _schema = {'$ref': '#/definitions/Dict'} + + _schema = {"$ref": "#/definitions/Dict"} def __init__(self, **kwds): super(Dict, self).__init__(**kwds) @@ -4304,9 +11345,10 @@ def __init__(self, **kwds): class DictInlineDataset(VegaLiteSchema): """DictInlineDataset schema wrapper - Mapping(required=[]) + :class:`DictInlineDataset`, Dict """ - _schema = {'$ref': '#/definitions/Dict<InlineDataset>'} + + _schema = {"$ref": "#/definitions/Dict<InlineDataset>"} def __init__(self, **kwds): super(DictInlineDataset, self).__init__(**kwds) @@ -4315,9 +11357,10 @@ def __init__(self, **kwds): class DictSelectionInit(VegaLiteSchema): """DictSelectionInit schema wrapper - Mapping(required=[]) + :class:`DictSelectionInit`, Dict """ - _schema = {'$ref': '#/definitions/Dict<SelectionInit>'} + + _schema = {"$ref": "#/definitions/Dict<SelectionInit>"} def __init__(self, **kwds): super(DictSelectionInit, self).__init__(**kwds) @@ -4326,9 +11369,10 @@ def __init__(self, **kwds): class DictSelectionInitInterval(VegaLiteSchema): """DictSelectionInitInterval schema wrapper - Mapping(required=[]) + :class:`DictSelectionInitInterval`, Dict """ - _schema = {'$ref': '#/definitions/Dict<SelectionInitInterval>'} + + _schema = {"$ref": "#/definitions/Dict<SelectionInitInterval>"} def __init__(self, **kwds): super(DictSelectionInitInterval, self).__init__(**kwds) @@ -4337,29 +11381,30 @@ def __init__(self, **kwds): class Diverging(ColorScheme): """Diverging schema wrapper - enum('blueorange', 'blueorange-3', 'blueorange-4', 'blueorange-5', 'blueorange-6', - 'blueorange-7', 'blueorange-8', 'blueorange-9', 'blueorange-10', 'blueorange-11', - 'brownbluegreen', 'brownbluegreen-3', 'brownbluegreen-4', 'brownbluegreen-5', - 'brownbluegreen-6', 'brownbluegreen-7', 'brownbluegreen-8', 'brownbluegreen-9', - 'brownbluegreen-10', 'brownbluegreen-11', 'purplegreen', 'purplegreen-3', 'purplegreen-4', - 'purplegreen-5', 'purplegreen-6', 'purplegreen-7', 'purplegreen-8', 'purplegreen-9', - 'purplegreen-10', 'purplegreen-11', 'pinkyellowgreen', 'pinkyellowgreen-3', - 'pinkyellowgreen-4', 'pinkyellowgreen-5', 'pinkyellowgreen-6', 'pinkyellowgreen-7', - 'pinkyellowgreen-8', 'pinkyellowgreen-9', 'pinkyellowgreen-10', 'pinkyellowgreen-11', - 'purpleorange', 'purpleorange-3', 'purpleorange-4', 'purpleorange-5', 'purpleorange-6', - 'purpleorange-7', 'purpleorange-8', 'purpleorange-9', 'purpleorange-10', 'purpleorange-11', - 'redblue', 'redblue-3', 'redblue-4', 'redblue-5', 'redblue-6', 'redblue-7', 'redblue-8', - 'redblue-9', 'redblue-10', 'redblue-11', 'redgrey', 'redgrey-3', 'redgrey-4', 'redgrey-5', - 'redgrey-6', 'redgrey-7', 'redgrey-8', 'redgrey-9', 'redgrey-10', 'redgrey-11', - 'redyellowblue', 'redyellowblue-3', 'redyellowblue-4', 'redyellowblue-5', 'redyellowblue-6', - 'redyellowblue-7', 'redyellowblue-8', 'redyellowblue-9', 'redyellowblue-10', - 'redyellowblue-11', 'redyellowgreen', 'redyellowgreen-3', 'redyellowgreen-4', - 'redyellowgreen-5', 'redyellowgreen-6', 'redyellowgreen-7', 'redyellowgreen-8', - 'redyellowgreen-9', 'redyellowgreen-10', 'redyellowgreen-11', 'spectral', 'spectral-3', - 'spectral-4', 'spectral-5', 'spectral-6', 'spectral-7', 'spectral-8', 'spectral-9', - 'spectral-10', 'spectral-11') - """ - _schema = {'$ref': '#/definitions/Diverging'} + :class:`Diverging`, Literal['blueorange', 'blueorange-3', 'blueorange-4', 'blueorange-5', + 'blueorange-6', 'blueorange-7', 'blueorange-8', 'blueorange-9', 'blueorange-10', + 'blueorange-11', 'brownbluegreen', 'brownbluegreen-3', 'brownbluegreen-4', + 'brownbluegreen-5', 'brownbluegreen-6', 'brownbluegreen-7', 'brownbluegreen-8', + 'brownbluegreen-9', 'brownbluegreen-10', 'brownbluegreen-11', 'purplegreen', + 'purplegreen-3', 'purplegreen-4', 'purplegreen-5', 'purplegreen-6', 'purplegreen-7', + 'purplegreen-8', 'purplegreen-9', 'purplegreen-10', 'purplegreen-11', 'pinkyellowgreen', + 'pinkyellowgreen-3', 'pinkyellowgreen-4', 'pinkyellowgreen-5', 'pinkyellowgreen-6', + 'pinkyellowgreen-7', 'pinkyellowgreen-8', 'pinkyellowgreen-9', 'pinkyellowgreen-10', + 'pinkyellowgreen-11', 'purpleorange', 'purpleorange-3', 'purpleorange-4', 'purpleorange-5', + 'purpleorange-6', 'purpleorange-7', 'purpleorange-8', 'purpleorange-9', 'purpleorange-10', + 'purpleorange-11', 'redblue', 'redblue-3', 'redblue-4', 'redblue-5', 'redblue-6', + 'redblue-7', 'redblue-8', 'redblue-9', 'redblue-10', 'redblue-11', 'redgrey', 'redgrey-3', + 'redgrey-4', 'redgrey-5', 'redgrey-6', 'redgrey-7', 'redgrey-8', 'redgrey-9', 'redgrey-10', + 'redgrey-11', 'redyellowblue', 'redyellowblue-3', 'redyellowblue-4', 'redyellowblue-5', + 'redyellowblue-6', 'redyellowblue-7', 'redyellowblue-8', 'redyellowblue-9', + 'redyellowblue-10', 'redyellowblue-11', 'redyellowgreen', 'redyellowgreen-3', + 'redyellowgreen-4', 'redyellowgreen-5', 'redyellowgreen-6', 'redyellowgreen-7', + 'redyellowgreen-8', 'redyellowgreen-9', 'redyellowgreen-10', 'redyellowgreen-11', + 'spectral', 'spectral-3', 'spectral-4', 'spectral-5', 'spectral-6', 'spectral-7', + 'spectral-8', 'spectral-9', 'spectral-10', 'spectral-11'] + """ + + _schema = {"$ref": "#/definitions/Diverging"} def __init__(self, *args): super(Diverging, self).__init__(*args) @@ -4368,34 +11413,47 @@ def __init__(self, *args): class DomainUnionWith(VegaLiteSchema): """DomainUnionWith schema wrapper - Mapping(required=[unionWith]) + :class:`DomainUnionWith`, Dict[required=[unionWith]] Parameters ---------- - unionWith : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`)) + unionWith : Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str] Customized domain values to be union with the field's values or explicitly defined domain. Should be an array of valid scale domain values. """ - _schema = {'$ref': '#/definitions/DomainUnionWith'} - def __init__(self, unionWith=Undefined, **kwds): + _schema = {"$ref": "#/definitions/DomainUnionWith"} + + def __init__( + self, + unionWith: Union[ + Union[ + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(DomainUnionWith, self).__init__(unionWith=unionWith, **kwds) class DsvDataFormat(DataFormat): """DsvDataFormat schema wrapper - Mapping(required=[delimiter]) + :class:`DsvDataFormat`, Dict[required=[delimiter]] Parameters ---------- - delimiter : string + delimiter : str The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not. - parse : anyOf(:class:`Parse`, None) + parse : :class:`Parse`, Dict, None If set to ``null``, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field @@ -4411,24 +11469,34 @@ class DsvDataFormat(DataFormat): UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). See more about `UTC time <https://vega.github.io/vega-lite/docs/timeunit.html#utc>`__ - type : string + type : str Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. **Default value:** The default format type is determined by the extension of the file URL. If no extension is detected, ``"json"`` will be used by default. """ - _schema = {'$ref': '#/definitions/DsvDataFormat'} - def __init__(self, delimiter=Undefined, parse=Undefined, type=Undefined, **kwds): - super(DsvDataFormat, self).__init__(delimiter=delimiter, parse=parse, type=type, **kwds) + _schema = {"$ref": "#/definitions/DsvDataFormat"} + + def __init__( + self, + delimiter: Union[str, UndefinedType] = Undefined, + parse: Union[Union[None, Union["Parse", dict]], UndefinedType] = Undefined, + type: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(DsvDataFormat, self).__init__( + delimiter=delimiter, parse=parse, type=type, **kwds + ) class Element(VegaLiteSchema): """Element schema wrapper - string + :class:`Element`, str """ - _schema = {'$ref': '#/definitions/Element'} + + _schema = {"$ref": "#/definitions/Element"} def __init__(self, *args): super(Element, self).__init__(*args) @@ -4437,14 +11505,14 @@ def __init__(self, *args): class Encoding(VegaLiteSchema): """Encoding schema wrapper - Mapping(required=[]) + :class:`Encoding`, Dict Parameters ---------- - angle : :class:`NumericMarkPropDef` + angle : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Rotation angle of point and text marks. - color : :class:`ColorDef` + color : :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, Dict[required=[shorthand]], :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Color of the marks – either fill or stroke color based on the ``filled`` property of mark definition. By default, ``color`` represents fill color for ``"area"``, ``"bar"``, ``"tick"``, ``"text"``, ``"trail"``, ``"circle"``, and ``"square"`` / @@ -4460,49 +11528,49 @@ class Encoding(VegaLiteSchema): encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing `color scheme <https://vega.github.io/vega-lite/docs/scale.html#scheme>`__. - description : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + description : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict A text description of this mark for ARIA accessibility (SVG output only). For SVG output the ``"aria-label"`` attribute will be set to this description. - detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + detail : :class:`FieldDefWithoutScale`, Dict[required=[shorthand]], Sequence[:class:`FieldDefWithoutScale`, Dict[required=[shorthand]]] Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel. - fill : :class:`ColorDef` + fill : :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, Dict[required=[shorthand]], :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Fill color of the marks. **Default value:** If undefined, the default color depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``color`` property. *Note:* The ``fill`` encoding has higher precedence than ``color``, thus may override the ``color`` encoding if conflicting encodings are specified. - fillOpacity : :class:`NumericMarkPropDef` + fillOpacity : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Fill opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``fillOpacity`` property. - href : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + href : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict A URL to load upon mouse click. - key : :class:`FieldDefWithoutScale` + key : :class:`FieldDefWithoutScale`, Dict[required=[shorthand]] A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data. - latitude : :class:`LatLongDef` + latitude : :class:`DatumDef`, Dict, :class:`LatLongDef`, :class:`LatLongFieldDef`, Dict[required=[shorthand]] Latitude position of geographically projected marks. - latitude2 : :class:`Position2Def` + latitude2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. - longitude : :class:`LatLongDef` + longitude : :class:`DatumDef`, Dict, :class:`LatLongDef`, :class:`LatLongFieldDef`, Dict[required=[shorthand]] Longitude position of geographically projected marks. - longitude2 : :class:`Position2Def` + longitude2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. - opacity : :class:`NumericMarkPropDef` + opacity : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``opacity`` property. - order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`, :class:`OrderOnlyDef`) + order : :class:`OrderFieldDef`, Dict[required=[shorthand]], :class:`OrderOnlyDef`, Dict, :class:`OrderValueDef`, Dict[required=[value]], Sequence[:class:`OrderFieldDef`, Dict[required=[shorthand]]] Order of the marks. @@ -4517,11 +11585,11 @@ class Encoding(VegaLiteSchema): **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid creating additional aggregation grouping. - radius : :class:`PolarDef` + radius : :class:`PolarDef`, :class:`PositionDatumDefBase`, Dict, :class:`PositionFieldDefBase`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] The outer radius in pixels of arc marks. - radius2 : :class:`Position2Def` + radius2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] The inner radius in pixels of arc marks. - shape : :class:`ShapeDef` + shape : :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, Dict[required=[shorthand]], :class:`ShapeDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`, Dict Shape of the mark. @@ -4541,7 +11609,7 @@ class Encoding(VegaLiteSchema): **Default value:** If undefined, the default shape depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#point-config>`__ 's ``shape`` property. ( ``"circle"`` if unset.) - size : :class:`NumericMarkPropDef` + size : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Size of the mark. @@ -4551,7 +11619,7 @@ class Encoding(VegaLiteSchema): * For ``"text"`` – the text's font size. * Size is unsupported for ``"line"``, ``"area"``, and ``"rect"``. (Use ``"trail"`` instead of line with varying size) - stroke : :class:`ColorDef` + stroke : :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, Dict[required=[shorthand]], :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Stroke color of the marks. **Default value:** If undefined, the default color depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``color`` @@ -4559,108 +11627,450 @@ class Encoding(VegaLiteSchema): *Note:* The ``stroke`` encoding has higher precedence than ``color``, thus may override the ``color`` encoding if conflicting encodings are specified. - strokeDash : :class:`NumericArrayMarkPropDef` + strokeDash : :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, Dict[required=[shorthand]], :class:`NumericArrayMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`, Dict Stroke dash of the marks. **Default value:** ``[1,0]`` (No dash). - strokeOpacity : :class:`NumericMarkPropDef` + strokeOpacity : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Stroke opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``strokeOpacity`` property. - strokeWidth : :class:`NumericMarkPropDef` + strokeWidth : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Stroke width of the marks. **Default value:** If undefined, the default stroke width depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``strokeWidth`` property. - text : :class:`TextDef` + text : :class:`FieldOrDatumDefWithConditionStringDatumDefText`, Dict, :class:`FieldOrDatumDefWithConditionStringFieldDefText`, Dict[required=[shorthand]], :class:`TextDef`, :class:`ValueDefWithConditionStringFieldDefText`, Dict Text of the ``text`` mark. - theta : :class:`PolarDef` + theta : :class:`PolarDef`, :class:`PositionDatumDefBase`, Dict, :class:`PositionFieldDefBase`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : :class:`Position2Def` + theta2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. - tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, List(:class:`StringFieldDef`), None) + tooltip : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict, None, Sequence[:class:`StringFieldDef`, Dict] The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. See the `tooltip <https://vega.github.io/vega-lite/docs/tooltip.html>`__ documentation for a detailed discussion about tooltip in Vega-Lite. - url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + url : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict The URL of an image mark. - x : :class:`PositionDef` + x : :class:`PositionDatumDef`, Dict, :class:`PositionDef`, :class:`PositionFieldDef`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : :class:`Position2Def` + x2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - xError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + xError : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + xError2 : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Secondary error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - xOffset : :class:`OffsetDef` + xOffset : :class:`OffsetDef`, :class:`ScaleDatumDef`, Dict, :class:`ScaleFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Offset of x-position of the marks - y : :class:`PositionDef` + y : :class:`PositionDatumDef`, Dict, :class:`PositionDef`, :class:`PositionFieldDef`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : :class:`Position2Def` + y2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - yError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + yError : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. - yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + yError2 : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Secondary error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. - yOffset : :class:`OffsetDef` + yOffset : :class:`OffsetDef`, :class:`ScaleDatumDef`, Dict, :class:`ScaleFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Offset of y-position of the marks """ - _schema = {'$ref': '#/definitions/Encoding'} - - def __init__(self, angle=Undefined, color=Undefined, description=Undefined, detail=Undefined, - fill=Undefined, fillOpacity=Undefined, href=Undefined, key=Undefined, - latitude=Undefined, latitude2=Undefined, longitude=Undefined, longitude2=Undefined, - opacity=Undefined, order=Undefined, radius=Undefined, radius2=Undefined, - shape=Undefined, size=Undefined, stroke=Undefined, strokeDash=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, theta=Undefined, - theta2=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, - xError=Undefined, xError2=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, - yError=Undefined, yError2=Undefined, yOffset=Undefined, **kwds): - super(Encoding, self).__init__(angle=angle, color=color, description=description, detail=detail, - fill=fill, fillOpacity=fillOpacity, href=href, key=key, - latitude=latitude, latitude2=latitude2, longitude=longitude, - longitude2=longitude2, opacity=opacity, order=order, - radius=radius, radius2=radius2, shape=shape, size=size, - stroke=stroke, strokeDash=strokeDash, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, text=text, - theta=theta, theta2=theta2, tooltip=tooltip, url=url, x=x, x2=x2, - xError=xError, xError2=xError2, xOffset=xOffset, y=y, y2=y2, - yError=yError, yError2=yError2, yOffset=yOffset, **kwds) + + _schema = {"$ref": "#/definitions/Encoding"} + + def __init__( + self, + angle: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + "ColorDef", + Union["FieldOrDatumDefWithConditionDatumDefGradientstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[ + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + detail: Union[ + Union[ + Sequence[Union["FieldDefWithoutScale", dict]], + Union["FieldDefWithoutScale", dict], + ], + UndefinedType, + ] = Undefined, + fill: Union[ + Union[ + "ColorDef", + Union["FieldOrDatumDefWithConditionDatumDefGradientstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[ + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + key: Union[Union["FieldDefWithoutScale", dict], UndefinedType] = Undefined, + latitude: Union[ + Union[ + "LatLongDef", Union["DatumDef", dict], Union["LatLongFieldDef", dict] + ], + UndefinedType, + ] = Undefined, + latitude2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + longitude: Union[ + Union[ + "LatLongDef", Union["DatumDef", dict], Union["LatLongFieldDef", dict] + ], + UndefinedType, + ] = Undefined, + longitude2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + opacity: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[ + Sequence[Union["OrderFieldDef", dict]], + Union["OrderFieldDef", dict], + Union["OrderOnlyDef", dict], + Union["OrderValueDef", dict], + ], + UndefinedType, + ] = Undefined, + radius: Union[ + Union[ + "PolarDef", + Union["PositionDatumDefBase", dict], + Union["PositionFieldDefBase", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + radius2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + shape: Union[ + Union[ + "ShapeDef", + Union["FieldOrDatumDefWithConditionDatumDefstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + stroke: Union[ + Union[ + "ColorDef", + Union["FieldOrDatumDefWithConditionDatumDefGradientstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[ + "NumericArrayMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumberArray", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray", dict], + ], + UndefinedType, + ] = Undefined, + strokeOpacity: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + strokeWidth: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + text: Union[ + Union[ + "TextDef", + Union["FieldOrDatumDefWithConditionStringDatumDefText", dict], + Union["FieldOrDatumDefWithConditionStringFieldDefText", dict], + Union["ValueDefWithConditionStringFieldDefText", dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[ + "PolarDef", + Union["PositionDatumDefBase", dict], + Union["PositionFieldDefBase", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + theta2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + tooltip: Union[ + Union[ + None, + Sequence[Union["StringFieldDef", dict]], + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[ + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[ + "PositionDef", + Union["PositionDatumDef", dict], + Union["PositionFieldDef", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + x2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + xError: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + xError2: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + xOffset: Union[ + Union[ + "OffsetDef", + Union["ScaleDatumDef", dict], + Union["ScaleFieldDef", dict], + Union["ValueDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + y: Union[ + Union[ + "PositionDef", + Union["PositionDatumDef", dict], + Union["PositionFieldDef", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + y2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + yError: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + yError2: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + yOffset: Union[ + Union[ + "OffsetDef", + Union["ScaleDatumDef", dict], + Union["ScaleFieldDef", dict], + Union["ValueDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Encoding, self).__init__( + angle=angle, + color=color, + description=description, + detail=detail, + fill=fill, + fillOpacity=fillOpacity, + href=href, + key=key, + latitude=latitude, + latitude2=latitude2, + longitude=longitude, + longitude2=longitude2, + opacity=opacity, + order=order, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + stroke=stroke, + strokeDash=strokeDash, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + text=text, + theta=theta, + theta2=theta2, + tooltip=tooltip, + url=url, + x=x, + x2=x2, + xError=xError, + xError2=xError2, + xOffset=xOffset, + y=y, + y2=y2, + yError=yError, + yError2=yError2, + yOffset=yOffset, + **kwds, + ) class ErrorBand(CompositeMark): """ErrorBand schema wrapper - string + :class:`ErrorBand`, str """ - _schema = {'$ref': '#/definitions/ErrorBand'} + + _schema = {"$ref": "#/definitions/ErrorBand"} def __init__(self, *args): super(ErrorBand, self).__init__(*args) @@ -4669,16 +12079,16 @@ def __init__(self, *args): class ErrorBandConfig(VegaLiteSchema): """ErrorBandConfig schema wrapper - Mapping(required=[]) + :class:`ErrorBandConfig`, Dict Parameters ---------- - band : anyOf(boolean, :class:`AnyMarkConfig`) + band : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - borders : anyOf(boolean, :class:`AnyMarkConfig`) + borders : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - extent : :class:`ErrorBarExtent` + extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the band. Available options include: @@ -4690,7 +12100,7 @@ class ErrorBandConfig(VegaLiteSchema): * ``"iqr"`` : Extend the band to the q1 and q3. **Default value:** ``"stderr"``. - interpolate : :class:`Interpolate` + interpolate : :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method for the error band. One of the following: @@ -4716,34 +12126,101 @@ class ErrorBandConfig(VegaLiteSchema): tension : float The tension parameter for the interpolation type of the error band. """ - _schema = {'$ref': '#/definitions/ErrorBandConfig'} - def __init__(self, band=Undefined, borders=Undefined, extent=Undefined, interpolate=Undefined, - tension=Undefined, **kwds): - super(ErrorBandConfig, self).__init__(band=band, borders=borders, extent=extent, - interpolate=interpolate, tension=tension, **kwds) + _schema = {"$ref": "#/definitions/ErrorBandConfig"} + + def __init__( + self, + band: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + borders: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + extent: Union[ + Union["ErrorBarExtent", Literal["ci", "iqr", "stderr", "stdev"]], + UndefinedType, + ] = Undefined, + interpolate: Union[ + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + UndefinedType, + ] = Undefined, + tension: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(ErrorBandConfig, self).__init__( + band=band, + borders=borders, + extent=extent, + interpolate=interpolate, + tension=tension, + **kwds, + ) class ErrorBandDef(CompositeMarkDef): """ErrorBandDef schema wrapper - Mapping(required=[type]) + :class:`ErrorBandDef`, Dict[required=[type]] Parameters ---------- - type : :class:`ErrorBand` + type : :class:`ErrorBand`, str The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, ``"errorband"``, ``"errorbar"`` ). - band : anyOf(boolean, :class:`AnyMarkConfig`) + band : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - borders : anyOf(boolean, :class:`AnyMarkConfig`) + borders : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool - clip : boolean + clip : bool Whether a composite mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -4756,7 +12233,7 @@ class ErrorBandDef(CompositeMarkDef): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - extent : :class:`ErrorBarExtent` + extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the band. Available options include: @@ -4768,7 +12245,7 @@ class ErrorBandDef(CompositeMarkDef): * ``"iqr"`` : Extend the band to the q1 and q3. **Default value:** ``"stderr"``. - interpolate : :class:`Interpolate` + interpolate : :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method for the error band. One of the following: @@ -4793,28 +12270,274 @@ class ErrorBandDef(CompositeMarkDef): * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. opacity : float The opacity (value between [0,1]) of the mark. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined. tension : float The tension parameter for the interpolation type of the error band. """ - _schema = {'$ref': '#/definitions/ErrorBandDef'} - def __init__(self, type=Undefined, band=Undefined, borders=Undefined, clip=Undefined, - color=Undefined, extent=Undefined, interpolate=Undefined, opacity=Undefined, - orient=Undefined, tension=Undefined, **kwds): - super(ErrorBandDef, self).__init__(type=type, band=band, borders=borders, clip=clip, - color=color, extent=extent, interpolate=interpolate, - opacity=opacity, orient=orient, tension=tension, **kwds) + _schema = {"$ref": "#/definitions/ErrorBandDef"} + + def __init__( + self, + type: Union[Union["ErrorBand", str], UndefinedType] = Undefined, + band: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + borders: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + extent: Union[ + Union["ErrorBarExtent", Literal["ci", "iqr", "stderr", "stdev"]], + UndefinedType, + ] = Undefined, + interpolate: Union[ + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + UndefinedType, + ] = Undefined, + opacity: Union[float, UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + tension: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(ErrorBandDef, self).__init__( + type=type, + band=band, + borders=borders, + clip=clip, + color=color, + extent=extent, + interpolate=interpolate, + opacity=opacity, + orient=orient, + tension=tension, + **kwds, + ) class ErrorBar(CompositeMark): """ErrorBar schema wrapper - string + :class:`ErrorBar`, str """ - _schema = {'$ref': '#/definitions/ErrorBar'} + + _schema = {"$ref": "#/definitions/ErrorBar"} def __init__(self, *args): super(ErrorBar, self).__init__(*args) @@ -4823,12 +12546,12 @@ def __init__(self, *args): class ErrorBarConfig(VegaLiteSchema): """ErrorBarConfig schema wrapper - Mapping(required=[]) + :class:`ErrorBarConfig`, Dict Parameters ---------- - extent : :class:`ErrorBarExtent` + extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the rule. Available options include: @@ -4840,39 +12563,84 @@ class ErrorBarConfig(VegaLiteSchema): * ``"iqr"`` : Extend the rule to the q1 and q3. **Default value:** ``"stderr"``. - rule : anyOf(boolean, :class:`AnyMarkConfig`) + rule : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool size : float Size of the ticks of an error bar thickness : float Thickness of the ticks and the bar of an error bar - ticks : anyOf(boolean, :class:`AnyMarkConfig`) - - """ - _schema = {'$ref': '#/definitions/ErrorBarConfig'} - - def __init__(self, extent=Undefined, rule=Undefined, size=Undefined, thickness=Undefined, - ticks=Undefined, **kwds): - super(ErrorBarConfig, self).__init__(extent=extent, rule=rule, size=size, thickness=thickness, - ticks=ticks, **kwds) + ticks : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool + + """ + + _schema = {"$ref": "#/definitions/ErrorBarConfig"} + + def __init__( + self, + extent: Union[ + Union["ErrorBarExtent", Literal["ci", "iqr", "stderr", "stdev"]], + UndefinedType, + ] = Undefined, + rule: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + size: Union[float, UndefinedType] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + ticks: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ErrorBarConfig, self).__init__( + extent=extent, + rule=rule, + size=size, + thickness=thickness, + ticks=ticks, + **kwds, + ) class ErrorBarDef(CompositeMarkDef): """ErrorBarDef schema wrapper - Mapping(required=[type]) + :class:`ErrorBarDef`, Dict[required=[type]] Parameters ---------- - type : :class:`ErrorBar` + type : :class:`ErrorBar`, str The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, ``"errorband"``, ``"errorbar"`` ). - clip : boolean + clip : bool Whether a composite mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -4885,7 +12653,7 @@ class ErrorBarDef(CompositeMarkDef): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - extent : :class:`ErrorBarExtent` + extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the rule. Available options include: @@ -4899,34 +12667,258 @@ class ErrorBarDef(CompositeMarkDef): **Default value:** ``"stderr"``. opacity : float The opacity (value between [0,1]) of the mark. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] Orientation of the error bar. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined. - rule : anyOf(boolean, :class:`AnyMarkConfig`) + rule : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool size : float Size of the ticks of an error bar thickness : float Thickness of the ticks and the bar of an error bar - ticks : anyOf(boolean, :class:`AnyMarkConfig`) - - """ - _schema = {'$ref': '#/definitions/ErrorBarDef'} - - def __init__(self, type=Undefined, clip=Undefined, color=Undefined, extent=Undefined, - opacity=Undefined, orient=Undefined, rule=Undefined, size=Undefined, - thickness=Undefined, ticks=Undefined, **kwds): - super(ErrorBarDef, self).__init__(type=type, clip=clip, color=color, extent=extent, - opacity=opacity, orient=orient, rule=rule, size=size, - thickness=thickness, ticks=ticks, **kwds) + ticks : :class:`AnyMarkConfig`, :class:`AreaConfig`, Dict, :class:`BarConfig`, Dict, :class:`LineConfig`, Dict, :class:`MarkConfig`, Dict, :class:`RectConfig`, Dict, :class:`TickConfig`, Dict, bool + + """ + + _schema = {"$ref": "#/definitions/ErrorBarDef"} + + def __init__( + self, + type: Union[Union["ErrorBar", str], UndefinedType] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + extent: Union[ + Union["ErrorBarExtent", Literal["ci", "iqr", "stderr", "stdev"]], + UndefinedType, + ] = Undefined, + opacity: Union[float, UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + rule: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + size: Union[float, UndefinedType] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + ticks: Union[ + Union[ + Union[ + "AnyMarkConfig", + Union["AreaConfig", dict], + Union["BarConfig", dict], + Union["LineConfig", dict], + Union["MarkConfig", dict], + Union["RectConfig", dict], + Union["TickConfig", dict], + ], + bool, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ErrorBarDef, self).__init__( + type=type, + clip=clip, + color=color, + extent=extent, + opacity=opacity, + orient=orient, + rule=rule, + size=size, + thickness=thickness, + ticks=ticks, + **kwds, + ) class ErrorBarExtent(VegaLiteSchema): """ErrorBarExtent schema wrapper - enum('ci', 'iqr', 'stderr', 'stdev') + :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] """ - _schema = {'$ref': '#/definitions/ErrorBarExtent'} + + _schema = {"$ref": "#/definitions/ErrorBarExtent"} def __init__(self, *args): super(ErrorBarExtent, self).__init__(*args) @@ -4935,9 +12927,10 @@ def __init__(self, *args): class Expr(VegaLiteSchema): """Expr schema wrapper - string + :class:`Expr`, str """ - _schema = {'$ref': '#/definitions/Expr'} + + _schema = {"$ref": "#/definitions/Expr"} def __init__(self, *args): super(Expr, self).__init__(*args) @@ -4946,29 +12939,32 @@ def __init__(self, *args): class ExprRef(VegaLiteSchema): """ExprRef schema wrapper - Mapping(required=[expr]) + :class:`ExprRef`, Dict[required=[expr]] Parameters ---------- - expr : string + expr : str Vega expression (which can refer to Vega-Lite parameters). """ - _schema = {'$ref': '#/definitions/ExprRef'} - def __init__(self, expr=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ExprRef"} + + def __init__(self, expr: Union[str, UndefinedType] = Undefined, **kwds): super(ExprRef, self).__init__(expr=expr, **kwds) class FacetEncodingFieldDef(VegaLiteSchema): """FacetEncodingFieldDef schema wrapper - Mapping(required=[]) + :class:`FacetEncodingFieldDef`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -4976,7 +12972,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -4997,7 +12993,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -5018,7 +13014,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -5030,7 +13026,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -5056,7 +13052,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -5071,9 +13067,9 @@ class FacetEncodingFieldDef(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - header : anyOf(:class:`Header`, None) + header : :class:`Header`, Dict, None An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + sort : :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortOrder`, Literal['ascending', 'descending'], None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -5100,7 +13096,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): **Default value:** ``"ascending"`` **Note:** ``null`` is not supported for ``row`` and ``column``. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -5108,7 +13104,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -5117,7 +13113,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5137,7 +13133,7 @@ class FacetEncodingFieldDef(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -5207,28 +13203,278 @@ class FacetEncodingFieldDef(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FacetEncodingFieldDef'} - def __init__(self, aggregate=Undefined, align=Undefined, bandPosition=Undefined, bin=Undefined, - bounds=Undefined, center=Undefined, columns=Undefined, field=Undefined, - header=Undefined, sort=Undefined, spacing=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(FacetEncodingFieldDef, self).__init__(aggregate=aggregate, align=align, - bandPosition=bandPosition, bin=bin, bounds=bounds, - center=center, columns=columns, field=field, - header=header, sort=sort, spacing=spacing, - timeUnit=timeUnit, title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/FacetEncodingFieldDef"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + header: Union[Union[None, Union["Header", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + UndefinedType, + ] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FacetEncodingFieldDef, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + align=align, + bandPosition=bandPosition, + bin=bin, + bounds=bounds, + center=center, + columns=columns, + field=field, + header=header, + sort=sort, + spacing=spacing, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class FacetFieldDef(VegaLiteSchema): """FacetFieldDef schema wrapper - Mapping(required=[]) + :class:`FacetFieldDef`, Dict Parameters ---------- - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -5240,7 +13486,7 @@ class FacetFieldDef(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -5261,7 +13507,7 @@ class FacetFieldDef(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -5276,9 +13522,9 @@ class FacetFieldDef(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - header : anyOf(:class:`Header`, None) + header : :class:`Header`, Dict, None An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + sort : :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortOrder`, Literal['ascending', 'descending'], None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -5305,7 +13551,7 @@ class FacetFieldDef(VegaLiteSchema): **Default value:** ``"ascending"`` **Note:** ``null`` is not supported for ``row`` and ``column``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -5314,7 +13560,7 @@ class FacetFieldDef(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5334,7 +13580,7 @@ class FacetFieldDef(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -5404,46 +13650,281 @@ class FacetFieldDef(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FacetFieldDef'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, - **kwds): - super(FacetFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, - field=field, header=header, sort=sort, timeUnit=timeUnit, - title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/FacetFieldDef"} + + def __init__( + self, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + header: Union[Union[None, Union["Header", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FacetFieldDef, self).__init__( + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + header=header, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class FacetMapping(VegaLiteSchema): """FacetMapping schema wrapper - Mapping(required=[]) + :class:`FacetMapping`, Dict Parameters ---------- - column : :class:`FacetFieldDef` + column : :class:`FacetFieldDef`, Dict A field definition for the horizontal facet of trellis plots. - row : :class:`FacetFieldDef` + row : :class:`FacetFieldDef`, Dict A field definition for the vertical facet of trellis plots. """ - _schema = {'$ref': '#/definitions/FacetMapping'} - def __init__(self, column=Undefined, row=Undefined, **kwds): + _schema = {"$ref": "#/definitions/FacetMapping"} + + def __init__( + self, + column: Union[Union["FacetFieldDef", dict], UndefinedType] = Undefined, + row: Union[Union["FacetFieldDef", dict], UndefinedType] = Undefined, + **kwds, + ): super(FacetMapping, self).__init__(column=column, row=row, **kwds) class FacetedEncoding(VegaLiteSchema): """FacetedEncoding schema wrapper - Mapping(required=[]) + :class:`FacetedEncoding`, Dict Parameters ---------- - angle : :class:`NumericMarkPropDef` + angle : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Rotation angle of point and text marks. - color : :class:`ColorDef` + color : :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, Dict[required=[shorthand]], :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Color of the marks – either fill or stroke color based on the ``filled`` property of mark definition. By default, ``color`` represents fill color for ``"area"``, ``"bar"``, ``"tick"``, ``"text"``, ``"trail"``, ``"circle"``, and ``"square"`` / @@ -5459,55 +13940,55 @@ class FacetedEncoding(VegaLiteSchema): encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing `color scheme <https://vega.github.io/vega-lite/docs/scale.html#scheme>`__. - column : :class:`RowColumnEncodingFieldDef` + column : :class:`RowColumnEncodingFieldDef`, Dict[required=[shorthand]] A field definition for the horizontal facet of trellis plots. - description : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + description : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict A text description of this mark for ARIA accessibility (SVG output only). For SVG output the ``"aria-label"`` attribute will be set to this description. - detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + detail : :class:`FieldDefWithoutScale`, Dict[required=[shorthand]], Sequence[:class:`FieldDefWithoutScale`, Dict[required=[shorthand]]] Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel. - facet : :class:`FacetEncodingFieldDef` + facet : :class:`FacetEncodingFieldDef`, Dict[required=[shorthand]] A field definition for the (flexible) facet of trellis plots. If either ``row`` or ``column`` is specified, this channel will be ignored. - fill : :class:`ColorDef` + fill : :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, Dict[required=[shorthand]], :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Fill color of the marks. **Default value:** If undefined, the default color depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``color`` property. *Note:* The ``fill`` encoding has higher precedence than ``color``, thus may override the ``color`` encoding if conflicting encodings are specified. - fillOpacity : :class:`NumericMarkPropDef` + fillOpacity : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Fill opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``fillOpacity`` property. - href : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + href : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict A URL to load upon mouse click. - key : :class:`FieldDefWithoutScale` + key : :class:`FieldDefWithoutScale`, Dict[required=[shorthand]] A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data. - latitude : :class:`LatLongDef` + latitude : :class:`DatumDef`, Dict, :class:`LatLongDef`, :class:`LatLongFieldDef`, Dict[required=[shorthand]] Latitude position of geographically projected marks. - latitude2 : :class:`Position2Def` + latitude2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. - longitude : :class:`LatLongDef` + longitude : :class:`DatumDef`, Dict, :class:`LatLongDef`, :class:`LatLongFieldDef`, Dict[required=[shorthand]] Longitude position of geographically projected marks. - longitude2 : :class:`Position2Def` + longitude2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. - opacity : :class:`NumericMarkPropDef` + opacity : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``opacity`` property. - order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`, :class:`OrderOnlyDef`) + order : :class:`OrderFieldDef`, Dict[required=[shorthand]], :class:`OrderOnlyDef`, Dict, :class:`OrderValueDef`, Dict[required=[value]], Sequence[:class:`OrderFieldDef`, Dict[required=[shorthand]]] Order of the marks. @@ -5522,13 +14003,13 @@ class FacetedEncoding(VegaLiteSchema): **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid creating additional aggregation grouping. - radius : :class:`PolarDef` + radius : :class:`PolarDef`, :class:`PositionDatumDefBase`, Dict, :class:`PositionFieldDefBase`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] The outer radius in pixels of arc marks. - radius2 : :class:`Position2Def` + radius2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] The inner radius in pixels of arc marks. - row : :class:`RowColumnEncodingFieldDef` + row : :class:`RowColumnEncodingFieldDef`, Dict[required=[shorthand]] A field definition for the vertical facet of trellis plots. - shape : :class:`ShapeDef` + shape : :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, Dict[required=[shorthand]], :class:`ShapeDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`, Dict Shape of the mark. @@ -5548,7 +14029,7 @@ class FacetedEncoding(VegaLiteSchema): **Default value:** If undefined, the default shape depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#point-config>`__ 's ``shape`` property. ( ``"circle"`` if unset.) - size : :class:`NumericMarkPropDef` + size : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Size of the mark. @@ -5558,7 +14039,7 @@ class FacetedEncoding(VegaLiteSchema): * For ``"text"`` – the text's font size. * Size is unsupported for ``"line"``, ``"area"``, and ``"rect"``. (Use ``"trail"`` instead of line with varying size) - stroke : :class:`ColorDef` + stroke : :class:`ColorDef`, :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, Dict[required=[shorthand]], :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Stroke color of the marks. **Default value:** If undefined, the default color depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``color`` @@ -5566,197 +14047,610 @@ class FacetedEncoding(VegaLiteSchema): *Note:* The ``stroke`` encoding has higher precedence than ``color``, thus may override the ``color`` encoding if conflicting encodings are specified. - strokeDash : :class:`NumericArrayMarkPropDef` + strokeDash : :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, Dict[required=[shorthand]], :class:`NumericArrayMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`, Dict Stroke dash of the marks. **Default value:** ``[1,0]`` (No dash). - strokeOpacity : :class:`NumericMarkPropDef` + strokeOpacity : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Stroke opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``strokeOpacity`` property. - strokeWidth : :class:`NumericMarkPropDef` + strokeWidth : :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Stroke width of the marks. **Default value:** If undefined, the default stroke width depends on `mark config <https://vega.github.io/vega-lite/docs/config.html#mark-config>`__ 's ``strokeWidth`` property. - text : :class:`TextDef` + text : :class:`FieldOrDatumDefWithConditionStringDatumDefText`, Dict, :class:`FieldOrDatumDefWithConditionStringFieldDefText`, Dict[required=[shorthand]], :class:`TextDef`, :class:`ValueDefWithConditionStringFieldDefText`, Dict Text of the ``text`` mark. - theta : :class:`PolarDef` + theta : :class:`PolarDef`, :class:`PositionDatumDefBase`, Dict, :class:`PositionFieldDefBase`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : :class:`Position2Def` + theta2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. - tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, List(:class:`StringFieldDef`), None) + tooltip : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict, None, Sequence[:class:`StringFieldDef`, Dict] The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. See the `tooltip <https://vega.github.io/vega-lite/docs/tooltip.html>`__ documentation for a detailed discussion about tooltip in Vega-Lite. - url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + url : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict The URL of an image mark. - x : :class:`PositionDef` + x : :class:`PositionDatumDef`, Dict, :class:`PositionDef`, :class:`PositionFieldDef`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : :class:`Position2Def` + x2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - xError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + xError : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + xError2 : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Secondary error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - xOffset : :class:`OffsetDef` + xOffset : :class:`OffsetDef`, :class:`ScaleDatumDef`, Dict, :class:`ScaleFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Offset of x-position of the marks - y : :class:`PositionDef` + y : :class:`PositionDatumDef`, Dict, :class:`PositionDef`, :class:`PositionFieldDef`, Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : :class:`Position2Def` + y2 : :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - yError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + yError : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. - yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + yError2 : :class:`SecondaryFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Secondary error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. - yOffset : :class:`OffsetDef` + yOffset : :class:`OffsetDef`, :class:`ScaleDatumDef`, Dict, :class:`ScaleFieldDef`, Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] Offset of y-position of the marks """ - _schema = {'$ref': '#/definitions/FacetedEncoding'} - - def __init__(self, angle=Undefined, color=Undefined, column=Undefined, description=Undefined, - detail=Undefined, facet=Undefined, fill=Undefined, fillOpacity=Undefined, - href=Undefined, key=Undefined, latitude=Undefined, latitude2=Undefined, - longitude=Undefined, longitude2=Undefined, opacity=Undefined, order=Undefined, - radius=Undefined, radius2=Undefined, row=Undefined, shape=Undefined, size=Undefined, - stroke=Undefined, strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, tooltip=Undefined, url=Undefined, - x=Undefined, x2=Undefined, xError=Undefined, xError2=Undefined, xOffset=Undefined, - y=Undefined, y2=Undefined, yError=Undefined, yError2=Undefined, yOffset=Undefined, - **kwds): - super(FacetedEncoding, self).__init__(angle=angle, color=color, column=column, - description=description, detail=detail, facet=facet, - fill=fill, fillOpacity=fillOpacity, href=href, key=key, - latitude=latitude, latitude2=latitude2, - longitude=longitude, longitude2=longitude2, - opacity=opacity, order=order, radius=radius, - radius2=radius2, row=row, shape=shape, size=size, - stroke=stroke, strokeDash=strokeDash, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - text=text, theta=theta, theta2=theta2, tooltip=tooltip, - url=url, x=x, x2=x2, xError=xError, xError2=xError2, - xOffset=xOffset, y=y, y2=y2, yError=yError, - yError2=yError2, yOffset=yOffset, **kwds) + + _schema = {"$ref": "#/definitions/FacetedEncoding"} + + def __init__( + self, + angle: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + "ColorDef", + Union["FieldOrDatumDefWithConditionDatumDefGradientstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + column: Union[ + Union["RowColumnEncodingFieldDef", dict], UndefinedType + ] = Undefined, + description: Union[ + Union[ + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + detail: Union[ + Union[ + Sequence[Union["FieldDefWithoutScale", dict]], + Union["FieldDefWithoutScale", dict], + ], + UndefinedType, + ] = Undefined, + facet: Union[Union["FacetEncodingFieldDef", dict], UndefinedType] = Undefined, + fill: Union[ + Union[ + "ColorDef", + Union["FieldOrDatumDefWithConditionDatumDefGradientstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[ + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + key: Union[Union["FieldDefWithoutScale", dict], UndefinedType] = Undefined, + latitude: Union[ + Union[ + "LatLongDef", Union["DatumDef", dict], Union["LatLongFieldDef", dict] + ], + UndefinedType, + ] = Undefined, + latitude2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + longitude: Union[ + Union[ + "LatLongDef", Union["DatumDef", dict], Union["LatLongFieldDef", dict] + ], + UndefinedType, + ] = Undefined, + longitude2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + opacity: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[ + Sequence[Union["OrderFieldDef", dict]], + Union["OrderFieldDef", dict], + Union["OrderOnlyDef", dict], + Union["OrderValueDef", dict], + ], + UndefinedType, + ] = Undefined, + radius: Union[ + Union[ + "PolarDef", + Union["PositionDatumDefBase", dict], + Union["PositionFieldDefBase", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + radius2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + row: Union[Union["RowColumnEncodingFieldDef", dict], UndefinedType] = Undefined, + shape: Union[ + Union[ + "ShapeDef", + Union["FieldOrDatumDefWithConditionDatumDefstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + stroke: Union[ + Union[ + "ColorDef", + Union["FieldOrDatumDefWithConditionDatumDefGradientstringnull", dict], + Union[ + "FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull", + dict, + ], + Union[ + "ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull", + dict, + ], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[ + "NumericArrayMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumberArray", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray", dict], + ], + UndefinedType, + ] = Undefined, + strokeOpacity: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + strokeWidth: Union[ + Union[ + "NumericMarkPropDef", + Union["FieldOrDatumDefWithConditionDatumDefnumber", dict], + Union["FieldOrDatumDefWithConditionMarkPropFieldDefnumber", dict], + Union["ValueDefWithConditionMarkPropFieldOrDatumDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + text: Union[ + Union[ + "TextDef", + Union["FieldOrDatumDefWithConditionStringDatumDefText", dict], + Union["FieldOrDatumDefWithConditionStringFieldDefText", dict], + Union["ValueDefWithConditionStringFieldDefText", dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[ + "PolarDef", + Union["PositionDatumDefBase", dict], + Union["PositionFieldDefBase", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + theta2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + tooltip: Union[ + Union[ + None, + Sequence[Union["StringFieldDef", dict]], + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[ + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[ + "PositionDef", + Union["PositionDatumDef", dict], + Union["PositionFieldDef", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + x2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + xError: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + xError2: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + xOffset: Union[ + Union[ + "OffsetDef", + Union["ScaleDatumDef", dict], + Union["ScaleFieldDef", dict], + Union["ValueDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + y: Union[ + Union[ + "PositionDef", + Union["PositionDatumDef", dict], + Union["PositionFieldDef", dict], + Union["PositionValueDef", dict], + ], + UndefinedType, + ] = Undefined, + y2: Union[ + Union[ + "Position2Def", + Union["DatumDef", dict], + Union["PositionValueDef", dict], + Union["SecondaryFieldDef", dict], + ], + UndefinedType, + ] = Undefined, + yError: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + yError2: Union[ + Union[Union["SecondaryFieldDef", dict], Union["ValueDefnumber", dict]], + UndefinedType, + ] = Undefined, + yOffset: Union[ + Union[ + "OffsetDef", + Union["ScaleDatumDef", dict], + Union["ScaleFieldDef", dict], + Union["ValueDefnumber", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FacetedEncoding, self).__init__( + angle=angle, + color=color, + column=column, + description=description, + detail=detail, + facet=facet, + fill=fill, + fillOpacity=fillOpacity, + href=href, + key=key, + latitude=latitude, + latitude2=latitude2, + longitude=longitude, + longitude2=longitude2, + opacity=opacity, + order=order, + radius=radius, + radius2=radius2, + row=row, + shape=shape, + size=size, + stroke=stroke, + strokeDash=strokeDash, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + text=text, + theta=theta, + theta2=theta2, + tooltip=tooltip, + url=url, + x=x, + x2=x2, + xError=xError, + xError2=xError2, + xOffset=xOffset, + y=y, + y2=y2, + yError=yError, + yError2=yError2, + yOffset=yOffset, + **kwds, + ) class Feature(VegaLiteSchema): """Feature schema wrapper - Mapping(required=[geometry, properties, type]) + :class:`Feature`, Dict[required=[geometry, properties, type]] A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 Parameters ---------- - geometry : :class:`Geometry` + geometry : :class:`GeometryCollection`, Dict[required=[geometries, type]], :class:`Geometry`, :class:`LineString`, Dict[required=[coordinates, type]], :class:`MultiLineString`, Dict[required=[coordinates, type]], :class:`MultiPoint`, Dict[required=[coordinates, type]], :class:`MultiPolygon`, Dict[required=[coordinates, type]], :class:`Point`, Dict[required=[coordinates, type]], :class:`Polygon`, Dict[required=[coordinates, type]] The feature's geometry - properties : :class:`GeoJsonProperties` + properties : :class:`GeoJsonProperties`, Dict, None Properties associated with this feature. - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 - id : anyOf(string, float) + id : float, str A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. """ - _schema = {'$ref': '#/definitions/Feature'} - def __init__(self, geometry=Undefined, properties=Undefined, type=Undefined, bbox=Undefined, - id=Undefined, **kwds): - super(Feature, self).__init__(geometry=geometry, properties=properties, type=type, bbox=bbox, - id=id, **kwds) + _schema = {"$ref": "#/definitions/Feature"} + + def __init__( + self, + geometry: Union[ + Union[ + "Geometry", + Union["GeometryCollection", dict], + Union["LineString", dict], + Union["MultiLineString", dict], + Union["MultiPoint", dict], + Union["MultiPolygon", dict], + Union["Point", dict], + Union["Polygon", dict], + ], + UndefinedType, + ] = Undefined, + properties: Union[ + Union["GeoJsonProperties", None, dict], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + id: Union[Union[float, str], UndefinedType] = Undefined, + **kwds, + ): + super(Feature, self).__init__( + geometry=geometry, + properties=properties, + type=type, + bbox=bbox, + id=id, + **kwds, + ) class FeatureCollection(VegaLiteSchema): """FeatureCollection schema wrapper - Mapping(required=[features, type]) + :class:`FeatureCollection`, Dict[required=[features, type]] A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3 Parameters ---------- - features : List(:class:`FeatureGeometryGeoJsonProperties`) + features : Sequence[:class:`FeatureGeometryGeoJsonProperties`, Dict[required=[geometry, properties, type]]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/FeatureCollection'} - def __init__(self, features=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(FeatureCollection, self).__init__(features=features, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/FeatureCollection"} + + def __init__( + self, + features: Union[ + Sequence[Union["FeatureGeometryGeoJsonProperties", dict]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(FeatureCollection, self).__init__( + features=features, type=type, bbox=bbox, **kwds + ) class FeatureGeometryGeoJsonProperties(VegaLiteSchema): """FeatureGeometryGeoJsonProperties schema wrapper - Mapping(required=[geometry, properties, type]) + :class:`FeatureGeometryGeoJsonProperties`, Dict[required=[geometry, properties, type]] A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 Parameters ---------- - geometry : :class:`Geometry` + geometry : :class:`GeometryCollection`, Dict[required=[geometries, type]], :class:`Geometry`, :class:`LineString`, Dict[required=[coordinates, type]], :class:`MultiLineString`, Dict[required=[coordinates, type]], :class:`MultiPoint`, Dict[required=[coordinates, type]], :class:`MultiPolygon`, Dict[required=[coordinates, type]], :class:`Point`, Dict[required=[coordinates, type]], :class:`Polygon`, Dict[required=[coordinates, type]] The feature's geometry - properties : :class:`GeoJsonProperties` + properties : :class:`GeoJsonProperties`, Dict, None Properties associated with this feature. - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 - id : anyOf(string, float) + id : float, str A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. """ - _schema = {'$ref': '#/definitions/Feature<Geometry,GeoJsonProperties>'} - def __init__(self, geometry=Undefined, properties=Undefined, type=Undefined, bbox=Undefined, - id=Undefined, **kwds): - super(FeatureGeometryGeoJsonProperties, self).__init__(geometry=geometry, properties=properties, - type=type, bbox=bbox, id=id, **kwds) + _schema = {"$ref": "#/definitions/Feature<Geometry,GeoJsonProperties>"} + + def __init__( + self, + geometry: Union[ + Union[ + "Geometry", + Union["GeometryCollection", dict], + Union["LineString", dict], + Union["MultiLineString", dict], + Union["MultiPoint", dict], + Union["MultiPolygon", dict], + Union["Point", dict], + Union["Polygon", dict], + ], + UndefinedType, + ] = Undefined, + properties: Union[ + Union["GeoJsonProperties", None, dict], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + id: Union[Union[float, str], UndefinedType] = Undefined, + **kwds, + ): + super(FeatureGeometryGeoJsonProperties, self).__init__( + geometry=geometry, + properties=properties, + type=type, + bbox=bbox, + id=id, + **kwds, + ) class Field(VegaLiteSchema): """Field schema wrapper - anyOf(:class:`FieldName`, :class:`RepeatRef`) + :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] """ - _schema = {'$ref': '#/definitions/Field'} + + _schema = {"$ref": "#/definitions/Field"} def __init__(self, *args, **kwds): super(Field, self).__init__(*args, **kwds) @@ -5765,13 +14659,15 @@ def __init__(self, *args, **kwds): class FieldDefWithoutScale(VegaLiteSchema): """FieldDefWithoutScale schema wrapper - Mapping(required=[]) + :class:`FieldDefWithoutScale`, Dict[required=[shorthand]] Definition object for a data field, its type and transformation of an encoding channel. Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -5783,7 +14679,7 @@ class FieldDefWithoutScale(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -5804,7 +14700,7 @@ class FieldDefWithoutScale(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -5819,7 +14715,7 @@ class FieldDefWithoutScale(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -5828,7 +14724,7 @@ class FieldDefWithoutScale(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -5848,7 +14744,7 @@ class FieldDefWithoutScale(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -5918,21 +14814,238 @@ class FieldDefWithoutScale(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldDefWithoutScale'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(FieldDefWithoutScale, self).__init__(aggregate=aggregate, bandPosition=bandPosition, - bin=bin, field=field, timeUnit=timeUnit, title=title, - type=type, **kwds) + _schema = {"$ref": "#/definitions/FieldDefWithoutScale"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldDefWithoutScale, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class FieldName(Field): """FieldName schema wrapper - string + :class:`FieldName`, str """ - _schema = {'$ref': '#/definitions/FieldName'} + + _schema = {"$ref": "#/definitions/FieldName"} def __init__(self, *args): super(FieldName, self).__init__(*args) @@ -5941,12 +15054,12 @@ def __init__(self, *args): class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): """FieldOrDatumDefWithConditionStringFieldDefstring schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionStringFieldDefstring`, Dict Parameters ---------- - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -5958,7 +15071,7 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -5979,14 +15092,14 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringExprRef`, List(:class:`ConditionalValueDefstringExprRef`)) + condition : :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`, Sequence[:class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -6001,7 +15114,7 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -6024,7 +15137,7 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -6035,7 +15148,7 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -6044,7 +15157,7 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -6064,7 +15177,7 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -6134,47 +15247,278 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<StringFieldDef,string>'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionStringFieldDefstring, self).__init__(aggregate=aggregate, - bandPosition=bandPosition, - bin=bin, - condition=condition, - field=field, - format=format, - formatType=formatType, - timeUnit=timeUnit, - title=title, type=type, - **kwds) + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<StringFieldDef,string>" + } + + def __init__( + self, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefstringExprRef", + Union["ConditionalParameterValueDefstringExprRef", dict], + Union["ConditionalPredicateValueDefstringExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefstringExprRef", + Union["ConditionalParameterValueDefstringExprRef", dict], + Union["ConditionalPredicateValueDefstringExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionStringFieldDefstring, self).__init__( + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class FieldRange(VegaLiteSchema): """FieldRange schema wrapper - Mapping(required=[field]) + :class:`FieldRange`, Dict[required=[field]] Parameters ---------- - field : string + field : str """ - _schema = {'$ref': '#/definitions/FieldRange'} - def __init__(self, field=Undefined, **kwds): + _schema = {"$ref": "#/definitions/FieldRange"} + + def __init__(self, field: Union[str, UndefinedType] = Undefined, **kwds): super(FieldRange, self).__init__(field=field, **kwds) class Fit(VegaLiteSchema): """Fit schema wrapper - anyOf(:class:`GeoJsonFeature`, :class:`GeoJsonFeatureCollection`, - List(:class:`GeoJsonFeature`)) + :class:`Fit`, :class:`GeoJsonFeatureCollection`, Dict[required=[features, type]], + :class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]], + Sequence[:class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]]] """ - _schema = {'$ref': '#/definitions/Fit'} + + _schema = {"$ref": "#/definitions/Fit"} def __init__(self, *args, **kwds): super(Fit, self).__init__(*args, **kwds) @@ -6183,9 +15527,10 @@ def __init__(self, *args, **kwds): class FontStyle(VegaLiteSchema): """FontStyle schema wrapper - string + :class:`FontStyle`, str """ - _schema = {'$ref': '#/definitions/FontStyle'} + + _schema = {"$ref": "#/definitions/FontStyle"} def __init__(self, *args): super(FontStyle, self).__init__(*args) @@ -6194,9 +15539,11 @@ def __init__(self, *args): class FontWeight(VegaLiteSchema): """FontWeight schema wrapper - enum('normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900) + :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, + 600, 700, 800, 900] """ - _schema = {'$ref': '#/definitions/FontWeight'} + + _schema = {"$ref": "#/definitions/FontWeight"} def __init__(self, *args): super(FontWeight, self).__init__(*args) @@ -6205,12 +15552,12 @@ def __init__(self, *args): class FormatConfig(VegaLiteSchema): """FormatConfig schema wrapper - Mapping(required=[]) + :class:`FormatConfig`, Dict Parameters ---------- - normalizedNumberFormat : string + normalizedNumberFormat : str If normalizedNumberFormatType is not specified, D3 number format for axis labels, text marks, and tooltips of normalized stacked fields (fields with ``stack: "normalize"`` ). For example ``"s"`` for SI units. Use `D3's number format pattern @@ -6220,7 +15567,7 @@ class FormatConfig(VegaLiteSchema): ``config.customFormatTypes`` is ``true``, this value will be passed as ``format`` alongside ``datum.value`` to the ``config.numberFormatType`` function. **Default value:** ``%`` - normalizedNumberFormatType : string + normalizedNumberFormatType : str `Custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__ for ``config.normalizedNumberFormat``. @@ -6229,7 +15576,7 @@ class FormatConfig(VegaLiteSchema): exposed as `format in Vega-Expression <https://vega.github.io/vega/docs/expressions/#format>`__. **Note:** You must also set ``customFormatTypes`` to ``true`` to use this feature. - numberFormat : string + numberFormat : str If numberFormatType is not specified, D3 number format for guide labels, text marks, and tooltips of non-normalized fields (fields *without* ``stack: "normalize"`` ). For example ``"s"`` for SI units. Use `D3's number format pattern @@ -6238,7 +15585,7 @@ class FormatConfig(VegaLiteSchema): If ``config.numberFormatType`` is specified and ``config.customFormatTypes`` is ``true``, this value will be passed as ``format`` alongside ``datum.value`` to the ``config.numberFormatType`` function. - numberFormatType : string + numberFormatType : str `Custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__ for ``config.numberFormat``. @@ -6247,13 +15594,13 @@ class FormatConfig(VegaLiteSchema): exposed as `format in Vega-Expression <https://vega.github.io/vega/docs/expressions/#format>`__. **Note:** You must also set ``customFormatTypes`` to ``true`` to use this feature. - timeFormat : string + timeFormat : str Default time format for raw time values (without time units) in text marks, legend labels and header labels. **Default value:** ``"%b %d, %Y"`` **Note:** Axes automatically determine the format for each label automatically so this config does not affect axes. - timeFormatType : string + timeFormatType : str `Custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__ for ``config.timeFormat``. @@ -6264,23 +15611,39 @@ class FormatConfig(VegaLiteSchema): also set ``customFormatTypes`` to ``true`` and there must *not* be a ``timeUnit`` defined to use this feature. """ - _schema = {'$ref': '#/definitions/FormatConfig'} - def __init__(self, normalizedNumberFormat=Undefined, normalizedNumberFormatType=Undefined, - numberFormat=Undefined, numberFormatType=Undefined, timeFormat=Undefined, - timeFormatType=Undefined, **kwds): - super(FormatConfig, self).__init__(normalizedNumberFormat=normalizedNumberFormat, - normalizedNumberFormatType=normalizedNumberFormatType, - numberFormat=numberFormat, numberFormatType=numberFormatType, - timeFormat=timeFormat, timeFormatType=timeFormatType, **kwds) + _schema = {"$ref": "#/definitions/FormatConfig"} + + def __init__( + self, + normalizedNumberFormat: Union[str, UndefinedType] = Undefined, + normalizedNumberFormatType: Union[str, UndefinedType] = Undefined, + numberFormat: Union[str, UndefinedType] = Undefined, + numberFormatType: Union[str, UndefinedType] = Undefined, + timeFormat: Union[str, UndefinedType] = Undefined, + timeFormatType: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(FormatConfig, self).__init__( + normalizedNumberFormat=normalizedNumberFormat, + normalizedNumberFormatType=normalizedNumberFormatType, + numberFormat=numberFormat, + numberFormatType=numberFormatType, + timeFormat=timeFormat, + timeFormatType=timeFormatType, + **kwds, + ) class Generator(Data): """Generator schema wrapper - anyOf(:class:`SequenceGenerator`, :class:`SphereGenerator`, :class:`GraticuleGenerator`) + :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], + :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, + Dict[required=[sphere]] """ - _schema = {'$ref': '#/definitions/Generator'} + + _schema = {"$ref": "#/definitions/Generator"} def __init__(self, *args, **kwds): super(Generator, self).__init__(*args, **kwds) @@ -6289,110 +15652,256 @@ def __init__(self, *args, **kwds): class GenericUnitSpecEncodingAnyMark(VegaLiteSchema): """GenericUnitSpecEncodingAnyMark schema wrapper - Mapping(required=[mark]) + :class:`GenericUnitSpecEncodingAnyMark`, Dict[required=[mark]] Base interface for a unit (single-view) specification. Parameters ---------- - mark : :class:`AnyMark` + mark : :class:`AnyMark`, :class:`BoxPlotDef`, Dict[required=[type]], :class:`CompositeMarkDef`, :class:`ErrorBandDef`, Dict[required=[type]], :class:`ErrorBarDef`, Dict[required=[type]], :class:`BoxPlot`, str, :class:`CompositeMark`, :class:`ErrorBand`, str, :class:`ErrorBar`, str, :class:`MarkDef`, Dict[required=[type]], :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark definition object <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - encoding : :class:`Encoding` + encoding : :class:`Encoding`, Dict A key-value mapping between encoding channels and definition of fields. - name : string + name : str Name of the visualization for later reference. - params : List(:class:`SelectionParameter`) + params : Sequence[:class:`SelectionParameter`, Dict[required=[name, select]]] An array of parameters that may either be simple variables, or more complex selections that map user input to data queries. - projection : :class:`Projection` + projection : :class:`Projection`, Dict An object defining properties of geographic projection, which will be applied to ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` channels for other marks. - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/GenericUnitSpec<Encoding,AnyMark>'} - def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, - name=Undefined, params=Undefined, projection=Undefined, title=Undefined, - transform=Undefined, **kwds): - super(GenericUnitSpecEncodingAnyMark, self).__init__(mark=mark, data=data, - description=description, encoding=encoding, - name=name, params=params, - projection=projection, title=title, - transform=transform, **kwds) + _schema = {"$ref": "#/definitions/GenericUnitSpec<Encoding,AnyMark>"} + + def __init__( + self, + mark: Union[ + Union[ + "AnyMark", + Union[ + "CompositeMark", + Union["BoxPlot", str], + Union["ErrorBand", str], + Union["ErrorBar", str], + ], + Union[ + "CompositeMarkDef", + Union["BoxPlotDef", dict], + Union["ErrorBandDef", dict], + Union["ErrorBarDef", dict], + ], + Union[ + "Mark", + Literal[ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape", + ], + ], + Union["MarkDef", dict], + ], + UndefinedType, + ] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + encoding: Union[Union["Encoding", dict], UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + params: Union[ + Sequence[Union["SelectionParameter", dict]], UndefinedType + ] = Undefined, + projection: Union[Union["Projection", dict], UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(GenericUnitSpecEncodingAnyMark, self).__init__( + mark=mark, + data=data, + description=description, + encoding=encoding, + name=name, + params=params, + projection=projection, + title=title, + transform=transform, + **kwds, + ) class GeoJsonFeature(Fit): """GeoJsonFeature schema wrapper - Mapping(required=[geometry, properties, type]) + :class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]] A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2 Parameters ---------- - geometry : :class:`Geometry` + geometry : :class:`GeometryCollection`, Dict[required=[geometries, type]], :class:`Geometry`, :class:`LineString`, Dict[required=[coordinates, type]], :class:`MultiLineString`, Dict[required=[coordinates, type]], :class:`MultiPoint`, Dict[required=[coordinates, type]], :class:`MultiPolygon`, Dict[required=[coordinates, type]], :class:`Point`, Dict[required=[coordinates, type]], :class:`Polygon`, Dict[required=[coordinates, type]] The feature's geometry - properties : :class:`GeoJsonProperties` + properties : :class:`GeoJsonProperties`, Dict, None Properties associated with this feature. - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 - id : anyOf(string, float) + id : float, str A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. """ - _schema = {'$ref': '#/definitions/GeoJsonFeature'} - def __init__(self, geometry=Undefined, properties=Undefined, type=Undefined, bbox=Undefined, - id=Undefined, **kwds): - super(GeoJsonFeature, self).__init__(geometry=geometry, properties=properties, type=type, - bbox=bbox, id=id, **kwds) + _schema = {"$ref": "#/definitions/GeoJsonFeature"} + + def __init__( + self, + geometry: Union[ + Union[ + "Geometry", + Union["GeometryCollection", dict], + Union["LineString", dict], + Union["MultiLineString", dict], + Union["MultiPoint", dict], + Union["MultiPolygon", dict], + Union["Point", dict], + Union["Polygon", dict], + ], + UndefinedType, + ] = Undefined, + properties: Union[ + Union["GeoJsonProperties", None, dict], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + id: Union[Union[float, str], UndefinedType] = Undefined, + **kwds, + ): + super(GeoJsonFeature, self).__init__( + geometry=geometry, + properties=properties, + type=type, + bbox=bbox, + id=id, + **kwds, + ) class GeoJsonFeatureCollection(Fit): """GeoJsonFeatureCollection schema wrapper - Mapping(required=[features, type]) + :class:`GeoJsonFeatureCollection`, Dict[required=[features, type]] A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3 Parameters ---------- - features : List(:class:`FeatureGeometryGeoJsonProperties`) + features : Sequence[:class:`FeatureGeometryGeoJsonProperties`, Dict[required=[geometry, properties, type]]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/GeoJsonFeatureCollection'} - def __init__(self, features=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(GeoJsonFeatureCollection, self).__init__(features=features, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/GeoJsonFeatureCollection"} + + def __init__( + self, + features: Union[ + Sequence[Union["FeatureGeometryGeoJsonProperties", dict]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(GeoJsonFeatureCollection, self).__init__( + features=features, type=type, bbox=bbox, **kwds + ) class GeoJsonProperties(VegaLiteSchema): """GeoJsonProperties schema wrapper - anyOf(Mapping(required=[]), None) + :class:`GeoJsonProperties`, Dict, None """ - _schema = {'$ref': '#/definitions/GeoJsonProperties'} + + _schema = {"$ref": "#/definitions/GeoJsonProperties"} def __init__(self, *args, **kwds): super(GeoJsonProperties, self).__init__(*args, **kwds) @@ -6401,11 +15910,15 @@ def __init__(self, *args, **kwds): class Geometry(VegaLiteSchema): """Geometry schema wrapper - anyOf(:class:`Point`, :class:`MultiPoint`, :class:`LineString`, :class:`MultiLineString`, - :class:`Polygon`, :class:`MultiPolygon`, :class:`GeometryCollection`) + :class:`GeometryCollection`, Dict[required=[geometries, type]], :class:`Geometry`, + :class:`LineString`, Dict[required=[coordinates, type]], :class:`MultiLineString`, + Dict[required=[coordinates, type]], :class:`MultiPoint`, Dict[required=[coordinates, type]], + :class:`MultiPolygon`, Dict[required=[coordinates, type]], :class:`Point`, + Dict[required=[coordinates, type]], :class:`Polygon`, Dict[required=[coordinates, type]] Union of geometry objects. https://tools.ietf.org/html/rfc7946#section-3 """ - _schema = {'$ref': '#/definitions/Geometry'} + + _schema = {"$ref": "#/definitions/Geometry"} def __init__(self, *args, **kwds): super(Geometry, self).__init__(*args, **kwds) @@ -6414,32 +15927,57 @@ def __init__(self, *args, **kwds): class GeometryCollection(Geometry): """GeometryCollection schema wrapper - Mapping(required=[geometries, type]) + :class:`GeometryCollection`, Dict[required=[geometries, type]] Geometry Collection https://tools.ietf.org/html/rfc7946#section-3.1.8 Parameters ---------- - geometries : List(:class:`Geometry`) + geometries : Sequence[:class:`GeometryCollection`, Dict[required=[geometries, type]], :class:`Geometry`, :class:`LineString`, Dict[required=[coordinates, type]], :class:`MultiLineString`, Dict[required=[coordinates, type]], :class:`MultiPoint`, Dict[required=[coordinates, type]], :class:`MultiPolygon`, Dict[required=[coordinates, type]], :class:`Point`, Dict[required=[coordinates, type]], :class:`Polygon`, Dict[required=[coordinates, type]]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/GeometryCollection'} - def __init__(self, geometries=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(GeometryCollection, self).__init__(geometries=geometries, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/GeometryCollection"} + + def __init__( + self, + geometries: Union[ + Sequence[ + Union[ + "Geometry", + Union["GeometryCollection", dict], + Union["LineString", dict], + Union["MultiLineString", dict], + Union["MultiPoint", dict], + Union["MultiPolygon", dict], + Union["Point", dict], + Union["Polygon", dict], + ] + ], + UndefinedType, + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(GeometryCollection, self).__init__( + geometries=geometries, type=type, bbox=bbox, **kwds + ) class Gradient(VegaLiteSchema): """Gradient schema wrapper - anyOf(:class:`LinearGradient`, :class:`RadialGradient`) + :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], + :class:`RadialGradient`, Dict[required=[gradient, stops]] """ - _schema = {'$ref': '#/definitions/Gradient'} + + _schema = {"$ref": "#/definitions/Gradient"} def __init__(self, *args, **kwds): super(Gradient, self).__init__(*args, **kwds) @@ -6448,89 +15986,302 @@ def __init__(self, *args, **kwds): class GradientStop(VegaLiteSchema): """GradientStop schema wrapper - Mapping(required=[offset, color]) + :class:`GradientStop`, Dict[required=[offset, color]] Parameters ---------- - color : :class:`Color` + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str The color value at this point in the gradient. offset : float The offset fraction for the color stop, indicating its position within the gradient. """ - _schema = {'$ref': '#/definitions/GradientStop'} - def __init__(self, color=Undefined, offset=Undefined, **kwds): + _schema = {"$ref": "#/definitions/GradientStop"} + + def __init__( + self, + color: Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + UndefinedType, + ] = Undefined, + offset: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(GradientStop, self).__init__(color=color, offset=offset, **kwds) class GraticuleGenerator(Generator): """GraticuleGenerator schema wrapper - Mapping(required=[graticule]) + :class:`GraticuleGenerator`, Dict[required=[graticule]] Parameters ---------- - graticule : anyOf(boolean, :class:`GraticuleParams`) + graticule : :class:`GraticuleParams`, Dict, bool Generate graticule GeoJSON data for geographic reference lines. - name : string + name : str Provide a placeholder name and bind data at runtime. """ - _schema = {'$ref': '#/definitions/GraticuleGenerator'} - def __init__(self, graticule=Undefined, name=Undefined, **kwds): + _schema = {"$ref": "#/definitions/GraticuleGenerator"} + + def __init__( + self, + graticule: Union[ + Union[Union["GraticuleParams", dict], bool], UndefinedType + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + **kwds, + ): super(GraticuleGenerator, self).__init__(graticule=graticule, name=name, **kwds) class GraticuleParams(VegaLiteSchema): """GraticuleParams schema wrapper - Mapping(required=[]) + :class:`GraticuleParams`, Dict Parameters ---------- - extent : :class:`Vector2Vector2number` + extent : :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] Sets both the major and minor extents to the same values. - extentMajor : :class:`Vector2Vector2number` + extentMajor : :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] The major extent of the graticule as a two-element array of coordinates. - extentMinor : :class:`Vector2Vector2number` + extentMinor : :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] The minor extent of the graticule as a two-element array of coordinates. precision : float The precision of the graticule in degrees. **Default value:** ``2.5`` - step : :class:`Vector2number` + step : :class:`Vector2number`, Sequence[float] Sets both the major and minor step angles to the same values. - stepMajor : :class:`Vector2number` + stepMajor : :class:`Vector2number`, Sequence[float] The major step angles of the graticule. **Default value:** ``[90, 360]`` - stepMinor : :class:`Vector2number` + stepMinor : :class:`Vector2number`, Sequence[float] The minor step angles of the graticule. **Default value:** ``[10, 10]`` """ - _schema = {'$ref': '#/definitions/GraticuleParams'} - def __init__(self, extent=Undefined, extentMajor=Undefined, extentMinor=Undefined, - precision=Undefined, step=Undefined, stepMajor=Undefined, stepMinor=Undefined, **kwds): - super(GraticuleParams, self).__init__(extent=extent, extentMajor=extentMajor, - extentMinor=extentMinor, precision=precision, step=step, - stepMajor=stepMajor, stepMinor=stepMinor, **kwds) + _schema = {"$ref": "#/definitions/GraticuleParams"} + + def __init__( + self, + extent: Union[ + Union[ + "Vector2Vector2number", + Sequence[Union["Vector2number", Sequence[float]]], + ], + UndefinedType, + ] = Undefined, + extentMajor: Union[ + Union[ + "Vector2Vector2number", + Sequence[Union["Vector2number", Sequence[float]]], + ], + UndefinedType, + ] = Undefined, + extentMinor: Union[ + Union[ + "Vector2Vector2number", + Sequence[Union["Vector2number", Sequence[float]]], + ], + UndefinedType, + ] = Undefined, + precision: Union[float, UndefinedType] = Undefined, + step: Union[Union["Vector2number", Sequence[float]], UndefinedType] = Undefined, + stepMajor: Union[ + Union["Vector2number", Sequence[float]], UndefinedType + ] = Undefined, + stepMinor: Union[ + Union["Vector2number", Sequence[float]], UndefinedType + ] = Undefined, + **kwds, + ): + super(GraticuleParams, self).__init__( + extent=extent, + extentMajor=extentMajor, + extentMinor=extentMinor, + precision=precision, + step=step, + stepMajor=stepMajor, + stepMinor=stepMinor, + **kwds, + ) class Header(VegaLiteSchema): """Header schema wrapper - Mapping(required=[]) + :class:`Header`, Dict Headers of row / column channels for faceted plots. Parameters ---------- - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -6553,7 +16304,7 @@ class Header(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -6564,10 +16315,10 @@ class Header(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + labelAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment of header labels. One of ``"left"``, ``"center"``, or ``"right"``. - labelAnchor : :class:`TitleAnchor` + labelAnchor : :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] The anchor position for placing the labels. One of ``"start"``, ``"middle"``, or ``"end"``. For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label. @@ -6575,50 +16326,50 @@ class Header(VegaLiteSchema): The rotation angle of the header labels. **Default value:** ``0`` for column header, ``-90`` for row header. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + labelBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] The vertical text baseline for the header labels. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than ``titleFontSize`` alone. - labelColor : anyOf(:class:`Color`, :class:`ExprRef`) + labelColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] The color of the header label, can be in hex color code or regular color name. - labelExpr : string + labelExpr : str `Vega expression <https://vega.github.io/vega/docs/expressions/>`__ for customizing labels. **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the header's backing ``datum`` object. - labelFont : anyOf(string, :class:`ExprRef`) + labelFont : :class:`ExprRef`, Dict[required=[expr]], str The font of the header label. - labelFontSize : anyOf(float, :class:`ExprRef`) + labelFontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size of the header label, in pixels. - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + labelFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of the header label. - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + labelFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight of the header label. - labelLimit : anyOf(float, :class:`ExprRef`) + labelLimit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0``, indicating no limit - labelLineHeight : anyOf(float, :class:`ExprRef`) + labelLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line header labels or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - labelOrient : :class:`Orient` + labelOrient : :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or ``"right"``. - labelPadding : anyOf(float, :class:`ExprRef`) + labelPadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixel, between facet header's label and the plot. **Default value:** ``10`` - labels : boolean + labels : bool A boolean flag indicating if labels should be included as part of the header. **Default value:** ``true``. - orient : :class:`Orient` + orient : :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] Shortcut for setting both labelOrient and titleOrient. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -6638,9 +16389,9 @@ class Header(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + titleAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment (to the anchor) of header titles. - titleAnchor : :class:`TitleAnchor` + titleAnchor : :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] The anchor position for placing the title. One of ``"start"``, ``"middle"``, or ``"end"``. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title. @@ -6648,7 +16399,7 @@ class Header(VegaLiteSchema): The rotation angle of the header title. **Default value:** ``0``. - titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + titleBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] The vertical text baseline for the header title. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and @@ -6656,73 +16407,561 @@ class Header(VegaLiteSchema): ``titleFontSize`` alone. **Default value:** ``"middle"`` - titleColor : anyOf(:class:`Color`, :class:`ExprRef`) + titleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] Color of the header title, can be in hex color code or regular color name. - titleFont : anyOf(string, :class:`ExprRef`) + titleFont : :class:`ExprRef`, Dict[required=[expr]], str Font of the header title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : anyOf(float, :class:`ExprRef`) + titleFontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size of the header title. - titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + titleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of the header title. - titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + titleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight of the header title. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - titleLimit : anyOf(float, :class:`ExprRef`) + titleLimit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0``, indicating no limit - titleLineHeight : anyOf(float, :class:`ExprRef`) + titleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line header title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - titleOrient : :class:`Orient` + titleOrient : :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or ``"right"``. - titlePadding : anyOf(float, :class:`ExprRef`) + titlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixel, between facet header's title and the label. **Default value:** ``10`` """ - _schema = {'$ref': '#/definitions/Header'} - - def __init__(self, format=Undefined, formatType=Undefined, labelAlign=Undefined, - labelAnchor=Undefined, labelAngle=Undefined, labelBaseline=Undefined, - labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, - labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, - labelLimit=Undefined, labelLineHeight=Undefined, labelOrient=Undefined, - labelPadding=Undefined, labels=Undefined, orient=Undefined, title=Undefined, - titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, - titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, - titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, - titleLimit=Undefined, titleLineHeight=Undefined, titleOrient=Undefined, - titlePadding=Undefined, **kwds): - super(Header, self).__init__(format=format, formatType=formatType, labelAlign=labelAlign, - labelAnchor=labelAnchor, labelAngle=labelAngle, - labelBaseline=labelBaseline, labelColor=labelColor, - labelExpr=labelExpr, labelFont=labelFont, - labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, - labelFontWeight=labelFontWeight, labelLimit=labelLimit, - labelLineHeight=labelLineHeight, labelOrient=labelOrient, - labelPadding=labelPadding, labels=labels, orient=orient, - title=title, titleAlign=titleAlign, titleAnchor=titleAnchor, - titleAngle=titleAngle, titleBaseline=titleBaseline, - titleColor=titleColor, titleFont=titleFont, - titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, - titleFontWeight=titleFontWeight, titleLimit=titleLimit, - titleLineHeight=titleLineHeight, titleOrient=titleOrient, - titlePadding=titlePadding, **kwds) + + _schema = {"$ref": "#/definitions/Header"} + + def __init__( + self, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + labelAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelAnchor: Union[ + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], UndefinedType + ] = Undefined, + labelAngle: Union[float, UndefinedType] = Undefined, + labelBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOrient: Union[ + Union["Orient", Literal["left", "right", "top", "bottom"]], UndefinedType + ] = Undefined, + labelPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + orient: Union[ + Union["Orient", Literal["left", "right", "top", "bottom"]], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], UndefinedType + ] = Undefined, + titleAngle: Union[float, UndefinedType] = Undefined, + titleBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union["Orient", Literal["left", "right", "top", "bottom"]], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(Header, self).__init__( + format=format, + formatType=formatType, + labelAlign=labelAlign, + labelAnchor=labelAnchor, + labelAngle=labelAngle, + labelBaseline=labelBaseline, + labelColor=labelColor, + labelExpr=labelExpr, + labelFont=labelFont, + labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, + labelLimit=labelLimit, + labelLineHeight=labelLineHeight, + labelOrient=labelOrient, + labelPadding=labelPadding, + labels=labels, + orient=orient, + title=title, + titleAlign=titleAlign, + titleAnchor=titleAnchor, + titleAngle=titleAngle, + titleBaseline=titleBaseline, + titleColor=titleColor, + titleFont=titleFont, + titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, + titleLimit=titleLimit, + titleLineHeight=titleLineHeight, + titleOrient=titleOrient, + titlePadding=titlePadding, + **kwds, + ) class HeaderConfig(VegaLiteSchema): """HeaderConfig schema wrapper - Mapping(required=[]) + :class:`HeaderConfig`, Dict Parameters ---------- - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -6745,7 +16984,7 @@ class HeaderConfig(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -6756,10 +16995,10 @@ class HeaderConfig(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + labelAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment of header labels. One of ``"left"``, ``"center"``, or ``"right"``. - labelAnchor : :class:`TitleAnchor` + labelAnchor : :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] The anchor position for placing the labels. One of ``"start"``, ``"middle"``, or ``"end"``. For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label. @@ -6767,54 +17006,54 @@ class HeaderConfig(VegaLiteSchema): The rotation angle of the header labels. **Default value:** ``0`` for column header, ``-90`` for row header. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + labelBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] The vertical text baseline for the header labels. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than ``titleFontSize`` alone. - labelColor : anyOf(:class:`Color`, :class:`ExprRef`) + labelColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] The color of the header label, can be in hex color code or regular color name. - labelExpr : string + labelExpr : str `Vega expression <https://vega.github.io/vega/docs/expressions/>`__ for customizing labels. **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the header's backing ``datum`` object. - labelFont : anyOf(string, :class:`ExprRef`) + labelFont : :class:`ExprRef`, Dict[required=[expr]], str The font of the header label. - labelFontSize : anyOf(float, :class:`ExprRef`) + labelFontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size of the header label, in pixels. - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + labelFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of the header label. - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + labelFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight of the header label. - labelLimit : anyOf(float, :class:`ExprRef`) + labelLimit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0``, indicating no limit - labelLineHeight : anyOf(float, :class:`ExprRef`) + labelLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line header labels or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - labelOrient : :class:`Orient` + labelOrient : :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or ``"right"``. - labelPadding : anyOf(float, :class:`ExprRef`) + labelPadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixel, between facet header's label and the plot. **Default value:** ``10`` - labels : boolean + labels : bool A boolean flag indicating if labels should be included as part of the header. **Default value:** ``true``. - orient : :class:`Orient` + orient : :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] Shortcut for setting both labelOrient and titleOrient. title : None Set to null to disable title for the axis, legend, or header. - titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + titleAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment (to the anchor) of header titles. - titleAnchor : :class:`TitleAnchor` + titleAnchor : :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] The anchor position for placing the title. One of ``"start"``, ``"middle"``, or ``"end"``. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title. @@ -6822,7 +17061,7 @@ class HeaderConfig(VegaLiteSchema): The rotation angle of the header title. **Default value:** ``0``. - titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + titleBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] The vertical text baseline for the header title. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and @@ -6830,70 +17069,557 @@ class HeaderConfig(VegaLiteSchema): ``titleFontSize`` alone. **Default value:** ``"middle"`` - titleColor : anyOf(:class:`Color`, :class:`ExprRef`) + titleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] Color of the header title, can be in hex color code or regular color name. - titleFont : anyOf(string, :class:`ExprRef`) + titleFont : :class:`ExprRef`, Dict[required=[expr]], str Font of the header title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : anyOf(float, :class:`ExprRef`) + titleFontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size of the header title. - titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + titleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of the header title. - titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + titleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight of the header title. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - titleLimit : anyOf(float, :class:`ExprRef`) + titleLimit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0``, indicating no limit - titleLineHeight : anyOf(float, :class:`ExprRef`) + titleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line header title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - titleOrient : :class:`Orient` + titleOrient : :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or ``"right"``. - titlePadding : anyOf(float, :class:`ExprRef`) + titlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixel, between facet header's title and the label. **Default value:** ``10`` """ - _schema = {'$ref': '#/definitions/HeaderConfig'} - - def __init__(self, format=Undefined, formatType=Undefined, labelAlign=Undefined, - labelAnchor=Undefined, labelAngle=Undefined, labelBaseline=Undefined, - labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, - labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, - labelLimit=Undefined, labelLineHeight=Undefined, labelOrient=Undefined, - labelPadding=Undefined, labels=Undefined, orient=Undefined, title=Undefined, - titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, - titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, - titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, - titleLimit=Undefined, titleLineHeight=Undefined, titleOrient=Undefined, - titlePadding=Undefined, **kwds): - super(HeaderConfig, self).__init__(format=format, formatType=formatType, labelAlign=labelAlign, - labelAnchor=labelAnchor, labelAngle=labelAngle, - labelBaseline=labelBaseline, labelColor=labelColor, - labelExpr=labelExpr, labelFont=labelFont, - labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, - labelFontWeight=labelFontWeight, labelLimit=labelLimit, - labelLineHeight=labelLineHeight, labelOrient=labelOrient, - labelPadding=labelPadding, labels=labels, orient=orient, - title=title, titleAlign=titleAlign, titleAnchor=titleAnchor, - titleAngle=titleAngle, titleBaseline=titleBaseline, - titleColor=titleColor, titleFont=titleFont, - titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, - titleFontWeight=titleFontWeight, titleLimit=titleLimit, - titleLineHeight=titleLineHeight, titleOrient=titleOrient, - titlePadding=titlePadding, **kwds) + + _schema = {"$ref": "#/definitions/HeaderConfig"} + + def __init__( + self, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + labelAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelAnchor: Union[ + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], UndefinedType + ] = Undefined, + labelAngle: Union[float, UndefinedType] = Undefined, + labelBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOrient: Union[ + Union["Orient", Literal["left", "right", "top", "bottom"]], UndefinedType + ] = Undefined, + labelPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labels: Union[bool, UndefinedType] = Undefined, + orient: Union[ + Union["Orient", Literal["left", "right", "top", "bottom"]], UndefinedType + ] = Undefined, + title: Union[None, UndefinedType] = Undefined, + titleAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], UndefinedType + ] = Undefined, + titleAngle: Union[float, UndefinedType] = Undefined, + titleBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union["Orient", Literal["left", "right", "top", "bottom"]], UndefinedType + ] = Undefined, + titlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(HeaderConfig, self).__init__( + format=format, + formatType=formatType, + labelAlign=labelAlign, + labelAnchor=labelAnchor, + labelAngle=labelAngle, + labelBaseline=labelBaseline, + labelColor=labelColor, + labelExpr=labelExpr, + labelFont=labelFont, + labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, + labelLimit=labelLimit, + labelLineHeight=labelLineHeight, + labelOrient=labelOrient, + labelPadding=labelPadding, + labels=labels, + orient=orient, + title=title, + titleAlign=titleAlign, + titleAnchor=titleAnchor, + titleAngle=titleAngle, + titleBaseline=titleBaseline, + titleColor=titleColor, + titleFont=titleFont, + titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, + titleLimit=titleLimit, + titleLineHeight=titleLineHeight, + titleOrient=titleOrient, + titlePadding=titlePadding, + **kwds, + ) class HexColor(Color): """HexColor schema wrapper - string + :class:`HexColor`, str """ - _schema = {'$ref': '#/definitions/HexColor'} + + _schema = {"$ref": "#/definitions/HexColor"} def __init__(self, *args): super(HexColor, self).__init__(*args) @@ -6902,9 +17628,10 @@ def __init__(self, *args): class ImputeMethod(VegaLiteSchema): """ImputeMethod schema wrapper - enum('value', 'median', 'max', 'min', 'mean') + :class:`ImputeMethod`, Literal['value', 'median', 'max', 'min', 'mean'] """ - _schema = {'$ref': '#/definitions/ImputeMethod'} + + _schema = {"$ref": "#/definitions/ImputeMethod"} def __init__(self, *args): super(ImputeMethod, self).__init__(*args) @@ -6913,12 +17640,12 @@ def __init__(self, *args): class ImputeParams(VegaLiteSchema): """ImputeParams schema wrapper - Mapping(required=[]) + :class:`ImputeParams`, Dict Parameters ---------- - frame : List(anyOf(None, float)) + frame : Sequence[None, float] A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded @@ -6928,7 +17655,7 @@ class ImputeParams(VegaLiteSchema): **Default value:** : ``[null, null]`` indicating that the window includes all objects. - keyvals : anyOf(List(Any), :class:`ImputeSequence`) + keyvals : :class:`ImputeSequence`, Dict[required=[stop]], Sequence[Any] Defines the key values that should be considered for imputation. An array of key values or an object defining a `number sequence <https://vega.github.io/vega-lite/docs/impute.html#sequence-def>`__. @@ -6939,7 +17666,7 @@ class ImputeParams(VegaLiteSchema): the y-field is imputed, or vice versa. If there is no impute grouping, this property *must* be specified. - method : :class:`ImputeMethod` + method : :class:`ImputeMethod`, Literal['value', 'median', 'max', 'min', 'mean'] The imputation method to use for the field value of imputed data objects. One of ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. @@ -6947,17 +17674,31 @@ class ImputeParams(VegaLiteSchema): value : Any The field value to use when the imputation ``method`` is ``"value"``. """ - _schema = {'$ref': '#/definitions/ImputeParams'} - def __init__(self, frame=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds): - super(ImputeParams, self).__init__(frame=frame, keyvals=keyvals, method=method, value=value, - **kwds) + _schema = {"$ref": "#/definitions/ImputeParams"} + + def __init__( + self, + frame: Union[Sequence[Union[None, float]], UndefinedType] = Undefined, + keyvals: Union[ + Union[Sequence[Any], Union["ImputeSequence", dict]], UndefinedType + ] = Undefined, + method: Union[ + Union["ImputeMethod", Literal["value", "median", "max", "min", "mean"]], + UndefinedType, + ] = Undefined, + value: Union[Any, UndefinedType] = Undefined, + **kwds, + ): + super(ImputeParams, self).__init__( + frame=frame, keyvals=keyvals, method=method, value=value, **kwds + ) class ImputeSequence(VegaLiteSchema): """ImputeSequence schema wrapper - Mapping(required=[stop]) + :class:`ImputeSequence`, Dict[required=[stop]] Parameters ---------- @@ -6970,42 +17711,79 @@ class ImputeSequence(VegaLiteSchema): The step value between sequence entries. **Default value:** ``1`` or ``-1`` if ``stop < start`` """ - _schema = {'$ref': '#/definitions/ImputeSequence'} - def __init__(self, stop=Undefined, start=Undefined, step=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ImputeSequence"} + + def __init__( + self, + stop: Union[float, UndefinedType] = Undefined, + start: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(ImputeSequence, self).__init__(stop=stop, start=start, step=step, **kwds) class InlineData(DataSource): """InlineData schema wrapper - Mapping(required=[values]) + :class:`InlineData`, Dict[required=[values]] Parameters ---------- - values : :class:`InlineDataset` + values : :class:`InlineDataset`, Dict, Sequence[Dict], Sequence[bool], Sequence[float], Sequence[str], str The full data set, included inline. This can be an array of objects or primitive values, an object, or a string. Arrays of primitive values are ingested as objects with a ``data`` property. Strings are parsed according to the specified format type. - format : :class:`DataFormat` + format : :class:`CsvDataFormat`, Dict, :class:`DataFormat`, :class:`DsvDataFormat`, Dict[required=[delimiter]], :class:`JsonDataFormat`, Dict, :class:`TopoDataFormat`, Dict An object that specifies the format for parsing the data. - name : string + name : str Provide a placeholder name and bind data at runtime. """ - _schema = {'$ref': '#/definitions/InlineData'} - def __init__(self, values=Undefined, format=Undefined, name=Undefined, **kwds): - super(InlineData, self).__init__(values=values, format=format, name=name, **kwds) + _schema = {"$ref": "#/definitions/InlineData"} + + def __init__( + self, + values: Union[ + Union[ + "InlineDataset", + Sequence[bool], + Sequence[dict], + Sequence[float], + Sequence[str], + dict, + str, + ], + UndefinedType, + ] = Undefined, + format: Union[ + Union[ + "DataFormat", + Union["CsvDataFormat", dict], + Union["DsvDataFormat", dict], + Union["JsonDataFormat", dict], + Union["TopoDataFormat", dict], + ], + UndefinedType, + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(InlineData, self).__init__( + values=values, format=format, name=name, **kwds + ) class InlineDataset(VegaLiteSchema): """InlineDataset schema wrapper - anyOf(List(float), List(string), List(boolean), List(Mapping(required=[])), string, - Mapping(required=[])) + :class:`InlineDataset`, Dict, Sequence[Dict], Sequence[bool], Sequence[float], + Sequence[str], str """ - _schema = {'$ref': '#/definitions/InlineDataset'} + + _schema = {"$ref": "#/definitions/InlineDataset"} def __init__(self, *args, **kwds): super(InlineDataset, self).__init__(*args, **kwds) @@ -7014,11 +17792,12 @@ def __init__(self, *args, **kwds): class Interpolate(VegaLiteSchema): """Interpolate schema wrapper - enum('basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', - 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', - 'step-before', 'step-after') + :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', + 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', + 'natural', 'step', 'step-before', 'step-after'] """ - _schema = {'$ref': '#/definitions/Interpolate'} + + _schema = {"$ref": "#/definitions/Interpolate"} def __init__(self, *args): super(Interpolate, self).__init__(*args) @@ -7027,12 +17806,12 @@ def __init__(self, *args): class IntervalSelectionConfig(VegaLiteSchema): """IntervalSelectionConfig schema wrapper - Mapping(required=[type]) + :class:`IntervalSelectionConfig`, Dict[required=[type]] Parameters ---------- - type : string + type : str Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types: @@ -7040,7 +17819,7 @@ class IntervalSelectionConfig(VegaLiteSchema): * ``"point"`` -- to select multiple discrete data values; the first value is selected on ``click`` and additional values toggled on shift-click. * ``"interval"`` -- to select a continuous range of data values on ``drag``. - clear : anyOf(:class:`Stream`, string, boolean) + clear : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, bool, str Clears the selection, emptying it of all values. This property can be a `Event Stream <https://vega.github.io/vega/docs/event-streams/>`__ or ``false`` to disable clear. @@ -7050,27 +17829,27 @@ class IntervalSelectionConfig(VegaLiteSchema): **See also:** `clear examples <https://vega.github.io/vega-lite/docs/selection.html#clear>`__ in the documentation. - encodings : List(:class:`SingleDefUnitChannel`) + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'shape', 'key', 'text', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - fields : List(:class:`FieldName`) + fields : Sequence[:class:`FieldName`, str] An array of field names whose values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - mark : :class:`BrushConfig` + mark : :class:`BrushConfig`, Dict An interval selection also adds a rectangle mark to depict the extents of the interval. The ``mark`` property can be used to customize the appearance of the mark. **See also:** `mark examples <https://vega.github.io/vega-lite/docs/selection.html#mark>`__ in the documentation. - on : anyOf(:class:`Stream`, string) + on : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, str A `Vega event stream <https://vega.github.io/vega/docs/event-streams/>`__ (object or selector) that triggers the selection. For interval selections, the event stream must specify a `start and end @@ -7078,7 +17857,7 @@ class IntervalSelectionConfig(VegaLiteSchema): **See also:** `on examples <https://vega.github.io/vega-lite/docs/selection.html#on>`__ in the documentation. - resolve : :class:`SelectionResolution` + resolve : :class:`SelectionResolution`, Literal['global', 'union', 'intersect'] With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain. @@ -7098,7 +17877,7 @@ class IntervalSelectionConfig(VegaLiteSchema): **See also:** `resolve examples <https://vega.github.io/vega-lite/docs/selection.html#resolve>`__ in the documentation. - translate : anyOf(string, boolean) + translate : bool, str When truthy, allows a user to interactively move an interval selection back-and-forth. Can be ``true``, ``false`` (to disable panning), or a `Vega event stream definition <https://vega.github.io/vega/docs/event-streams/>`__ which must @@ -7112,7 +17891,7 @@ class IntervalSelectionConfig(VegaLiteSchema): **See also:** `translate examples <https://vega.github.io/vega-lite/docs/selection.html#translate>`__ in the documentation. - zoom : anyOf(string, boolean) + zoom : bool, str When truthy, allows a user to interactively resize an interval selection. Can be ``true``, ``false`` (to disable zooming), or a `Vega event stream definition <https://vega.github.io/vega/docs/event-streams/>`__. Currently, only ``wheel`` @@ -7126,25 +17905,110 @@ class IntervalSelectionConfig(VegaLiteSchema): **See also:** `zoom examples <https://vega.github.io/vega-lite/docs/selection.html#zoom>`__ in the documentation. """ - _schema = {'$ref': '#/definitions/IntervalSelectionConfig'} - def __init__(self, type=Undefined, clear=Undefined, encodings=Undefined, fields=Undefined, - mark=Undefined, on=Undefined, resolve=Undefined, translate=Undefined, zoom=Undefined, - **kwds): - super(IntervalSelectionConfig, self).__init__(type=type, clear=clear, encodings=encodings, - fields=fields, mark=mark, on=on, resolve=resolve, - translate=translate, zoom=zoom, **kwds) + _schema = {"$ref": "#/definitions/IntervalSelectionConfig"} + + def __init__( + self, + type: Union[str, UndefinedType] = Undefined, + clear: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + bool, + str, + ], + UndefinedType, + ] = Undefined, + encodings: Union[ + Sequence[ + Union[ + "SingleDefUnitChannel", + Literal[ + "x", + "y", + "xOffset", + "yOffset", + "x2", + "y2", + "longitude", + "latitude", + "longitude2", + "latitude2", + "theta", + "theta2", + "radius", + "radius2", + "color", + "fill", + "stroke", + "opacity", + "fillOpacity", + "strokeOpacity", + "strokeWidth", + "strokeDash", + "size", + "angle", + "shape", + "key", + "text", + "href", + "url", + "description", + ], + ] + ], + UndefinedType, + ] = Undefined, + fields: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + mark: Union[Union["BrushConfig", dict], UndefinedType] = Undefined, + on: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + resolve: Union[ + Union["SelectionResolution", Literal["global", "union", "intersect"]], + UndefinedType, + ] = Undefined, + translate: Union[Union[bool, str], UndefinedType] = Undefined, + zoom: Union[Union[bool, str], UndefinedType] = Undefined, + **kwds, + ): + super(IntervalSelectionConfig, self).__init__( + type=type, + clear=clear, + encodings=encodings, + fields=fields, + mark=mark, + on=on, + resolve=resolve, + translate=translate, + zoom=zoom, + **kwds, + ) class IntervalSelectionConfigWithoutType(VegaLiteSchema): """IntervalSelectionConfigWithoutType schema wrapper - Mapping(required=[]) + :class:`IntervalSelectionConfigWithoutType`, Dict Parameters ---------- - clear : anyOf(:class:`Stream`, string, boolean) + clear : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, bool, str Clears the selection, emptying it of all values. This property can be a `Event Stream <https://vega.github.io/vega/docs/event-streams/>`__ or ``false`` to disable clear. @@ -7154,27 +18018,27 @@ class IntervalSelectionConfigWithoutType(VegaLiteSchema): **See also:** `clear examples <https://vega.github.io/vega-lite/docs/selection.html#clear>`__ in the documentation. - encodings : List(:class:`SingleDefUnitChannel`) + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'shape', 'key', 'text', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - fields : List(:class:`FieldName`) + fields : Sequence[:class:`FieldName`, str] An array of field names whose values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - mark : :class:`BrushConfig` + mark : :class:`BrushConfig`, Dict An interval selection also adds a rectangle mark to depict the extents of the interval. The ``mark`` property can be used to customize the appearance of the mark. **See also:** `mark examples <https://vega.github.io/vega-lite/docs/selection.html#mark>`__ in the documentation. - on : anyOf(:class:`Stream`, string) + on : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, str A `Vega event stream <https://vega.github.io/vega/docs/event-streams/>`__ (object or selector) that triggers the selection. For interval selections, the event stream must specify a `start and end @@ -7182,7 +18046,7 @@ class IntervalSelectionConfigWithoutType(VegaLiteSchema): **See also:** `on examples <https://vega.github.io/vega-lite/docs/selection.html#on>`__ in the documentation. - resolve : :class:`SelectionResolution` + resolve : :class:`SelectionResolution`, Literal['global', 'union', 'intersect'] With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain. @@ -7202,7 +18066,7 @@ class IntervalSelectionConfigWithoutType(VegaLiteSchema): **See also:** `resolve examples <https://vega.github.io/vega-lite/docs/selection.html#resolve>`__ in the documentation. - translate : anyOf(string, boolean) + translate : bool, str When truthy, allows a user to interactively move an interval selection back-and-forth. Can be ``true``, ``false`` (to disable panning), or a `Vega event stream definition <https://vega.github.io/vega/docs/event-streams/>`__ which must @@ -7216,7 +18080,7 @@ class IntervalSelectionConfigWithoutType(VegaLiteSchema): **See also:** `translate examples <https://vega.github.io/vega-lite/docs/selection.html#translate>`__ in the documentation. - zoom : anyOf(string, boolean) + zoom : bool, str When truthy, allows a user to interactively resize an interval selection. Can be ``true``, ``false`` (to disable zooming), or a `Vega event stream definition <https://vega.github.io/vega/docs/event-streams/>`__. Currently, only ``wheel`` @@ -7230,49 +18094,168 @@ class IntervalSelectionConfigWithoutType(VegaLiteSchema): **See also:** `zoom examples <https://vega.github.io/vega-lite/docs/selection.html#zoom>`__ in the documentation. """ - _schema = {'$ref': '#/definitions/IntervalSelectionConfigWithoutType'} - def __init__(self, clear=Undefined, encodings=Undefined, fields=Undefined, mark=Undefined, - on=Undefined, resolve=Undefined, translate=Undefined, zoom=Undefined, **kwds): - super(IntervalSelectionConfigWithoutType, self).__init__(clear=clear, encodings=encodings, - fields=fields, mark=mark, on=on, - resolve=resolve, translate=translate, - zoom=zoom, **kwds) + _schema = {"$ref": "#/definitions/IntervalSelectionConfigWithoutType"} + + def __init__( + self, + clear: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + bool, + str, + ], + UndefinedType, + ] = Undefined, + encodings: Union[ + Sequence[ + Union[ + "SingleDefUnitChannel", + Literal[ + "x", + "y", + "xOffset", + "yOffset", + "x2", + "y2", + "longitude", + "latitude", + "longitude2", + "latitude2", + "theta", + "theta2", + "radius", + "radius2", + "color", + "fill", + "stroke", + "opacity", + "fillOpacity", + "strokeOpacity", + "strokeWidth", + "strokeDash", + "size", + "angle", + "shape", + "key", + "text", + "href", + "url", + "description", + ], + ] + ], + UndefinedType, + ] = Undefined, + fields: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + mark: Union[Union["BrushConfig", dict], UndefinedType] = Undefined, + on: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + resolve: Union[ + Union["SelectionResolution", Literal["global", "union", "intersect"]], + UndefinedType, + ] = Undefined, + translate: Union[Union[bool, str], UndefinedType] = Undefined, + zoom: Union[Union[bool, str], UndefinedType] = Undefined, + **kwds, + ): + super(IntervalSelectionConfigWithoutType, self).__init__( + clear=clear, + encodings=encodings, + fields=fields, + mark=mark, + on=on, + resolve=resolve, + translate=translate, + zoom=zoom, + **kwds, + ) class JoinAggregateFieldDef(VegaLiteSchema): """JoinAggregateFieldDef schema wrapper - Mapping(required=[op, as]) + :class:`JoinAggregateFieldDef`, Dict[required=[op, as]] Parameters ---------- - op : :class:`AggregateOp` + op : :class:`AggregateOp`, Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] The aggregation operation to apply (e.g., ``"sum"``, ``"average"`` or ``"count"`` ). See the list of all supported operations `here <https://vega.github.io/vega-lite/docs/aggregate.html#ops>`__. - field : :class:`FieldName` + field : :class:`FieldName`, str The data field for which to compute the aggregate function. This can be omitted for functions that do not operate over a field such as ``"count"``. - as : :class:`FieldName` + as : :class:`FieldName`, str The output name for the join aggregate operation. """ - _schema = {'$ref': '#/definitions/JoinAggregateFieldDef'} - def __init__(self, op=Undefined, field=Undefined, **kwds): + _schema = {"$ref": "#/definitions/JoinAggregateFieldDef"} + + def __init__( + self, + op: Union[ + Union[ + "AggregateOp", + Literal[ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + UndefinedType, + ] = Undefined, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + **kwds, + ): super(JoinAggregateFieldDef, self).__init__(op=op, field=field, **kwds) class JsonDataFormat(DataFormat): """JsonDataFormat schema wrapper - Mapping(required=[]) + :class:`JsonDataFormat`, Dict Parameters ---------- - parse : anyOf(:class:`Parse`, None) + parse : :class:`Parse`, Dict, None If set to ``null``, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field @@ -7288,29 +18271,39 @@ class JsonDataFormat(DataFormat): UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). See more about `UTC time <https://vega.github.io/vega-lite/docs/timeunit.html#utc>`__ - property : string + property : str The JSON property containing the desired data. This parameter can be used when the loaded JSON file may have surrounding structure or meta-data. For example ``"property": "values.features"`` is equivalent to retrieving ``json.values.features`` from the loaded JSON object. - type : string + type : str Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. **Default value:** The default format type is determined by the extension of the file URL. If no extension is detected, ``"json"`` will be used by default. """ - _schema = {'$ref': '#/definitions/JsonDataFormat'} - def __init__(self, parse=Undefined, property=Undefined, type=Undefined, **kwds): - super(JsonDataFormat, self).__init__(parse=parse, property=property, type=type, **kwds) + _schema = {"$ref": "#/definitions/JsonDataFormat"} + + def __init__( + self, + parse: Union[Union[None, Union["Parse", dict]], UndefinedType] = Undefined, + property: Union[str, UndefinedType] = Undefined, + type: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(JsonDataFormat, self).__init__( + parse=parse, property=property, type=type, **kwds + ) class LabelOverlap(VegaLiteSchema): """LabelOverlap schema wrapper - anyOf(boolean, string, string) + :class:`LabelOverlap`, bool, str """ - _schema = {'$ref': '#/definitions/LabelOverlap'} + + _schema = {"$ref": "#/definitions/LabelOverlap"} def __init__(self, *args, **kwds): super(LabelOverlap, self).__init__(*args, **kwds) @@ -7319,9 +18312,11 @@ def __init__(self, *args, **kwds): class LatLongDef(VegaLiteSchema): """LatLongDef schema wrapper - anyOf(:class:`LatLongFieldDef`, :class:`DatumDef`) + :class:`DatumDef`, Dict, :class:`LatLongDef`, :class:`LatLongFieldDef`, + Dict[required=[shorthand]] """ - _schema = {'$ref': '#/definitions/LatLongDef'} + + _schema = {"$ref": "#/definitions/LatLongDef"} def __init__(self, *args, **kwds): super(LatLongDef, self).__init__(*args, **kwds) @@ -7330,12 +18325,14 @@ def __init__(self, *args, **kwds): class LatLongFieldDef(LatLongDef): """LatLongFieldDef schema wrapper - Mapping(required=[]) + :class:`LatLongFieldDef`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -7368,7 +18365,7 @@ class LatLongFieldDef(LatLongDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -7383,7 +18380,7 @@ class LatLongFieldDef(LatLongDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -7392,7 +18389,7 @@ class LatLongFieldDef(LatLongDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -7412,7 +18409,7 @@ class LatLongFieldDef(LatLongDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : string + type : str The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -7482,42 +18479,260 @@ class LatLongFieldDef(LatLongDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/LatLongFieldDef'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(LatLongFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, - field=field, timeUnit=timeUnit, title=title, type=type, - **kwds) + _schema = {"$ref": "#/definitions/LatLongFieldDef"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(LatLongFieldDef, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class LayerRepeatMapping(VegaLiteSchema): """LayerRepeatMapping schema wrapper - Mapping(required=[layer]) + :class:`LayerRepeatMapping`, Dict[required=[layer]] Parameters ---------- - layer : List(string) + layer : Sequence[str] An array of fields to be repeated as layers. - column : List(string) + column : Sequence[str] An array of fields to be repeated horizontally. - row : List(string) + row : Sequence[str] An array of fields to be repeated vertically. """ - _schema = {'$ref': '#/definitions/LayerRepeatMapping'} - def __init__(self, layer=Undefined, column=Undefined, row=Undefined, **kwds): - super(LayerRepeatMapping, self).__init__(layer=layer, column=column, row=row, **kwds) + _schema = {"$ref": "#/definitions/LayerRepeatMapping"} + + def __init__( + self, + layer: Union[Sequence[str], UndefinedType] = Undefined, + column: Union[Sequence[str], UndefinedType] = Undefined, + row: Union[Sequence[str], UndefinedType] = Undefined, + **kwds, + ): + super(LayerRepeatMapping, self).__init__( + layer=layer, column=column, row=row, **kwds + ) class LayoutAlign(VegaLiteSchema): """LayoutAlign schema wrapper - enum('all', 'each', 'none') + :class:`LayoutAlign`, Literal['all', 'each', 'none'] """ - _schema = {'$ref': '#/definitions/LayoutAlign'} + + _schema = {"$ref": "#/definitions/LayoutAlign"} def __init__(self, *args): super(LayoutAlign, self).__init__(*args) @@ -7526,38 +18741,38 @@ def __init__(self, *args): class Legend(VegaLiteSchema): """Legend schema wrapper - Mapping(required=[]) + :class:`Legend`, Dict Properties of a legend or boolean flag for determining whether to show it. Parameters ---------- - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG group, removing the legend from the ARIA accessibility tree. **Default value:** ``true`` - clipHeight : anyOf(float, :class:`ExprRef`) + clipHeight : :class:`ExprRef`, Dict[required=[expr]], float The height in pixels to clip symbol legend entries and limit their size. - columnPadding : anyOf(float, :class:`ExprRef`) + columnPadding : :class:`ExprRef`, Dict[required=[expr]], float The horizontal padding in pixels between symbol legend entries. **Default value:** ``10``. - columns : anyOf(float, :class:`ExprRef`) + columns : :class:`ExprRef`, Dict[required=[expr]], float The number of columns in which to arrange symbol legend entries. A value of ``0`` or lower indicates a single row with one column per entry. - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float Corner radius for the full legend. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of this legend for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If the ``aria`` property is true, for SVG output the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__ will be set to this description. If the description is unspecified it will be automatically generated. - direction : :class:`Orientation` + direction : :class:`Orientation`, Literal['horizontal', 'vertical'] The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. **Default value:** @@ -7567,9 +18782,9 @@ class Legend(VegaLiteSchema): * For left-/right- ``orient`` ed legends, ``"vertical"`` * For top/bottom-left/right- ``orient`` ed legends, ``"horizontal"`` for gradient legends and ``"vertical"`` for symbol legends. - fillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + fillColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Background fill color for the full legend. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -7592,7 +18807,7 @@ class Legend(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -7603,68 +18818,68 @@ class Legend(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - gradientLength : anyOf(float, :class:`ExprRef`) + gradientLength : :class:`ExprRef`, Dict[required=[expr]], float The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient. **Default value:** ``200``. - gradientOpacity : anyOf(float, :class:`ExprRef`) + gradientOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the color gradient. - gradientStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + gradientStrokeColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the gradient stroke, can be in hex color code or regular color name. **Default value:** ``"lightGray"``. - gradientStrokeWidth : anyOf(float, :class:`ExprRef`) + gradientStrokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The width of the gradient stroke, in pixels. **Default value:** ``0``. - gradientThickness : anyOf(float, :class:`ExprRef`) + gradientThickness : :class:`ExprRef`, Dict[required=[expr]], float The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient. **Default value:** ``16``. - gridAlign : anyOf(:class:`LayoutAlign`, :class:`ExprRef`) + gridAlign : :class:`ExprRef`, Dict[required=[expr]], :class:`LayoutAlign`, Literal['all', 'each', 'none'] The alignment to apply to symbol legends rows and columns. The supported string values are ``"all"``, ``"each"`` (the default), and ``none``. For more information, see the `grid layout documentation <https://vega.github.io/vega/docs/layout>`__. **Default value:** ``"each"``. - labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + labelAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The alignment of the legend label, can be left, center, or right. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + labelBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] The position of the baseline of legend label, can be ``"top"``, ``"middle"``, ``"bottom"``, or ``"alphabetic"``. **Default value:** ``"middle"``. - labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + labelColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the legend label, can be in hex color code or regular color name. - labelExpr : string + labelExpr : str `Vega expression <https://vega.github.io/vega/docs/expressions/>`__ for customizing labels. **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the legend's backing ``datum`` object. - labelFont : anyOf(string, :class:`ExprRef`) + labelFont : :class:`ExprRef`, Dict[required=[expr]], str The font of the legend label. - labelFontSize : anyOf(float, :class:`ExprRef`) + labelFontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size of legend label. **Default value:** ``10``. - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + labelFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of legend label. - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + labelFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight of legend label. - labelLimit : anyOf(float, :class:`ExprRef`) + labelLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of legend tick labels. **Default value:** ``160``. - labelOffset : anyOf(float, :class:`ExprRef`) + labelOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset of the legend label. **Default value:** ``4``. - labelOpacity : anyOf(float, :class:`ExprRef`) + labelOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of labels. - labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + labelOverlap : :class:`ExprRef`, Dict[required=[expr]], :class:`LabelOverlap`, bool, str The strategy to use for resolving overlap of labels in gradient legends. If ``false``, no overlap reduction is attempted. If set to ``true`` (default) or ``"parity"``, a strategy of removing every other label is used. If set to @@ -7672,63 +18887,63 @@ class Legend(VegaLiteSchema): overlaps with the last visible label (this often works better for log-scaled axes). **Default value:** ``true``. - labelPadding : anyOf(float, :class:`ExprRef`) + labelPadding : :class:`ExprRef`, Dict[required=[expr]], float Padding in pixels between the legend and legend labels. - labelSeparation : anyOf(float, :class:`ExprRef`) + labelSeparation : :class:`ExprRef`, Dict[required=[expr]], float The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default ``0`` ). This property is ignored if *labelOverlap* resolution is not enabled. - legendX : anyOf(float, :class:`ExprRef`) + legendX : :class:`ExprRef`, Dict[required=[expr]], float Custom x-position for legend with orient "none". - legendY : anyOf(float, :class:`ExprRef`) + legendY : :class:`ExprRef`, Dict[required=[expr]], float Custom y-position for legend with orient "none". - offset : anyOf(float, :class:`ExprRef`) + offset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels by which to displace the legend from the data rectangle and axes. **Default value:** ``18``. - orient : :class:`LegendOrient` + orient : :class:`LegendOrient`, Literal['none', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right'] The orientation of the legend, which determines how the legend is positioned within the scene. One of ``"left"``, ``"right"``, ``"top"``, ``"bottom"``, ``"top-left"``, ``"top-right"``, ``"bottom-left"``, ``"bottom-right"``, ``"none"``. **Default value:** ``"right"`` - padding : anyOf(float, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], float The padding between the border and content of the legend group. **Default value:** ``0``. - rowPadding : anyOf(float, :class:`ExprRef`) + rowPadding : :class:`ExprRef`, Dict[required=[expr]], float The vertical padding in pixels between symbol legend entries. **Default value:** ``2``. - strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + strokeColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Border stroke color for the full legend. - symbolDash : anyOf(List(float), :class:`ExprRef`) + symbolDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed symbol strokes. - symbolDashOffset : anyOf(float, :class:`ExprRef`) + symbolDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the symbol stroke dash array. - symbolFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + symbolFillColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the legend symbol, - symbolLimit : anyOf(float, :class:`ExprRef`) + symbolLimit : :class:`ExprRef`, Dict[required=[expr]], float The maximum number of allowed entries for a symbol legend. Additional entries will be dropped. - symbolOffset : anyOf(float, :class:`ExprRef`) + symbolOffset : :class:`ExprRef`, Dict[required=[expr]], float Horizontal pixel offset for legend symbols. **Default value:** ``0``. - symbolOpacity : anyOf(float, :class:`ExprRef`) + symbolOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the legend symbols. - symbolSize : anyOf(float, :class:`ExprRef`) + symbolSize : :class:`ExprRef`, Dict[required=[expr]], float The size of the legend symbol, in pixels. **Default value:** ``100``. - symbolStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + symbolStrokeColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Stroke color for legend symbols. - symbolStrokeWidth : anyOf(float, :class:`ExprRef`) + symbolStrokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The width of the symbol's stroke. **Default value:** ``1.5``. - symbolType : anyOf(:class:`SymbolShape`, :class:`ExprRef`) + symbolType : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str The symbol shape. One of the plotting shapes ``circle`` (default), ``square``, ``cross``, ``diamond``, ``triangle-up``, ``triangle-down``, ``triangle-right``, or ``triangle-left``, the line symbol ``stroke``, or one of the centered directional @@ -7739,16 +18954,16 @@ class Legend(VegaLiteSchema): dimensions. **Default value:** ``"circle"``. - tickCount : anyOf(:class:`TickCount`, :class:`ExprRef`) + tickCount : :class:`ExprRef`, Dict[required=[expr]], :class:`TickCount`, :class:`TimeIntervalStep`, Dict[required=[interval, step]], :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'], float The desired number of tick values for quantitative legends. - tickMinStep : anyOf(float, :class:`ExprRef`) + tickMinStep : :class:`ExprRef`, Dict[required=[expr]], float The minimum desired step between legend ticks, in terms of scale domain values. For example, a value of ``1`` indicates that ticks should not be less than 1 unit apart. If ``tickMinStep`` is specified, the ``tickCount`` value will be adjusted, if necessary, to enforce the minimum step value. **Default value** : ``undefined`` - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -7768,13 +18983,13 @@ class Legend(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + titleAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment for legend titles. **Default value:** ``"left"``. - titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + titleAnchor : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] Text anchor position for placing legend titles. - titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + titleBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] Vertical text baseline for legend titles. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and @@ -7782,107 +18997,1592 @@ class Legend(VegaLiteSchema): alone. **Default value:** ``"top"``. - titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + titleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the legend title, can be in hex color code or regular color name. - titleFont : anyOf(string, :class:`ExprRef`) + titleFont : :class:`ExprRef`, Dict[required=[expr]], str The font of the legend title. - titleFontSize : anyOf(float, :class:`ExprRef`) + titleFontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size of the legend title. - titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + titleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of the legend title. - titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + titleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight of the legend title. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - titleLimit : anyOf(float, :class:`ExprRef`) + titleLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of legend titles. **Default value:** ``180``. - titleLineHeight : anyOf(float, :class:`ExprRef`) + titleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - titleOpacity : anyOf(float, :class:`ExprRef`) + titleOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the legend title. - titleOrient : anyOf(:class:`Orient`, :class:`ExprRef`) + titleOrient : :class:`ExprRef`, Dict[required=[expr]], :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] Orientation of the legend title. - titlePadding : anyOf(float, :class:`ExprRef`) + titlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixels, between title and legend. **Default value:** ``5``. - type : enum('symbol', 'gradient') + type : Literal['symbol', 'gradient'] The type of the legend. Use ``"symbol"`` to create a discrete legend and ``"gradient"`` for a continuous color gradient. **Default value:** ``"gradient"`` for non-binned quantitative fields and temporal fields; ``"symbol"`` otherwise. - values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), :class:`ExprRef`) + values : :class:`ExprRef`, Dict[required=[expr]], Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str] Explicitly set the visible legend values. zindex : float A non-negative integer indicating the z-index of the legend. If zindex is 0, legend should be drawn behind all chart elements. To put them in front, use zindex = 1. """ - _schema = {'$ref': '#/definitions/Legend'} - - def __init__(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, - cornerRadius=Undefined, description=Undefined, direction=Undefined, - fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, - gradientOpacity=Undefined, gradientStrokeColor=Undefined, - gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, - labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, - labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, - labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, - labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, - labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, - legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, - rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, - symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, - symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, - symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, - tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, - titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, - titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, - titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, - titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, - values=Undefined, zindex=Undefined, **kwds): - super(Legend, self).__init__(aria=aria, clipHeight=clipHeight, columnPadding=columnPadding, - columns=columns, cornerRadius=cornerRadius, - description=description, direction=direction, fillColor=fillColor, - format=format, formatType=formatType, - gradientLength=gradientLength, gradientOpacity=gradientOpacity, - gradientStrokeColor=gradientStrokeColor, - gradientStrokeWidth=gradientStrokeWidth, - gradientThickness=gradientThickness, gridAlign=gridAlign, - labelAlign=labelAlign, labelBaseline=labelBaseline, - labelColor=labelColor, labelExpr=labelExpr, labelFont=labelFont, - labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, - labelFontWeight=labelFontWeight, labelLimit=labelLimit, - labelOffset=labelOffset, labelOpacity=labelOpacity, - labelOverlap=labelOverlap, labelPadding=labelPadding, - labelSeparation=labelSeparation, legendX=legendX, legendY=legendY, - offset=offset, orient=orient, padding=padding, - rowPadding=rowPadding, strokeColor=strokeColor, - symbolDash=symbolDash, symbolDashOffset=symbolDashOffset, - symbolFillColor=symbolFillColor, symbolLimit=symbolLimit, - symbolOffset=symbolOffset, symbolOpacity=symbolOpacity, - symbolSize=symbolSize, symbolStrokeColor=symbolStrokeColor, - symbolStrokeWidth=symbolStrokeWidth, symbolType=symbolType, - tickCount=tickCount, tickMinStep=tickMinStep, title=title, - titleAlign=titleAlign, titleAnchor=titleAnchor, - titleBaseline=titleBaseline, titleColor=titleColor, - titleFont=titleFont, titleFontSize=titleFontSize, - titleFontStyle=titleFontStyle, titleFontWeight=titleFontWeight, - titleLimit=titleLimit, titleLineHeight=titleLineHeight, - titleOpacity=titleOpacity, titleOrient=titleOrient, - titlePadding=titlePadding, type=type, values=values, zindex=zindex, - **kwds) + + _schema = {"$ref": "#/definitions/Legend"} + + def __init__( + self, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + fillColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + gradientLength: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gridAlign: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["LayoutAlign", Literal["all", "each", "none"]], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelExpr: Union[str, UndefinedType] = Undefined, + labelFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["LabelOverlap", bool, str] + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + legendX: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + "LegendOrient", + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + symbolDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["SymbolShape", str]], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TickCount", + Union[ + "TimeInterval", + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + ], + Union["TimeIntervalStep", dict], + float, + ], + ], + UndefinedType, + ] = Undefined, + tickMinStep: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + titleAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Orient", Literal["left", "right", "top", "bottom"]], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + type: Union[Literal["symbol", "gradient"], UndefinedType] = Undefined, + values: Union[ + Union[ + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(Legend, self).__init__( + aria=aria, + clipHeight=clipHeight, + columnPadding=columnPadding, + columns=columns, + cornerRadius=cornerRadius, + description=description, + direction=direction, + fillColor=fillColor, + format=format, + formatType=formatType, + gradientLength=gradientLength, + gradientOpacity=gradientOpacity, + gradientStrokeColor=gradientStrokeColor, + gradientStrokeWidth=gradientStrokeWidth, + gradientThickness=gradientThickness, + gridAlign=gridAlign, + labelAlign=labelAlign, + labelBaseline=labelBaseline, + labelColor=labelColor, + labelExpr=labelExpr, + labelFont=labelFont, + labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, + labelLimit=labelLimit, + labelOffset=labelOffset, + labelOpacity=labelOpacity, + labelOverlap=labelOverlap, + labelPadding=labelPadding, + labelSeparation=labelSeparation, + legendX=legendX, + legendY=legendY, + offset=offset, + orient=orient, + padding=padding, + rowPadding=rowPadding, + strokeColor=strokeColor, + symbolDash=symbolDash, + symbolDashOffset=symbolDashOffset, + symbolFillColor=symbolFillColor, + symbolLimit=symbolLimit, + symbolOffset=symbolOffset, + symbolOpacity=symbolOpacity, + symbolSize=symbolSize, + symbolStrokeColor=symbolStrokeColor, + symbolStrokeWidth=symbolStrokeWidth, + symbolType=symbolType, + tickCount=tickCount, + tickMinStep=tickMinStep, + title=title, + titleAlign=titleAlign, + titleAnchor=titleAnchor, + titleBaseline=titleBaseline, + titleColor=titleColor, + titleFont=titleFont, + titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, + titleLimit=titleLimit, + titleLineHeight=titleLineHeight, + titleOpacity=titleOpacity, + titleOrient=titleOrient, + titlePadding=titlePadding, + type=type, + values=values, + zindex=zindex, + **kwds, + ) class LegendBinding(VegaLiteSchema): """LegendBinding schema wrapper - anyOf(string, :class:`LegendStreamBinding`) + :class:`LegendBinding`, :class:`LegendStreamBinding`, Dict[required=[legend]], str """ - _schema = {'$ref': '#/definitions/LegendBinding'} + + _schema = {"$ref": "#/definitions/LegendBinding"} def __init__(self, *args, **kwds): super(LegendBinding, self).__init__(*args, **kwds) @@ -7891,37 +20591,37 @@ def __init__(self, *args, **kwds): class LegendConfig(VegaLiteSchema): """LegendConfig schema wrapper - Mapping(required=[]) + :class:`LegendConfig`, Dict Parameters ---------- - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG group, removing the legend from the ARIA accessibility tree. **Default value:** ``true`` - clipHeight : anyOf(float, :class:`ExprRef`) + clipHeight : :class:`ExprRef`, Dict[required=[expr]], float The height in pixels to clip symbol legend entries and limit their size. - columnPadding : anyOf(float, :class:`ExprRef`) + columnPadding : :class:`ExprRef`, Dict[required=[expr]], float The horizontal padding in pixels between symbol legend entries. **Default value:** ``10``. - columns : anyOf(float, :class:`ExprRef`) + columns : :class:`ExprRef`, Dict[required=[expr]], float The number of columns in which to arrange symbol legend entries. A value of ``0`` or lower indicates a single row with one column per entry. - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float Corner radius for the full legend. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of this legend for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If the ``aria`` property is true, for SVG output the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__ will be set to this description. If the description is unspecified it will be automatically generated. - direction : :class:`Orientation` + direction : :class:`Orientation`, Literal['horizontal', 'vertical'] The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. **Default value:** @@ -7931,11 +20631,11 @@ class LegendConfig(VegaLiteSchema): * For left-/right- ``orient`` ed legends, ``"vertical"`` * For top/bottom-left/right- ``orient`` ed legends, ``"horizontal"`` for gradient legends and ``"vertical"`` for symbol legends. - disable : boolean + disable : bool Disable legend by default - fillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + fillColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Background fill color for the full legend. - gradientDirection : anyOf(:class:`Orientation`, :class:`ExprRef`) + gradientDirection : :class:`ExprRef`, Dict[required=[expr]], :class:`Orientation`, Literal['horizontal', 'vertical'] The default direction ( ``"horizontal"`` or ``"vertical"`` ) for gradient legends. **Default value:** ``"vertical"``. @@ -7949,28 +20649,28 @@ class LegendConfig(VegaLiteSchema): undefined. **Default value:** ``100`` - gradientLabelLimit : anyOf(float, :class:`ExprRef`) + gradientLabelLimit : :class:`ExprRef`, Dict[required=[expr]], float The maximum allowed length in pixels of color ramp gradient labels. - gradientLabelOffset : anyOf(float, :class:`ExprRef`) + gradientLabelOffset : :class:`ExprRef`, Dict[required=[expr]], float Vertical offset in pixels for color ramp gradient labels. **Default value:** ``2``. - gradientLength : anyOf(float, :class:`ExprRef`) + gradientLength : :class:`ExprRef`, Dict[required=[expr]], float The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient. **Default value:** ``200``. - gradientOpacity : anyOf(float, :class:`ExprRef`) + gradientOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the color gradient. - gradientStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + gradientStrokeColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the gradient stroke, can be in hex color code or regular color name. **Default value:** ``"lightGray"``. - gradientStrokeWidth : anyOf(float, :class:`ExprRef`) + gradientStrokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The width of the gradient stroke, in pixels. **Default value:** ``0``. - gradientThickness : anyOf(float, :class:`ExprRef`) + gradientThickness : :class:`ExprRef`, Dict[required=[expr]], float The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient. @@ -7985,42 +20685,42 @@ class LegendConfig(VegaLiteSchema): undefined. **Default value:** ``100`` - gridAlign : anyOf(:class:`LayoutAlign`, :class:`ExprRef`) + gridAlign : :class:`ExprRef`, Dict[required=[expr]], :class:`LayoutAlign`, Literal['all', 'each', 'none'] The alignment to apply to symbol legends rows and columns. The supported string values are ``"all"``, ``"each"`` (the default), and ``none``. For more information, see the `grid layout documentation <https://vega.github.io/vega/docs/layout>`__. **Default value:** ``"each"``. - labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + labelAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The alignment of the legend label, can be left, center, or right. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + labelBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] The position of the baseline of legend label, can be ``"top"``, ``"middle"``, ``"bottom"``, or ``"alphabetic"``. **Default value:** ``"middle"``. - labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + labelColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the legend label, can be in hex color code or regular color name. - labelFont : anyOf(string, :class:`ExprRef`) + labelFont : :class:`ExprRef`, Dict[required=[expr]], str The font of the legend label. - labelFontSize : anyOf(float, :class:`ExprRef`) + labelFontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size of legend label. **Default value:** ``10``. - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + labelFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of legend label. - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + labelFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight of legend label. - labelLimit : anyOf(float, :class:`ExprRef`) + labelLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of legend tick labels. **Default value:** ``160``. - labelOffset : anyOf(float, :class:`ExprRef`) + labelOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset of the legend label. **Default value:** ``4``. - labelOpacity : anyOf(float, :class:`ExprRef`) + labelOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of labels. - labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + labelOverlap : :class:`ExprRef`, Dict[required=[expr]], :class:`LabelOverlap`, bool, str The strategy to use for resolving overlap of labels in gradient legends. If ``false``, no overlap reduction is attempted. If set to ``true`` or ``"parity"``, a strategy of removing every other label is used. If set to ``"greedy"``, a linear @@ -8028,83 +20728,83 @@ class LegendConfig(VegaLiteSchema): visible label (this often works better for log-scaled axes). **Default value:** ``"greedy"`` for ``log scales otherwise`` true`. - labelPadding : anyOf(float, :class:`ExprRef`) + labelPadding : :class:`ExprRef`, Dict[required=[expr]], float Padding in pixels between the legend and legend labels. - labelSeparation : anyOf(float, :class:`ExprRef`) + labelSeparation : :class:`ExprRef`, Dict[required=[expr]], float The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default ``0`` ). This property is ignored if *labelOverlap* resolution is not enabled. - layout : :class:`ExprRef` + layout : :class:`ExprRef`, Dict[required=[expr]] - legendX : anyOf(float, :class:`ExprRef`) + legendX : :class:`ExprRef`, Dict[required=[expr]], float Custom x-position for legend with orient "none". - legendY : anyOf(float, :class:`ExprRef`) + legendY : :class:`ExprRef`, Dict[required=[expr]], float Custom y-position for legend with orient "none". - offset : anyOf(float, :class:`ExprRef`) + offset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels by which to displace the legend from the data rectangle and axes. **Default value:** ``18``. - orient : :class:`LegendOrient` + orient : :class:`LegendOrient`, Literal['none', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right'] The orientation of the legend, which determines how the legend is positioned within the scene. One of ``"left"``, ``"right"``, ``"top"``, ``"bottom"``, ``"top-left"``, ``"top-right"``, ``"bottom-left"``, ``"bottom-right"``, ``"none"``. **Default value:** ``"right"`` - padding : anyOf(float, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], float The padding between the border and content of the legend group. **Default value:** ``0``. - rowPadding : anyOf(float, :class:`ExprRef`) + rowPadding : :class:`ExprRef`, Dict[required=[expr]], float The vertical padding in pixels between symbol legend entries. **Default value:** ``2``. - strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + strokeColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Border stroke color for the full legend. - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] Border stroke dash pattern for the full legend. - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float Border stroke width for the full legend. - symbolBaseFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + symbolBaseFillColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Default fill color for legend symbols. Only applied if there is no ``"fill"`` scale color encoding for the legend. **Default value:** ``"transparent"``. - symbolBaseStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + symbolBaseStrokeColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Default stroke color for legend symbols. Only applied if there is no ``"fill"`` scale color encoding for the legend. **Default value:** ``"gray"``. - symbolDash : anyOf(List(float), :class:`ExprRef`) + symbolDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating [stroke, space] lengths for dashed symbol strokes. - symbolDashOffset : anyOf(float, :class:`ExprRef`) + symbolDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The pixel offset at which to start drawing with the symbol stroke dash array. - symbolDirection : anyOf(:class:`Orientation`, :class:`ExprRef`) + symbolDirection : :class:`ExprRef`, Dict[required=[expr]], :class:`Orientation`, Literal['horizontal', 'vertical'] The default direction ( ``"horizontal"`` or ``"vertical"`` ) for symbol legends. **Default value:** ``"vertical"``. - symbolFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + symbolFillColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the legend symbol, - symbolLimit : anyOf(float, :class:`ExprRef`) + symbolLimit : :class:`ExprRef`, Dict[required=[expr]], float The maximum number of allowed entries for a symbol legend. Additional entries will be dropped. - symbolOffset : anyOf(float, :class:`ExprRef`) + symbolOffset : :class:`ExprRef`, Dict[required=[expr]], float Horizontal pixel offset for legend symbols. **Default value:** ``0``. - symbolOpacity : anyOf(float, :class:`ExprRef`) + symbolOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the legend symbols. - symbolSize : anyOf(float, :class:`ExprRef`) + symbolSize : :class:`ExprRef`, Dict[required=[expr]], float The size of the legend symbol, in pixels. **Default value:** ``100``. - symbolStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + symbolStrokeColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Stroke color for legend symbols. - symbolStrokeWidth : anyOf(float, :class:`ExprRef`) + symbolStrokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The width of the symbol's stroke. **Default value:** ``1.5``. - symbolType : anyOf(:class:`SymbolShape`, :class:`ExprRef`) + symbolType : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str The symbol shape. One of the plotting shapes ``circle`` (default), ``square``, ``cross``, ``diamond``, ``triangle-up``, ``triangle-down``, ``triangle-right``, or ``triangle-left``, the line symbol ``stroke``, or one of the centered directional @@ -8115,17 +20815,17 @@ class LegendConfig(VegaLiteSchema): dimensions. **Default value:** ``"circle"``. - tickCount : anyOf(:class:`TickCount`, :class:`ExprRef`) + tickCount : :class:`ExprRef`, Dict[required=[expr]], :class:`TickCount`, :class:`TimeIntervalStep`, Dict[required=[interval, step]], :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'], float The desired number of tick values for quantitative legends. title : None Set to null to disable title for the axis, legend, or header. - titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + titleAlign : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] Horizontal text alignment for legend titles. **Default value:** ``"left"``. - titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + titleAnchor : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] Text anchor position for placing legend titles. - titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + titleBaseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] Vertical text baseline for legend titles. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and @@ -8133,30 +20833,30 @@ class LegendConfig(VegaLiteSchema): alone. **Default value:** ``"top"``. - titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + titleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] The color of the legend title, can be in hex color code or regular color name. - titleFont : anyOf(string, :class:`ExprRef`) + titleFont : :class:`ExprRef`, Dict[required=[expr]], str The font of the legend title. - titleFontSize : anyOf(float, :class:`ExprRef`) + titleFontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size of the legend title. - titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + titleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style of the legend title. - titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + titleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight of the legend title. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - titleLimit : anyOf(float, :class:`ExprRef`) + titleLimit : :class:`ExprRef`, Dict[required=[expr]], float Maximum allowed pixel width of legend titles. **Default value:** ``180``. - titleLineHeight : anyOf(float, :class:`ExprRef`) + titleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - titleOpacity : anyOf(float, :class:`ExprRef`) + titleOpacity : :class:`ExprRef`, Dict[required=[expr]], float Opacity of the legend title. - titleOrient : anyOf(:class:`Orient`, :class:`ExprRef`) + titleOrient : :class:`ExprRef`, Dict[required=[expr]], :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] Orientation of the legend title. - titlePadding : anyOf(float, :class:`ExprRef`) + titlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding, in pixels, between title and legend. **Default value:** ``5``. @@ -8164,90 +20864,1917 @@ class LegendConfig(VegaLiteSchema): The opacity of unselected legend entries. **Default value:** 0.35. - zindex : anyOf(float, :class:`ExprRef`) + zindex : :class:`ExprRef`, Dict[required=[expr]], float The integer z-index indicating the layering of the legend group relative to other axis, mark, and legend groups. """ - _schema = {'$ref': '#/definitions/LegendConfig'} - - def __init__(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, - cornerRadius=Undefined, description=Undefined, direction=Undefined, disable=Undefined, - fillColor=Undefined, gradientDirection=Undefined, - gradientHorizontalMaxLength=Undefined, gradientHorizontalMinLength=Undefined, - gradientLabelLimit=Undefined, gradientLabelOffset=Undefined, gradientLength=Undefined, - gradientOpacity=Undefined, gradientStrokeColor=Undefined, - gradientStrokeWidth=Undefined, gradientThickness=Undefined, - gradientVerticalMaxLength=Undefined, gradientVerticalMinLength=Undefined, - gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, - labelColor=Undefined, labelFont=Undefined, labelFontSize=Undefined, - labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, - labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, - labelPadding=Undefined, labelSeparation=Undefined, layout=Undefined, legendX=Undefined, - legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, - rowPadding=Undefined, strokeColor=Undefined, strokeDash=Undefined, - strokeWidth=Undefined, symbolBaseFillColor=Undefined, symbolBaseStrokeColor=Undefined, - symbolDash=Undefined, symbolDashOffset=Undefined, symbolDirection=Undefined, - symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, - symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, - symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, - title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, - titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, - titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, - titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, - titlePadding=Undefined, unselectedOpacity=Undefined, zindex=Undefined, **kwds): - super(LegendConfig, self).__init__(aria=aria, clipHeight=clipHeight, - columnPadding=columnPadding, columns=columns, - cornerRadius=cornerRadius, description=description, - direction=direction, disable=disable, fillColor=fillColor, - gradientDirection=gradientDirection, - gradientHorizontalMaxLength=gradientHorizontalMaxLength, - gradientHorizontalMinLength=gradientHorizontalMinLength, - gradientLabelLimit=gradientLabelLimit, - gradientLabelOffset=gradientLabelOffset, - gradientLength=gradientLength, - gradientOpacity=gradientOpacity, - gradientStrokeColor=gradientStrokeColor, - gradientStrokeWidth=gradientStrokeWidth, - gradientThickness=gradientThickness, - gradientVerticalMaxLength=gradientVerticalMaxLength, - gradientVerticalMinLength=gradientVerticalMinLength, - gridAlign=gridAlign, labelAlign=labelAlign, - labelBaseline=labelBaseline, labelColor=labelColor, - labelFont=labelFont, labelFontSize=labelFontSize, - labelFontStyle=labelFontStyle, - labelFontWeight=labelFontWeight, labelLimit=labelLimit, - labelOffset=labelOffset, labelOpacity=labelOpacity, - labelOverlap=labelOverlap, labelPadding=labelPadding, - labelSeparation=labelSeparation, layout=layout, - legendX=legendX, legendY=legendY, offset=offset, - orient=orient, padding=padding, rowPadding=rowPadding, - strokeColor=strokeColor, strokeDash=strokeDash, - strokeWidth=strokeWidth, - symbolBaseFillColor=symbolBaseFillColor, - symbolBaseStrokeColor=symbolBaseStrokeColor, - symbolDash=symbolDash, symbolDashOffset=symbolDashOffset, - symbolDirection=symbolDirection, - symbolFillColor=symbolFillColor, symbolLimit=symbolLimit, - symbolOffset=symbolOffset, symbolOpacity=symbolOpacity, - symbolSize=symbolSize, symbolStrokeColor=symbolStrokeColor, - symbolStrokeWidth=symbolStrokeWidth, symbolType=symbolType, - tickCount=tickCount, title=title, titleAlign=titleAlign, - titleAnchor=titleAnchor, titleBaseline=titleBaseline, - titleColor=titleColor, titleFont=titleFont, - titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, - titleFontWeight=titleFontWeight, titleLimit=titleLimit, - titleLineHeight=titleLineHeight, titleOpacity=titleOpacity, - titleOrient=titleOrient, titlePadding=titlePadding, - unselectedOpacity=unselectedOpacity, zindex=zindex, **kwds) + + _schema = {"$ref": "#/definitions/LegendConfig"} + + def __init__( + self, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + clipHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + columnPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + columns: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + direction: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + disable: Union[bool, UndefinedType] = Undefined, + fillColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + gradientDirection: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Orientation", Literal["horizontal", "vertical"]], + ], + UndefinedType, + ] = Undefined, + gradientHorizontalMaxLength: Union[float, UndefinedType] = Undefined, + gradientHorizontalMinLength: Union[float, UndefinedType] = Undefined, + gradientLabelLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientLabelOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientLength: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientStrokeColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + gradientStrokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientThickness: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + gradientVerticalMaxLength: Union[float, UndefinedType] = Undefined, + gradientVerticalMinLength: Union[float, UndefinedType] = Undefined, + gridAlign: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["LayoutAlign", Literal["all", "each", "none"]], + ], + UndefinedType, + ] = Undefined, + labelAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + labelBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + labelColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + labelFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + labelFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + labelLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelOverlap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["LabelOverlap", bool, str] + ], + UndefinedType, + ] = Undefined, + labelPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + labelSeparation: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + layout: Union[Union["ExprRef", "_Parameter", dict], UndefinedType] = Undefined, + legendX: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + legendY: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + "LegendOrient", + Literal[ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right", + ], + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + rowPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolBaseFillColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + symbolBaseStrokeColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + symbolDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + symbolDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolDirection: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Orientation", Literal["horizontal", "vertical"]], + ], + UndefinedType, + ] = Undefined, + symbolFillColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + symbolLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolStrokeColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + symbolStrokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + symbolType: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["SymbolShape", str]], + UndefinedType, + ] = Undefined, + tickCount: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TickCount", + Union[ + "TimeInterval", + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + ], + Union["TimeIntervalStep", dict], + float, + ], + ], + UndefinedType, + ] = Undefined, + title: Union[None, UndefinedType] = Undefined, + titleAlign: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + titleAnchor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], + ], + UndefinedType, + ] = Undefined, + titleBaseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + titleColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + titleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + titleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + titleLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + titleOrient: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Orient", Literal["left", "right", "top", "bottom"]], + ], + UndefinedType, + ] = Undefined, + titlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + unselectedOpacity: Union[float, UndefinedType] = Undefined, + zindex: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(LegendConfig, self).__init__( + aria=aria, + clipHeight=clipHeight, + columnPadding=columnPadding, + columns=columns, + cornerRadius=cornerRadius, + description=description, + direction=direction, + disable=disable, + fillColor=fillColor, + gradientDirection=gradientDirection, + gradientHorizontalMaxLength=gradientHorizontalMaxLength, + gradientHorizontalMinLength=gradientHorizontalMinLength, + gradientLabelLimit=gradientLabelLimit, + gradientLabelOffset=gradientLabelOffset, + gradientLength=gradientLength, + gradientOpacity=gradientOpacity, + gradientStrokeColor=gradientStrokeColor, + gradientStrokeWidth=gradientStrokeWidth, + gradientThickness=gradientThickness, + gradientVerticalMaxLength=gradientVerticalMaxLength, + gradientVerticalMinLength=gradientVerticalMinLength, + gridAlign=gridAlign, + labelAlign=labelAlign, + labelBaseline=labelBaseline, + labelColor=labelColor, + labelFont=labelFont, + labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, + labelLimit=labelLimit, + labelOffset=labelOffset, + labelOpacity=labelOpacity, + labelOverlap=labelOverlap, + labelPadding=labelPadding, + labelSeparation=labelSeparation, + layout=layout, + legendX=legendX, + legendY=legendY, + offset=offset, + orient=orient, + padding=padding, + rowPadding=rowPadding, + strokeColor=strokeColor, + strokeDash=strokeDash, + strokeWidth=strokeWidth, + symbolBaseFillColor=symbolBaseFillColor, + symbolBaseStrokeColor=symbolBaseStrokeColor, + symbolDash=symbolDash, + symbolDashOffset=symbolDashOffset, + symbolDirection=symbolDirection, + symbolFillColor=symbolFillColor, + symbolLimit=symbolLimit, + symbolOffset=symbolOffset, + symbolOpacity=symbolOpacity, + symbolSize=symbolSize, + symbolStrokeColor=symbolStrokeColor, + symbolStrokeWidth=symbolStrokeWidth, + symbolType=symbolType, + tickCount=tickCount, + title=title, + titleAlign=titleAlign, + titleAnchor=titleAnchor, + titleBaseline=titleBaseline, + titleColor=titleColor, + titleFont=titleFont, + titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, + titleLimit=titleLimit, + titleLineHeight=titleLineHeight, + titleOpacity=titleOpacity, + titleOrient=titleOrient, + titlePadding=titlePadding, + unselectedOpacity=unselectedOpacity, + zindex=zindex, + **kwds, + ) class LegendOrient(VegaLiteSchema): """LegendOrient schema wrapper - enum('none', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', - 'bottom-right') + :class:`LegendOrient`, Literal['none', 'left', 'right', 'top', 'bottom', 'top-left', + 'top-right', 'bottom-left', 'bottom-right'] """ - _schema = {'$ref': '#/definitions/LegendOrient'} + + _schema = {"$ref": "#/definitions/LegendOrient"} def __init__(self, *args): super(LegendOrient, self).__init__(*args) @@ -8256,97 +22783,157 @@ def __init__(self, *args): class LegendResolveMap(VegaLiteSchema): """LegendResolveMap schema wrapper - Mapping(required=[]) + :class:`LegendResolveMap`, Dict Parameters ---------- - angle : :class:`ResolveMode` - - color : :class:`ResolveMode` - - fill : :class:`ResolveMode` - - fillOpacity : :class:`ResolveMode` - - opacity : :class:`ResolveMode` - - shape : :class:`ResolveMode` - - size : :class:`ResolveMode` - - stroke : :class:`ResolveMode` - - strokeDash : :class:`ResolveMode` - - strokeOpacity : :class:`ResolveMode` - - strokeWidth : :class:`ResolveMode` - - """ - _schema = {'$ref': '#/definitions/LegendResolveMap'} - - def __init__(self, angle=Undefined, color=Undefined, fill=Undefined, fillOpacity=Undefined, - opacity=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, - strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, **kwds): - super(LegendResolveMap, self).__init__(angle=angle, color=color, fill=fill, - fillOpacity=fillOpacity, opacity=opacity, shape=shape, - size=size, stroke=stroke, strokeDash=strokeDash, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - **kwds) + angle : :class:`ResolveMode`, Literal['independent', 'shared'] + + color : :class:`ResolveMode`, Literal['independent', 'shared'] + + fill : :class:`ResolveMode`, Literal['independent', 'shared'] + + fillOpacity : :class:`ResolveMode`, Literal['independent', 'shared'] + + opacity : :class:`ResolveMode`, Literal['independent', 'shared'] + + shape : :class:`ResolveMode`, Literal['independent', 'shared'] + + size : :class:`ResolveMode`, Literal['independent', 'shared'] + + stroke : :class:`ResolveMode`, Literal['independent', 'shared'] + + strokeDash : :class:`ResolveMode`, Literal['independent', 'shared'] + + strokeOpacity : :class:`ResolveMode`, Literal['independent', 'shared'] + + strokeWidth : :class:`ResolveMode`, Literal['independent', 'shared'] + + """ + + _schema = {"$ref": "#/definitions/LegendResolveMap"} + + def __init__( + self, + angle: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + color: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + fill: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + fillOpacity: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + opacity: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + shape: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + size: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + stroke: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + strokeDash: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + **kwds, + ): + super(LegendResolveMap, self).__init__( + angle=angle, + color=color, + fill=fill, + fillOpacity=fillOpacity, + opacity=opacity, + shape=shape, + size=size, + stroke=stroke, + strokeDash=strokeDash, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + **kwds, + ) class LegendStreamBinding(LegendBinding): """LegendStreamBinding schema wrapper - Mapping(required=[legend]) + :class:`LegendStreamBinding`, Dict[required=[legend]] Parameters ---------- - legend : anyOf(string, :class:`Stream`) + legend : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, str """ - _schema = {'$ref': '#/definitions/LegendStreamBinding'} - def __init__(self, legend=Undefined, **kwds): + _schema = {"$ref": "#/definitions/LegendStreamBinding"} + + def __init__( + self, + legend: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(LegendStreamBinding, self).__init__(legend=legend, **kwds) class LineConfig(AnyMarkConfig): """LineConfig schema wrapper - Mapping(required=[]) + :class:`LineConfig`, Dict Parameters ---------- - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -8357,13 +22944,13 @@ class LineConfig(AnyMarkConfig): ``"middle"``, ``"bottom"``. **Note:** Expression reference is *not* supported for range marks. - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -8376,63 +22963,63 @@ class LineConfig(AnyMarkConfig): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - endAngle : anyOf(float, :class:`ExprRef`) + endAngle : :class:`ExprRef`, Dict[required=[expr]], float The end angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -8442,28 +23029,28 @@ class LineConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`) + height : :class:`ExprRef`, Dict[required=[expr]], float Height of the marks. - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -8485,7 +23072,7 @@ class LineConfig(AnyMarkConfig): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -8494,26 +23081,26 @@ class LineConfig(AnyMarkConfig): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -8525,13 +23112,13 @@ class LineConfig(AnyMarkConfig): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - point : anyOf(boolean, :class:`OverlayMarkDef`, string) + point : :class:`OverlayMarkDef`, Dict, bool, str A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points. @@ -8546,18 +23133,18 @@ class LineConfig(AnyMarkConfig): area marks. **Default value:** ``false``. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -8572,7 +23159,7 @@ class LineConfig(AnyMarkConfig): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -8589,56 +23176,56 @@ class LineConfig(AnyMarkConfig): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - startAngle : anyOf(float, :class:`ExprRef`) + startAngle : :class:`ExprRef`, Dict[required=[expr]], float The start angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. timeUnitBandPosition : float @@ -8649,7 +23236,7 @@ class LineConfig(AnyMarkConfig): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -8664,118 +23251,1016 @@ class LineConfig(AnyMarkConfig): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`) + width : :class:`ExprRef`, Dict[required=[expr]], float Width of the marks. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. """ - _schema = {'$ref': '#/definitions/LineConfig'} - - def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, - color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, - dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, - fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, - fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, - innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, - startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, - timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, - url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, - **kwds): - super(LineConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - baseline=baseline, blend=blend, color=color, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, dx=dx, dy=dy, - ellipsis=ellipsis, endAngle=endAngle, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, - interpolate=interpolate, invalid=invalid, limit=limit, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, - order=order, orient=orient, outerRadius=outerRadius, - padAngle=padAngle, point=point, radius=radius, radius2=radius2, - shape=shape, size=size, smooth=smooth, startAngle=startAngle, - stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - tension=tension, text=text, theta=theta, theta2=theta2, - timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + _schema = {"$ref": "#/definitions/LineConfig"} + + def __init__( + self, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + endAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union["OverlayMarkDef", dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + startAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): + super(LineConfig, self).__init__( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + baseline=baseline, + blend=blend, + color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + dx=dx, + dy=dy, + ellipsis=ellipsis, + endAngle=endAngle, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + lineBreak=lineBreak, + lineHeight=lineHeight, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + smooth=smooth, + startAngle=startAngle, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + y=y, + y2=y2, + **kwds, + ) class LineString(Geometry): """LineString schema wrapper - Mapping(required=[coordinates, type]) + :class:`LineString`, Dict[required=[coordinates, type]] LineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.4 Parameters ---------- - coordinates : List(:class:`Position`) + coordinates : Sequence[:class:`Position`, Sequence[float]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/LineString'} - def __init__(self, coordinates=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(LineString, self).__init__(coordinates=coordinates, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/LineString"} + + def __init__( + self, + coordinates: Union[ + Sequence[Union["Position", Sequence[float]]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(LineString, self).__init__( + coordinates=coordinates, type=type, bbox=bbox, **kwds + ) class LinearGradient(Gradient): """LinearGradient schema wrapper - Mapping(required=[gradient, stops]) + :class:`LinearGradient`, Dict[required=[gradient, stops]] Parameters ---------- - gradient : string + gradient : str The type of gradient. Use ``"linear"`` for a linear gradient. - stops : List(:class:`GradientStop`) + stops : Sequence[:class:`GradientStop`, Dict[required=[offset, color]]] An array of gradient stops defining the gradient color sequence. - id : string + id : str x1 : float The starting x-coordinate, in normalized [0, 1] coordinates, of the linear gradient. @@ -8794,85 +24279,136 @@ class LinearGradient(Gradient): **Default value:** ``0`` """ - _schema = {'$ref': '#/definitions/LinearGradient'} - def __init__(self, gradient=Undefined, stops=Undefined, id=Undefined, x1=Undefined, x2=Undefined, - y1=Undefined, y2=Undefined, **kwds): - super(LinearGradient, self).__init__(gradient=gradient, stops=stops, id=id, x1=x1, x2=x2, y1=y1, - y2=y2, **kwds) + _schema = {"$ref": "#/definitions/LinearGradient"} + + def __init__( + self, + gradient: Union[str, UndefinedType] = Undefined, + stops: Union[Sequence[Union["GradientStop", dict]], UndefinedType] = Undefined, + id: Union[str, UndefinedType] = Undefined, + x1: Union[float, UndefinedType] = Undefined, + x2: Union[float, UndefinedType] = Undefined, + y1: Union[float, UndefinedType] = Undefined, + y2: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(LinearGradient, self).__init__( + gradient=gradient, stops=stops, id=id, x1=x1, x2=x2, y1=y1, y2=y2, **kwds + ) class Locale(VegaLiteSchema): """Locale schema wrapper - Mapping(required=[]) + :class:`Locale`, Dict Parameters ---------- - number : :class:`NumberLocale` + number : :class:`NumberLocale`, Dict[required=[decimal, thousands, grouping, currency]] Locale definition for formatting numbers. - time : :class:`TimeLocale` + time : :class:`TimeLocale`, Dict[required=[dateTime, date, time, periods, days, shortDays, months, shortMonths]] Locale definition for formatting dates and times. """ - _schema = {'$ref': '#/definitions/Locale'} - def __init__(self, number=Undefined, time=Undefined, **kwds): + _schema = {"$ref": "#/definitions/Locale"} + + def __init__( + self, + number: Union[Union["NumberLocale", dict], UndefinedType] = Undefined, + time: Union[Union["TimeLocale", dict], UndefinedType] = Undefined, + **kwds, + ): super(Locale, self).__init__(number=number, time=time, **kwds) class LookupData(VegaLiteSchema): """LookupData schema wrapper - Mapping(required=[data, key]) + :class:`LookupData`, Dict[required=[data, key]] Parameters ---------- - data : :class:`Data` + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]] Secondary data source to lookup in. - key : :class:`FieldName` + key : :class:`FieldName`, str Key in data to lookup. - fields : List(:class:`FieldName`) + fields : Sequence[:class:`FieldName`, str] Fields in foreign data or selection to lookup. If not specified, the entire object is queried. """ - _schema = {'$ref': '#/definitions/LookupData'} - def __init__(self, data=Undefined, key=Undefined, fields=Undefined, **kwds): + _schema = {"$ref": "#/definitions/LookupData"} + + def __init__( + self, + data: Union[ + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + UndefinedType, + ] = Undefined, + key: Union[Union["FieldName", str], UndefinedType] = Undefined, + fields: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + **kwds, + ): super(LookupData, self).__init__(data=data, key=key, fields=fields, **kwds) class LookupSelection(VegaLiteSchema): """LookupSelection schema wrapper - Mapping(required=[key, param]) + :class:`LookupSelection`, Dict[required=[key, param]] Parameters ---------- - key : :class:`FieldName` + key : :class:`FieldName`, str Key in data to lookup. - param : :class:`ParameterName` + param : :class:`ParameterName`, str Selection parameter name to look up. - fields : List(:class:`FieldName`) + fields : Sequence[:class:`FieldName`, str] Fields in foreign data or selection to lookup. If not specified, the entire object is queried. """ - _schema = {'$ref': '#/definitions/LookupSelection'} - def __init__(self, key=Undefined, param=Undefined, fields=Undefined, **kwds): - super(LookupSelection, self).__init__(key=key, param=param, fields=fields, **kwds) + _schema = {"$ref": "#/definitions/LookupSelection"} + + def __init__( + self, + key: Union[Union["FieldName", str], UndefinedType] = Undefined, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + fields: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + **kwds, + ): + super(LookupSelection, self).__init__( + key=key, param=param, fields=fields, **kwds + ) class Mark(AnyMark): """Mark schema wrapper - enum('arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', - 'trail', 'circle', 'square', 'geoshape') + :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', + 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] All types of primitive marks. """ - _schema = {'$ref': '#/definitions/Mark'} + + _schema = {"$ref": "#/definitions/Mark"} def __init__(self, *args): super(Mark, self).__init__(*args) @@ -8881,37 +24417,37 @@ def __init__(self, *args): class MarkConfig(AnyMarkConfig): """MarkConfig schema wrapper - Mapping(required=[]) + :class:`MarkConfig`, Dict Parameters ---------- - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -8922,13 +24458,13 @@ class MarkConfig(AnyMarkConfig): ``"middle"``, ``"bottom"``. **Note:** Expression reference is *not* supported for range marks. - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -8941,63 +24477,63 @@ class MarkConfig(AnyMarkConfig): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - endAngle : anyOf(float, :class:`ExprRef`) + endAngle : :class:`ExprRef`, Dict[required=[expr]], float The end angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -9007,28 +24543,28 @@ class MarkConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`) + height : :class:`ExprRef`, Dict[required=[expr]], float Height of the marks. - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -9050,7 +24586,7 @@ class MarkConfig(AnyMarkConfig): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -9059,26 +24595,26 @@ class MarkConfig(AnyMarkConfig): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -9090,24 +24626,24 @@ class MarkConfig(AnyMarkConfig): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -9122,7 +24658,7 @@ class MarkConfig(AnyMarkConfig): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -9139,56 +24675,56 @@ class MarkConfig(AnyMarkConfig): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - startAngle : anyOf(float, :class:`ExprRef`) + startAngle : :class:`ExprRef`, Dict[required=[expr]], float The start angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. timeUnitBandPosition : float @@ -9199,7 +24735,7 @@ class MarkConfig(AnyMarkConfig): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -9214,126 +24750,1009 @@ class MarkConfig(AnyMarkConfig): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`) + width : :class:`ExprRef`, Dict[required=[expr]], float Width of the marks. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. """ - _schema = {'$ref': '#/definitions/MarkConfig'} - - def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, - color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, - dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, - fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, - fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, - innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, radius=Undefined, - radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, - startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, - timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, - url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, - **kwds): - super(MarkConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - baseline=baseline, blend=blend, color=color, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, dx=dx, dy=dy, - ellipsis=ellipsis, endAngle=endAngle, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, - interpolate=interpolate, invalid=invalid, limit=limit, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, - order=order, orient=orient, outerRadius=outerRadius, - padAngle=padAngle, radius=radius, radius2=radius2, shape=shape, - size=size, smooth=smooth, startAngle=startAngle, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - tension=tension, text=text, theta=theta, theta2=theta2, - timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + _schema = {"$ref": "#/definitions/MarkConfig"} + + def __init__( + self, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + endAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + startAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): + super(MarkConfig, self).__init__( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + baseline=baseline, + blend=blend, + color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + dx=dx, + dy=dy, + ellipsis=ellipsis, + endAngle=endAngle, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + lineBreak=lineBreak, + lineHeight=lineHeight, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + smooth=smooth, + startAngle=startAngle, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + y=y, + y2=y2, + **kwds, + ) class MarkDef(AnyMark): """MarkDef schema wrapper - Mapping(required=[type]) + :class:`MarkDef`, Dict[required=[type]] Parameters ---------- - type : :class:`Mark` + type : :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, ``"errorband"``, ``"errorbar"`` ). - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. bandSize : float The width of the ticks. **Default value:** 3/4 of step (width step for horizontal ticks and height step for vertical ticks). - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -9349,15 +25768,15 @@ class MarkDef(AnyMark): (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). **Default value:** ``1`` - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - clip : boolean + clip : bool Whether a mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -9374,67 +25793,67 @@ class MarkDef(AnyMark): The default size of the bars on continuous scales. **Default value:** ``5`` - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusEnd : anyOf(float, :class:`ExprRef`) + cornerRadiusEnd : :class:`ExprRef`, Dict[required=[expr]], float For vertical bars, top-left and top-right corner radius. For horizontal bars, top-right and bottom-right corner radius. - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - discreteBandSize : anyOf(float, :class:`RelativeBandSize`) + discreteBandSize : :class:`RelativeBandSize`, Dict[required=[band]], float The default size of the bars with discrete dimensions. If unspecified, the default size is ``step-2``, which provides 2 pixel offset between bars. - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -9444,19 +25863,19 @@ class MarkDef(AnyMark): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`, :class:`RelativeBandSize`) + height : :class:`ExprRef`, Dict[required=[expr]], :class:`RelativeBandSize`, Dict[required=[band]], float Height of the marks. One of: @@ -9464,14 +25883,14 @@ class MarkDef(AnyMark): A relative band size definition. For example, ``{band: 0.5}`` represents half of the band - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -9493,7 +25912,7 @@ class MarkDef(AnyMark): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -9502,12 +25921,12 @@ class MarkDef(AnyMark): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - line : anyOf(boolean, :class:`OverlayMarkDef`) + line : :class:`OverlayMarkDef`, Dict, bool A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines. @@ -9518,23 +25937,23 @@ class MarkDef(AnyMark): If this value is ``false``, no lines would be automatically added to area marks. **Default value:** ``false``. - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - minBandSize : anyOf(float, :class:`ExprRef`) + minBandSize : :class:`ExprRef`, Dict[required=[expr]], float The minimum band size for bar and rectangle marks. **Default value:** ``0.25`` - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -9546,13 +25965,13 @@ class MarkDef(AnyMark): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - point : anyOf(boolean, :class:`OverlayMarkDef`, string) + point : :class:`OverlayMarkDef`, Dict, bool, str A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points. @@ -9567,22 +25986,22 @@ class MarkDef(AnyMark): area marks. **Default value:** ``false``. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - radius2Offset : anyOf(float, :class:`ExprRef`) + radius2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for radius2. - radiusOffset : anyOf(float, :class:`ExprRef`) + radiusOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for radius. - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -9597,7 +26016,7 @@ class MarkDef(AnyMark): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -9614,42 +26033,42 @@ class MarkDef(AnyMark): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - style : anyOf(string, List(string)) + style : Sequence[str], str A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the `style configuration @@ -9663,23 +26082,23 @@ class MarkDef(AnyMark): For example, a bar mark with ``"style": "foo"`` will receive from ``config.style.bar`` and ``config.style.foo`` (the specified style ``"foo"`` has higher precedence). - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. - theta2Offset : anyOf(float, :class:`ExprRef`) + theta2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for theta2. - thetaOffset : anyOf(float, :class:`ExprRef`) + thetaOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for theta. thickness : float Thickness of the tick mark. @@ -9693,7 +26112,7 @@ class MarkDef(AnyMark): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -9708,9 +26127,9 @@ class MarkDef(AnyMark): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`, :class:`RelativeBandSize`) + width : :class:`ExprRef`, Dict[required=[expr]], :class:`RelativeBandSize`, Dict[required=[band]], float Width of the marks. One of: @@ -9718,114 +26137,1079 @@ class MarkDef(AnyMark): A relative band size definition. For example, ``{band: 0.5}`` represents half of the band. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2Offset : anyOf(float, :class:`ExprRef`) + x2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for x2-position. - xOffset : anyOf(float, :class:`ExprRef`) + xOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for x-position. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2Offset : anyOf(float, :class:`ExprRef`) + y2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for y2-position. - yOffset : anyOf(float, :class:`ExprRef`) + yOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for y-position. """ - _schema = {'$ref': '#/definitions/MarkDef'} - - def __init__(self, type=Undefined, align=Undefined, angle=Undefined, aria=Undefined, - ariaRole=Undefined, ariaRoleDescription=Undefined, aspect=Undefined, - bandSize=Undefined, baseline=Undefined, binSpacing=Undefined, blend=Undefined, - clip=Undefined, color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, - discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, - fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, - fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, - href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, - limit=Undefined, line=Undefined, lineBreak=Undefined, lineHeight=Undefined, - minBandSize=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, - radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, - size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, - strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, - strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, - strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, - theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, - thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, - tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, - x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, - yOffset=Undefined, **kwds): - super(MarkDef, self).__init__(type=type, align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - bandSize=bandSize, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, - discreteBandSize=discreteBandSize, dx=dx, dy=dy, - ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, - filled=filled, font=font, fontSize=fontSize, fontStyle=fontStyle, - fontWeight=fontWeight, height=height, href=href, - innerRadius=innerRadius, interpolate=interpolate, invalid=invalid, - limit=limit, line=line, lineBreak=lineBreak, - lineHeight=lineHeight, minBandSize=minBandSize, opacity=opacity, - order=order, orient=orient, outerRadius=outerRadius, - padAngle=padAngle, point=point, radius=radius, radius2=radius2, - radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, - tension=tension, text=text, theta=theta, theta2=theta2, - theta2Offset=theta2Offset, thetaOffset=thetaOffset, - thickness=thickness, timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, - width=width, x=x, x2=x2, x2Offset=x2Offset, xOffset=xOffset, y=y, - y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + + _schema = {"$ref": "#/definitions/MarkDef"} + + def __init__( + self, + type: Union[ + Union[ + "Mark", + Literal[ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape", + ], + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union["RelativeBandSize", dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["RelativeBandSize", dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union["OverlayMarkDef", dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union["OverlayMarkDef", dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["RelativeBandSize", dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(MarkDef, self).__init__( + type=type, + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) class MarkPropDefGradientstringnull(VegaLiteSchema): """MarkPropDefGradientstringnull schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, - :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`) + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + Dict[required=[shorthand]], :class:`MarkPropDefGradientstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict """ - _schema = {'$ref': '#/definitions/MarkPropDef<(Gradient|string|null)>'} + + _schema = {"$ref": "#/definitions/MarkPropDef<(Gradient|string|null)>"} def __init__(self, *args, **kwds): super(MarkPropDefGradientstringnull, self).__init__(*args, **kwds) -class FieldOrDatumDefWithConditionDatumDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): +class FieldOrDatumDefWithConditionDatumDefGradientstringnull( + ColorDef, MarkPropDefGradientstringnull +): """FieldOrDatumDefWithConditionDatumDefGradientstringnull schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, Dict Parameters ---------- @@ -9834,16 +27218,16 @@ class FieldOrDatumDefWithConditionDatumDefGradientstringnull(ColorDef, MarkPropD Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -9863,7 +27247,7 @@ class FieldOrDatumDefWithConditionDatumDefGradientstringnull(ColorDef, MarkPropD 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -9933,26 +27317,86 @@ class FieldOrDatumDefWithConditionDatumDefGradientstringnull(ColorDef, MarkPropD **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<DatumDef,(Gradient|string|null)>'} - def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, - type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionDatumDefGradientstringnull, self).__init__(bandPosition=bandPosition, - condition=condition, - datum=datum, - title=title, - type=type, **kwds) - - -class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<DatumDef,(Gradient|string|null)>" + } + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefGradientstringnullExprRef", + Union[ + "ConditionalParameterValueDefGradientstringnullExprRef", + dict, + ], + Union[ + "ConditionalPredicateValueDefGradientstringnullExprRef", + dict, + ], + ] + ], + Union[ + "ConditionalValueDefGradientstringnullExprRef", + Union[ + "ConditionalParameterValueDefGradientstringnullExprRef", dict + ], + Union[ + "ConditionalPredicateValueDefGradientstringnullExprRef", dict + ], + ], + ], + UndefinedType, + ] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionDatumDefGradientstringnull, self).__init__( + bandPosition=bandPosition, + condition=condition, + datum=datum, + title=title, + type=type, + **kwds, + ) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull( + ColorDef, MarkPropDefGradientstringnull +): """FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -9964,7 +27408,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -9985,14 +27429,14 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -10007,7 +27451,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -10016,7 +27460,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -10029,7 +27473,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -10068,7 +27512,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -10077,7 +27521,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -10097,7 +27541,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10167,33 +27611,332 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, M **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef,(Gradient|string|null)>'} - - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, self).__init__(aggregate=aggregate, - bandPosition=bandPosition, - bin=bin, - condition=condition, - field=field, - legend=legend, - scale=scale, - sort=sort, - timeUnit=timeUnit, - title=title, - type=type, - **kwds) + + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef,(Gradient|string|null)>" + } + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefGradientstringnullExprRef", + Union[ + "ConditionalParameterValueDefGradientstringnullExprRef", + dict, + ], + Union[ + "ConditionalPredicateValueDefGradientstringnullExprRef", + dict, + ], + ] + ], + Union[ + "ConditionalValueDefGradientstringnullExprRef", + Union[ + "ConditionalParameterValueDefGradientstringnullExprRef", dict + ], + Union[ + "ConditionalPredicateValueDefGradientstringnullExprRef", dict + ], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union["Legend", dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + "Sort", + None, + Union[ + "AllSortString", + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + Union[ + "SortByChannelDesc", + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortByEncoding", dict], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super( + FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, self + ).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class MarkPropDefnumber(VegaLiteSchema): """MarkPropDefnumber schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, - :class:`FieldOrDatumDefWithConditionDatumDefnumber`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], + :class:`MarkPropDefnumber`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, + Dict """ - _schema = {'$ref': '#/definitions/MarkPropDef<number>'} + + _schema = {"$ref": "#/definitions/MarkPropDef<number>"} def __init__(self, *args, **kwds): super(MarkPropDefnumber, self).__init__(*args, **kwds) @@ -10202,11 +27945,13 @@ def __init__(self, *args, **kwds): class MarkPropDefnumberArray(VegaLiteSchema): """MarkPropDefnumberArray schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, - :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`) + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, + Dict[required=[shorthand]], :class:`MarkPropDefnumberArray`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`, Dict """ - _schema = {'$ref': '#/definitions/MarkPropDef<number[]>'} + + _schema = {"$ref": "#/definitions/MarkPropDef<number[]>"} def __init__(self, *args, **kwds): super(MarkPropDefnumberArray, self).__init__(*args, **kwds) @@ -10215,11 +27960,13 @@ def __init__(self, *args, **kwds): class MarkPropDefstringnullTypeForShape(VegaLiteSchema): """MarkPropDefstringnullTypeForShape schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, - :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`) + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + Dict[required=[shorthand]], :class:`MarkPropDefstringnullTypeForShape`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`, Dict """ - _schema = {'$ref': '#/definitions/MarkPropDef<(string|null),TypeForShape>'} + + _schema = {"$ref": "#/definitions/MarkPropDef<(string|null),TypeForShape>"} def __init__(self, *args, **kwds): super(MarkPropDefstringnullTypeForShape, self).__init__(*args, **kwds) @@ -10228,10 +27975,11 @@ def __init__(self, *args, **kwds): class MarkType(VegaLiteSchema): """MarkType schema wrapper - enum('arc', 'area', 'image', 'group', 'line', 'path', 'rect', 'rule', 'shape', 'symbol', - 'text', 'trail') + :class:`MarkType`, Literal['arc', 'area', 'image', 'group', 'line', 'path', 'rect', 'rule', + 'shape', 'symbol', 'text', 'trail'] """ - _schema = {'$ref': '#/definitions/MarkType'} + + _schema = {"$ref": "#/definitions/MarkType"} def __init__(self, *args): super(MarkType, self).__init__(*args) @@ -10240,9 +27988,10 @@ def __init__(self, *args): class Month(VegaLiteSchema): """Month schema wrapper - float + :class:`Month`, float """ - _schema = {'$ref': '#/definitions/Month'} + + _schema = {"$ref": "#/definitions/Month"} def __init__(self, *args): super(Month, self).__init__(*args) @@ -10251,104 +28000,154 @@ def __init__(self, *args): class MultiLineString(Geometry): """MultiLineString schema wrapper - Mapping(required=[coordinates, type]) + :class:`MultiLineString`, Dict[required=[coordinates, type]] MultiLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.5 Parameters ---------- - coordinates : List(List(:class:`Position`)) + coordinates : Sequence[Sequence[:class:`Position`, Sequence[float]]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/MultiLineString'} - def __init__(self, coordinates=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(MultiLineString, self).__init__(coordinates=coordinates, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/MultiLineString"} + + def __init__( + self, + coordinates: Union[ + Sequence[Sequence[Union["Position", Sequence[float]]]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(MultiLineString, self).__init__( + coordinates=coordinates, type=type, bbox=bbox, **kwds + ) class MultiPoint(Geometry): """MultiPoint schema wrapper - Mapping(required=[coordinates, type]) + :class:`MultiPoint`, Dict[required=[coordinates, type]] MultiPoint geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.3 Parameters ---------- - coordinates : List(:class:`Position`) + coordinates : Sequence[:class:`Position`, Sequence[float]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/MultiPoint'} - def __init__(self, coordinates=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(MultiPoint, self).__init__(coordinates=coordinates, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/MultiPoint"} + + def __init__( + self, + coordinates: Union[ + Sequence[Union["Position", Sequence[float]]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(MultiPoint, self).__init__( + coordinates=coordinates, type=type, bbox=bbox, **kwds + ) class MultiPolygon(Geometry): """MultiPolygon schema wrapper - Mapping(required=[coordinates, type]) + :class:`MultiPolygon`, Dict[required=[coordinates, type]] MultiPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.7 Parameters ---------- - coordinates : List(List(List(:class:`Position`))) + coordinates : Sequence[Sequence[Sequence[:class:`Position`, Sequence[float]]]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/MultiPolygon'} - def __init__(self, coordinates=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(MultiPolygon, self).__init__(coordinates=coordinates, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/MultiPolygon"} + + def __init__( + self, + coordinates: Union[ + Sequence[Sequence[Sequence[Union["Position", Sequence[float]]]]], + UndefinedType, + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(MultiPolygon, self).__init__( + coordinates=coordinates, type=type, bbox=bbox, **kwds + ) class NamedData(DataSource): """NamedData schema wrapper - Mapping(required=[name]) + :class:`NamedData`, Dict[required=[name]] Parameters ---------- - name : string + name : str Provide a placeholder name and bind data at runtime. New data may change the layout but Vega does not always resize the chart. To update the layout when the data updates, set `autosize <https://vega.github.io/vega-lite/docs/size.html#autosize>`__ or explicitly use `view.resize <https://vega.github.io/vega/docs/api/view/#view_resize>`__. - format : :class:`DataFormat` + format : :class:`CsvDataFormat`, Dict, :class:`DataFormat`, :class:`DsvDataFormat`, Dict[required=[delimiter]], :class:`JsonDataFormat`, Dict, :class:`TopoDataFormat`, Dict An object that specifies the format for parsing the data. """ - _schema = {'$ref': '#/definitions/NamedData'} - def __init__(self, name=Undefined, format=Undefined, **kwds): + _schema = {"$ref": "#/definitions/NamedData"} + + def __init__( + self, + name: Union[str, UndefinedType] = Undefined, + format: Union[ + Union[ + "DataFormat", + Union["CsvDataFormat", dict], + Union["DsvDataFormat", dict], + Union["JsonDataFormat", dict], + Union["TopoDataFormat", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(NamedData, self).__init__(name=name, format=format, **kwds) class NonArgAggregateOp(Aggregate): """NonArgAggregateOp schema wrapper - enum('average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', - 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', - 'variancep') + :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', + 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', + 'valid', 'values', 'variance', 'variancep'] """ - _schema = {'$ref': '#/definitions/NonArgAggregateOp'} + + _schema = {"$ref": "#/definitions/NonArgAggregateOp"} def __init__(self, *args): super(NonArgAggregateOp, self).__init__(*args) @@ -10357,12 +28156,16 @@ def __init__(self, *args): class NonNormalizedSpec(VegaLiteSchema): """NonNormalizedSpec schema wrapper - anyOf(:class:`FacetedUnitSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetSpec`, - :class:`ConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`, - :class:`HConcatSpecGenericSpec`) + :class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, + Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], + :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, + Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], + :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`NonNormalizedSpec`, + :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]] Any specification in Vega-Lite. """ - _schema = {'$ref': '#/definitions/NonNormalizedSpec'} + + _schema = {"$ref": "#/definitions/NonNormalizedSpec"} def __init__(self, *args, **kwds): super(NonNormalizedSpec, self).__init__(*args, **kwds) @@ -10371,55 +28174,82 @@ def __init__(self, *args, **kwds): class NumberLocale(VegaLiteSchema): """NumberLocale schema wrapper - Mapping(required=[decimal, thousands, grouping, currency]) + :class:`NumberLocale`, Dict[required=[decimal, thousands, grouping, currency]] Locale definition for formatting numbers. Parameters ---------- - currency : :class:`Vector2string` + currency : :class:`Vector2string`, Sequence[str] The currency prefix and suffix (e.g., ["$", ""]). - decimal : string + decimal : str The decimal point (e.g., "."). - grouping : List(float) + grouping : Sequence[float] The array of group sizes (e.g., [3]), cycled as needed. - thousands : string + thousands : str The group separator (e.g., ","). - minus : string + minus : str The minus sign (defaults to hyphen-minus, "-"). - nan : string + nan : str The not-a-number value (defaults to "NaN"). - numerals : :class:`Vector10string` + numerals : :class:`Vector10string`, Sequence[str] An array of ten strings to replace the numerals 0-9. - percent : string + percent : str The percent sign (defaults to "%"). """ - _schema = {'$ref': '#/definitions/NumberLocale'} - def __init__(self, currency=Undefined, decimal=Undefined, grouping=Undefined, thousands=Undefined, - minus=Undefined, nan=Undefined, numerals=Undefined, percent=Undefined, **kwds): - super(NumberLocale, self).__init__(currency=currency, decimal=decimal, grouping=grouping, - thousands=thousands, minus=minus, nan=nan, numerals=numerals, - percent=percent, **kwds) + _schema = {"$ref": "#/definitions/NumberLocale"} + + def __init__( + self, + currency: Union[ + Union["Vector2string", Sequence[str]], UndefinedType + ] = Undefined, + decimal: Union[str, UndefinedType] = Undefined, + grouping: Union[Sequence[float], UndefinedType] = Undefined, + thousands: Union[str, UndefinedType] = Undefined, + minus: Union[str, UndefinedType] = Undefined, + nan: Union[str, UndefinedType] = Undefined, + numerals: Union[ + Union["Vector10string", Sequence[str]], UndefinedType + ] = Undefined, + percent: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(NumberLocale, self).__init__( + currency=currency, + decimal=decimal, + grouping=grouping, + thousands=thousands, + minus=minus, + nan=nan, + numerals=numerals, + percent=percent, + **kwds, + ) class NumericArrayMarkPropDef(VegaLiteSchema): """NumericArrayMarkPropDef schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, - :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`) + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, + Dict[required=[shorthand]], :class:`NumericArrayMarkPropDef`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`, Dict """ - _schema = {'$ref': '#/definitions/NumericArrayMarkPropDef'} + + _schema = {"$ref": "#/definitions/NumericArrayMarkPropDef"} def __init__(self, *args, **kwds): super(NumericArrayMarkPropDef, self).__init__(*args, **kwds) -class FieldOrDatumDefWithConditionDatumDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): +class FieldOrDatumDefWithConditionDatumDefnumberArray( + MarkPropDefnumberArray, NumericArrayMarkPropDef +): """FieldOrDatumDefWithConditionDatumDefnumberArray schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, Dict Parameters ---------- @@ -10428,16 +28258,16 @@ class FieldOrDatumDefWithConditionDatumDefnumberArray(MarkPropDefnumberArray, Nu Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, List(:class:`ConditionalValueDefnumberArrayExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -10457,7 +28287,7 @@ class FieldOrDatumDefWithConditionDatumDefnumberArray(MarkPropDefnumberArray, Nu 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10527,25 +28357,73 @@ class FieldOrDatumDefWithConditionDatumDefnumberArray(MarkPropDefnumberArray, Nu **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<DatumDef,number[]>'} - def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, - type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionDatumDefnumberArray, self).__init__(bandPosition=bandPosition, - condition=condition, - datum=datum, title=title, - type=type, **kwds) - - -class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + _schema = {"$ref": "#/definitions/FieldOrDatumDefWithCondition<DatumDef,number[]>"} + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefnumberArrayExprRef", + Union["ConditionalParameterValueDefnumberArrayExprRef", dict], + Union["ConditionalPredicateValueDefnumberArrayExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefnumberArrayExprRef", + Union["ConditionalParameterValueDefnumberArrayExprRef", dict], + Union["ConditionalPredicateValueDefnumberArrayExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionDatumDefnumberArray, self).__init__( + bandPosition=bandPosition, + condition=condition, + datum=datum, + title=title, + type=type, + **kwds, + ) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray( + MarkPropDefnumberArray, NumericArrayMarkPropDef +): """FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -10557,7 +28435,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -10578,14 +28456,14 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, List(:class:`ConditionalValueDefnumberArrayExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -10600,7 +28478,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -10609,7 +28487,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -10622,7 +28500,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -10661,7 +28539,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -10670,7 +28548,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -10690,7 +28568,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10760,32 +28638,320 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberA **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef,number[]>'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray, self).__init__(aggregate=aggregate, - bandPosition=bandPosition, - bin=bin, - condition=condition, - field=field, - legend=legend, - scale=scale, - sort=sort, - timeUnit=timeUnit, - title=title, - type=type, **kwds) + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef,number[]>" + } + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefnumberArrayExprRef", + Union["ConditionalParameterValueDefnumberArrayExprRef", dict], + Union["ConditionalPredicateValueDefnumberArrayExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefnumberArrayExprRef", + Union["ConditionalParameterValueDefnumberArrayExprRef", dict], + Union["ConditionalPredicateValueDefnumberArrayExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union["Legend", dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + "Sort", + None, + Union[ + "AllSortString", + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + Union[ + "SortByChannelDesc", + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortByEncoding", dict], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class NumericMarkPropDef(VegaLiteSchema): """NumericMarkPropDef schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, - :class:`FieldOrDatumDefWithConditionDatumDefnumber`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]], + :class:`NumericMarkPropDef`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, + Dict """ - _schema = {'$ref': '#/definitions/NumericMarkPropDef'} + + _schema = {"$ref": "#/definitions/NumericMarkPropDef"} def __init__(self, *args, **kwds): super(NumericMarkPropDef, self).__init__(*args, **kwds) @@ -10794,7 +28960,7 @@ def __init__(self, *args, **kwds): class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): """FieldOrDatumDefWithConditionDatumDefnumber schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, Dict Parameters ---------- @@ -10803,16 +28969,16 @@ class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkP Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -10832,7 +28998,7 @@ class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkP 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -10902,25 +29068,73 @@ class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkP **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<DatumDef,number>'} - - def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, - type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionDatumDefnumber, self).__init__(bandPosition=bandPosition, - condition=condition, - datum=datum, title=title, - type=type, **kwds) - -class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, NumericMarkPropDef): + _schema = {"$ref": "#/definitions/FieldOrDatumDefWithCondition<DatumDef,number>"} + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefnumberExprRef", + Union["ConditionalParameterValueDefnumberExprRef", dict], + Union["ConditionalPredicateValueDefnumberExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefnumberExprRef", + Union["ConditionalParameterValueDefnumberExprRef", dict], + Union["ConditionalPredicateValueDefnumberExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionDatumDefnumber, self).__init__( + bandPosition=bandPosition, + condition=condition, + datum=datum, + title=title, + type=type, + **kwds, + ) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefnumber( + MarkPropDefnumber, NumericMarkPropDef +): """FieldOrDatumDefWithConditionMarkPropFieldDefnumber schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -10932,7 +29146,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -10953,14 +29167,14 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -10975,7 +29189,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -10984,7 +29198,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -10997,7 +29211,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -11036,7 +29250,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -11045,7 +29259,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -11065,7 +29279,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -11135,29 +29349,318 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef,number>'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionMarkPropFieldDefnumber, self).__init__(aggregate=aggregate, - bandPosition=bandPosition, - bin=bin, - condition=condition, - field=field, - legend=legend, - scale=scale, sort=sort, - timeUnit=timeUnit, - title=title, type=type, - **kwds) + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef,number>" + } + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefnumberExprRef", + Union["ConditionalParameterValueDefnumberExprRef", dict], + Union["ConditionalPredicateValueDefnumberExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefnumberExprRef", + Union["ConditionalParameterValueDefnumberExprRef", dict], + Union["ConditionalPredicateValueDefnumberExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union["Legend", dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + "Sort", + None, + Union[ + "AllSortString", + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + Union[ + "SortByChannelDesc", + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortByEncoding", dict], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionMarkPropFieldDefnumber, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class OffsetDef(VegaLiteSchema): """OffsetDef schema wrapper - anyOf(:class:`ScaleFieldDef`, :class:`ScaleDatumDef`, :class:`ValueDefnumber`) + :class:`OffsetDef`, :class:`ScaleDatumDef`, Dict, :class:`ScaleFieldDef`, + Dict[required=[shorthand]], :class:`ValueDefnumber`, Dict[required=[value]] """ - _schema = {'$ref': '#/definitions/OffsetDef'} + + _schema = {"$ref": "#/definitions/OffsetDef"} def __init__(self, *args, **kwds): super(OffsetDef, self).__init__(*args, **kwds) @@ -11166,12 +29669,14 @@ def __init__(self, *args, **kwds): class OrderFieldDef(VegaLiteSchema): """OrderFieldDef schema wrapper - Mapping(required=[]) + :class:`OrderFieldDef`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -11183,7 +29688,7 @@ class OrderFieldDef(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -11204,7 +29709,7 @@ class OrderFieldDef(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -11219,9 +29724,9 @@ class OrderFieldDef(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - sort : :class:`SortOrder` + sort : :class:`SortOrder`, Literal['ascending', 'descending'] The sort order. One of ``"ascending"`` (default) or ``"descending"``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -11230,7 +29735,7 @@ class OrderFieldDef(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -11250,7 +29755,7 @@ class OrderFieldDef(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -11320,45 +29825,272 @@ class OrderFieldDef(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/OrderFieldDef'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(OrderFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, - field=field, sort=sort, timeUnit=timeUnit, title=title, - type=type, **kwds) + _schema = {"$ref": "#/definitions/OrderFieldDef"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + sort: Union[ + Union["SortOrder", Literal["ascending", "descending"]], UndefinedType + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(OrderFieldDef, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class OrderOnlyDef(VegaLiteSchema): """OrderOnlyDef schema wrapper - Mapping(required=[]) + :class:`OrderOnlyDef`, Dict Parameters ---------- - sort : :class:`SortOrder` + sort : :class:`SortOrder`, Literal['ascending', 'descending'] The sort order. One of ``"ascending"`` (default) or ``"descending"``. """ - _schema = {'$ref': '#/definitions/OrderOnlyDef'} - def __init__(self, sort=Undefined, **kwds): + _schema = {"$ref": "#/definitions/OrderOnlyDef"} + + def __init__( + self, + sort: Union[ + Union["SortOrder", Literal["ascending", "descending"]], UndefinedType + ] = Undefined, + **kwds, + ): super(OrderOnlyDef, self).__init__(sort=sort, **kwds) class OrderValueDef(VegaLiteSchema): """OrderValueDef schema wrapper - Mapping(required=[value]) + :class:`OrderValueDef`, Dict[required=[value]] Parameters ---------- - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). - condition : anyOf(:class:`ConditionalValueDefnumber`, List(:class:`ConditionalValueDefnumber`)) + condition : :class:`ConditionalParameterValueDefnumber`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumber`, Dict[required=[test, value]], :class:`ConditionalValueDefnumber`, Sequence[:class:`ConditionalParameterValueDefnumber`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumber`, Dict[required=[test, value]], :class:`ConditionalValueDefnumber`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. @@ -11366,18 +30098,43 @@ class OrderValueDef(VegaLiteSchema): value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. """ - _schema = {'$ref': '#/definitions/OrderValueDef'} - def __init__(self, value=Undefined, condition=Undefined, **kwds): + _schema = {"$ref": "#/definitions/OrderValueDef"} + + def __init__( + self, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefnumber", + Union["ConditionalParameterValueDefnumber", dict], + Union["ConditionalPredicateValueDefnumber", dict], + ] + ], + Union[ + "ConditionalValueDefnumber", + Union["ConditionalParameterValueDefnumber", dict], + Union["ConditionalPredicateValueDefnumber", dict], + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(OrderValueDef, self).__init__(value=value, condition=condition, **kwds) class Orient(VegaLiteSchema): """Orient schema wrapper - enum('left', 'right', 'top', 'bottom') + :class:`Orient`, Literal['left', 'right', 'top', 'bottom'] """ - _schema = {'$ref': '#/definitions/Orient'} + + _schema = {"$ref": "#/definitions/Orient"} def __init__(self, *args): super(Orient, self).__init__(*args) @@ -11386,9 +30143,10 @@ def __init__(self, *args): class Orientation(VegaLiteSchema): """Orientation schema wrapper - enum('horizontal', 'vertical') + :class:`Orientation`, Literal['horizontal', 'vertical'] """ - _schema = {'$ref': '#/definitions/Orientation'} + + _schema = {"$ref": "#/definitions/Orientation"} def __init__(self, *args): super(Orientation, self).__init__(*args) @@ -11397,37 +30155,37 @@ def __init__(self, *args): class OverlayMarkDef(VegaLiteSchema): """OverlayMarkDef schema wrapper - Mapping(required=[]) + :class:`OverlayMarkDef`, Dict Parameters ---------- - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -11438,15 +30196,15 @@ class OverlayMarkDef(VegaLiteSchema): ``"middle"``, ``"bottom"``. **Note:** Expression reference is *not* supported for range marks. - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - clip : boolean + clip : bool Whether a mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -11459,63 +30217,63 @@ class OverlayMarkDef(VegaLiteSchema): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - endAngle : anyOf(float, :class:`ExprRef`) + endAngle : :class:`ExprRef`, Dict[required=[expr]], float The end angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -11525,28 +30283,28 @@ class OverlayMarkDef(VegaLiteSchema): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`) + height : :class:`ExprRef`, Dict[required=[expr]], float Height of the marks. - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -11568,7 +30326,7 @@ class OverlayMarkDef(VegaLiteSchema): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -11577,26 +30335,26 @@ class OverlayMarkDef(VegaLiteSchema): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -11608,28 +30366,28 @@ class OverlayMarkDef(VegaLiteSchema): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - radius2Offset : anyOf(float, :class:`ExprRef`) + radius2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for radius2. - radiusOffset : anyOf(float, :class:`ExprRef`) + radiusOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for radius. - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -11644,7 +30402,7 @@ class OverlayMarkDef(VegaLiteSchema): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -11661,45 +30419,45 @@ class OverlayMarkDef(VegaLiteSchema): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - startAngle : anyOf(float, :class:`ExprRef`) + startAngle : :class:`ExprRef`, Dict[required=[expr]], float The start angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - style : anyOf(string, List(string)) + style : Sequence[str], str A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the `style configuration @@ -11713,23 +30471,23 @@ class OverlayMarkDef(VegaLiteSchema): For example, a bar mark with ``"style": "foo"`` will receive from ``config.style.bar`` and ``config.style.foo`` (the specified style ``"foo"`` has higher precedence). - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. - theta2Offset : anyOf(float, :class:`ExprRef`) + theta2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for theta2. - thetaOffset : anyOf(float, :class:`ExprRef`) + thetaOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for theta. timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be @@ -11739,7 +30497,7 @@ class OverlayMarkDef(VegaLiteSchema): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -11754,104 +30512,1016 @@ class OverlayMarkDef(VegaLiteSchema): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`) + width : :class:`ExprRef`, Dict[required=[expr]], float Width of the marks. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2Offset : anyOf(float, :class:`ExprRef`) + x2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for x2-position. - xOffset : anyOf(float, :class:`ExprRef`) + xOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for x-position. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2Offset : anyOf(float, :class:`ExprRef`) + y2Offset : :class:`ExprRef`, Dict[required=[expr]], float Offset for y2-position. - yOffset : anyOf(float, :class:`ExprRef`) + yOffset : :class:`ExprRef`, Dict[required=[expr]], float Offset for y-position. """ - _schema = {'$ref': '#/definitions/OverlayMarkDef'} - - def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, - clip=Undefined, color=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - description=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, - endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, - opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, - padAngle=Undefined, radius=Undefined, radius2=Undefined, radius2Offset=Undefined, - radiusOffset=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, - startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, - theta2Offset=Undefined, thetaOffset=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - super(OverlayMarkDef, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - baseline=baseline, blend=blend, clip=clip, color=color, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, dx=dx, dy=dy, - ellipsis=ellipsis, endAngle=endAngle, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, - fontWeight=fontWeight, height=height, href=href, - innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, lineBreak=lineBreak, - lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, outerRadius=outerRadius, padAngle=padAngle, - radius=radius, radius2=radius2, - radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, - startAngle=startAngle, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, - strokeOffset=strokeOffset, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, - theta2Offset=theta2Offset, thetaOffset=thetaOffset, - timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, - url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, - yOffset=yOffset, **kwds) + + _schema = {"$ref": "#/definitions/OverlayMarkDef"} + + def __init__( + self, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + endAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + startAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(OverlayMarkDef, self).__init__( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + baseline=baseline, + blend=blend, + clip=clip, + color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + dx=dx, + dy=dy, + ellipsis=ellipsis, + endAngle=endAngle, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + lineBreak=lineBreak, + lineHeight=lineHeight, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + startAngle=startAngle, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) class Padding(VegaLiteSchema): """Padding schema wrapper - anyOf(float, Mapping(required=[])) + :class:`Padding`, Dict, float """ - _schema = {'$ref': '#/definitions/Padding'} + + _schema = {"$ref": "#/definitions/Padding"} def __init__(self, *args, **kwds): super(Padding, self).__init__(*args, **kwds) @@ -11860,9 +31530,10 @@ def __init__(self, *args, **kwds): class ParameterExtent(BinExtent): """ParameterExtent schema wrapper - anyOf(Mapping(required=[param]), Mapping(required=[param])) + :class:`ParameterExtent`, Dict[required=[param]] """ - _schema = {'$ref': '#/definitions/ParameterExtent'} + + _schema = {"$ref": "#/definitions/ParameterExtent"} def __init__(self, *args, **kwds): super(ParameterExtent, self).__init__(*args, **kwds) @@ -11871,9 +31542,10 @@ def __init__(self, *args, **kwds): class ParameterName(VegaLiteSchema): """ParameterName schema wrapper - string + :class:`ParameterName`, str """ - _schema = {'$ref': '#/definitions/ParameterName'} + + _schema = {"$ref": "#/definitions/ParameterName"} def __init__(self, *args): super(ParameterName, self).__init__(*args) @@ -11882,9 +31554,10 @@ def __init__(self, *args): class Parse(VegaLiteSchema): """Parse schema wrapper - Mapping(required=[]) + :class:`Parse`, Dict """ - _schema = {'$ref': '#/definitions/Parse'} + + _schema = {"$ref": "#/definitions/Parse"} def __init__(self, **kwds): super(Parse, self).__init__(**kwds) @@ -11893,9 +31566,10 @@ def __init__(self, **kwds): class ParseValue(VegaLiteSchema): """ParseValue schema wrapper - anyOf(None, string, string, string, string, string) + :class:`ParseValue`, None, str """ - _schema = {'$ref': '#/definitions/ParseValue'} + + _schema = {"$ref": "#/definitions/ParseValue"} def __init__(self, *args, **kwds): super(ParseValue, self).__init__(*args, **kwds) @@ -11904,39 +31578,50 @@ def __init__(self, *args, **kwds): class Point(Geometry): """Point schema wrapper - Mapping(required=[coordinates, type]) + :class:`Point`, Dict[required=[coordinates, type]] Point geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2 Parameters ---------- - coordinates : :class:`Position` + coordinates : :class:`Position`, Sequence[float] A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined. - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/Point'} - def __init__(self, coordinates=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(Point, self).__init__(coordinates=coordinates, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/Point"} + + def __init__( + self, + coordinates: Union[ + Union["Position", Sequence[float]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(Point, self).__init__( + coordinates=coordinates, type=type, bbox=bbox, **kwds + ) class PointSelectionConfig(VegaLiteSchema): """PointSelectionConfig schema wrapper - Mapping(required=[type]) + :class:`PointSelectionConfig`, Dict[required=[type]] Parameters ---------- - type : string + type : str Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types: @@ -11944,7 +31629,7 @@ class PointSelectionConfig(VegaLiteSchema): * ``"point"`` -- to select multiple discrete data values; the first value is selected on ``click`` and additional values toggled on shift-click. * ``"interval"`` -- to select a continuous range of data values on ``drag``. - clear : anyOf(:class:`Stream`, string, boolean) + clear : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, bool, str Clears the selection, emptying it of all values. This property can be a `Event Stream <https://vega.github.io/vega/docs/event-streams/>`__ or ``false`` to disable clear. @@ -11954,21 +31639,21 @@ class PointSelectionConfig(VegaLiteSchema): **See also:** `clear examples <https://vega.github.io/vega-lite/docs/selection.html#clear>`__ in the documentation. - encodings : List(:class:`SingleDefUnitChannel`) + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'shape', 'key', 'text', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - fields : List(:class:`FieldName`) + fields : Sequence[:class:`FieldName`, str] An array of field names whose values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - nearest : boolean + nearest : bool When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value *nearest* the mouse cursor is added to the selection. @@ -11977,7 +31662,7 @@ class PointSelectionConfig(VegaLiteSchema): **See also:** `nearest examples <https://vega.github.io/vega-lite/docs/selection.html#nearest>`__ documentation. - on : anyOf(:class:`Stream`, string) + on : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, str A `Vega event stream <https://vega.github.io/vega/docs/event-streams/>`__ (object or selector) that triggers the selection. For interval selections, the event stream must specify a `start and end @@ -11985,7 +31670,7 @@ class PointSelectionConfig(VegaLiteSchema): **See also:** `on examples <https://vega.github.io/vega-lite/docs/selection.html#on>`__ in the documentation. - resolve : :class:`SelectionResolution` + resolve : :class:`SelectionResolution`, Literal['global', 'union', 'intersect'] With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain. @@ -12005,7 +31690,7 @@ class PointSelectionConfig(VegaLiteSchema): **See also:** `resolve examples <https://vega.github.io/vega-lite/docs/selection.html#resolve>`__ in the documentation. - toggle : anyOf(string, boolean) + toggle : bool, str Controls whether data values should be toggled (inserted or removed from a point selection) or only ever inserted into point selections. @@ -12030,24 +31715,108 @@ class PointSelectionConfig(VegaLiteSchema): <https://vega.github.io/vega-lite/docs/selection.html#toggle>`__ in the documentation. """ - _schema = {'$ref': '#/definitions/PointSelectionConfig'} - def __init__(self, type=Undefined, clear=Undefined, encodings=Undefined, fields=Undefined, - nearest=Undefined, on=Undefined, resolve=Undefined, toggle=Undefined, **kwds): - super(PointSelectionConfig, self).__init__(type=type, clear=clear, encodings=encodings, - fields=fields, nearest=nearest, on=on, - resolve=resolve, toggle=toggle, **kwds) + _schema = {"$ref": "#/definitions/PointSelectionConfig"} + + def __init__( + self, + type: Union[str, UndefinedType] = Undefined, + clear: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + bool, + str, + ], + UndefinedType, + ] = Undefined, + encodings: Union[ + Sequence[ + Union[ + "SingleDefUnitChannel", + Literal[ + "x", + "y", + "xOffset", + "yOffset", + "x2", + "y2", + "longitude", + "latitude", + "longitude2", + "latitude2", + "theta", + "theta2", + "radius", + "radius2", + "color", + "fill", + "stroke", + "opacity", + "fillOpacity", + "strokeOpacity", + "strokeWidth", + "strokeDash", + "size", + "angle", + "shape", + "key", + "text", + "href", + "url", + "description", + ], + ] + ], + UndefinedType, + ] = Undefined, + fields: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + nearest: Union[bool, UndefinedType] = Undefined, + on: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + resolve: Union[ + Union["SelectionResolution", Literal["global", "union", "intersect"]], + UndefinedType, + ] = Undefined, + toggle: Union[Union[bool, str], UndefinedType] = Undefined, + **kwds, + ): + super(PointSelectionConfig, self).__init__( + type=type, + clear=clear, + encodings=encodings, + fields=fields, + nearest=nearest, + on=on, + resolve=resolve, + toggle=toggle, + **kwds, + ) class PointSelectionConfigWithoutType(VegaLiteSchema): """PointSelectionConfigWithoutType schema wrapper - Mapping(required=[]) + :class:`PointSelectionConfigWithoutType`, Dict Parameters ---------- - clear : anyOf(:class:`Stream`, string, boolean) + clear : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, bool, str Clears the selection, emptying it of all values. This property can be a `Event Stream <https://vega.github.io/vega/docs/event-streams/>`__ or ``false`` to disable clear. @@ -12057,21 +31826,21 @@ class PointSelectionConfigWithoutType(VegaLiteSchema): **See also:** `clear examples <https://vega.github.io/vega-lite/docs/selection.html#clear>`__ in the documentation. - encodings : List(:class:`SingleDefUnitChannel`) + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'shape', 'key', 'text', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - fields : List(:class:`FieldName`) + fields : Sequence[:class:`FieldName`, str] An array of field names whose values must match for a data tuple to fall within the selection. **See also:** The `projection with encodings and fields section <https://vega.github.io/vega-lite/docs/selection.html#project>`__ in the documentation. - nearest : boolean + nearest : bool When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value *nearest* the mouse cursor is added to the selection. @@ -12080,7 +31849,7 @@ class PointSelectionConfigWithoutType(VegaLiteSchema): **See also:** `nearest examples <https://vega.github.io/vega-lite/docs/selection.html#nearest>`__ documentation. - on : anyOf(:class:`Stream`, string) + on : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`, str A `Vega event stream <https://vega.github.io/vega/docs/event-streams/>`__ (object or selector) that triggers the selection. For interval selections, the event stream must specify a `start and end @@ -12088,7 +31857,7 @@ class PointSelectionConfigWithoutType(VegaLiteSchema): **See also:** `on examples <https://vega.github.io/vega-lite/docs/selection.html#on>`__ in the documentation. - resolve : :class:`SelectionResolution` + resolve : :class:`SelectionResolution`, Literal['global', 'union', 'intersect'] With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain. @@ -12108,7 +31877,7 @@ class PointSelectionConfigWithoutType(VegaLiteSchema): **See also:** `resolve examples <https://vega.github.io/vega-lite/docs/selection.html#resolve>`__ in the documentation. - toggle : anyOf(string, boolean) + toggle : bool, str Controls whether data values should be toggled (inserted or removed from a point selection) or only ever inserted into point selections. @@ -12133,22 +31902,105 @@ class PointSelectionConfigWithoutType(VegaLiteSchema): <https://vega.github.io/vega-lite/docs/selection.html#toggle>`__ in the documentation. """ - _schema = {'$ref': '#/definitions/PointSelectionConfigWithoutType'} - def __init__(self, clear=Undefined, encodings=Undefined, fields=Undefined, nearest=Undefined, - on=Undefined, resolve=Undefined, toggle=Undefined, **kwds): - super(PointSelectionConfigWithoutType, self).__init__(clear=clear, encodings=encodings, - fields=fields, nearest=nearest, on=on, - resolve=resolve, toggle=toggle, **kwds) + _schema = {"$ref": "#/definitions/PointSelectionConfigWithoutType"} + + def __init__( + self, + clear: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + bool, + str, + ], + UndefinedType, + ] = Undefined, + encodings: Union[ + Sequence[ + Union[ + "SingleDefUnitChannel", + Literal[ + "x", + "y", + "xOffset", + "yOffset", + "x2", + "y2", + "longitude", + "latitude", + "longitude2", + "latitude2", + "theta", + "theta2", + "radius", + "radius2", + "color", + "fill", + "stroke", + "opacity", + "fillOpacity", + "strokeOpacity", + "strokeWidth", + "strokeDash", + "size", + "angle", + "shape", + "key", + "text", + "href", + "url", + "description", + ], + ] + ], + UndefinedType, + ] = Undefined, + fields: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + nearest: Union[bool, UndefinedType] = Undefined, + on: Union[ + Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + resolve: Union[ + Union["SelectionResolution", Literal["global", "union", "intersect"]], + UndefinedType, + ] = Undefined, + toggle: Union[Union[bool, str], UndefinedType] = Undefined, + **kwds, + ): + super(PointSelectionConfigWithoutType, self).__init__( + clear=clear, + encodings=encodings, + fields=fields, + nearest=nearest, + on=on, + resolve=resolve, + toggle=toggle, + **kwds, + ) class PolarDef(VegaLiteSchema): """PolarDef schema wrapper - anyOf(:class:`PositionFieldDefBase`, :class:`PositionDatumDefBase`, - :class:`PositionValueDef`) + :class:`PolarDef`, :class:`PositionDatumDefBase`, Dict, :class:`PositionFieldDefBase`, + Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] """ - _schema = {'$ref': '#/definitions/PolarDef'} + + _schema = {"$ref": "#/definitions/PolarDef"} def __init__(self, *args, **kwds): super(PolarDef, self).__init__(*args, **kwds) @@ -12157,36 +32009,48 @@ def __init__(self, *args, **kwds): class Polygon(Geometry): """Polygon schema wrapper - Mapping(required=[coordinates, type]) + :class:`Polygon`, Dict[required=[coordinates, type]] Polygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.6 Parameters ---------- - coordinates : List(List(:class:`Position`)) + coordinates : Sequence[Sequence[:class:`Position`, Sequence[float]]] - type : string + type : str Specifies the type of GeoJSON object. - bbox : :class:`BBox` + bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 """ - _schema = {'$ref': '#/definitions/Polygon'} - def __init__(self, coordinates=Undefined, type=Undefined, bbox=Undefined, **kwds): - super(Polygon, self).__init__(coordinates=coordinates, type=type, bbox=bbox, **kwds) + _schema = {"$ref": "#/definitions/Polygon"} + + def __init__( + self, + coordinates: Union[ + Sequence[Sequence[Union["Position", Sequence[float]]]], UndefinedType + ] = Undefined, + type: Union[str, UndefinedType] = Undefined, + bbox: Union[Union["BBox", Sequence[float]], UndefinedType] = Undefined, + **kwds, + ): + super(Polygon, self).__init__( + coordinates=coordinates, type=type, bbox=bbox, **kwds + ) class Position(VegaLiteSchema): """Position schema wrapper - List(float) + :class:`Position`, Sequence[float] A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined. """ - _schema = {'$ref': '#/definitions/Position'} + + _schema = {"$ref": "#/definitions/Position"} def __init__(self, *args): super(Position, self).__init__(*args) @@ -12195,9 +32059,11 @@ def __init__(self, *args): class Position2Def(VegaLiteSchema): """Position2Def schema wrapper - anyOf(:class:`SecondaryFieldDef`, :class:`DatumDef`, :class:`PositionValueDef`) + :class:`DatumDef`, Dict, :class:`Position2Def`, :class:`PositionValueDef`, + Dict[required=[value]], :class:`SecondaryFieldDef`, Dict[required=[shorthand]] """ - _schema = {'$ref': '#/definitions/Position2Def'} + + _schema = {"$ref": "#/definitions/Position2Def"} def __init__(self, *args, **kwds): super(Position2Def, self).__init__(*args, **kwds) @@ -12206,7 +32072,7 @@ def __init__(self, *args, **kwds): class DatumDef(LatLongDef, Position2Def): """DatumDef schema wrapper - Mapping(required=[]) + :class:`DatumDef`, Dict Parameters ---------- @@ -12215,9 +32081,9 @@ class DatumDef(LatLongDef, Position2Def): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12237,7 +32103,7 @@ class DatumDef(LatLongDef, Position2Def): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -12307,17 +32173,42 @@ class DatumDef(LatLongDef, Position2Def): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/DatumDef'} - def __init__(self, bandPosition=Undefined, datum=Undefined, title=Undefined, type=Undefined, **kwds): - super(DatumDef, self).__init__(bandPosition=bandPosition, datum=datum, title=title, type=type, - **kwds) + _schema = {"$ref": "#/definitions/DatumDef"} + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(DatumDef, self).__init__( + bandPosition=bandPosition, datum=datum, title=title, type=type, **kwds + ) class PositionDatumDefBase(PolarDef): """PositionDatumDefBase schema wrapper - Mapping(required=[]) + :class:`PositionDatumDefBase`, Dict Parameters ---------- @@ -12326,9 +32217,9 @@ class PositionDatumDefBase(PolarDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -12341,7 +32232,7 @@ class PositionDatumDefBase(PolarDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -12372,7 +32263,7 @@ class PositionDatumDefBase(PolarDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12392,7 +32283,7 @@ class PositionDatumDefBase(PolarDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -12462,20 +32353,59 @@ class PositionDatumDefBase(PolarDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/PositionDatumDefBase'} - def __init__(self, bandPosition=Undefined, datum=Undefined, scale=Undefined, stack=Undefined, - title=Undefined, type=Undefined, **kwds): - super(PositionDatumDefBase, self).__init__(bandPosition=bandPosition, datum=datum, scale=scale, - stack=stack, title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/PositionDatumDefBase"} + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + stack: Union[ + Union[ + None, Union["StackOffset", Literal["zero", "center", "normalize"]], bool + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(PositionDatumDefBase, self).__init__( + bandPosition=bandPosition, + datum=datum, + scale=scale, + stack=stack, + title=title, + type=type, + **kwds, + ) class PositionDef(VegaLiteSchema): """PositionDef schema wrapper - anyOf(:class:`PositionFieldDef`, :class:`PositionDatumDef`, :class:`PositionValueDef`) + :class:`PositionDatumDef`, Dict, :class:`PositionDef`, :class:`PositionFieldDef`, + Dict[required=[shorthand]], :class:`PositionValueDef`, Dict[required=[value]] """ - _schema = {'$ref': '#/definitions/PositionDef'} + + _schema = {"$ref": "#/definitions/PositionDef"} def __init__(self, *args, **kwds): super(PositionDef, self).__init__(*args, **kwds) @@ -12484,12 +32414,12 @@ def __init__(self, *args, **kwds): class PositionDatumDef(PositionDef): """PositionDatumDef schema wrapper - Mapping(required=[]) + :class:`PositionDatumDef`, Dict Parameters ---------- - axis : anyOf(:class:`Axis`, None) + axis : :class:`Axis`, Dict, None An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -12502,9 +32432,9 @@ class PositionDatumDef(PositionDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - impute : anyOf(:class:`ImputeParams`, None) + impute : :class:`ImputeParams`, Dict, None An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as ``key`` of the ``Impute`` Operation. The field of the ``color`` channel if specified is used as ``groupby`` of @@ -12512,7 +32442,7 @@ class PositionDatumDef(PositionDef): **See also:** `impute <https://vega.github.io/vega-lite/docs/impute.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -12525,7 +32455,7 @@ class PositionDatumDef(PositionDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -12556,7 +32486,7 @@ class PositionDatumDef(PositionDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12576,7 +32506,7 @@ class PositionDatumDef(PositionDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -12646,24 +32576,68 @@ class PositionDatumDef(PositionDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/PositionDatumDef'} - def __init__(self, axis=Undefined, bandPosition=Undefined, datum=Undefined, impute=Undefined, - scale=Undefined, stack=Undefined, title=Undefined, type=Undefined, **kwds): - super(PositionDatumDef, self).__init__(axis=axis, bandPosition=bandPosition, datum=datum, - impute=impute, scale=scale, stack=stack, title=title, - type=type, **kwds) + _schema = {"$ref": "#/definitions/PositionDatumDef"} + + def __init__( + self, + axis: Union[Union[None, Union["Axis", dict]], UndefinedType] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + impute: Union[ + Union[None, Union["ImputeParams", dict]], UndefinedType + ] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + stack: Union[ + Union[ + None, Union["StackOffset", Literal["zero", "center", "normalize"]], bool + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(PositionDatumDef, self).__init__( + axis=axis, + bandPosition=bandPosition, + datum=datum, + impute=impute, + scale=scale, + stack=stack, + title=title, + type=type, + **kwds, + ) class PositionFieldDef(PositionDef): """PositionFieldDef schema wrapper - Mapping(required=[]) + :class:`PositionFieldDef`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -12671,7 +32645,7 @@ class PositionFieldDef(PositionDef): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - axis : anyOf(:class:`Axis`, None) + axis : :class:`Axis`, Dict, None An object defining properties of axis's gridlines, ticks and labels. If ``null``, the axis for the encoding channel will be removed. @@ -12684,7 +32658,7 @@ class PositionFieldDef(PositionDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -12705,7 +32679,7 @@ class PositionFieldDef(PositionDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -12720,7 +32694,7 @@ class PositionFieldDef(PositionDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - impute : anyOf(:class:`ImputeParams`, None) + impute : :class:`ImputeParams`, Dict, None An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as ``key`` of the ``Impute`` Operation. The field of the ``color`` channel if specified is used as ``groupby`` of @@ -12728,7 +32702,7 @@ class PositionFieldDef(PositionDef): **See also:** `impute <https://vega.github.io/vega-lite/docs/impute.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -12741,7 +32715,7 @@ class PositionFieldDef(PositionDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -12780,7 +32754,7 @@ class PositionFieldDef(PositionDef): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -12811,7 +32785,7 @@ class PositionFieldDef(PositionDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -12820,7 +32794,7 @@ class PositionFieldDef(PositionDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -12840,7 +32814,7 @@ class PositionFieldDef(PositionDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -12910,26 +32884,312 @@ class PositionFieldDef(PositionDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/PositionFieldDef'} - def __init__(self, aggregate=Undefined, axis=Undefined, bandPosition=Undefined, bin=Undefined, - field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(PositionFieldDef, self).__init__(aggregate=aggregate, axis=axis, - bandPosition=bandPosition, bin=bin, field=field, - impute=impute, scale=scale, sort=sort, stack=stack, - timeUnit=timeUnit, title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/PositionFieldDef"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + axis: Union[Union[None, Union["Axis", dict]], UndefinedType] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + impute: Union[ + Union[None, Union["ImputeParams", dict]], UndefinedType + ] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + "Sort", + None, + Union[ + "AllSortString", + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + Union[ + "SortByChannelDesc", + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortByEncoding", dict], + ], + UndefinedType, + ] = Undefined, + stack: Union[ + Union[ + None, Union["StackOffset", Literal["zero", "center", "normalize"]], bool + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(PositionFieldDef, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + axis=axis, + bandPosition=bandPosition, + bin=bin, + field=field, + impute=impute, + scale=scale, + sort=sort, + stack=stack, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class PositionFieldDefBase(PolarDef): """PositionFieldDefBase schema wrapper - Mapping(required=[]) + :class:`PositionFieldDefBase`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -12941,7 +33201,7 @@ class PositionFieldDefBase(PolarDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -12962,7 +33222,7 @@ class PositionFieldDefBase(PolarDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -12977,7 +33237,7 @@ class PositionFieldDefBase(PolarDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -12990,7 +33250,7 @@ class PositionFieldDefBase(PolarDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -13029,7 +33289,7 @@ class PositionFieldDefBase(PolarDef): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - stack : anyOf(:class:`StackOffset`, None, boolean) + stack : :class:`StackOffset`, Literal['zero', 'center', 'normalize'], None, bool Type of stacking offset if the field should be stacked. ``stack`` is only applicable for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar @@ -13060,7 +33320,7 @@ class PositionFieldDefBase(PolarDef): **See also:** `stack <https://vega.github.io/vega-lite/docs/stack.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -13069,7 +33329,7 @@ class PositionFieldDefBase(PolarDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -13089,7 +33349,7 @@ class PositionFieldDefBase(PolarDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -13159,45 +33419,338 @@ class PositionFieldDefBase(PolarDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/PositionFieldDefBase'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, title=Undefined, - type=Undefined, **kwds): - super(PositionFieldDefBase, self).__init__(aggregate=aggregate, bandPosition=bandPosition, - bin=bin, field=field, scale=scale, sort=sort, - stack=stack, timeUnit=timeUnit, title=title, - type=type, **kwds) + _schema = {"$ref": "#/definitions/PositionFieldDefBase"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + "Sort", + None, + Union[ + "AllSortString", + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + Union[ + "SortByChannelDesc", + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortByEncoding", dict], + ], + UndefinedType, + ] = Undefined, + stack: Union[ + Union[ + None, Union["StackOffset", Literal["zero", "center", "normalize"]], bool + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(PositionFieldDefBase, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + scale=scale, + sort=sort, + stack=stack, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class PositionValueDef(PolarDef, Position2Def, PositionDef): """PositionValueDef schema wrapper - Mapping(required=[value]) + :class:`PositionValueDef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/PositionValueDef'} - def __init__(self, value=Undefined, **kwds): + _schema = {"$ref": "#/definitions/PositionValueDef"} + + def __init__( + self, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): super(PositionValueDef, self).__init__(value=value, **kwds) class PredicateComposition(VegaLiteSchema): """PredicateComposition schema wrapper - anyOf(:class:`LogicalNotPredicate`, :class:`LogicalAndPredicate`, - :class:`LogicalOrPredicate`, :class:`Predicate`) + :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, + Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], + :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, + Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], + :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, + Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], + :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], + :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, + Dict[required=[or]], :class:`PredicateComposition` """ - _schema = {'$ref': '#/definitions/PredicateComposition'} + + _schema = {"$ref": "#/definitions/PredicateComposition"} def __init__(self, *args, **kwds): super(PredicateComposition, self).__init__(*args, **kwds) @@ -13206,15 +33759,16 @@ def __init__(self, *args, **kwds): class LogicalAndPredicate(PredicateComposition): """LogicalAndPredicate schema wrapper - Mapping(required=[and]) + :class:`LogicalAndPredicate`, Dict[required=[and]] Parameters ---------- - and : List(:class:`PredicateComposition`) + and : Sequence[:class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition`] """ - _schema = {'$ref': '#/definitions/LogicalAnd<Predicate>'} + + _schema = {"$ref": "#/definitions/LogicalAnd<Predicate>"} def __init__(self, **kwds): super(LogicalAndPredicate, self).__init__(**kwds) @@ -13223,15 +33777,16 @@ def __init__(self, **kwds): class LogicalNotPredicate(PredicateComposition): """LogicalNotPredicate schema wrapper - Mapping(required=[not]) + :class:`LogicalNotPredicate`, Dict[required=[not]] Parameters ---------- - not : :class:`PredicateComposition` + not : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` """ - _schema = {'$ref': '#/definitions/LogicalNot<Predicate>'} + + _schema = {"$ref": "#/definitions/LogicalNot<Predicate>"} def __init__(self, **kwds): super(LogicalNotPredicate, self).__init__(**kwds) @@ -13240,15 +33795,16 @@ def __init__(self, **kwds): class LogicalOrPredicate(PredicateComposition): """LogicalOrPredicate schema wrapper - Mapping(required=[or]) + :class:`LogicalOrPredicate`, Dict[required=[or]] Parameters ---------- - or : List(:class:`PredicateComposition`) + or : Sequence[:class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition`] """ - _schema = {'$ref': '#/definitions/LogicalOr<Predicate>'} + + _schema = {"$ref": "#/definitions/LogicalOr<Predicate>"} def __init__(self, **kwds): super(LogicalOrPredicate, self).__init__(**kwds) @@ -13257,12 +33813,16 @@ def __init__(self, **kwds): class Predicate(PredicateComposition): """Predicate schema wrapper - anyOf(:class:`FieldEqualPredicate`, :class:`FieldRangePredicate`, - :class:`FieldOneOfPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTPredicate`, - :class:`FieldLTEPredicate`, :class:`FieldGTEPredicate`, :class:`FieldValidPredicate`, - :class:`ParameterPredicate`, string) + :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, + Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], + :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, + Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], + :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, + Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], + :class:`Predicate`, str """ - _schema = {'$ref': '#/definitions/Predicate'} + + _schema = {"$ref": "#/definitions/Predicate"} def __init__(self, *args, **kwds): super(Predicate, self).__init__(*args, **kwds) @@ -13271,297 +33831,1629 @@ def __init__(self, *args, **kwds): class FieldEqualPredicate(Predicate): """FieldEqualPredicate schema wrapper - Mapping(required=[equal, field]) + :class:`FieldEqualPredicate`, Dict[required=[equal, field]] Parameters ---------- - equal : anyOf(string, float, boolean, :class:`DateTime`, :class:`ExprRef`) + equal : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], bool, float, str The value that the field should be equal to. - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldEqualPredicate'} - def __init__(self, equal=Undefined, field=Undefined, timeUnit=Undefined, **kwds): - super(FieldEqualPredicate, self).__init__(equal=equal, field=field, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldEqualPredicate"} + + def __init__( + self, + equal: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldEqualPredicate, self).__init__( + equal=equal, field=field, timeUnit=timeUnit, **kwds + ) class FieldGTEPredicate(Predicate): """FieldGTEPredicate schema wrapper - Mapping(required=[field, gte]) + :class:`FieldGTEPredicate`, Dict[required=[field, gte]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - gte : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + gte : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], float, str The value that the field should be greater than or equals to. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldGTEPredicate'} - def __init__(self, field=Undefined, gte=Undefined, timeUnit=Undefined, **kwds): - super(FieldGTEPredicate, self).__init__(field=field, gte=gte, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldGTEPredicate"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + gte: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + float, + str, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldGTEPredicate, self).__init__( + field=field, gte=gte, timeUnit=timeUnit, **kwds + ) class FieldGTPredicate(Predicate): """FieldGTPredicate schema wrapper - Mapping(required=[field, gt]) + :class:`FieldGTPredicate`, Dict[required=[field, gt]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - gt : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + gt : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], float, str The value that the field should be greater than. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldGTPredicate'} - def __init__(self, field=Undefined, gt=Undefined, timeUnit=Undefined, **kwds): - super(FieldGTPredicate, self).__init__(field=field, gt=gt, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldGTPredicate"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + gt: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + float, + str, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldGTPredicate, self).__init__( + field=field, gt=gt, timeUnit=timeUnit, **kwds + ) class FieldLTEPredicate(Predicate): """FieldLTEPredicate schema wrapper - Mapping(required=[field, lte]) + :class:`FieldLTEPredicate`, Dict[required=[field, lte]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - lte : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + lte : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], float, str The value that the field should be less than or equals to. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldLTEPredicate'} - def __init__(self, field=Undefined, lte=Undefined, timeUnit=Undefined, **kwds): - super(FieldLTEPredicate, self).__init__(field=field, lte=lte, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldLTEPredicate"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + lte: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + float, + str, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldLTEPredicate, self).__init__( + field=field, lte=lte, timeUnit=timeUnit, **kwds + ) class FieldLTPredicate(Predicate): """FieldLTPredicate schema wrapper - Mapping(required=[field, lt]) + :class:`FieldLTPredicate`, Dict[required=[field, lt]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - lt : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + lt : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], float, str The value that the field should be less than. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldLTPredicate'} - def __init__(self, field=Undefined, lt=Undefined, timeUnit=Undefined, **kwds): - super(FieldLTPredicate, self).__init__(field=field, lt=lt, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldLTPredicate"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + lt: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + float, + str, + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldLTPredicate, self).__init__( + field=field, lt=lt, timeUnit=timeUnit, **kwds + ) class FieldOneOfPredicate(Predicate): """FieldOneOfPredicate schema wrapper - Mapping(required=[field, oneOf]) + :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - oneOf : anyOf(List(string), List(float), List(boolean), List(:class:`DateTime`)) + oneOf : Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str] A set of values that the ``field`` 's value should be a member of, for a data item included in the filtered data. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldOneOfPredicate'} - def __init__(self, field=Undefined, oneOf=Undefined, timeUnit=Undefined, **kwds): - super(FieldOneOfPredicate, self).__init__(field=field, oneOf=oneOf, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldOneOfPredicate"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + oneOf: Union[ + Union[ + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOneOfPredicate, self).__init__( + field=field, oneOf=oneOf, timeUnit=timeUnit, **kwds + ) class FieldRangePredicate(Predicate): """FieldRangePredicate schema wrapper - Mapping(required=[field, range]) + :class:`FieldRangePredicate`, Dict[required=[field, range]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - range : anyOf(List(anyOf(float, :class:`DateTime`, None, :class:`ExprRef`)), :class:`ExprRef`) + range : :class:`ExprRef`, Dict[required=[expr]], Sequence[:class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], None, float] An array of inclusive minimum and maximum values for a field value of a data item to be included in the filtered data. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldRangePredicate'} - def __init__(self, field=Undefined, range=Undefined, timeUnit=Undefined, **kwds): - super(FieldRangePredicate, self).__init__(field=field, range=range, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldRangePredicate"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + None, + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + float, + ] + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldRangePredicate, self).__init__( + field=field, range=range, timeUnit=timeUnit, **kwds + ) class FieldValidPredicate(Predicate): """FieldValidPredicate schema wrapper - Mapping(required=[field, valid]) + :class:`FieldValidPredicate`, Dict[required=[field, valid]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str Field to be tested. - valid : boolean + valid : bool If set to true the field's value has to be valid, meaning both not ``null`` and not `NaN <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN>`__. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit for the field to be tested. """ - _schema = {'$ref': '#/definitions/FieldValidPredicate'} - def __init__(self, field=Undefined, valid=Undefined, timeUnit=Undefined, **kwds): - super(FieldValidPredicate, self).__init__(field=field, valid=valid, timeUnit=timeUnit, **kwds) + _schema = {"$ref": "#/definitions/FieldValidPredicate"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + valid: Union[bool, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldValidPredicate, self).__init__( + field=field, valid=valid, timeUnit=timeUnit, **kwds + ) class ParameterPredicate(Predicate): """ParameterPredicate schema wrapper - Mapping(required=[param]) + :class:`ParameterPredicate`, Dict[required=[param]] Parameters ---------- - param : :class:`ParameterName` + param : :class:`ParameterName`, str Filter using a parameter name. - empty : boolean + empty : bool For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property ``empty: false``. """ - _schema = {'$ref': '#/definitions/ParameterPredicate'} - def __init__(self, param=Undefined, empty=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ParameterPredicate"} + + def __init__( + self, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + empty: Union[bool, UndefinedType] = Undefined, + **kwds, + ): super(ParameterPredicate, self).__init__(param=param, empty=empty, **kwds) class Projection(VegaLiteSchema): """Projection schema wrapper - Mapping(required=[]) + :class:`Projection`, Dict Parameters ---------- - center : anyOf(:class:`Vector2number`, :class:`ExprRef`) + center : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float] The projection's center, a two-element array of longitude and latitude in degrees. **Default value:** ``[0, 0]`` - clipAngle : anyOf(float, :class:`ExprRef`) + clipAngle : :class:`ExprRef`, Dict[required=[expr]], float The projection's clipping circle radius to the specified angle in degrees. If ``null``, switches to `antimeridian <http://bl.ocks.org/mbostock/3788999>`__ cutting rather than small-circle clipping. - clipExtent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + clipExtent : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] The projection's viewport clip extent to the specified bounds in pixels. The extent bounds are specified as an array ``[[x0, y0], [x1, y1]]``, where ``x0`` is the left-side of the viewport, ``y0`` is the top, ``x1`` is the right and ``y1`` is the bottom. If ``null``, no viewport clipping is performed. - coefficient : anyOf(float, :class:`ExprRef`) + coefficient : :class:`ExprRef`, Dict[required=[expr]], float The coefficient parameter for the ``hammer`` projection. **Default value:** ``2`` - distance : anyOf(float, :class:`ExprRef`) + distance : :class:`ExprRef`, Dict[required=[expr]], float For the ``satellite`` projection, the distance from the center of the sphere to the point of view, as a proportion of the sphere’s radius. The recommended maximum clip angle for a given ``distance`` is acos(1 / distance) converted to degrees. If tilt is also applied, then more conservative clipping may be necessary. **Default value:** ``2.0`` - extent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + extent : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] - fit : anyOf(:class:`Fit`, List(:class:`Fit`), :class:`ExprRef`) + fit : :class:`ExprRef`, Dict[required=[expr]], :class:`Fit`, :class:`GeoJsonFeatureCollection`, Dict[required=[features, type]], :class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]], Sequence[:class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]]], Sequence[:class:`Fit`, :class:`GeoJsonFeatureCollection`, Dict[required=[features, type]], :class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]], Sequence[:class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]]]] - fraction : anyOf(float, :class:`ExprRef`) + fraction : :class:`ExprRef`, Dict[required=[expr]], float The fraction parameter for the ``bottomley`` projection. **Default value:** ``0.5``, corresponding to a sin(ψ) where ψ = π/6. - lobes : anyOf(float, :class:`ExprRef`) + lobes : :class:`ExprRef`, Dict[required=[expr]], float The number of lobes in projections that support multi-lobe views: ``berghaus``, ``gingery``, or ``healpix``. The default value varies based on the projection type. - parallel : anyOf(float, :class:`ExprRef`) + parallel : :class:`ExprRef`, Dict[required=[expr]], float The parallel parameter for projections that support it: ``armadillo``, ``bonne``, ``craig``, ``cylindricalEqualArea``, ``cylindricalStereographic``, ``hammerRetroazimuthal``, ``loximuthal``, or ``rectangularPolyconic``. The default value varies based on the projection type. - parallels : anyOf(List(float), :class:`ExprRef`) + parallels : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] For conic projections, the `two standard parallels <https://en.wikipedia.org/wiki/Map_projection#Conic>`__ that define the map layout. The default depends on the specific conic projection used. - pointRadius : anyOf(float, :class:`ExprRef`) + pointRadius : :class:`ExprRef`, Dict[required=[expr]], float The default radius (in pixels) to use when drawing GeoJSON ``Point`` and ``MultiPoint`` geometries. This parameter sets a constant default value. To modify the point radius in response to data, see the corresponding parameter of the GeoPath and GeoShape transforms. **Default value:** ``4.5`` - precision : anyOf(float, :class:`ExprRef`) + precision : :class:`ExprRef`, Dict[required=[expr]], float The threshold for the projection's `adaptive resampling <http://bl.ocks.org/mbostock/3795544>`__ to the specified value in pixels. This value corresponds to the `Douglas–Peucker distance <http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm>`__. If precision is not specified, returns the projection's current resampling precision which defaults to ``√0.5 ≅ 0.70710…``. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float The radius parameter for the ``airy`` or ``gingery`` projection. The default value varies based on the projection type. - ratio : anyOf(float, :class:`ExprRef`) + ratio : :class:`ExprRef`, Dict[required=[expr]], float The ratio parameter for the ``hill``, ``hufnagel``, or ``wagner`` projections. The default value varies based on the projection type. - reflectX : anyOf(boolean, :class:`ExprRef`) + reflectX : :class:`ExprRef`, Dict[required=[expr]], bool Sets whether or not the x-dimension is reflected (negated) in the output. - reflectY : anyOf(boolean, :class:`ExprRef`) + reflectY : :class:`ExprRef`, Dict[required=[expr]], bool Sets whether or not the y-dimension is reflected (negated) in the output. - rotate : anyOf(anyOf(:class:`Vector2number`, :class:`Vector3number`), :class:`ExprRef`) + rotate : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float], :class:`Vector3number`, Sequence[float] The projection's three-axis rotation to the specified angles, which must be a two- or three-element array of numbers [ ``lambda``, ``phi``, ``gamma`` ] specifying the rotation angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.) **Default value:** ``[0, 0, 0]`` - scale : anyOf(float, :class:`ExprRef`) + scale : :class:`ExprRef`, Dict[required=[expr]], float The projection’s scale (zoom) factor, overriding automatic fitting. The default scale is projection-specific. The scale factor corresponds linearly to the distance between projected points; however, scale factor values are not equivalent across projections. - size : anyOf(:class:`Vector2number`, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float] Used in conjunction with fit, provides the width and height in pixels of the area to which the projection should be automatically fit. - spacing : anyOf(float, :class:`ExprRef`) + spacing : :class:`ExprRef`, Dict[required=[expr]], float The spacing parameter for the ``lagrange`` projection. **Default value:** ``0.5`` - tilt : anyOf(float, :class:`ExprRef`) + tilt : :class:`ExprRef`, Dict[required=[expr]], float The tilt angle (in degrees) for the ``satellite`` projection. **Default value:** ``0``. - translate : anyOf(:class:`Vector2number`, :class:`ExprRef`) + translate : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float] The projection’s translation offset as a two-element array ``[tx, ty]``. - type : anyOf(:class:`ProjectionType`, :class:`ExprRef`) + type : :class:`ExprRef`, Dict[required=[expr]], :class:`ProjectionType`, Literal['albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', 'conicConformal', 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', 'gnomonic', 'identity', 'mercator', 'naturalEarth1', 'orthographic', 'stereographic', 'transverseMercator'] The cartographic projection to use. This value is case-insensitive, for example ``"albers"`` and ``"Albers"`` indicate the same projection type. You can find all valid projection types `in the documentation @@ -13569,127 +35461,290 @@ class Projection(VegaLiteSchema): **Default value:** ``equalEarth`` """ - _schema = {'$ref': '#/definitions/Projection'} - - def __init__(self, center=Undefined, clipAngle=Undefined, clipExtent=Undefined, - coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, - fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, - pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, - reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, - size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, - **kwds): - super(Projection, self).__init__(center=center, clipAngle=clipAngle, clipExtent=clipExtent, - coefficient=coefficient, distance=distance, extent=extent, - fit=fit, fraction=fraction, lobes=lobes, parallel=parallel, - parallels=parallels, pointRadius=pointRadius, - precision=precision, radius=radius, ratio=ratio, - reflectX=reflectX, reflectY=reflectY, rotate=rotate, - scale=scale, size=size, spacing=spacing, tilt=tilt, - translate=translate, type=type, **kwds) + + _schema = {"$ref": "#/definitions/Projection"} + + def __init__( + self, + center: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Vector2number", Sequence[float]], + ], + UndefinedType, + ] = Undefined, + clipAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + clipExtent: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Vector2Vector2number", + Sequence[Union["Vector2number", Sequence[float]]], + ], + ], + UndefinedType, + ] = Undefined, + coefficient: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + distance: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + extent: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Vector2Vector2number", + Sequence[Union["Vector2number", Sequence[float]]], + ], + ], + UndefinedType, + ] = Undefined, + fit: Union[ + Union[ + Sequence[ + Union[ + "Fit", + Sequence[Union["GeoJsonFeature", dict]], + Union["GeoJsonFeature", dict], + Union["GeoJsonFeatureCollection", dict], + ] + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Fit", + Sequence[Union["GeoJsonFeature", dict]], + Union["GeoJsonFeature", dict], + Union["GeoJsonFeatureCollection", dict], + ], + ], + UndefinedType, + ] = Undefined, + fraction: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lobes: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + parallel: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + parallels: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + pointRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + precision: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ratio: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + reflectX: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + reflectY: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + rotate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + Union["Vector2number", Sequence[float]], + Union["Vector3number", Sequence[float]], + ], + ], + UndefinedType, + ] = Undefined, + scale: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + size: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Vector2number", Sequence[float]], + ], + UndefinedType, + ] = Undefined, + spacing: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tilt: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Vector2number", Sequence[float]], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "ProjectionType", + Literal[ + "albers", + "albersUsa", + "azimuthalEqualArea", + "azimuthalEquidistant", + "conicConformal", + "conicEqualArea", + "conicEquidistant", + "equalEarth", + "equirectangular", + "gnomonic", + "identity", + "mercator", + "naturalEarth1", + "orthographic", + "stereographic", + "transverseMercator", + ], + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(Projection, self).__init__( + center=center, + clipAngle=clipAngle, + clipExtent=clipExtent, + coefficient=coefficient, + distance=distance, + extent=extent, + fit=fit, + fraction=fraction, + lobes=lobes, + parallel=parallel, + parallels=parallels, + pointRadius=pointRadius, + precision=precision, + radius=radius, + ratio=ratio, + reflectX=reflectX, + reflectY=reflectY, + rotate=rotate, + scale=scale, + size=size, + spacing=spacing, + tilt=tilt, + translate=translate, + type=type, + **kwds, + ) class ProjectionConfig(VegaLiteSchema): """ProjectionConfig schema wrapper - Mapping(required=[]) + :class:`ProjectionConfig`, Dict Parameters ---------- - center : anyOf(:class:`Vector2number`, :class:`ExprRef`) + center : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float] The projection's center, a two-element array of longitude and latitude in degrees. **Default value:** ``[0, 0]`` - clipAngle : anyOf(float, :class:`ExprRef`) + clipAngle : :class:`ExprRef`, Dict[required=[expr]], float The projection's clipping circle radius to the specified angle in degrees. If ``null``, switches to `antimeridian <http://bl.ocks.org/mbostock/3788999>`__ cutting rather than small-circle clipping. - clipExtent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + clipExtent : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] The projection's viewport clip extent to the specified bounds in pixels. The extent bounds are specified as an array ``[[x0, y0], [x1, y1]]``, where ``x0`` is the left-side of the viewport, ``y0`` is the top, ``x1`` is the right and ``y1`` is the bottom. If ``null``, no viewport clipping is performed. - coefficient : anyOf(float, :class:`ExprRef`) + coefficient : :class:`ExprRef`, Dict[required=[expr]], float The coefficient parameter for the ``hammer`` projection. **Default value:** ``2`` - distance : anyOf(float, :class:`ExprRef`) + distance : :class:`ExprRef`, Dict[required=[expr]], float For the ``satellite`` projection, the distance from the center of the sphere to the point of view, as a proportion of the sphere’s radius. The recommended maximum clip angle for a given ``distance`` is acos(1 / distance) converted to degrees. If tilt is also applied, then more conservative clipping may be necessary. **Default value:** ``2.0`` - extent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + extent : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] - fit : anyOf(:class:`Fit`, List(:class:`Fit`), :class:`ExprRef`) + fit : :class:`ExprRef`, Dict[required=[expr]], :class:`Fit`, :class:`GeoJsonFeatureCollection`, Dict[required=[features, type]], :class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]], Sequence[:class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]]], Sequence[:class:`Fit`, :class:`GeoJsonFeatureCollection`, Dict[required=[features, type]], :class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]], Sequence[:class:`GeoJsonFeature`, Dict[required=[geometry, properties, type]]]] - fraction : anyOf(float, :class:`ExprRef`) + fraction : :class:`ExprRef`, Dict[required=[expr]], float The fraction parameter for the ``bottomley`` projection. **Default value:** ``0.5``, corresponding to a sin(ψ) where ψ = π/6. - lobes : anyOf(float, :class:`ExprRef`) + lobes : :class:`ExprRef`, Dict[required=[expr]], float The number of lobes in projections that support multi-lobe views: ``berghaus``, ``gingery``, or ``healpix``. The default value varies based on the projection type. - parallel : anyOf(float, :class:`ExprRef`) + parallel : :class:`ExprRef`, Dict[required=[expr]], float The parallel parameter for projections that support it: ``armadillo``, ``bonne``, ``craig``, ``cylindricalEqualArea``, ``cylindricalStereographic``, ``hammerRetroazimuthal``, ``loximuthal``, or ``rectangularPolyconic``. The default value varies based on the projection type. - parallels : anyOf(List(float), :class:`ExprRef`) + parallels : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] For conic projections, the `two standard parallels <https://en.wikipedia.org/wiki/Map_projection#Conic>`__ that define the map layout. The default depends on the specific conic projection used. - pointRadius : anyOf(float, :class:`ExprRef`) + pointRadius : :class:`ExprRef`, Dict[required=[expr]], float The default radius (in pixels) to use when drawing GeoJSON ``Point`` and ``MultiPoint`` geometries. This parameter sets a constant default value. To modify the point radius in response to data, see the corresponding parameter of the GeoPath and GeoShape transforms. **Default value:** ``4.5`` - precision : anyOf(float, :class:`ExprRef`) + precision : :class:`ExprRef`, Dict[required=[expr]], float The threshold for the projection's `adaptive resampling <http://bl.ocks.org/mbostock/3795544>`__ to the specified value in pixels. This value corresponds to the `Douglas–Peucker distance <http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm>`__. If precision is not specified, returns the projection's current resampling precision which defaults to ``√0.5 ≅ 0.70710…``. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float The radius parameter for the ``airy`` or ``gingery`` projection. The default value varies based on the projection type. - ratio : anyOf(float, :class:`ExprRef`) + ratio : :class:`ExprRef`, Dict[required=[expr]], float The ratio parameter for the ``hill``, ``hufnagel``, or ``wagner`` projections. The default value varies based on the projection type. - reflectX : anyOf(boolean, :class:`ExprRef`) + reflectX : :class:`ExprRef`, Dict[required=[expr]], bool Sets whether or not the x-dimension is reflected (negated) in the output. - reflectY : anyOf(boolean, :class:`ExprRef`) + reflectY : :class:`ExprRef`, Dict[required=[expr]], bool Sets whether or not the y-dimension is reflected (negated) in the output. - rotate : anyOf(anyOf(:class:`Vector2number`, :class:`Vector3number`), :class:`ExprRef`) + rotate : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float], :class:`Vector3number`, Sequence[float] The projection's three-axis rotation to the specified angles, which must be a two- or three-element array of numbers [ ``lambda``, ``phi``, ``gamma`` ] specifying the rotation angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.) **Default value:** ``[0, 0, 0]`` - scale : anyOf(float, :class:`ExprRef`) + scale : :class:`ExprRef`, Dict[required=[expr]], float The projection’s scale (zoom) factor, overriding automatic fitting. The default scale is projection-specific. The scale factor corresponds linearly to the distance between projected points; however, scale factor values are not equivalent across projections. - size : anyOf(:class:`Vector2number`, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float] Used in conjunction with fit, provides the width and height in pixels of the area to which the projection should be automatically fit. - spacing : anyOf(float, :class:`ExprRef`) + spacing : :class:`ExprRef`, Dict[required=[expr]], float The spacing parameter for the ``lagrange`` projection. **Default value:** ``0.5`` - tilt : anyOf(float, :class:`ExprRef`) + tilt : :class:`ExprRef`, Dict[required=[expr]], float The tilt angle (in degrees) for the ``satellite`` projection. **Default value:** ``0``. - translate : anyOf(:class:`Vector2number`, :class:`ExprRef`) + translate : :class:`ExprRef`, Dict[required=[expr]], :class:`Vector2number`, Sequence[float] The projection’s translation offset as a two-element array ``[tx, ty]``. - type : anyOf(:class:`ProjectionType`, :class:`ExprRef`) + type : :class:`ExprRef`, Dict[required=[expr]], :class:`ProjectionType`, Literal['albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', 'conicConformal', 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', 'gnomonic', 'identity', 'mercator', 'naturalEarth1', 'orthographic', 'stereographic', 'transverseMercator'] The cartographic projection to use. This value is case-insensitive, for example ``"albers"`` and ``"Albers"`` indicate the same projection type. You can find all valid projection types `in the documentation @@ -13697,35 +35752,198 @@ class ProjectionConfig(VegaLiteSchema): **Default value:** ``equalEarth`` """ - _schema = {'$ref': '#/definitions/ProjectionConfig'} - - def __init__(self, center=Undefined, clipAngle=Undefined, clipExtent=Undefined, - coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, - fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, - pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, - reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, - size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, - **kwds): - super(ProjectionConfig, self).__init__(center=center, clipAngle=clipAngle, - clipExtent=clipExtent, coefficient=coefficient, - distance=distance, extent=extent, fit=fit, - fraction=fraction, lobes=lobes, parallel=parallel, - parallels=parallels, pointRadius=pointRadius, - precision=precision, radius=radius, ratio=ratio, - reflectX=reflectX, reflectY=reflectY, rotate=rotate, - scale=scale, size=size, spacing=spacing, tilt=tilt, - translate=translate, type=type, **kwds) + + _schema = {"$ref": "#/definitions/ProjectionConfig"} + + def __init__( + self, + center: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Vector2number", Sequence[float]], + ], + UndefinedType, + ] = Undefined, + clipAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + clipExtent: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Vector2Vector2number", + Sequence[Union["Vector2number", Sequence[float]]], + ], + ], + UndefinedType, + ] = Undefined, + coefficient: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + distance: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + extent: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Vector2Vector2number", + Sequence[Union["Vector2number", Sequence[float]]], + ], + ], + UndefinedType, + ] = Undefined, + fit: Union[ + Union[ + Sequence[ + Union[ + "Fit", + Sequence[Union["GeoJsonFeature", dict]], + Union["GeoJsonFeature", dict], + Union["GeoJsonFeatureCollection", dict], + ] + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Fit", + Sequence[Union["GeoJsonFeature", dict]], + Union["GeoJsonFeature", dict], + Union["GeoJsonFeatureCollection", dict], + ], + ], + UndefinedType, + ] = Undefined, + fraction: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lobes: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + parallel: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + parallels: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + pointRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + precision: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ratio: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + reflectX: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + reflectY: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + rotate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + Union["Vector2number", Sequence[float]], + Union["Vector3number", Sequence[float]], + ], + ], + UndefinedType, + ] = Undefined, + scale: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + size: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Vector2number", Sequence[float]], + ], + UndefinedType, + ] = Undefined, + spacing: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tilt: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + translate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["Vector2number", Sequence[float]], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "ProjectionType", + Literal[ + "albers", + "albersUsa", + "azimuthalEqualArea", + "azimuthalEquidistant", + "conicConformal", + "conicEqualArea", + "conicEquidistant", + "equalEarth", + "equirectangular", + "gnomonic", + "identity", + "mercator", + "naturalEarth1", + "orthographic", + "stereographic", + "transverseMercator", + ], + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ProjectionConfig, self).__init__( + center=center, + clipAngle=clipAngle, + clipExtent=clipExtent, + coefficient=coefficient, + distance=distance, + extent=extent, + fit=fit, + fraction=fraction, + lobes=lobes, + parallel=parallel, + parallels=parallels, + pointRadius=pointRadius, + precision=precision, + radius=radius, + ratio=ratio, + reflectX=reflectX, + reflectY=reflectY, + rotate=rotate, + scale=scale, + size=size, + spacing=spacing, + tilt=tilt, + translate=translate, + type=type, + **kwds, + ) class ProjectionType(VegaLiteSchema): """ProjectionType schema wrapper - enum('albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', 'conicConformal', - 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', 'gnomonic', - 'identity', 'mercator', 'naturalEarth1', 'orthographic', 'stereographic', - 'transverseMercator') + :class:`ProjectionType`, Literal['albers', 'albersUsa', 'azimuthalEqualArea', + 'azimuthalEquidistant', 'conicConformal', 'conicEqualArea', 'conicEquidistant', + 'equalEarth', 'equirectangular', 'gnomonic', 'identity', 'mercator', 'naturalEarth1', + 'orthographic', 'stereographic', 'transverseMercator'] """ - _schema = {'$ref': '#/definitions/ProjectionType'} + + _schema = {"$ref": "#/definitions/ProjectionType"} def __init__(self, *args): super(ProjectionType, self).__init__(*args) @@ -13734,16 +35952,16 @@ def __init__(self, *args): class RadialGradient(Gradient): """RadialGradient schema wrapper - Mapping(required=[gradient, stops]) + :class:`RadialGradient`, Dict[required=[gradient, stops]] Parameters ---------- - gradient : string + gradient : str The type of gradient. Use ``"radial"`` for a radial gradient. - stops : List(:class:`GradientStop`) + stops : Sequence[:class:`GradientStop`, Dict[required=[offset, color]]] An array of gradient stops defining the gradient color sequence. - id : string + id : str r1 : float The radius length, in normalized [0, 1] coordinates, of the inner circle for the @@ -13776,55 +35994,1059 @@ class RadialGradient(Gradient): **Default value:** ``0.5`` """ - _schema = {'$ref': '#/definitions/RadialGradient'} - def __init__(self, gradient=Undefined, stops=Undefined, id=Undefined, r1=Undefined, r2=Undefined, - x1=Undefined, x2=Undefined, y1=Undefined, y2=Undefined, **kwds): - super(RadialGradient, self).__init__(gradient=gradient, stops=stops, id=id, r1=r1, r2=r2, x1=x1, - x2=x2, y1=y1, y2=y2, **kwds) + _schema = {"$ref": "#/definitions/RadialGradient"} + + def __init__( + self, + gradient: Union[str, UndefinedType] = Undefined, + stops: Union[Sequence[Union["GradientStop", dict]], UndefinedType] = Undefined, + id: Union[str, UndefinedType] = Undefined, + r1: Union[float, UndefinedType] = Undefined, + r2: Union[float, UndefinedType] = Undefined, + x1: Union[float, UndefinedType] = Undefined, + x2: Union[float, UndefinedType] = Undefined, + y1: Union[float, UndefinedType] = Undefined, + y2: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(RadialGradient, self).__init__( + gradient=gradient, + stops=stops, + id=id, + r1=r1, + r2=r2, + x1=x1, + x2=x2, + y1=y1, + y2=y2, + **kwds, + ) class RangeConfig(VegaLiteSchema): """RangeConfig schema wrapper - Mapping(required=[]) + :class:`RangeConfig`, Dict Parameters ---------- - category : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + category : :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap'], :class:`RangeRaw`, Sequence[:class:`RangeRawArray`, Sequence[float], None, bool, float, str], :class:`RangeScheme`, Dict[required=[scheme]], Sequence[:class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str] Default `color scheme <https://vega.github.io/vega/docs/schemes/>`__ for categorical data. - diverging : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + diverging : :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap'], :class:`RangeRaw`, Sequence[:class:`RangeRawArray`, Sequence[float], None, bool, float, str], :class:`RangeScheme`, Dict[required=[scheme]], Sequence[:class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str] Default `color scheme <https://vega.github.io/vega/docs/schemes/>`__ for diverging quantitative ramps. - heatmap : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + heatmap : :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap'], :class:`RangeRaw`, Sequence[:class:`RangeRawArray`, Sequence[float], None, bool, float, str], :class:`RangeScheme`, Dict[required=[scheme]], Sequence[:class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str] Default `color scheme <https://vega.github.io/vega/docs/schemes/>`__ for quantitative heatmaps. - ordinal : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + ordinal : :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap'], :class:`RangeRaw`, Sequence[:class:`RangeRawArray`, Sequence[float], None, bool, float, str], :class:`RangeScheme`, Dict[required=[scheme]], Sequence[:class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str] Default `color scheme <https://vega.github.io/vega/docs/schemes/>`__ for rank-ordered data. - ramp : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + ramp : :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap'], :class:`RangeRaw`, Sequence[:class:`RangeRawArray`, Sequence[float], None, bool, float, str], :class:`RangeScheme`, Dict[required=[scheme]], Sequence[:class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str] Default `color scheme <https://vega.github.io/vega/docs/schemes/>`__ for sequential quantitative ramps. - symbol : List(:class:`SymbolShape`) + symbol : Sequence[:class:`SymbolShape`, str] Array of `symbol <https://vega.github.io/vega/docs/marks/symbol/>`__ names or paths for the default shape palette. """ - _schema = {'$ref': '#/definitions/RangeConfig'} - def __init__(self, category=Undefined, diverging=Undefined, heatmap=Undefined, ordinal=Undefined, - ramp=Undefined, symbol=Undefined, **kwds): - super(RangeConfig, self).__init__(category=category, diverging=diverging, heatmap=heatmap, - ordinal=ordinal, ramp=ramp, symbol=symbol, **kwds) + _schema = {"$ref": "#/definitions/RangeConfig"} + + def __init__( + self, + category: Union[ + Union[ + Sequence[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ] + ], + Union[ + "RangeScheme", + Union[ + "RangeEnum", + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + ], + Union[ + "RangeRaw", + Sequence[ + Union[ + None, + Union["RangeRawArray", Sequence[float]], + bool, + float, + str, + ] + ], + ], + dict, + ], + ], + UndefinedType, + ] = Undefined, + diverging: Union[ + Union[ + Sequence[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ] + ], + Union[ + "RangeScheme", + Union[ + "RangeEnum", + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + ], + Union[ + "RangeRaw", + Sequence[ + Union[ + None, + Union["RangeRawArray", Sequence[float]], + bool, + float, + str, + ] + ], + ], + dict, + ], + ], + UndefinedType, + ] = Undefined, + heatmap: Union[ + Union[ + Sequence[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ] + ], + Union[ + "RangeScheme", + Union[ + "RangeEnum", + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + ], + Union[ + "RangeRaw", + Sequence[ + Union[ + None, + Union["RangeRawArray", Sequence[float]], + bool, + float, + str, + ] + ], + ], + dict, + ], + ], + UndefinedType, + ] = Undefined, + ordinal: Union[ + Union[ + Sequence[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ] + ], + Union[ + "RangeScheme", + Union[ + "RangeEnum", + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + ], + Union[ + "RangeRaw", + Sequence[ + Union[ + None, + Union["RangeRawArray", Sequence[float]], + bool, + float, + str, + ] + ], + ], + dict, + ], + ], + UndefinedType, + ] = Undefined, + ramp: Union[ + Union[ + Sequence[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ] + ], + Union[ + "RangeScheme", + Union[ + "RangeEnum", + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + ], + Union[ + "RangeRaw", + Sequence[ + Union[ + None, + Union["RangeRawArray", Sequence[float]], + bool, + float, + str, + ] + ], + ], + dict, + ], + ], + UndefinedType, + ] = Undefined, + symbol: Union[Sequence[Union["SymbolShape", str]], UndefinedType] = Undefined, + **kwds, + ): + super(RangeConfig, self).__init__( + category=category, + diverging=diverging, + heatmap=heatmap, + ordinal=ordinal, + ramp=ramp, + symbol=symbol, + **kwds, + ) class RangeRawArray(VegaLiteSchema): """RangeRawArray schema wrapper - List(float) + :class:`RangeRawArray`, Sequence[float] """ - _schema = {'$ref': '#/definitions/RangeRawArray'} + + _schema = {"$ref": "#/definitions/RangeRawArray"} def __init__(self, *args): super(RangeRawArray, self).__init__(*args) @@ -13833,9 +37055,12 @@ def __init__(self, *args): class RangeScheme(VegaLiteSchema): """RangeScheme schema wrapper - anyOf(:class:`RangeEnum`, :class:`RangeRaw`, Mapping(required=[scheme])) + :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', + 'diverging', 'heatmap'], :class:`RangeRaw`, Sequence[:class:`RangeRawArray`, + Sequence[float], None, bool, float, str], :class:`RangeScheme`, Dict[required=[scheme]] """ - _schema = {'$ref': '#/definitions/RangeScheme'} + + _schema = {"$ref": "#/definitions/RangeScheme"} def __init__(self, *args, **kwds): super(RangeScheme, self).__init__(*args, **kwds) @@ -13844,9 +37069,11 @@ def __init__(self, *args, **kwds): class RangeEnum(RangeScheme): """RangeEnum schema wrapper - enum('width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap') + :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', + 'diverging', 'heatmap'] """ - _schema = {'$ref': '#/definitions/RangeEnum'} + + _schema = {"$ref": "#/definitions/RangeEnum"} def __init__(self, *args): super(RangeEnum, self).__init__(*args) @@ -13855,9 +37082,10 @@ def __init__(self, *args): class RangeRaw(RangeScheme): """RangeRaw schema wrapper - List(anyOf(None, boolean, string, float, :class:`RangeRawArray`)) + :class:`RangeRaw`, Sequence[:class:`RangeRawArray`, Sequence[float], None, bool, float, str] """ - _schema = {'$ref': '#/definitions/RangeRaw'} + + _schema = {"$ref": "#/definitions/RangeRaw"} def __init__(self, *args): super(RangeRaw, self).__init__(*args) @@ -13866,37 +37094,37 @@ def __init__(self, *args): class RectConfig(AnyMarkConfig): """RectConfig schema wrapper - Mapping(required=[]) + :class:`RectConfig`, Dict Parameters ---------- - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -13912,13 +37140,13 @@ class RectConfig(AnyMarkConfig): (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). **Default value:** ``1`` - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -13935,66 +37163,66 @@ class RectConfig(AnyMarkConfig): The default size of the bars on continuous scales. **Default value:** ``5`` - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - discreteBandSize : anyOf(float, :class:`RelativeBandSize`) + discreteBandSize : :class:`RelativeBandSize`, Dict[required=[band]], float The default size of the bars with discrete dimensions. If unspecified, the default size is ``step-2``, which provides 2 pixel offset between bars. - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - endAngle : anyOf(float, :class:`ExprRef`) + endAngle : :class:`ExprRef`, Dict[required=[expr]], float The end angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -14004,28 +37232,28 @@ class RectConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`) + height : :class:`ExprRef`, Dict[required=[expr]], float Height of the marks. - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -14047,7 +37275,7 @@ class RectConfig(AnyMarkConfig): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -14056,28 +37284,28 @@ class RectConfig(AnyMarkConfig): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - minBandSize : anyOf(float, :class:`ExprRef`) + minBandSize : :class:`ExprRef`, Dict[required=[expr]], float The minimum band size for bar and rectangle marks. **Default value:** ``0.25`` - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -14089,24 +37317,24 @@ class RectConfig(AnyMarkConfig): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -14121,7 +37349,7 @@ class RectConfig(AnyMarkConfig): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -14138,56 +37366,56 @@ class RectConfig(AnyMarkConfig): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - startAngle : anyOf(float, :class:`ExprRef`) + startAngle : :class:`ExprRef`, Dict[required=[expr]], float The start angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. timeUnitBandPosition : float @@ -14198,7 +37426,7 @@ class RectConfig(AnyMarkConfig): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -14213,91 +37441,981 @@ class RectConfig(AnyMarkConfig): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`) + width : :class:`ExprRef`, Dict[required=[expr]], float Width of the marks. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. """ - _schema = {'$ref': '#/definitions/RectConfig'} - - def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, color=Undefined, continuousBandSize=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, - discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, - endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, - minBandSize=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - outerRadius=Undefined, padAngle=Undefined, radius=Undefined, radius2=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, startAngle=Undefined, - stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, - timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, - url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, - **kwds): - super(RectConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - baseline=baseline, binSpacing=binSpacing, blend=blend, - color=color, continuousBandSize=continuousBandSize, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, - discreteBandSize=discreteBandSize, dx=dx, dy=dy, - ellipsis=ellipsis, endAngle=endAngle, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, - interpolate=interpolate, invalid=invalid, limit=limit, - lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, - orient=orient, outerRadius=outerRadius, padAngle=padAngle, - radius=radius, radius2=radius2, shape=shape, size=size, - smooth=smooth, startAngle=startAngle, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - tension=tension, text=text, theta=theta, theta2=theta2, - timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + _schema = {"$ref": "#/definitions/RectConfig"} + + def __init__( + self, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union["RelativeBandSize", dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + endAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + startAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): + super(RectConfig, self).__init__( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + endAngle=endAngle, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + smooth=smooth, + startAngle=startAngle, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + y=y, + y2=y2, + **kwds, + ) class RelativeBandSize(VegaLiteSchema): """RelativeBandSize schema wrapper - Mapping(required=[band]) + :class:`RelativeBandSize`, Dict[required=[band]] Parameters ---------- @@ -14306,53 +38424,67 @@ class RelativeBandSize(VegaLiteSchema): The relative band size. For example ``0.5`` means half of the band scale's band width. """ - _schema = {'$ref': '#/definitions/RelativeBandSize'} - def __init__(self, band=Undefined, **kwds): + _schema = {"$ref": "#/definitions/RelativeBandSize"} + + def __init__(self, band: Union[float, UndefinedType] = Undefined, **kwds): super(RelativeBandSize, self).__init__(band=band, **kwds) class RepeatMapping(VegaLiteSchema): """RepeatMapping schema wrapper - Mapping(required=[]) + :class:`RepeatMapping`, Dict Parameters ---------- - column : List(string) + column : Sequence[str] An array of fields to be repeated horizontally. - row : List(string) + row : Sequence[str] An array of fields to be repeated vertically. """ - _schema = {'$ref': '#/definitions/RepeatMapping'} - def __init__(self, column=Undefined, row=Undefined, **kwds): + _schema = {"$ref": "#/definitions/RepeatMapping"} + + def __init__( + self, + column: Union[Sequence[str], UndefinedType] = Undefined, + row: Union[Sequence[str], UndefinedType] = Undefined, + **kwds, + ): super(RepeatMapping, self).__init__(column=column, row=row, **kwds) class RepeatRef(Field): """RepeatRef schema wrapper - Mapping(required=[repeat]) + :class:`RepeatRef`, Dict[required=[repeat]] Reference to a repeated value. Parameters ---------- - repeat : enum('row', 'column', 'repeat', 'layer') + repeat : Literal['row', 'column', 'repeat', 'layer'] """ - _schema = {'$ref': '#/definitions/RepeatRef'} - def __init__(self, repeat=Undefined, **kwds): + _schema = {"$ref": "#/definitions/RepeatRef"} + + def __init__( + self, + repeat: Union[ + Literal["row", "column", "repeat", "layer"], UndefinedType + ] = Undefined, + **kwds, + ): super(RepeatRef, self).__init__(repeat=repeat, **kwds) class Resolve(VegaLiteSchema): """Resolve schema wrapper - Mapping(required=[]) + :class:`Resolve`, Dict Defines how scales, axes, and legends from different specs should be combined. Resolve is a mapping from ``scale``, ``axis``, and ``legend`` to a mapping from channels to resolutions. Scales and guides can be resolved to be ``"independent"`` or ``"shared"``. @@ -14360,25 +38492,33 @@ class Resolve(VegaLiteSchema): Parameters ---------- - axis : :class:`AxisResolveMap` + axis : :class:`AxisResolveMap`, Dict - legend : :class:`LegendResolveMap` + legend : :class:`LegendResolveMap`, Dict - scale : :class:`ScaleResolveMap` + scale : :class:`ScaleResolveMap`, Dict """ - _schema = {'$ref': '#/definitions/Resolve'} - def __init__(self, axis=Undefined, legend=Undefined, scale=Undefined, **kwds): + _schema = {"$ref": "#/definitions/Resolve"} + + def __init__( + self, + axis: Union[Union["AxisResolveMap", dict], UndefinedType] = Undefined, + legend: Union[Union["LegendResolveMap", dict], UndefinedType] = Undefined, + scale: Union[Union["ScaleResolveMap", dict], UndefinedType] = Undefined, + **kwds, + ): super(Resolve, self).__init__(axis=axis, legend=legend, scale=scale, **kwds) class ResolveMode(VegaLiteSchema): """ResolveMode schema wrapper - enum('independent', 'shared') + :class:`ResolveMode`, Literal['independent', 'shared'] """ - _schema = {'$ref': '#/definitions/ResolveMode'} + + _schema = {"$ref": "#/definitions/ResolveMode"} def __init__(self, *args): super(ResolveMode, self).__init__(*args) @@ -14387,45 +38527,61 @@ def __init__(self, *args): class RowColLayoutAlign(VegaLiteSchema): """RowColLayoutAlign schema wrapper - Mapping(required=[]) + :class:`RowColLayoutAlign`, Dict Parameters ---------- - column : :class:`LayoutAlign` + column : :class:`LayoutAlign`, Literal['all', 'each', 'none'] - row : :class:`LayoutAlign` + row : :class:`LayoutAlign`, Literal['all', 'each', 'none'] """ - _schema = {'$ref': '#/definitions/RowCol<LayoutAlign>'} - def __init__(self, column=Undefined, row=Undefined, **kwds): + _schema = {"$ref": "#/definitions/RowCol<LayoutAlign>"} + + def __init__( + self, + column: Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], UndefinedType + ] = Undefined, + row: Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], UndefinedType + ] = Undefined, + **kwds, + ): super(RowColLayoutAlign, self).__init__(column=column, row=row, **kwds) class RowColboolean(VegaLiteSchema): """RowColboolean schema wrapper - Mapping(required=[]) + :class:`RowColboolean`, Dict Parameters ---------- - column : boolean + column : bool - row : boolean + row : bool """ - _schema = {'$ref': '#/definitions/RowCol<boolean>'} - def __init__(self, column=Undefined, row=Undefined, **kwds): + _schema = {"$ref": "#/definitions/RowCol<boolean>"} + + def __init__( + self, + column: Union[bool, UndefinedType] = Undefined, + row: Union[bool, UndefinedType] = Undefined, + **kwds, + ): super(RowColboolean, self).__init__(column=column, row=row, **kwds) class RowColnumber(VegaLiteSchema): """RowColnumber schema wrapper - Mapping(required=[]) + :class:`RowColnumber`, Dict Parameters ---------- @@ -14435,21 +38591,29 @@ class RowColnumber(VegaLiteSchema): row : float """ - _schema = {'$ref': '#/definitions/RowCol<number>'} - def __init__(self, column=Undefined, row=Undefined, **kwds): + _schema = {"$ref": "#/definitions/RowCol<number>"} + + def __init__( + self, + column: Union[float, UndefinedType] = Undefined, + row: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(RowColnumber, self).__init__(column=column, row=row, **kwds) class RowColumnEncodingFieldDef(VegaLiteSchema): """RowColumnEncodingFieldDef schema wrapper - Mapping(required=[]) + :class:`RowColumnEncodingFieldDef`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -14457,7 +38621,7 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): **See also:** `aggregate <https://vega.github.io/vega-lite/docs/aggregate.html>`__ documentation. - align : :class:`LayoutAlign` + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'] The alignment to apply to row/column facet's subplot. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -14475,7 +38639,7 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -14496,12 +38660,12 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - center : boolean + center : bool Boolean flag indicating if facet's subviews should be centered relative to their respective rows or columns. **Default value:** ``false`` - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -14516,9 +38680,9 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - header : anyOf(:class:`Header`, None) + header : :class:`Header`, Dict, None An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + sort : :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortOrder`, Literal['ascending', 'descending'], None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -14551,7 +38715,7 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -14560,7 +38724,7 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -14580,7 +38744,7 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -14650,27 +38814,266 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/RowColumnEncodingFieldDef'} - def __init__(self, aggregate=Undefined, align=Undefined, bandPosition=Undefined, bin=Undefined, - center=Undefined, field=Undefined, header=Undefined, sort=Undefined, spacing=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(RowColumnEncodingFieldDef, self).__init__(aggregate=aggregate, align=align, - bandPosition=bandPosition, bin=bin, - center=center, field=field, header=header, - sort=sort, spacing=spacing, timeUnit=timeUnit, - title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/RowColumnEncodingFieldDef"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], UndefinedType + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + center: Union[bool, UndefinedType] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + header: Union[Union[None, Union["Header", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + None, + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + UndefinedType, + ] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(RowColumnEncodingFieldDef, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + align=align, + bandPosition=bandPosition, + bin=bin, + center=center, + field=field, + header=header, + sort=sort, + spacing=spacing, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class Scale(VegaLiteSchema): """Scale schema wrapper - Mapping(required=[]) + :class:`Scale`, Dict Parameters ---------- - align : anyOf(float, :class:`ExprRef`) + align : :class:`ExprRef`, Dict[required=[expr]], float The alignment of the steps within the scale range. This value must lie in the range ``[0,1]``. A value of ``0.5`` indicates that the @@ -14678,9 +39081,9 @@ class Scale(VegaLiteSchema): shift the bands to one side, say to position them adjacent to an axis. **Default value:** ``0.5`` - base : anyOf(float, :class:`ExprRef`) + base : :class:`ExprRef`, Dict[required=[expr]], float The logarithm base of the ``log`` scale (default ``10`` ). - bins : :class:`ScaleBins` + bins : :class:`ScaleBinParams`, Dict[required=[step]], :class:`ScaleBins`, Sequence[float] Bin boundaries can be provided to scales as either an explicit array of bin boundaries or as a bin specification object. The legal values are: @@ -14695,19 +39098,19 @@ class Scale(VegaLiteSchema): *step* size, and optionally the *start* and *stop* boundaries. * An array of bin boundaries over the scale domain. If provided, axes and legends will use the bin boundaries to inform the choice of tick marks and text labels. - clamp : anyOf(boolean, :class:`ExprRef`) + clamp : :class:`ExprRef`, Dict[required=[expr]], bool If ``true``, values that exceed the data domain are clamped to either the minimum or maximum range value **Default value:** derived from the `scale config <https://vega.github.io/vega-lite/docs/config.html#scale-config>`__ 's ``clamp`` ( ``true`` by default). - constant : anyOf(float, :class:`ExprRef`) + constant : :class:`ExprRef`, Dict[required=[expr]], float A constant determining the slope of the symlog function around zero. Only used for ``symlog`` scales. **Default value:** ``1`` - domain : anyOf(List(anyOf(None, string, float, boolean, :class:`DateTime`, :class:`ExprRef`)), string, :class:`ParameterExtent`, :class:`DomainUnionWith`, :class:`ExprRef`) + domain : :class:`DomainUnionWith`, Dict[required=[unionWith]], :class:`ExprRef`, Dict[required=[expr]], :class:`ParameterExtent`, Dict[required=[param]], Sequence[:class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], None, bool, float, str], str Customized domain values in the form of constant values or dynamic values driven by a parameter. @@ -14739,27 +39142,27 @@ class Scale(VegaLiteSchema): `interactively determines <https://vega.github.io/vega-lite/docs/selection.html#scale-domains>`__ the scale domain. - domainMax : anyOf(float, :class:`DateTime`, :class:`ExprRef`) + domainMax : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], float Sets the maximum value in the scale domain, overriding the ``domain`` property. This property is only intended for use with scales having continuous domains. - domainMid : anyOf(float, :class:`ExprRef`) + domainMid : :class:`ExprRef`, Dict[required=[expr]], float Inserts a single mid-point value into a two-element domain. The mid-point value must lie between the domain minimum and maximum values. This property can be useful for setting a midpoint for `diverging color scales <https://vega.github.io/vega-lite/docs/scale.html#piecewise>`__. The domainMid property is only intended for use with scales supporting continuous, piecewise domains. - domainMin : anyOf(float, :class:`DateTime`, :class:`ExprRef`) + domainMin : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], float Sets the minimum value in the scale domain, overriding the domain property. This property is only intended for use with scales having continuous domains. - domainRaw : :class:`ExprRef` + domainRaw : :class:`ExprRef`, Dict[required=[expr]] An expression for an array of raw values that, if non-null, directly overrides the *domain* property. This is useful for supporting interactions such as panning or zooming a scale. The scale may be initially determined using a data-driven domain, then modified in response to user input by setting the rawDomain value. - exponent : anyOf(float, :class:`ExprRef`) + exponent : :class:`ExprRef`, Dict[required=[expr]], float The exponent of the ``pow`` scale. - interpolate : anyOf(:class:`ScaleInterpolateEnum`, :class:`ExprRef`, :class:`ScaleInterpolateParams`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`ScaleInterpolateEnum`, Literal['rgb', 'lab', 'hcl', 'hsl', 'hsl-long', 'hcl-long', 'cubehelix', 'cubehelix-long'], :class:`ScaleInterpolateParams`, Dict[required=[type]] The interpolation method for range values. By default, a general interpolator for numbers, dates, strings and colors (in HCL space) is used. For color ranges, this property allows interpolation in alternative color spaces. Legal values include @@ -14772,7 +39175,7 @@ class Scale(VegaLiteSchema): * **Default value:** ``hcl`` - nice : anyOf(boolean, float, :class:`TimeInterval`, :class:`TimeIntervalStep`, :class:`ExprRef`) + nice : :class:`ExprRef`, Dict[required=[expr]], :class:`TimeIntervalStep`, Dict[required=[interval, step]], :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'], bool, float Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be @@ -14794,7 +39197,7 @@ class Scale(VegaLiteSchema): **Default value:** ``true`` for unbinned *quantitative* fields without explicit domain bounds; ``false`` otherwise. - padding : anyOf(float, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], float For * `continuous <https://vega.github.io/vega-lite/docs/scale.html#continuous>`__ * scales, expands the scale domain to accommodate the specified number of pixels on each of the scale range. The scale range must represent pixels for this parameter to @@ -14813,7 +39216,7 @@ class Scale(VegaLiteSchema): ``continuousPadding``. For *band and point* scales, see ``paddingInner`` and ``paddingOuter``. By default, Vega-Lite sets padding such that *width/height = number of unique values * step*. - paddingInner : anyOf(float, :class:`ExprRef`) + paddingInner : :class:`ExprRef`, Dict[required=[expr]], float The inner padding (spacing) within each band step of band scales, as a fraction of the step size. This value must lie in the range [0,1]. @@ -14823,7 +39226,7 @@ class Scale(VegaLiteSchema): **Default value:** derived from the `scale config <https://vega.github.io/vega-lite/docs/scale.html#config>`__ 's ``bandPaddingInner``. - paddingOuter : anyOf(float, :class:`ExprRef`) + paddingOuter : :class:`ExprRef`, Dict[required=[expr]], float The outer padding (spacing) at the ends of the range of band and point scales, as a fraction of the step size. This value must lie in the range [0,1]. @@ -14831,7 +39234,7 @@ class Scale(VegaLiteSchema): <https://vega.github.io/vega-lite/docs/scale.html#config>`__ 's ``bandPaddingOuter`` for band scales and ``pointPadding`` for point scales. By default, Vega-Lite sets outer padding such that *width/height = number of unique values * step*. - range : anyOf(:class:`RangeEnum`, List(anyOf(float, string, List(float), :class:`ExprRef`)), :class:`FieldRange`) + range : :class:`FieldRange`, Dict[required=[field]], :class:`RangeEnum`, Literal['width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap'], Sequence[:class:`ExprRef`, Dict[required=[expr]], Sequence[float], float, str] The range of the scale. One of: @@ -14859,22 +39262,22 @@ class Scale(VegaLiteSchema): 2) Any directly specified ``range`` for ``x`` and ``y`` channels will be ignored. Range can be customized via the view's corresponding `size <https://vega.github.io/vega-lite/docs/size.html>`__ ( ``width`` and ``height`` ). - rangeMax : anyOf(float, string, :class:`ExprRef`) + rangeMax : :class:`ExprRef`, Dict[required=[expr]], float, str Sets the maximum value in the scale range, overriding the ``range`` property or the default range. This property is only intended for use with scales having continuous ranges. - rangeMin : anyOf(float, string, :class:`ExprRef`) + rangeMin : :class:`ExprRef`, Dict[required=[expr]], float, str Sets the minimum value in the scale range, overriding the ``range`` property or the default range. This property is only intended for use with scales having continuous ranges. - reverse : anyOf(boolean, :class:`ExprRef`) + reverse : :class:`ExprRef`, Dict[required=[expr]], bool If true, reverses the order of the scale range. **Default value:** ``false``. - round : anyOf(boolean, :class:`ExprRef`) + round : :class:`ExprRef`, Dict[required=[expr]], bool If ``true``, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid. **Default value:** ``false``. - scheme : anyOf(:class:`ColorScheme`, :class:`SchemeParams`, :class:`ExprRef`) + scheme : :class:`Categorical`, Literal['accent', 'category10', 'category20', 'category20b', 'category20c', 'dark2', 'paired', 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', 'tableau20'], :class:`ColorScheme`, :class:`Cyclical`, Literal['rainbow', 'sinebow'], :class:`Diverging`, Literal['blueorange', 'blueorange-3', 'blueorange-4', 'blueorange-5', 'blueorange-6', 'blueorange-7', 'blueorange-8', 'blueorange-9', 'blueorange-10', 'blueorange-11', 'brownbluegreen', 'brownbluegreen-3', 'brownbluegreen-4', 'brownbluegreen-5', 'brownbluegreen-6', 'brownbluegreen-7', 'brownbluegreen-8', 'brownbluegreen-9', 'brownbluegreen-10', 'brownbluegreen-11', 'purplegreen', 'purplegreen-3', 'purplegreen-4', 'purplegreen-5', 'purplegreen-6', 'purplegreen-7', 'purplegreen-8', 'purplegreen-9', 'purplegreen-10', 'purplegreen-11', 'pinkyellowgreen', 'pinkyellowgreen-3', 'pinkyellowgreen-4', 'pinkyellowgreen-5', 'pinkyellowgreen-6', 'pinkyellowgreen-7', 'pinkyellowgreen-8', 'pinkyellowgreen-9', 'pinkyellowgreen-10', 'pinkyellowgreen-11', 'purpleorange', 'purpleorange-3', 'purpleorange-4', 'purpleorange-5', 'purpleorange-6', 'purpleorange-7', 'purpleorange-8', 'purpleorange-9', 'purpleorange-10', 'purpleorange-11', 'redblue', 'redblue-3', 'redblue-4', 'redblue-5', 'redblue-6', 'redblue-7', 'redblue-8', 'redblue-9', 'redblue-10', 'redblue-11', 'redgrey', 'redgrey-3', 'redgrey-4', 'redgrey-5', 'redgrey-6', 'redgrey-7', 'redgrey-8', 'redgrey-9', 'redgrey-10', 'redgrey-11', 'redyellowblue', 'redyellowblue-3', 'redyellowblue-4', 'redyellowblue-5', 'redyellowblue-6', 'redyellowblue-7', 'redyellowblue-8', 'redyellowblue-9', 'redyellowblue-10', 'redyellowblue-11', 'redyellowgreen', 'redyellowgreen-3', 'redyellowgreen-4', 'redyellowgreen-5', 'redyellowgreen-6', 'redyellowgreen-7', 'redyellowgreen-8', 'redyellowgreen-9', 'redyellowgreen-10', 'redyellowgreen-11', 'spectral', 'spectral-3', 'spectral-4', 'spectral-5', 'spectral-6', 'spectral-7', 'spectral-8', 'spectral-9', 'spectral-10', 'spectral-11'], :class:`SequentialMultiHue`, Literal['turbo', 'viridis', 'inferno', 'magma', 'plasma', 'cividis', 'bluegreen', 'bluegreen-3', 'bluegreen-4', 'bluegreen-5', 'bluegreen-6', 'bluegreen-7', 'bluegreen-8', 'bluegreen-9', 'bluepurple', 'bluepurple-3', 'bluepurple-4', 'bluepurple-5', 'bluepurple-6', 'bluepurple-7', 'bluepurple-8', 'bluepurple-9', 'goldgreen', 'goldgreen-3', 'goldgreen-4', 'goldgreen-5', 'goldgreen-6', 'goldgreen-7', 'goldgreen-8', 'goldgreen-9', 'goldorange', 'goldorange-3', 'goldorange-4', 'goldorange-5', 'goldorange-6', 'goldorange-7', 'goldorange-8', 'goldorange-9', 'goldred', 'goldred-3', 'goldred-4', 'goldred-5', 'goldred-6', 'goldred-7', 'goldred-8', 'goldred-9', 'greenblue', 'greenblue-3', 'greenblue-4', 'greenblue-5', 'greenblue-6', 'greenblue-7', 'greenblue-8', 'greenblue-9', 'orangered', 'orangered-3', 'orangered-4', 'orangered-5', 'orangered-6', 'orangered-7', 'orangered-8', 'orangered-9', 'purplebluegreen', 'purplebluegreen-3', 'purplebluegreen-4', 'purplebluegreen-5', 'purplebluegreen-6', 'purplebluegreen-7', 'purplebluegreen-8', 'purplebluegreen-9', 'purpleblue', 'purpleblue-3', 'purpleblue-4', 'purpleblue-5', 'purpleblue-6', 'purpleblue-7', 'purpleblue-8', 'purpleblue-9', 'purplered', 'purplered-3', 'purplered-4', 'purplered-5', 'purplered-6', 'purplered-7', 'purplered-8', 'purplered-9', 'redpurple', 'redpurple-3', 'redpurple-4', 'redpurple-5', 'redpurple-6', 'redpurple-7', 'redpurple-8', 'redpurple-9', 'yellowgreenblue', 'yellowgreenblue-3', 'yellowgreenblue-4', 'yellowgreenblue-5', 'yellowgreenblue-6', 'yellowgreenblue-7', 'yellowgreenblue-8', 'yellowgreenblue-9', 'yellowgreen', 'yellowgreen-3', 'yellowgreen-4', 'yellowgreen-5', 'yellowgreen-6', 'yellowgreen-7', 'yellowgreen-8', 'yellowgreen-9', 'yelloworangebrown', 'yelloworangebrown-3', 'yelloworangebrown-4', 'yelloworangebrown-5', 'yelloworangebrown-6', 'yelloworangebrown-7', 'yelloworangebrown-8', 'yelloworangebrown-9', 'yelloworangered', 'yelloworangered-3', 'yelloworangered-4', 'yelloworangered-5', 'yelloworangered-6', 'yelloworangered-7', 'yelloworangered-8', 'yelloworangered-9', 'darkblue', 'darkblue-3', 'darkblue-4', 'darkblue-5', 'darkblue-6', 'darkblue-7', 'darkblue-8', 'darkblue-9', 'darkgold', 'darkgold-3', 'darkgold-4', 'darkgold-5', 'darkgold-6', 'darkgold-7', 'darkgold-8', 'darkgold-9', 'darkgreen', 'darkgreen-3', 'darkgreen-4', 'darkgreen-5', 'darkgreen-6', 'darkgreen-7', 'darkgreen-8', 'darkgreen-9', 'darkmulti', 'darkmulti-3', 'darkmulti-4', 'darkmulti-5', 'darkmulti-6', 'darkmulti-7', 'darkmulti-8', 'darkmulti-9', 'darkred', 'darkred-3', 'darkred-4', 'darkred-5', 'darkred-6', 'darkred-7', 'darkred-8', 'darkred-9', 'lightgreyred', 'lightgreyred-3', 'lightgreyred-4', 'lightgreyred-5', 'lightgreyred-6', 'lightgreyred-7', 'lightgreyred-8', 'lightgreyred-9', 'lightgreyteal', 'lightgreyteal-3', 'lightgreyteal-4', 'lightgreyteal-5', 'lightgreyteal-6', 'lightgreyteal-7', 'lightgreyteal-8', 'lightgreyteal-9', 'lightmulti', 'lightmulti-3', 'lightmulti-4', 'lightmulti-5', 'lightmulti-6', 'lightmulti-7', 'lightmulti-8', 'lightmulti-9', 'lightorange', 'lightorange-3', 'lightorange-4', 'lightorange-5', 'lightorange-6', 'lightorange-7', 'lightorange-8', 'lightorange-9', 'lighttealblue', 'lighttealblue-3', 'lighttealblue-4', 'lighttealblue-5', 'lighttealblue-6', 'lighttealblue-7', 'lighttealblue-8', 'lighttealblue-9'], :class:`SequentialSingleHue`, Literal['blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', 'reds', 'oranges'], :class:`ExprRef`, Dict[required=[expr]], :class:`SchemeParams`, Dict[required=[name]] A string indicating a color `scheme <https://vega.github.io/vega-lite/docs/scale.html#scheme>`__ name (e.g., ``"category10"`` or ``"blues"`` ) or a `scheme parameter object @@ -14887,7 +39290,7 @@ class Scale(VegaLiteSchema): For the full list of supported schemes, please refer to the `Vega Scheme <https://vega.github.io/vega/docs/schemes/#reference>`__ reference. - type : :class:`ScaleType` + type : :class:`ScaleType`, Literal['linear', 'log', 'pow', 'sqrt', 'symlog', 'identity', 'sequential', 'time', 'utc', 'quantile', 'quantize', 'threshold', 'bin-ordinal', 'ordinal', 'point', 'band'] The type of scale. Vega-Lite supports the following categories of scale types: 1) `Continuous Scales @@ -14917,7 +39320,7 @@ class Scale(VegaLiteSchema): **Default value:** please see the `scale type table <https://vega.github.io/vega-lite/docs/scale.html#type>`__. - zero : anyOf(boolean, :class:`ExprRef`) + zero : :class:`ExprRef`, Dict[required=[expr]], bool If ``true``, ensures that a zero baseline value is included in the scale domain. **Default value:** ``true`` for x and y channels if the quantitative field is not @@ -14925,29 +39328,579 @@ class Scale(VegaLiteSchema): **Note:** Log, time, and utc scales do not support ``zero``. """ - _schema = {'$ref': '#/definitions/Scale'} - def __init__(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, - constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, - domainMin=Undefined, domainRaw=Undefined, exponent=Undefined, interpolate=Undefined, - nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, - range=Undefined, rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, - round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, **kwds): - super(Scale, self).__init__(align=align, base=base, bins=bins, clamp=clamp, constant=constant, - domain=domain, domainMax=domainMax, domainMid=domainMid, - domainMin=domainMin, domainRaw=domainRaw, exponent=exponent, - interpolate=interpolate, nice=nice, padding=padding, - paddingInner=paddingInner, paddingOuter=paddingOuter, range=range, - rangeMax=rangeMax, rangeMin=rangeMin, reverse=reverse, round=round, - scheme=scheme, type=type, zero=zero, **kwds) + _schema = {"$ref": "#/definitions/Scale"} + + def __init__( + self, + align: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + base: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + bins: Union[ + Union["ScaleBins", Sequence[float], Union["ScaleBinParams", dict]], + UndefinedType, + ] = Undefined, + clamp: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + constant: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + domain: Union[ + Union[ + Sequence[ + Union[ + None, + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + bool, + float, + str, + ] + ], + Union["DomainUnionWith", dict], + Union["ExprRef", "_Parameter", dict], + Union["ParameterExtent", "_Parameter", dict], + str, + ], + UndefinedType, + ] = Undefined, + domainMax: Union[ + Union[Union["DateTime", dict], Union["ExprRef", "_Parameter", dict], float], + UndefinedType, + ] = Undefined, + domainMid: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + domainMin: Union[ + Union[Union["DateTime", dict], Union["ExprRef", "_Parameter", dict], float], + UndefinedType, + ] = Undefined, + domainRaw: Union[ + Union["ExprRef", "_Parameter", dict], UndefinedType + ] = Undefined, + exponent: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "ScaleInterpolateEnum", + Literal[ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long", + ], + ], + Union["ScaleInterpolateParams", dict], + ], + UndefinedType, + ] = Undefined, + nice: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TimeInterval", + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + ], + Union["TimeIntervalStep", dict], + bool, + float, + ], + UndefinedType, + ] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + paddingInner: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + paddingOuter: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + range: Union[ + Union[ + Sequence[ + Union[ + Sequence[float], + Union["ExprRef", "_Parameter", dict], + float, + str, + ] + ], + Union["FieldRange", dict], + Union[ + "RangeEnum", + Literal[ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap", + ], + ], + ], + UndefinedType, + ] = Undefined, + rangeMax: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + rangeMin: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + reverse: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + round: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + scheme: Union[ + Union[ + Union[ + "ColorScheme", + Union[ + "Categorical", + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + ], + Union["Cyclical", Literal["rainbow", "sinebow"]], + Union[ + "Diverging", + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + ], + Union[ + "SequentialMultiHue", + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + ], + Union[ + "SequentialSingleHue", + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + ], + ], + Union["ExprRef", "_Parameter", dict], + Union["SchemeParams", dict], + ], + UndefinedType, + ] = Undefined, + type: Union[ + Union[ + "ScaleType", + Literal[ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band", + ], + ], + UndefinedType, + ] = Undefined, + zero: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + **kwds, + ): + super(Scale, self).__init__( + align=align, + base=base, + bins=bins, + clamp=clamp, + constant=constant, + domain=domain, + domainMax=domainMax, + domainMid=domainMid, + domainMin=domainMin, + domainRaw=domainRaw, + exponent=exponent, + interpolate=interpolate, + nice=nice, + padding=padding, + paddingInner=paddingInner, + paddingOuter=paddingOuter, + range=range, + rangeMax=rangeMax, + rangeMin=rangeMin, + reverse=reverse, + round=round, + scheme=scheme, + type=type, + zero=zero, + **kwds, + ) class ScaleBins(VegaLiteSchema): """ScaleBins schema wrapper - anyOf(List(float), :class:`ScaleBinParams`) + :class:`ScaleBinParams`, Dict[required=[step]], :class:`ScaleBins`, Sequence[float] """ - _schema = {'$ref': '#/definitions/ScaleBins'} + + _schema = {"$ref": "#/definitions/ScaleBins"} def __init__(self, *args, **kwds): super(ScaleBins, self).__init__(*args, **kwds) @@ -14956,7 +39909,7 @@ def __init__(self, *args, **kwds): class ScaleBinParams(ScaleBins): """ScaleBinParams schema wrapper - Mapping(required=[step]) + :class:`ScaleBinParams`, Dict[required=[step]] Parameters ---------- @@ -14972,21 +39925,28 @@ class ScaleBinParams(ScaleBins): **Default value:** The highest value of the scale domain will be used. """ - _schema = {'$ref': '#/definitions/ScaleBinParams'} - def __init__(self, step=Undefined, start=Undefined, stop=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ScaleBinParams"} + + def __init__( + self, + step: Union[float, UndefinedType] = Undefined, + start: Union[float, UndefinedType] = Undefined, + stop: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(ScaleBinParams, self).__init__(step=step, start=start, stop=stop, **kwds) class ScaleConfig(VegaLiteSchema): """ScaleConfig schema wrapper - Mapping(required=[]) + :class:`ScaleConfig`, Dict Parameters ---------- - bandPaddingInner : anyOf(float, :class:`ExprRef`) + bandPaddingInner : :class:`ExprRef`, Dict[required=[expr]], float Default inner padding for ``x`` and ``y`` band scales. **Default value:** @@ -14995,29 +39955,29 @@ class ScaleConfig(VegaLiteSchema): * ``nestedOffsetPaddingInner`` for x/y scales with nested x/y offset scales. * ``barBandPaddingInner`` for bar marks ( ``0.1`` by default) * ``rectBandPaddingInner`` for rect and other marks ( ``0`` by default) - bandPaddingOuter : anyOf(float, :class:`ExprRef`) + bandPaddingOuter : :class:`ExprRef`, Dict[required=[expr]], float Default outer padding for ``x`` and ``y`` band scales. **Default value:** ``paddingInner/2`` (which makes *width/height = number of unique values * step* ) - bandWithNestedOffsetPaddingInner : anyOf(float, :class:`ExprRef`) + bandWithNestedOffsetPaddingInner : :class:`ExprRef`, Dict[required=[expr]], float Default inner padding for ``x`` and ``y`` band scales with nested ``xOffset`` and ``yOffset`` encoding. **Default value:** ``0.2`` - bandWithNestedOffsetPaddingOuter : anyOf(float, :class:`ExprRef`) + bandWithNestedOffsetPaddingOuter : :class:`ExprRef`, Dict[required=[expr]], float Default outer padding for ``x`` and ``y`` band scales with nested ``xOffset`` and ``yOffset`` encoding. **Default value:** ``0.2`` - barBandPaddingInner : anyOf(float, :class:`ExprRef`) + barBandPaddingInner : :class:`ExprRef`, Dict[required=[expr]], float Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"bar"`` marks. **Default value:** ``0.1`` - clamp : anyOf(boolean, :class:`ExprRef`) + clamp : :class:`ExprRef`, Dict[required=[expr]], bool If true, values that exceed the data domain are clamped to either the minimum or maximum range value - continuousPadding : anyOf(float, :class:`ExprRef`) + continuousPadding : :class:`ExprRef`, Dict[required=[expr]], float Default padding for continuous x/y scales. **Default:** The bar width for continuous x-scale of a vertical bar and continuous @@ -15064,15 +40024,15 @@ class ScaleConfig(VegaLiteSchema): of size for trail marks with zero=false. **Default value:** ``1`` - offsetBandPaddingInner : anyOf(float, :class:`ExprRef`) + offsetBandPaddingInner : :class:`ExprRef`, Dict[required=[expr]], float Default padding inner for xOffset/yOffset's band scales. **Default Value:** ``0`` - offsetBandPaddingOuter : anyOf(float, :class:`ExprRef`) + offsetBandPaddingOuter : :class:`ExprRef`, Dict[required=[expr]], float Default padding outer for xOffset/yOffset's band scales. **Default Value:** ``0`` - pointPadding : anyOf(float, :class:`ExprRef`) + pointPadding : :class:`ExprRef`, Dict[required=[expr]], float Default outer padding for ``x`` and ``y`` point-ordinal scales. **Default value:** ``0.5`` (which makes *width/height = number of unique values * @@ -15087,14 +40047,14 @@ class ScaleConfig(VegaLiteSchema): <https://vega.github.io/vega-lite/docs/scale.html#quantize>`__ scale. **Default value:** ``4`` - rectBandPaddingInner : anyOf(float, :class:`ExprRef`) + rectBandPaddingInner : :class:`ExprRef`, Dict[required=[expr]], float Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"rect"`` marks. **Default value:** ``0`` - round : anyOf(boolean, :class:`ExprRef`) + round : :class:`ExprRef`, Dict[required=[expr]], bool If true, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid. (Only available for ``x``, ``y``, and ``size`` scales.) - useUnaggregatedDomain : boolean + useUnaggregatedDomain : bool Use the source data range before aggregation as scale domain instead of aggregated data for aggregate axis. @@ -15107,51 +40067,111 @@ class ScaleConfig(VegaLiteSchema): raw data domain (e.g. ``"count"``, ``"sum"`` ), this property is ignored. **Default value:** ``false`` - xReverse : anyOf(boolean, :class:`ExprRef`) + xReverse : :class:`ExprRef`, Dict[required=[expr]], bool Reverse x-scale by default (useful for right-to-left charts). - zero : boolean + zero : bool Default ``scale.zero`` for `continuous <https://vega.github.io/vega-lite/docs/scale.html#continuous>`__ scales except for (1) x/y-scales of non-ranged bar or area charts and (2) size scales. **Default value:** ``true`` """ - _schema = {'$ref': '#/definitions/ScaleConfig'} - - def __init__(self, bandPaddingInner=Undefined, bandPaddingOuter=Undefined, - bandWithNestedOffsetPaddingInner=Undefined, bandWithNestedOffsetPaddingOuter=Undefined, - barBandPaddingInner=Undefined, clamp=Undefined, continuousPadding=Undefined, - maxBandSize=Undefined, maxFontSize=Undefined, maxOpacity=Undefined, maxSize=Undefined, - maxStrokeWidth=Undefined, minBandSize=Undefined, minFontSize=Undefined, - minOpacity=Undefined, minSize=Undefined, minStrokeWidth=Undefined, - offsetBandPaddingInner=Undefined, offsetBandPaddingOuter=Undefined, - pointPadding=Undefined, quantileCount=Undefined, quantizeCount=Undefined, - rectBandPaddingInner=Undefined, round=Undefined, useUnaggregatedDomain=Undefined, - xReverse=Undefined, zero=Undefined, **kwds): - super(ScaleConfig, self).__init__(bandPaddingInner=bandPaddingInner, - bandPaddingOuter=bandPaddingOuter, - bandWithNestedOffsetPaddingInner=bandWithNestedOffsetPaddingInner, - bandWithNestedOffsetPaddingOuter=bandWithNestedOffsetPaddingOuter, - barBandPaddingInner=barBandPaddingInner, clamp=clamp, - continuousPadding=continuousPadding, maxBandSize=maxBandSize, - maxFontSize=maxFontSize, maxOpacity=maxOpacity, - maxSize=maxSize, maxStrokeWidth=maxStrokeWidth, - minBandSize=minBandSize, minFontSize=minFontSize, - minOpacity=minOpacity, minSize=minSize, - minStrokeWidth=minStrokeWidth, - offsetBandPaddingInner=offsetBandPaddingInner, - offsetBandPaddingOuter=offsetBandPaddingOuter, - pointPadding=pointPadding, quantileCount=quantileCount, - quantizeCount=quantizeCount, - rectBandPaddingInner=rectBandPaddingInner, round=round, - useUnaggregatedDomain=useUnaggregatedDomain, - xReverse=xReverse, zero=zero, **kwds) + + _schema = {"$ref": "#/definitions/ScaleConfig"} + + def __init__( + self, + bandPaddingInner: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + bandPaddingOuter: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + bandWithNestedOffsetPaddingInner: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + bandWithNestedOffsetPaddingOuter: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + barBandPaddingInner: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + clamp: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + continuousPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + maxBandSize: Union[float, UndefinedType] = Undefined, + maxFontSize: Union[float, UndefinedType] = Undefined, + maxOpacity: Union[float, UndefinedType] = Undefined, + maxSize: Union[float, UndefinedType] = Undefined, + maxStrokeWidth: Union[float, UndefinedType] = Undefined, + minBandSize: Union[float, UndefinedType] = Undefined, + minFontSize: Union[float, UndefinedType] = Undefined, + minOpacity: Union[float, UndefinedType] = Undefined, + minSize: Union[float, UndefinedType] = Undefined, + minStrokeWidth: Union[float, UndefinedType] = Undefined, + offsetBandPaddingInner: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offsetBandPaddingOuter: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + pointPadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + quantileCount: Union[float, UndefinedType] = Undefined, + quantizeCount: Union[float, UndefinedType] = Undefined, + rectBandPaddingInner: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + round: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + useUnaggregatedDomain: Union[bool, UndefinedType] = Undefined, + xReverse: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + zero: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(ScaleConfig, self).__init__( + bandPaddingInner=bandPaddingInner, + bandPaddingOuter=bandPaddingOuter, + bandWithNestedOffsetPaddingInner=bandWithNestedOffsetPaddingInner, + bandWithNestedOffsetPaddingOuter=bandWithNestedOffsetPaddingOuter, + barBandPaddingInner=barBandPaddingInner, + clamp=clamp, + continuousPadding=continuousPadding, + maxBandSize=maxBandSize, + maxFontSize=maxFontSize, + maxOpacity=maxOpacity, + maxSize=maxSize, + maxStrokeWidth=maxStrokeWidth, + minBandSize=minBandSize, + minFontSize=minFontSize, + minOpacity=minOpacity, + minSize=minSize, + minStrokeWidth=minStrokeWidth, + offsetBandPaddingInner=offsetBandPaddingInner, + offsetBandPaddingOuter=offsetBandPaddingOuter, + pointPadding=pointPadding, + quantileCount=quantileCount, + quantizeCount=quantizeCount, + rectBandPaddingInner=rectBandPaddingInner, + round=round, + useUnaggregatedDomain=useUnaggregatedDomain, + xReverse=xReverse, + zero=zero, + **kwds, + ) class ScaleDatumDef(OffsetDef): """ScaleDatumDef schema wrapper - Mapping(required=[]) + :class:`ScaleDatumDef`, Dict Parameters ---------- @@ -15160,9 +40180,9 @@ class ScaleDatumDef(OffsetDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -15175,7 +40195,7 @@ class ScaleDatumDef(OffsetDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -15195,7 +40215,7 @@ class ScaleDatumDef(OffsetDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -15265,23 +40285,55 @@ class ScaleDatumDef(OffsetDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/ScaleDatumDef'} - def __init__(self, bandPosition=Undefined, datum=Undefined, scale=Undefined, title=Undefined, - type=Undefined, **kwds): - super(ScaleDatumDef, self).__init__(bandPosition=bandPosition, datum=datum, scale=scale, - title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/ScaleDatumDef"} + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ScaleDatumDef, self).__init__( + bandPosition=bandPosition, + datum=datum, + scale=scale, + title=title, + type=type, + **kwds, + ) class ScaleFieldDef(OffsetDef): """ScaleFieldDef schema wrapper - Mapping(required=[]) + :class:`ScaleFieldDef`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -15293,7 +40345,7 @@ class ScaleFieldDef(OffsetDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -15314,7 +40366,7 @@ class ScaleFieldDef(OffsetDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -15329,7 +40381,7 @@ class ScaleFieldDef(OffsetDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -15342,7 +40394,7 @@ class ScaleFieldDef(OffsetDef): **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -15381,7 +40433,7 @@ class ScaleFieldDef(OffsetDef): **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -15390,7 +40442,7 @@ class ScaleFieldDef(OffsetDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -15410,7 +40462,7 @@ class ScaleFieldDef(OffsetDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -15480,22 +40532,296 @@ class ScaleFieldDef(OffsetDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/ScaleFieldDef'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, - **kwds): - super(ScaleFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, - field=field, scale=scale, sort=sort, timeUnit=timeUnit, - title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/ScaleFieldDef"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + "Sort", + None, + Union[ + "AllSortString", + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + Union[ + "SortByChannelDesc", + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortByEncoding", dict], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ScaleFieldDef, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class ScaleInterpolateEnum(VegaLiteSchema): """ScaleInterpolateEnum schema wrapper - enum('rgb', 'lab', 'hcl', 'hsl', 'hsl-long', 'hcl-long', 'cubehelix', 'cubehelix-long') + :class:`ScaleInterpolateEnum`, Literal['rgb', 'lab', 'hcl', 'hsl', 'hsl-long', 'hcl-long', + 'cubehelix', 'cubehelix-long'] """ - _schema = {'$ref': '#/definitions/ScaleInterpolateEnum'} + + _schema = {"$ref": "#/definitions/ScaleInterpolateEnum"} def __init__(self, *args): super(ScaleInterpolateEnum, self).__init__(*args) @@ -15504,86 +40830,162 @@ def __init__(self, *args): class ScaleInterpolateParams(VegaLiteSchema): """ScaleInterpolateParams schema wrapper - Mapping(required=[type]) + :class:`ScaleInterpolateParams`, Dict[required=[type]] Parameters ---------- - type : enum('rgb', 'cubehelix', 'cubehelix-long') + type : Literal['rgb', 'cubehelix', 'cubehelix-long'] gamma : float """ - _schema = {'$ref': '#/definitions/ScaleInterpolateParams'} - def __init__(self, type=Undefined, gamma=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ScaleInterpolateParams"} + + def __init__( + self, + type: Union[ + Literal["rgb", "cubehelix", "cubehelix-long"], UndefinedType + ] = Undefined, + gamma: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(ScaleInterpolateParams, self).__init__(type=type, gamma=gamma, **kwds) class ScaleResolveMap(VegaLiteSchema): """ScaleResolveMap schema wrapper - Mapping(required=[]) + :class:`ScaleResolveMap`, Dict Parameters ---------- - angle : :class:`ResolveMode` - - color : :class:`ResolveMode` - - fill : :class:`ResolveMode` - - fillOpacity : :class:`ResolveMode` - - opacity : :class:`ResolveMode` - - radius : :class:`ResolveMode` - - shape : :class:`ResolveMode` - - size : :class:`ResolveMode` - - stroke : :class:`ResolveMode` - - strokeDash : :class:`ResolveMode` - - strokeOpacity : :class:`ResolveMode` - - strokeWidth : :class:`ResolveMode` - - theta : :class:`ResolveMode` - - x : :class:`ResolveMode` - - xOffset : :class:`ResolveMode` - - y : :class:`ResolveMode` - - yOffset : :class:`ResolveMode` - - """ - _schema = {'$ref': '#/definitions/ScaleResolveMap'} - - def __init__(self, angle=Undefined, color=Undefined, fill=Undefined, fillOpacity=Undefined, - opacity=Undefined, radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, - strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, theta=Undefined, - x=Undefined, xOffset=Undefined, y=Undefined, yOffset=Undefined, **kwds): - super(ScaleResolveMap, self).__init__(angle=angle, color=color, fill=fill, - fillOpacity=fillOpacity, opacity=opacity, radius=radius, - shape=shape, size=size, stroke=stroke, - strokeDash=strokeDash, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, theta=theta, x=x, - xOffset=xOffset, y=y, yOffset=yOffset, **kwds) + angle : :class:`ResolveMode`, Literal['independent', 'shared'] + + color : :class:`ResolveMode`, Literal['independent', 'shared'] + + fill : :class:`ResolveMode`, Literal['independent', 'shared'] + + fillOpacity : :class:`ResolveMode`, Literal['independent', 'shared'] + + opacity : :class:`ResolveMode`, Literal['independent', 'shared'] + + radius : :class:`ResolveMode`, Literal['independent', 'shared'] + + shape : :class:`ResolveMode`, Literal['independent', 'shared'] + + size : :class:`ResolveMode`, Literal['independent', 'shared'] + + stroke : :class:`ResolveMode`, Literal['independent', 'shared'] + + strokeDash : :class:`ResolveMode`, Literal['independent', 'shared'] + + strokeOpacity : :class:`ResolveMode`, Literal['independent', 'shared'] + + strokeWidth : :class:`ResolveMode`, Literal['independent', 'shared'] + + theta : :class:`ResolveMode`, Literal['independent', 'shared'] + + x : :class:`ResolveMode`, Literal['independent', 'shared'] + + xOffset : :class:`ResolveMode`, Literal['independent', 'shared'] + + y : :class:`ResolveMode`, Literal['independent', 'shared'] + + yOffset : :class:`ResolveMode`, Literal['independent', 'shared'] + + """ + + _schema = {"$ref": "#/definitions/ScaleResolveMap"} + + def __init__( + self, + angle: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + color: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + fill: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + fillOpacity: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + opacity: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + radius: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + shape: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + size: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + stroke: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + strokeDash: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + theta: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + x: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + xOffset: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + y: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + yOffset: Union[ + Union["ResolveMode", Literal["independent", "shared"]], UndefinedType + ] = Undefined, + **kwds, + ): + super(ScaleResolveMap, self).__init__( + angle=angle, + color=color, + fill=fill, + fillOpacity=fillOpacity, + opacity=opacity, + radius=radius, + shape=shape, + size=size, + stroke=stroke, + strokeDash=strokeDash, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + theta=theta, + x=x, + xOffset=xOffset, + y=y, + yOffset=yOffset, + **kwds, + ) class ScaleType(VegaLiteSchema): """ScaleType schema wrapper - enum('linear', 'log', 'pow', 'sqrt', 'symlog', 'identity', 'sequential', 'time', 'utc', - 'quantile', 'quantize', 'threshold', 'bin-ordinal', 'ordinal', 'point', 'band') + :class:`ScaleType`, Literal['linear', 'log', 'pow', 'sqrt', 'symlog', 'identity', + 'sequential', 'time', 'utc', 'quantile', 'quantize', 'threshold', 'bin-ordinal', 'ordinal', + 'point', 'band'] """ - _schema = {'$ref': '#/definitions/ScaleType'} + + _schema = {"$ref": "#/definitions/ScaleType"} def __init__(self, *args): super(ScaleType, self).__init__(*args) @@ -15592,12 +40994,12 @@ def __init__(self, *args): class SchemeParams(VegaLiteSchema): """SchemeParams schema wrapper - Mapping(required=[name]) + :class:`SchemeParams`, Dict[required=[name]] Parameters ---------- - name : :class:`ColorScheme` + name : :class:`Categorical`, Literal['accent', 'category10', 'category20', 'category20b', 'category20c', 'dark2', 'paired', 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', 'tableau20'], :class:`ColorScheme`, :class:`Cyclical`, Literal['rainbow', 'sinebow'], :class:`Diverging`, Literal['blueorange', 'blueorange-3', 'blueorange-4', 'blueorange-5', 'blueorange-6', 'blueorange-7', 'blueorange-8', 'blueorange-9', 'blueorange-10', 'blueorange-11', 'brownbluegreen', 'brownbluegreen-3', 'brownbluegreen-4', 'brownbluegreen-5', 'brownbluegreen-6', 'brownbluegreen-7', 'brownbluegreen-8', 'brownbluegreen-9', 'brownbluegreen-10', 'brownbluegreen-11', 'purplegreen', 'purplegreen-3', 'purplegreen-4', 'purplegreen-5', 'purplegreen-6', 'purplegreen-7', 'purplegreen-8', 'purplegreen-9', 'purplegreen-10', 'purplegreen-11', 'pinkyellowgreen', 'pinkyellowgreen-3', 'pinkyellowgreen-4', 'pinkyellowgreen-5', 'pinkyellowgreen-6', 'pinkyellowgreen-7', 'pinkyellowgreen-8', 'pinkyellowgreen-9', 'pinkyellowgreen-10', 'pinkyellowgreen-11', 'purpleorange', 'purpleorange-3', 'purpleorange-4', 'purpleorange-5', 'purpleorange-6', 'purpleorange-7', 'purpleorange-8', 'purpleorange-9', 'purpleorange-10', 'purpleorange-11', 'redblue', 'redblue-3', 'redblue-4', 'redblue-5', 'redblue-6', 'redblue-7', 'redblue-8', 'redblue-9', 'redblue-10', 'redblue-11', 'redgrey', 'redgrey-3', 'redgrey-4', 'redgrey-5', 'redgrey-6', 'redgrey-7', 'redgrey-8', 'redgrey-9', 'redgrey-10', 'redgrey-11', 'redyellowblue', 'redyellowblue-3', 'redyellowblue-4', 'redyellowblue-5', 'redyellowblue-6', 'redyellowblue-7', 'redyellowblue-8', 'redyellowblue-9', 'redyellowblue-10', 'redyellowblue-11', 'redyellowgreen', 'redyellowgreen-3', 'redyellowgreen-4', 'redyellowgreen-5', 'redyellowgreen-6', 'redyellowgreen-7', 'redyellowgreen-8', 'redyellowgreen-9', 'redyellowgreen-10', 'redyellowgreen-11', 'spectral', 'spectral-3', 'spectral-4', 'spectral-5', 'spectral-6', 'spectral-7', 'spectral-8', 'spectral-9', 'spectral-10', 'spectral-11'], :class:`SequentialMultiHue`, Literal['turbo', 'viridis', 'inferno', 'magma', 'plasma', 'cividis', 'bluegreen', 'bluegreen-3', 'bluegreen-4', 'bluegreen-5', 'bluegreen-6', 'bluegreen-7', 'bluegreen-8', 'bluegreen-9', 'bluepurple', 'bluepurple-3', 'bluepurple-4', 'bluepurple-5', 'bluepurple-6', 'bluepurple-7', 'bluepurple-8', 'bluepurple-9', 'goldgreen', 'goldgreen-3', 'goldgreen-4', 'goldgreen-5', 'goldgreen-6', 'goldgreen-7', 'goldgreen-8', 'goldgreen-9', 'goldorange', 'goldorange-3', 'goldorange-4', 'goldorange-5', 'goldorange-6', 'goldorange-7', 'goldorange-8', 'goldorange-9', 'goldred', 'goldred-3', 'goldred-4', 'goldred-5', 'goldred-6', 'goldred-7', 'goldred-8', 'goldred-9', 'greenblue', 'greenblue-3', 'greenblue-4', 'greenblue-5', 'greenblue-6', 'greenblue-7', 'greenblue-8', 'greenblue-9', 'orangered', 'orangered-3', 'orangered-4', 'orangered-5', 'orangered-6', 'orangered-7', 'orangered-8', 'orangered-9', 'purplebluegreen', 'purplebluegreen-3', 'purplebluegreen-4', 'purplebluegreen-5', 'purplebluegreen-6', 'purplebluegreen-7', 'purplebluegreen-8', 'purplebluegreen-9', 'purpleblue', 'purpleblue-3', 'purpleblue-4', 'purpleblue-5', 'purpleblue-6', 'purpleblue-7', 'purpleblue-8', 'purpleblue-9', 'purplered', 'purplered-3', 'purplered-4', 'purplered-5', 'purplered-6', 'purplered-7', 'purplered-8', 'purplered-9', 'redpurple', 'redpurple-3', 'redpurple-4', 'redpurple-5', 'redpurple-6', 'redpurple-7', 'redpurple-8', 'redpurple-9', 'yellowgreenblue', 'yellowgreenblue-3', 'yellowgreenblue-4', 'yellowgreenblue-5', 'yellowgreenblue-6', 'yellowgreenblue-7', 'yellowgreenblue-8', 'yellowgreenblue-9', 'yellowgreen', 'yellowgreen-3', 'yellowgreen-4', 'yellowgreen-5', 'yellowgreen-6', 'yellowgreen-7', 'yellowgreen-8', 'yellowgreen-9', 'yelloworangebrown', 'yelloworangebrown-3', 'yelloworangebrown-4', 'yelloworangebrown-5', 'yelloworangebrown-6', 'yelloworangebrown-7', 'yelloworangebrown-8', 'yelloworangebrown-9', 'yelloworangered', 'yelloworangered-3', 'yelloworangered-4', 'yelloworangered-5', 'yelloworangered-6', 'yelloworangered-7', 'yelloworangered-8', 'yelloworangered-9', 'darkblue', 'darkblue-3', 'darkblue-4', 'darkblue-5', 'darkblue-6', 'darkblue-7', 'darkblue-8', 'darkblue-9', 'darkgold', 'darkgold-3', 'darkgold-4', 'darkgold-5', 'darkgold-6', 'darkgold-7', 'darkgold-8', 'darkgold-9', 'darkgreen', 'darkgreen-3', 'darkgreen-4', 'darkgreen-5', 'darkgreen-6', 'darkgreen-7', 'darkgreen-8', 'darkgreen-9', 'darkmulti', 'darkmulti-3', 'darkmulti-4', 'darkmulti-5', 'darkmulti-6', 'darkmulti-7', 'darkmulti-8', 'darkmulti-9', 'darkred', 'darkred-3', 'darkred-4', 'darkred-5', 'darkred-6', 'darkred-7', 'darkred-8', 'darkred-9', 'lightgreyred', 'lightgreyred-3', 'lightgreyred-4', 'lightgreyred-5', 'lightgreyred-6', 'lightgreyred-7', 'lightgreyred-8', 'lightgreyred-9', 'lightgreyteal', 'lightgreyteal-3', 'lightgreyteal-4', 'lightgreyteal-5', 'lightgreyteal-6', 'lightgreyteal-7', 'lightgreyteal-8', 'lightgreyteal-9', 'lightmulti', 'lightmulti-3', 'lightmulti-4', 'lightmulti-5', 'lightmulti-6', 'lightmulti-7', 'lightmulti-8', 'lightmulti-9', 'lightorange', 'lightorange-3', 'lightorange-4', 'lightorange-5', 'lightorange-6', 'lightorange-7', 'lightorange-8', 'lightorange-9', 'lighttealblue', 'lighttealblue-3', 'lighttealblue-4', 'lighttealblue-5', 'lighttealblue-6', 'lighttealblue-7', 'lighttealblue-8', 'lighttealblue-9'], :class:`SequentialSingleHue`, Literal['blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', 'reds', 'oranges'] A color scheme name for ordinal scales (e.g., ``"category10"`` or ``"blues"`` ). For the full list of supported schemes, please refer to the `Vega Scheme @@ -15606,28 +41008,395 @@ class SchemeParams(VegaLiteSchema): The number of colors to use in the scheme. This can be useful for scale types such as ``"quantize"``, which use the length of the scale range to determine the number of discrete bins for the scale domain. - extent : List(float) + extent : Sequence[float] The extent of the color range to use. For example ``[0.2, 1]`` will rescale the color scheme such that color values in the range *[0, 0.2)* are excluded from the scheme. """ - _schema = {'$ref': '#/definitions/SchemeParams'} - def __init__(self, name=Undefined, count=Undefined, extent=Undefined, **kwds): - super(SchemeParams, self).__init__(name=name, count=count, extent=extent, **kwds) + _schema = {"$ref": "#/definitions/SchemeParams"} + + def __init__( + self, + name: Union[ + Union[ + "ColorScheme", + Union[ + "Categorical", + Literal[ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20", + ], + ], + Union["Cyclical", Literal["rainbow", "sinebow"]], + Union[ + "Diverging", + Literal[ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11", + ], + ], + Union[ + "SequentialMultiHue", + Literal[ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9", + ], + ], + Union[ + "SequentialSingleHue", + Literal[ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges", + ], + ], + ], + UndefinedType, + ] = Undefined, + count: Union[float, UndefinedType] = Undefined, + extent: Union[Sequence[float], UndefinedType] = Undefined, + **kwds, + ): + super(SchemeParams, self).__init__( + name=name, count=count, extent=extent, **kwds + ) class SecondaryFieldDef(Position2Def): """SecondaryFieldDef schema wrapper - Mapping(required=[]) + :class:`SecondaryFieldDef`, Dict[required=[shorthand]] A field definition of a secondary channel that shares a scale with another primary channel. For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -15660,7 +41429,7 @@ class SecondaryFieldDef(Position2Def): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -15675,7 +41444,7 @@ class SecondaryFieldDef(Position2Def): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -15684,7 +41453,7 @@ class SecondaryFieldDef(Position2Def): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -15705,23 +41474,230 @@ class SecondaryFieldDef(Position2Def): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. """ - _schema = {'$ref': '#/definitions/SecondaryFieldDef'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(SecondaryFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, - field=field, timeUnit=timeUnit, title=title, **kwds) + _schema = {"$ref": "#/definitions/SecondaryFieldDef"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[None, UndefinedType] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + **kwds, + ): + super(SecondaryFieldDef, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + **kwds, + ) class SelectionConfig(VegaLiteSchema): """SelectionConfig schema wrapper - Mapping(required=[]) + :class:`SelectionConfig`, Dict Parameters ---------- - interval : :class:`IntervalSelectionConfigWithoutType` + interval : :class:`IntervalSelectionConfigWithoutType`, Dict The default definition for an `interval <https://vega.github.io/vega-lite/docs/parameter.html#select>`__ selection. All properties and transformations for an interval selection definition (except ``type`` @@ -15729,7 +41705,7 @@ class SelectionConfig(VegaLiteSchema): For instance, setting ``interval`` to ``{"translate": false}`` disables the ability to move interval selections by default. - point : :class:`PointSelectionConfigWithoutType` + point : :class:`PointSelectionConfigWithoutType`, Dict The default definition for a `point <https://vega.github.io/vega-lite/docs/parameter.html#select>`__ selection. All properties and transformations for a point selection definition (except ``type`` ) @@ -15738,18 +41714,30 @@ class SelectionConfig(VegaLiteSchema): For instance, setting ``point`` to ``{"on": "dblclick"}`` populates point selections on double-click by default. """ - _schema = {'$ref': '#/definitions/SelectionConfig'} - def __init__(self, interval=Undefined, point=Undefined, **kwds): + _schema = {"$ref": "#/definitions/SelectionConfig"} + + def __init__( + self, + interval: Union[ + Union["IntervalSelectionConfigWithoutType", dict], UndefinedType + ] = Undefined, + point: Union[ + Union["PointSelectionConfigWithoutType", dict], UndefinedType + ] = Undefined, + **kwds, + ): super(SelectionConfig, self).__init__(interval=interval, point=point, **kwds) class SelectionInit(VegaLiteSchema): """SelectionInit schema wrapper - anyOf(:class:`PrimitiveValue`, :class:`DateTime`) + :class:`DateTime`, Dict, :class:`PrimitiveValue`, None, bool, float, str, + :class:`SelectionInit` """ - _schema = {'$ref': '#/definitions/SelectionInit'} + + _schema = {"$ref": "#/definitions/SelectionInit"} def __init__(self, *args, **kwds): super(SelectionInit, self).__init__(*args, **kwds) @@ -15758,7 +41746,7 @@ def __init__(self, *args, **kwds): class DateTime(SelectionInit): """DateTime schema wrapper - Mapping(required=[]) + :class:`DateTime`, Dict Object for defining datetime in Vega-Lite Filter. If both month and quarter are provided, month has higher precedence. ``day`` cannot be combined with other date. We accept string for month and day names. @@ -15768,7 +41756,7 @@ class DateTime(SelectionInit): date : float Integer value representing the date (day of the month) from 1-31. - day : anyOf(:class:`Day`, string) + day : :class:`Day`, float, str Value representing the day of a week. This can be one of: (1) integer value -- ``1`` represents Monday; (2) case-insensitive day name (e.g., ``"Monday"`` ); (3) case-insensitive, 3-character short day name (e.g., ``"Mon"`` ). @@ -15781,7 +41769,7 @@ class DateTime(SelectionInit): Integer value representing the millisecond segment of time. minutes : float Integer value representing the minute segment of time from 0-59. - month : anyOf(:class:`Month`, string) + month : :class:`Month`, float, str One of: (1) integer value representing the month from ``1`` - ``12``. ``1`` represents January; (2) case-insensitive month name (e.g., ``"January"`` ); (3) case-insensitive, 3-character short month name (e.g., ``"Jan"`` ). @@ -15789,28 +41777,51 @@ class DateTime(SelectionInit): Integer value representing the quarter of the year (from 1-4). seconds : float Integer value representing the second segment (0-59) of a time value - utc : boolean + utc : bool A boolean flag indicating if date time is in utc time. If false, the date time is in local time year : float Integer value representing the year. """ - _schema = {'$ref': '#/definitions/DateTime'} - def __init__(self, date=Undefined, day=Undefined, hours=Undefined, milliseconds=Undefined, - minutes=Undefined, month=Undefined, quarter=Undefined, seconds=Undefined, - utc=Undefined, year=Undefined, **kwds): - super(DateTime, self).__init__(date=date, day=day, hours=hours, milliseconds=milliseconds, - minutes=minutes, month=month, quarter=quarter, seconds=seconds, - utc=utc, year=year, **kwds) + _schema = {"$ref": "#/definitions/DateTime"} + + def __init__( + self, + date: Union[float, UndefinedType] = Undefined, + day: Union[Union[Union["Day", float], str], UndefinedType] = Undefined, + hours: Union[float, UndefinedType] = Undefined, + milliseconds: Union[float, UndefinedType] = Undefined, + minutes: Union[float, UndefinedType] = Undefined, + month: Union[Union[Union["Month", float], str], UndefinedType] = Undefined, + quarter: Union[float, UndefinedType] = Undefined, + seconds: Union[float, UndefinedType] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + year: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(DateTime, self).__init__( + date=date, + day=day, + hours=hours, + milliseconds=milliseconds, + minutes=minutes, + month=month, + quarter=quarter, + seconds=seconds, + utc=utc, + year=year, + **kwds, + ) class PrimitiveValue(SelectionInit): """PrimitiveValue schema wrapper - anyOf(float, string, boolean, None) + :class:`PrimitiveValue`, None, bool, float, str """ - _schema = {'$ref': '#/definitions/PrimitiveValue'} + + _schema = {"$ref": "#/definitions/PrimitiveValue"} def __init__(self, *args): super(PrimitiveValue, self).__init__(*args) @@ -15819,10 +41830,12 @@ def __init__(self, *args): class SelectionInitInterval(VegaLiteSchema): """SelectionInitInterval schema wrapper - anyOf(:class:`Vector2boolean`, :class:`Vector2number`, :class:`Vector2string`, - :class:`Vector2DateTime`) + :class:`SelectionInitInterval`, :class:`Vector2DateTime`, Sequence[:class:`DateTime`, Dict], + :class:`Vector2boolean`, Sequence[bool], :class:`Vector2number`, Sequence[float], + :class:`Vector2string`, Sequence[str] """ - _schema = {'$ref': '#/definitions/SelectionInitInterval'} + + _schema = {"$ref": "#/definitions/SelectionInitInterval"} def __init__(self, *args, **kwds): super(SelectionInitInterval, self).__init__(*args, **kwds) @@ -15831,9 +41844,10 @@ def __init__(self, *args, **kwds): class SelectionInitIntervalMapping(VegaLiteSchema): """SelectionInitIntervalMapping schema wrapper - Mapping(required=[]) + :class:`SelectionInitIntervalMapping`, Dict """ - _schema = {'$ref': '#/definitions/SelectionInitIntervalMapping'} + + _schema = {"$ref": "#/definitions/SelectionInitIntervalMapping"} def __init__(self, **kwds): super(SelectionInitIntervalMapping, self).__init__(**kwds) @@ -15842,9 +41856,10 @@ def __init__(self, **kwds): class SelectionInitMapping(VegaLiteSchema): """SelectionInitMapping schema wrapper - Mapping(required=[]) + :class:`SelectionInitMapping`, Dict """ - _schema = {'$ref': '#/definitions/SelectionInitMapping'} + + _schema = {"$ref": "#/definitions/SelectionInitMapping"} def __init__(self, **kwds): super(SelectionInitMapping, self).__init__(**kwds) @@ -15853,17 +41868,17 @@ def __init__(self, **kwds): class SelectionParameter(VegaLiteSchema): """SelectionParameter schema wrapper - Mapping(required=[name, select]) + :class:`SelectionParameter`, Dict[required=[name, select]] Parameters ---------- - name : :class:`ParameterName` + name : :class:`ParameterName`, str Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are "datum", "event", "item", and "parent". - select : anyOf(:class:`SelectionType`, :class:`PointSelectionConfig`, :class:`IntervalSelectionConfig`) + select : :class:`IntervalSelectionConfig`, Dict[required=[type]], :class:`PointSelectionConfig`, Dict[required=[type]], :class:`SelectionType`, Literal['point', 'interval'] Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types: @@ -15871,7 +41886,7 @@ class SelectionParameter(VegaLiteSchema): * ``"point"`` -- to select multiple discrete data values; the first value is selected on ``click`` and additional values toggled on shift-click. * ``"interval"`` -- to select a continuous range of data values on ``drag``. - bind : anyOf(:class:`Binding`, Mapping(required=[]), :class:`LegendBinding`, string) + bind : :class:`BindCheckbox`, Dict[required=[input]], :class:`BindDirect`, Dict[required=[element]], :class:`BindInput`, Dict, :class:`BindRadioSelect`, Dict[required=[input, options]], :class:`BindRange`, Dict[required=[input]], :class:`Binding`, :class:`LegendBinding`, :class:`LegendStreamBinding`, Dict[required=[legend]], str, Dict, str When set, a selection is populated by input elements (also known as dynamic query widgets) or by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's `on @@ -15887,7 +41902,7 @@ class SelectionParameter(VegaLiteSchema): **See also:** `bind <https://vega.github.io/vega-lite/docs/bind.html>`__ documentation. - value : anyOf(:class:`SelectionInit`, List(:class:`SelectionInitMapping`), :class:`SelectionInitIntervalMapping`) + value : :class:`DateTime`, Dict, :class:`PrimitiveValue`, None, bool, float, str, :class:`SelectionInit`, :class:`SelectionInitIntervalMapping`, Dict, Sequence[:class:`SelectionInitMapping`, Dict] Initialize the selection with a mapping between `projected channels or field names <https://vega.github.io/vega-lite/docs/selection.html#project>`__ and initial values. @@ -15895,19 +41910,62 @@ class SelectionParameter(VegaLiteSchema): **See also:** `init <https://vega.github.io/vega-lite/docs/value.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/SelectionParameter'} - def __init__(self, name=Undefined, select=Undefined, bind=Undefined, value=Undefined, **kwds): - super(SelectionParameter, self).__init__(name=name, select=select, bind=bind, value=value, - **kwds) + _schema = {"$ref": "#/definitions/SelectionParameter"} + + def __init__( + self, + name: Union[Union["ParameterName", str], UndefinedType] = Undefined, + select: Union[ + Union[ + Union["IntervalSelectionConfig", dict], + Union["PointSelectionConfig", dict], + Union["SelectionType", Literal["point", "interval"]], + ], + UndefinedType, + ] = Undefined, + bind: Union[ + Union[ + Union[ + "Binding", + Union["BindCheckbox", dict], + Union["BindDirect", dict], + Union["BindInput", dict], + Union["BindRadioSelect", dict], + Union["BindRange", dict], + ], + Union["LegendBinding", Union["LegendStreamBinding", dict], str], + dict, + str, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + Sequence[Union["SelectionInitMapping", dict]], + Union[ + "SelectionInit", + Union["DateTime", dict], + Union["PrimitiveValue", None, bool, float, str], + ], + Union["SelectionInitIntervalMapping", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(SelectionParameter, self).__init__( + name=name, select=select, bind=bind, value=value, **kwds + ) class SelectionResolution(VegaLiteSchema): """SelectionResolution schema wrapper - enum('global', 'union', 'intersect') + :class:`SelectionResolution`, Literal['global', 'union', 'intersect'] """ - _schema = {'$ref': '#/definitions/SelectionResolution'} + + _schema = {"$ref": "#/definitions/SelectionResolution"} def __init__(self, *args): super(SelectionResolution, self).__init__(*args) @@ -15916,9 +41974,10 @@ def __init__(self, *args): class SelectionType(VegaLiteSchema): """SelectionType schema wrapper - enum('point', 'interval') + :class:`SelectionType`, Literal['point', 'interval'] """ - _schema = {'$ref': '#/definitions/SelectionType'} + + _schema = {"$ref": "#/definitions/SelectionType"} def __init__(self, *args): super(SelectionType, self).__init__(*args) @@ -15927,26 +41986,32 @@ def __init__(self, *args): class SequenceGenerator(Generator): """SequenceGenerator schema wrapper - Mapping(required=[sequence]) + :class:`SequenceGenerator`, Dict[required=[sequence]] Parameters ---------- - sequence : :class:`SequenceParams` + sequence : :class:`SequenceParams`, Dict[required=[start, stop]] Generate a sequence of numbers. - name : string + name : str Provide a placeholder name and bind data at runtime. """ - _schema = {'$ref': '#/definitions/SequenceGenerator'} - def __init__(self, sequence=Undefined, name=Undefined, **kwds): + _schema = {"$ref": "#/definitions/SequenceGenerator"} + + def __init__( + self, + sequence: Union[Union["SequenceParams", dict], UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + **kwds, + ): super(SequenceGenerator, self).__init__(sequence=sequence, name=name, **kwds) class SequenceParams(VegaLiteSchema): """SequenceParams schema wrapper - Mapping(required=[start, stop]) + :class:`SequenceParams`, Dict[required=[start, stop]] Parameters ---------- @@ -15959,28 +42024,35 @@ class SequenceParams(VegaLiteSchema): The step value between sequence entries. **Default value:** ``1`` - as : :class:`FieldName` + as : :class:`FieldName`, str The name of the generated sequence field. **Default value:** ``"data"`` """ - _schema = {'$ref': '#/definitions/SequenceParams'} - def __init__(self, start=Undefined, stop=Undefined, step=Undefined, **kwds): + _schema = {"$ref": "#/definitions/SequenceParams"} + + def __init__( + self, + start: Union[float, UndefinedType] = Undefined, + stop: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(SequenceParams, self).__init__(start=start, stop=stop, step=step, **kwds) class SequentialMultiHue(ColorScheme): """SequentialMultiHue schema wrapper - enum('turbo', 'viridis', 'inferno', 'magma', 'plasma', 'cividis', 'bluegreen', - 'bluegreen-3', 'bluegreen-4', 'bluegreen-5', 'bluegreen-6', 'bluegreen-7', 'bluegreen-8', - 'bluegreen-9', 'bluepurple', 'bluepurple-3', 'bluepurple-4', 'bluepurple-5', 'bluepurple-6', - 'bluepurple-7', 'bluepurple-8', 'bluepurple-9', 'goldgreen', 'goldgreen-3', 'goldgreen-4', - 'goldgreen-5', 'goldgreen-6', 'goldgreen-7', 'goldgreen-8', 'goldgreen-9', 'goldorange', - 'goldorange-3', 'goldorange-4', 'goldorange-5', 'goldorange-6', 'goldorange-7', - 'goldorange-8', 'goldorange-9', 'goldred', 'goldred-3', 'goldred-4', 'goldred-5', - 'goldred-6', 'goldred-7', 'goldred-8', 'goldred-9', 'greenblue', 'greenblue-3', + :class:`SequentialMultiHue`, Literal['turbo', 'viridis', 'inferno', 'magma', 'plasma', + 'cividis', 'bluegreen', 'bluegreen-3', 'bluegreen-4', 'bluegreen-5', 'bluegreen-6', + 'bluegreen-7', 'bluegreen-8', 'bluegreen-9', 'bluepurple', 'bluepurple-3', 'bluepurple-4', + 'bluepurple-5', 'bluepurple-6', 'bluepurple-7', 'bluepurple-8', 'bluepurple-9', 'goldgreen', + 'goldgreen-3', 'goldgreen-4', 'goldgreen-5', 'goldgreen-6', 'goldgreen-7', 'goldgreen-8', + 'goldgreen-9', 'goldorange', 'goldorange-3', 'goldorange-4', 'goldorange-5', 'goldorange-6', + 'goldorange-7', 'goldorange-8', 'goldorange-9', 'goldred', 'goldred-3', 'goldred-4', + 'goldred-5', 'goldred-6', 'goldred-7', 'goldred-8', 'goldred-9', 'greenblue', 'greenblue-3', 'greenblue-4', 'greenblue-5', 'greenblue-6', 'greenblue-7', 'greenblue-8', 'greenblue-9', 'orangered', 'orangered-3', 'orangered-4', 'orangered-5', 'orangered-6', 'orangered-7', 'orangered-8', 'orangered-9', 'purplebluegreen', 'purplebluegreen-3', 'purplebluegreen-4', @@ -16011,9 +42083,10 @@ class SequentialMultiHue(ColorScheme): 'lightmulti-9', 'lightorange', 'lightorange-3', 'lightorange-4', 'lightorange-5', 'lightorange-6', 'lightorange-7', 'lightorange-8', 'lightorange-9', 'lighttealblue', 'lighttealblue-3', 'lighttealblue-4', 'lighttealblue-5', 'lighttealblue-6', - 'lighttealblue-7', 'lighttealblue-8', 'lighttealblue-9') + 'lighttealblue-7', 'lighttealblue-8', 'lighttealblue-9'] """ - _schema = {'$ref': '#/definitions/SequentialMultiHue'} + + _schema = {"$ref": "#/definitions/SequentialMultiHue"} def __init__(self, *args): super(SequentialMultiHue, self).__init__(*args) @@ -16022,10 +42095,11 @@ def __init__(self, *args): class SequentialSingleHue(ColorScheme): """SequentialSingleHue schema wrapper - enum('blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', - 'reds', 'oranges') + :class:`SequentialSingleHue`, Literal['blues', 'tealblues', 'teals', 'greens', 'browns', + 'greys', 'purples', 'warmgreys', 'reds', 'oranges'] """ - _schema = {'$ref': '#/definitions/SequentialSingleHue'} + + _schema = {"$ref": "#/definitions/SequentialSingleHue"} def __init__(self, *args): super(SequentialSingleHue, self).__init__(*args) @@ -16034,20 +42108,24 @@ def __init__(self, *args): class ShapeDef(VegaLiteSchema): """ShapeDef schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, - :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`) + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, Dict, + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + Dict[required=[shorthand]], :class:`ShapeDef`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`, Dict """ - _schema = {'$ref': '#/definitions/ShapeDef'} + + _schema = {"$ref": "#/definitions/ShapeDef"} def __init__(self, *args, **kwds): super(ShapeDef, self).__init__(*args, **kwds) -class FieldOrDatumDefWithConditionDatumDefstringnull(MarkPropDefstringnullTypeForShape, ShapeDef): +class FieldOrDatumDefWithConditionDatumDefstringnull( + MarkPropDefstringnullTypeForShape, ShapeDef +): """FieldOrDatumDefWithConditionDatumDefstringnull schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, Dict Parameters ---------- @@ -16056,16 +42134,16 @@ class FieldOrDatumDefWithConditionDatumDefstringnull(MarkPropDefstringnullTypeFo Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -16085,7 +42163,7 @@ class FieldOrDatumDefWithConditionDatumDefstringnull(MarkPropDefstringnullTypeFo 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -16155,25 +42233,76 @@ class FieldOrDatumDefWithConditionDatumDefstringnull(MarkPropDefstringnullTypeFo **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<DatumDef,(string|null)>'} - - def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, - type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionDatumDefstringnull, self).__init__(bandPosition=bandPosition, - condition=condition, - datum=datum, title=title, - type=type, **kwds) - -class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<DatumDef,(string|null)>" + } + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionDatumDefstringnull, self).__init__( + bandPosition=bandPosition, + condition=condition, + datum=datum, + title=title, + type=type, + **kwds, + ) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull( + MarkPropDefstringnullTypeForShape, ShapeDef +): """FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -16185,7 +42314,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, None) + bin : :class:`BinParams`, Dict, None, bool A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -16206,14 +42335,14 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -16228,7 +42357,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - legend : anyOf(:class:`Legend`, None) + legend : :class:`Legend`, Dict, None An object defining properties of the legend. If ``null``, the legend for the encoding channel will be removed. @@ -16237,7 +42366,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro **See also:** `legend <https://vega.github.io/vega-lite/docs/legend.html>`__ documentation. - scale : anyOf(:class:`Scale`, None) + scale : :class:`Scale`, Dict, None An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. @@ -16250,7 +42379,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro **See also:** `scale <https://vega.github.io/vega-lite/docs/scale.html>`__ documentation. - sort : :class:`Sort` + sort : :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either @@ -16289,7 +42418,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro **See also:** `sort <https://vega.github.io/vega-lite/docs/sort.html>`__ documentation. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -16298,7 +42427,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -16318,7 +42447,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`TypeForShape` + type : :class:`TypeForShape`, Literal['nominal', 'ordinal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -16388,61 +42517,345 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPro **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef<TypeForShape>,(string|null)>'} - - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull, self).__init__(aggregate=aggregate, - bandPosition=bandPosition, - bin=bin, - condition=condition, - field=field, - legend=legend, - scale=scale, - sort=sort, - timeUnit=timeUnit, - title=title, - type=type, - **kwds) + + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<MarkPropFieldDef<TypeForShape>,(string|null)>" + } + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + legend: Union[Union[None, Union["Legend", dict]], UndefinedType] = Undefined, + scale: Union[Union[None, Union["Scale", dict]], UndefinedType] = Undefined, + sort: Union[ + Union[ + "Sort", + None, + Union[ + "AllSortString", + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + Union[ + "SortByChannelDesc", + Literal[ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text", + ], + ], + Union["SortOrder", Literal["ascending", "descending"]], + ], + Union["EncodingSortField", dict], + Union[ + "SortArray", + Sequence[Union["DateTime", dict]], + Sequence[bool], + Sequence[float], + Sequence[str], + ], + Union["SortByEncoding", dict], + ], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union["TypeForShape", Literal["nominal", "ordinal", "geojson"]], + UndefinedType, + ] = Undefined, + **kwds, + ): + super( + FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull, self + ).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class SharedEncoding(VegaLiteSchema): """SharedEncoding schema wrapper - Mapping(required=[]) + :class:`SharedEncoding`, Dict Parameters ---------- - angle : Mapping(required=[]) + angle : Dict - color : Mapping(required=[]) + color : Dict - description : Mapping(required=[]) + description : Dict - detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + detail : :class:`FieldDefWithoutScale`, Dict[required=[shorthand]], Sequence[:class:`FieldDefWithoutScale`, Dict[required=[shorthand]]] Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel. - fill : Mapping(required=[]) + fill : Dict - fillOpacity : Mapping(required=[]) + fillOpacity : Dict - href : Mapping(required=[]) + href : Dict - key : Mapping(required=[]) + key : Dict - latitude : Mapping(required=[]) + latitude : Dict - latitude2 : Mapping(required=[]) + latitude2 : Dict - longitude : Mapping(required=[]) + longitude : Dict - longitude2 : Mapping(required=[]) + longitude2 : Dict - opacity : Mapping(required=[]) + opacity : Dict - order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`, :class:`OrderOnlyDef`) + order : :class:`OrderFieldDef`, Dict[required=[shorthand]], :class:`OrderOnlyDef`, Dict, :class:`OrderValueDef`, Dict[required=[value]], Sequence[:class:`OrderFieldDef`, Dict[required=[shorthand]]] Order of the marks. @@ -16457,92 +42870,176 @@ class SharedEncoding(VegaLiteSchema): **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid creating additional aggregation grouping. - radius : Mapping(required=[]) + radius : Dict - radius2 : Mapping(required=[]) + radius2 : Dict - shape : Mapping(required=[]) + shape : Dict - size : Mapping(required=[]) + size : Dict - stroke : Mapping(required=[]) + stroke : Dict - strokeDash : Mapping(required=[]) + strokeDash : Dict - strokeOpacity : Mapping(required=[]) + strokeOpacity : Dict - strokeWidth : Mapping(required=[]) + strokeWidth : Dict - text : Mapping(required=[]) + text : Dict - theta : Mapping(required=[]) + theta : Dict - theta2 : Mapping(required=[]) + theta2 : Dict - tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, List(:class:`StringFieldDef`), None) + tooltip : :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]], :class:`StringValueDefWithCondition`, Dict, None, Sequence[:class:`StringFieldDef`, Dict] The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. See the `tooltip <https://vega.github.io/vega-lite/docs/tooltip.html>`__ documentation for a detailed discussion about tooltip in Vega-Lite. - url : Mapping(required=[]) - - x : Mapping(required=[]) - - x2 : Mapping(required=[]) - - xError : Mapping(required=[]) - - xError2 : Mapping(required=[]) - - xOffset : Mapping(required=[]) - - y : Mapping(required=[]) - - y2 : Mapping(required=[]) - - yError : Mapping(required=[]) - - yError2 : Mapping(required=[]) - - yOffset : Mapping(required=[]) - - """ - _schema = {'$ref': '#/definitions/SharedEncoding'} - - def __init__(self, angle=Undefined, color=Undefined, description=Undefined, detail=Undefined, - fill=Undefined, fillOpacity=Undefined, href=Undefined, key=Undefined, - latitude=Undefined, latitude2=Undefined, longitude=Undefined, longitude2=Undefined, - opacity=Undefined, order=Undefined, radius=Undefined, radius2=Undefined, - shape=Undefined, size=Undefined, stroke=Undefined, strokeDash=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, theta=Undefined, - theta2=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, - xError=Undefined, xError2=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, - yError=Undefined, yError2=Undefined, yOffset=Undefined, **kwds): - super(SharedEncoding, self).__init__(angle=angle, color=color, description=description, - detail=detail, fill=fill, fillOpacity=fillOpacity, - href=href, key=key, latitude=latitude, latitude2=latitude2, - longitude=longitude, longitude2=longitude2, - opacity=opacity, order=order, radius=radius, - radius2=radius2, shape=shape, size=size, stroke=stroke, - strokeDash=strokeDash, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, text=text, theta=theta, - theta2=theta2, tooltip=tooltip, url=url, x=x, x2=x2, - xError=xError, xError2=xError2, xOffset=xOffset, y=y, - y2=y2, yError=yError, yError2=yError2, yOffset=yOffset, - **kwds) + url : Dict + + x : Dict + + x2 : Dict + + xError : Dict + + xError2 : Dict + + xOffset : Dict + + y : Dict + + y2 : Dict + + yError : Dict + + yError2 : Dict + + yOffset : Dict + + """ + + _schema = {"$ref": "#/definitions/SharedEncoding"} + + def __init__( + self, + angle: Union[dict, UndefinedType] = Undefined, + color: Union[dict, UndefinedType] = Undefined, + description: Union[dict, UndefinedType] = Undefined, + detail: Union[ + Union[ + Sequence[Union["FieldDefWithoutScale", dict]], + Union["FieldDefWithoutScale", dict], + ], + UndefinedType, + ] = Undefined, + fill: Union[dict, UndefinedType] = Undefined, + fillOpacity: Union[dict, UndefinedType] = Undefined, + href: Union[dict, UndefinedType] = Undefined, + key: Union[dict, UndefinedType] = Undefined, + latitude: Union[dict, UndefinedType] = Undefined, + latitude2: Union[dict, UndefinedType] = Undefined, + longitude: Union[dict, UndefinedType] = Undefined, + longitude2: Union[dict, UndefinedType] = Undefined, + opacity: Union[dict, UndefinedType] = Undefined, + order: Union[ + Union[ + Sequence[Union["OrderFieldDef", dict]], + Union["OrderFieldDef", dict], + Union["OrderOnlyDef", dict], + Union["OrderValueDef", dict], + ], + UndefinedType, + ] = Undefined, + radius: Union[dict, UndefinedType] = Undefined, + radius2: Union[dict, UndefinedType] = Undefined, + shape: Union[dict, UndefinedType] = Undefined, + size: Union[dict, UndefinedType] = Undefined, + stroke: Union[dict, UndefinedType] = Undefined, + strokeDash: Union[dict, UndefinedType] = Undefined, + strokeOpacity: Union[dict, UndefinedType] = Undefined, + strokeWidth: Union[dict, UndefinedType] = Undefined, + text: Union[dict, UndefinedType] = Undefined, + theta: Union[dict, UndefinedType] = Undefined, + theta2: Union[dict, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Sequence[Union["StringFieldDef", dict]], + Union["StringFieldDefWithCondition", dict], + Union["StringValueDefWithCondition", dict], + ], + UndefinedType, + ] = Undefined, + url: Union[dict, UndefinedType] = Undefined, + x: Union[dict, UndefinedType] = Undefined, + x2: Union[dict, UndefinedType] = Undefined, + xError: Union[dict, UndefinedType] = Undefined, + xError2: Union[dict, UndefinedType] = Undefined, + xOffset: Union[dict, UndefinedType] = Undefined, + y: Union[dict, UndefinedType] = Undefined, + y2: Union[dict, UndefinedType] = Undefined, + yError: Union[dict, UndefinedType] = Undefined, + yError2: Union[dict, UndefinedType] = Undefined, + yOffset: Union[dict, UndefinedType] = Undefined, + **kwds, + ): + super(SharedEncoding, self).__init__( + angle=angle, + color=color, + description=description, + detail=detail, + fill=fill, + fillOpacity=fillOpacity, + href=href, + key=key, + latitude=latitude, + latitude2=latitude2, + longitude=longitude, + longitude2=longitude2, + opacity=opacity, + order=order, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + stroke=stroke, + strokeDash=strokeDash, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + text=text, + theta=theta, + theta2=theta2, + tooltip=tooltip, + url=url, + x=x, + x2=x2, + xError=xError, + xError2=xError2, + xOffset=xOffset, + y=y, + y2=y2, + yError=yError, + yError2=yError2, + yOffset=yOffset, + **kwds, + ) class SingleDefUnitChannel(VegaLiteSchema): """SingleDefUnitChannel schema wrapper - enum('x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', - 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', - 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'shape', - 'key', 'text', 'href', 'url', 'description') + :class:`SingleDefUnitChannel`, Literal['x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', + 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', + 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', + 'strokeDash', 'size', 'angle', 'shape', 'key', 'text', 'href', 'url', 'description'] """ - _schema = {'$ref': '#/definitions/SingleDefUnitChannel'} + + _schema = {"$ref": "#/definitions/SingleDefUnitChannel"} def __init__(self, *args): super(SingleDefUnitChannel, self).__init__(*args) @@ -16551,10 +43048,16 @@ def __init__(self, *args): class Sort(VegaLiteSchema): """Sort schema wrapper - anyOf(:class:`SortArray`, :class:`AllSortString`, :class:`EncodingSortField`, - :class:`SortByEncoding`, None) + :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', + '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', + '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', + 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], + :class:`SortOrder`, Literal['ascending', 'descending'], :class:`EncodingSortField`, Dict, + :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], + Sequence[str], :class:`SortByEncoding`, Dict[required=[encoding]], :class:`Sort`, None """ - _schema = {'$ref': '#/definitions/Sort'} + + _schema = {"$ref": "#/definitions/Sort"} def __init__(self, *args, **kwds): super(Sort, self).__init__(*args, **kwds) @@ -16563,9 +43066,14 @@ def __init__(self, *args, **kwds): class AllSortString(Sort): """AllSortString schema wrapper - anyOf(:class:`SortOrder`, :class:`SortByChannel`, :class:`SortByChannelDesc`) + :class:`AllSortString`, :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', + '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', + '-text'], :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', + 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], + :class:`SortOrder`, Literal['ascending', 'descending'] """ - _schema = {'$ref': '#/definitions/AllSortString'} + + _schema = {"$ref": "#/definitions/AllSortString"} def __init__(self, *args, **kwds): super(AllSortString, self).__init__(*args, **kwds) @@ -16574,18 +43082,18 @@ def __init__(self, *args, **kwds): class EncodingSortField(Sort): """EncodingSortField schema wrapper - Mapping(required=[]) + :class:`EncodingSortField`, Dict A sort definition for sorting a discrete scale in an encoding field definition. Parameters ---------- - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] The data `field <https://vega.github.io/vega-lite/docs/field.html>`__ to sort by. **Default value:** If unspecified, defaults to the field specified in the outer data reference. - op : :class:`NonArgAggregateOp` + op : :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] An `aggregate operation <https://vega.github.io/vega-lite/docs/aggregate.html#ops>`__ to perform on the field prior to sorting (e.g., ``"count"``, ``"mean"`` and ``"median"`` ). An @@ -16597,22 +43105,65 @@ class EncodingSortField(Sort): <https://vega.github.io/vega-lite/docs/aggregate.html#ops>`__. **Default value:** ``"sum"`` for stacked plots. Otherwise, ``"min"``. - order : anyOf(:class:`SortOrder`, None) + order : :class:`SortOrder`, Literal['ascending', 'descending'], None The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (no not sort). """ - _schema = {'$ref': '#/definitions/EncodingSortField'} - def __init__(self, field=Undefined, op=Undefined, order=Undefined, **kwds): + _schema = {"$ref": "#/definitions/EncodingSortField"} + + def __init__( + self, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + op: Union[ + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union["SortOrder", Literal["ascending", "descending"]]], + UndefinedType, + ] = Undefined, + **kwds, + ): super(EncodingSortField, self).__init__(field=field, op=op, order=order, **kwds) class SortArray(Sort): """SortArray schema wrapper - anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`)) + :class:`SortArray`, Sequence[:class:`DateTime`, Dict], Sequence[bool], Sequence[float], + Sequence[str] """ - _schema = {'$ref': '#/definitions/SortArray'} + + _schema = {"$ref": "#/definitions/SortArray"} def __init__(self, *args, **kwds): super(SortArray, self).__init__(*args, **kwds) @@ -16621,10 +43172,11 @@ def __init__(self, *args, **kwds): class SortByChannel(AllSortString): """SortByChannel schema wrapper - enum('x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', - 'strokeOpacity', 'opacity', 'text') + :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', + 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'] """ - _schema = {'$ref': '#/definitions/SortByChannel'} + + _schema = {"$ref": "#/definitions/SortByChannel"} def __init__(self, *args): super(SortByChannel, self).__init__(*args) @@ -16633,10 +43185,11 @@ def __init__(self, *args): class SortByChannelDesc(AllSortString): """SortByChannelDesc schema wrapper - enum('-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', - '-fillOpacity', '-strokeOpacity', '-opacity', '-text') + :class:`SortByChannelDesc`, Literal['-x', '-y', '-color', '-fill', '-stroke', + '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text'] """ - _schema = {'$ref': '#/definitions/SortByChannelDesc'} + + _schema = {"$ref": "#/definitions/SortByChannelDesc"} def __init__(self, *args): super(SortByChannelDesc, self).__init__(*args) @@ -16645,52 +43198,90 @@ def __init__(self, *args): class SortByEncoding(Sort): """SortByEncoding schema wrapper - Mapping(required=[encoding]) + :class:`SortByEncoding`, Dict[required=[encoding]] Parameters ---------- - encoding : :class:`SortByChannel` + encoding : :class:`SortByChannel`, Literal['x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'] The `encoding channel <https://vega.github.io/vega-lite/docs/encoding.html#channels>`__ to sort by (e.g., ``"x"``, ``"y"`` ) - order : anyOf(:class:`SortOrder`, None) + order : :class:`SortOrder`, Literal['ascending', 'descending'], None The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (no not sort). """ - _schema = {'$ref': '#/definitions/SortByEncoding'} - def __init__(self, encoding=Undefined, order=Undefined, **kwds): + _schema = {"$ref": "#/definitions/SortByEncoding"} + + def __init__( + self, + encoding: Union[ + Union[ + "SortByChannel", + Literal[ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text", + ], + ], + UndefinedType, + ] = Undefined, + order: Union[ + Union[None, Union["SortOrder", Literal["ascending", "descending"]]], + UndefinedType, + ] = Undefined, + **kwds, + ): super(SortByEncoding, self).__init__(encoding=encoding, order=order, **kwds) class SortField(VegaLiteSchema): """SortField schema wrapper - Mapping(required=[field]) + :class:`SortField`, Dict[required=[field]] A sort definition for transform Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str The name of the field to sort. - order : anyOf(:class:`SortOrder`, None) + order : :class:`SortOrder`, Literal['ascending', 'descending'], None Whether to sort the field in ascending or descending order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (no not sort). """ - _schema = {'$ref': '#/definitions/SortField'} - def __init__(self, field=Undefined, order=Undefined, **kwds): + _schema = {"$ref": "#/definitions/SortField"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + order: Union[ + Union[None, Union["SortOrder", Literal["ascending", "descending"]]], + UndefinedType, + ] = Undefined, + **kwds, + ): super(SortField, self).__init__(field=field, order=order, **kwds) class SortOrder(AllSortString): """SortOrder schema wrapper - enum('ascending', 'descending') + :class:`SortOrder`, Literal['ascending', 'descending'] """ - _schema = {'$ref': '#/definitions/SortOrder'} + + _schema = {"$ref": "#/definitions/SortOrder"} def __init__(self, *args): super(SortOrder, self).__init__(*args) @@ -16699,12 +43290,16 @@ def __init__(self, *args): class Spec(VegaLiteSchema): """Spec schema wrapper - anyOf(:class:`FacetedUnitSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetSpec`, - :class:`ConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`, - :class:`HConcatSpecGenericSpec`) + :class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, + Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], + :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, + Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], + :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`Spec`, + :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]] Any specification in Vega-Lite. """ - _schema = {'$ref': '#/definitions/Spec'} + + _schema = {"$ref": "#/definitions/Spec"} def __init__(self, *args, **kwds): super(Spec, self).__init__(*args, **kwds) @@ -16713,15 +43308,15 @@ def __init__(self, *args, **kwds): class ConcatSpecGenericSpec(Spec, NonNormalizedSpec): """ConcatSpecGenericSpec schema wrapper - Mapping(required=[concat]) + :class:`ConcatSpecGenericSpec`, Dict[required=[concat]] Base interface for a generalized concatenation specification. Parameters ---------- - concat : List(:class:`Spec`) + concat : Sequence[:class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`Spec`, :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]]] A list of views to be concatenated. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -16738,7 +43333,7 @@ class ConcatSpecGenericSpec(Spec, NonNormalizedSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -16750,7 +43345,7 @@ class ConcatSpecGenericSpec(Spec, NonNormalizedSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -16776,16 +43371,16 @@ class ConcatSpecGenericSpec(Spec, NonNormalizedSpec): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -16793,41 +43388,142 @@ class ConcatSpecGenericSpec(Spec, NonNormalizedSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/ConcatSpec<GenericSpec>'} - def __init__(self, concat=Undefined, align=Undefined, bounds=Undefined, center=Undefined, - columns=Undefined, data=Undefined, description=Undefined, name=Undefined, - resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, **kwds): - super(ConcatSpecGenericSpec, self).__init__(concat=concat, align=align, bounds=bounds, - center=center, columns=columns, data=data, - description=description, name=name, resolve=resolve, - spacing=spacing, title=title, transform=transform, - **kwds) + _schema = {"$ref": "#/definitions/ConcatSpec<GenericSpec>"} + + def __init__( + self, + concat: Union[ + Sequence[ + Union[ + "Spec", + Union["ConcatSpecGenericSpec", dict], + Union["FacetSpec", dict], + Union["FacetedUnitSpec", dict], + Union["HConcatSpecGenericSpec", dict], + Union["LayerSpec", dict], + Union[ + "RepeatSpec", + Union["LayerRepeatSpec", dict], + Union["NonLayerRepeatSpec", dict], + ], + Union["VConcatSpecGenericSpec", dict], + ] + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ConcatSpecGenericSpec, self).__init__( + concat=concat, + align=align, + bounds=bounds, + center=center, + columns=columns, + data=data, + description=description, + name=name, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + **kwds, + ) class FacetSpec(Spec, NonNormalizedSpec): """FacetSpec schema wrapper - Mapping(required=[facet, spec]) + :class:`FacetSpec`, Dict[required=[facet, spec]] Base interface for a facet specification. Parameters ---------- - facet : anyOf(:class:`FacetFieldDef`, :class:`FacetMapping`) + facet : :class:`FacetFieldDef`, Dict, :class:`FacetMapping`, Dict Definition for how to facet the data. One of: 1) `a field definition for faceting the plot by one field <https://vega.github.io/vega-lite/docs/facet.html#field-def>`__ 2) `An object that maps row and column channels to their field definitions <https://vega.github.io/vega-lite/docs/facet.html#mapping>`__ - spec : anyOf(:class:`LayerSpec`, :class:`FacetedUnitSpec`) + spec : :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`LayerSpec`, Dict[required=[layer]] A specification of the view that gets faceted. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -16844,7 +43540,7 @@ class FacetSpec(Spec, NonNormalizedSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -16856,7 +43552,7 @@ class FacetSpec(Spec, NonNormalizedSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -16882,16 +43578,16 @@ class FacetSpec(Spec, NonNormalizedSpec): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -16899,39 +43595,130 @@ class FacetSpec(Spec, NonNormalizedSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/FacetSpec'} - def __init__(self, facet=Undefined, spec=Undefined, align=Undefined, bounds=Undefined, - center=Undefined, columns=Undefined, data=Undefined, description=Undefined, - name=Undefined, resolve=Undefined, spacing=Undefined, title=Undefined, - transform=Undefined, **kwds): - super(FacetSpec, self).__init__(facet=facet, spec=spec, align=align, bounds=bounds, - center=center, columns=columns, data=data, - description=description, name=name, resolve=resolve, - spacing=spacing, title=title, transform=transform, **kwds) + _schema = {"$ref": "#/definitions/FacetSpec"} + + def __init__( + self, + facet: Union[ + Union[Union["FacetFieldDef", dict], Union["FacetMapping", dict]], + UndefinedType, + ] = Undefined, + spec: Union[ + Union[Union["FacetedUnitSpec", dict], Union["LayerSpec", dict]], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FacetSpec, self).__init__( + facet=facet, + spec=spec, + align=align, + bounds=bounds, + center=center, + columns=columns, + data=data, + description=description, + name=name, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + **kwds, + ) class FacetedUnitSpec(Spec, NonNormalizedSpec): """FacetedUnitSpec schema wrapper - Mapping(required=[mark]) + :class:`FacetedUnitSpec`, Dict[required=[mark]] Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec). Parameters ---------- - mark : :class:`AnyMark` + mark : :class:`AnyMark`, :class:`BoxPlotDef`, Dict[required=[type]], :class:`CompositeMarkDef`, :class:`ErrorBandDef`, Dict[required=[type]], :class:`ErrorBarDef`, Dict[required=[type]], :class:`BoxPlot`, str, :class:`CompositeMark`, :class:`ErrorBand`, str, :class:`ErrorBar`, str, :class:`MarkDef`, Dict[required=[type]], :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark definition object <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -16948,7 +43735,7 @@ class FacetedUnitSpec(Spec, NonNormalizedSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -16960,7 +43747,7 @@ class FacetedUnitSpec(Spec, NonNormalizedSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -16968,14 +43755,14 @@ class FacetedUnitSpec(Spec, NonNormalizedSpec): supply different centering values for rows and columns. **Default value:** ``false`` - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - encoding : :class:`FacetedEncoding` + encoding : :class:`FacetedEncoding`, Dict A key-value mapping between encoding channels and definition of fields. - height : anyOf(float, string, :class:`Step`) + height : :class:`Step`, Dict[required=[step]], float, str The height of a visualization. @@ -16995,18 +43782,18 @@ class FacetedUnitSpec(Spec, NonNormalizedSpec): **See also:** `height <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. - name : string + name : str Name of the visualization for later reference. - params : List(:class:`SelectionParameter`) + params : Sequence[:class:`SelectionParameter`, Dict[required=[name, select]]] An array of parameters that may either be simple variables, or more complex selections that map user input to data queries. - projection : :class:`Projection` + projection : :class:`Projection`, Dict An object defining properties of geographic projection, which will be applied to ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` channels for other marks. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -17014,15 +43801,15 @@ class FacetedUnitSpec(Spec, NonNormalizedSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - view : :class:`ViewBackground` + view : :class:`ViewBackground`, Dict An object defining the view background's fill and stroke. **Default value:** none (transparent) - width : anyOf(float, string, :class:`Step`) + width : :class:`Step`, Dict[required=[step]], float, str The width of a visualization. @@ -17043,33 +43830,164 @@ class FacetedUnitSpec(Spec, NonNormalizedSpec): **See also:** `width <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FacetedUnitSpec'} - def __init__(self, mark=Undefined, align=Undefined, bounds=Undefined, center=Undefined, - data=Undefined, description=Undefined, encoding=Undefined, height=Undefined, - name=Undefined, params=Undefined, projection=Undefined, resolve=Undefined, - spacing=Undefined, title=Undefined, transform=Undefined, view=Undefined, - width=Undefined, **kwds): - super(FacetedUnitSpec, self).__init__(mark=mark, align=align, bounds=bounds, center=center, - data=data, description=description, encoding=encoding, - height=height, name=name, params=params, - projection=projection, resolve=resolve, spacing=spacing, - title=title, transform=transform, view=view, width=width, - **kwds) + _schema = {"$ref": "#/definitions/FacetedUnitSpec"} + + def __init__( + self, + mark: Union[ + Union[ + "AnyMark", + Union[ + "CompositeMark", + Union["BoxPlot", str], + Union["ErrorBand", str], + Union["ErrorBar", str], + ], + Union[ + "CompositeMarkDef", + Union["BoxPlotDef", dict], + Union["ErrorBandDef", dict], + Union["ErrorBarDef", dict], + ], + Union[ + "Mark", + Literal[ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape", + ], + ], + Union["MarkDef", dict], + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + encoding: Union[Union["FacetedEncoding", dict], UndefinedType] = Undefined, + height: Union[ + Union[Union["Step", dict], float, str], UndefinedType + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + params: Union[ + Sequence[Union["SelectionParameter", dict]], UndefinedType + ] = Undefined, + projection: Union[Union["Projection", dict], UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + view: Union[Union["ViewBackground", dict], UndefinedType] = Undefined, + width: Union[Union[Union["Step", dict], float, str], UndefinedType] = Undefined, + **kwds, + ): + super(FacetedUnitSpec, self).__init__( + mark=mark, + align=align, + bounds=bounds, + center=center, + data=data, + description=description, + encoding=encoding, + height=height, + name=name, + params=params, + projection=projection, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + view=view, + width=width, + **kwds, + ) class HConcatSpecGenericSpec(Spec, NonNormalizedSpec): """HConcatSpecGenericSpec schema wrapper - Mapping(required=[hconcat]) + :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]] Base interface for a horizontal concatenation specification. Parameters ---------- - hconcat : List(:class:`Spec`) + hconcat : Sequence[:class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`Spec`, :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]]] A list of views to be concatenated and put into a row. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -17081,66 +43999,154 @@ class HConcatSpecGenericSpec(Spec, NonNormalizedSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : boolean + center : bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. **Default value:** ``false`` - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. spacing : float The spacing in pixels between sub-views of the concat operator. **Default value** : ``10`` - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/HConcatSpec<GenericSpec>'} - def __init__(self, hconcat=Undefined, bounds=Undefined, center=Undefined, data=Undefined, - description=Undefined, name=Undefined, resolve=Undefined, spacing=Undefined, - title=Undefined, transform=Undefined, **kwds): - super(HConcatSpecGenericSpec, self).__init__(hconcat=hconcat, bounds=bounds, center=center, - data=data, description=description, name=name, - resolve=resolve, spacing=spacing, title=title, - transform=transform, **kwds) + _schema = {"$ref": "#/definitions/HConcatSpec<GenericSpec>"} + + def __init__( + self, + hconcat: Union[ + Sequence[ + Union[ + "Spec", + Union["ConcatSpecGenericSpec", dict], + Union["FacetSpec", dict], + Union["FacetedUnitSpec", dict], + Union["HConcatSpecGenericSpec", dict], + Union["LayerSpec", dict], + Union[ + "RepeatSpec", + Union["LayerRepeatSpec", dict], + Union["NonLayerRepeatSpec", dict], + ], + Union["VConcatSpecGenericSpec", dict], + ] + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[bool, UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(HConcatSpecGenericSpec, self).__init__( + hconcat=hconcat, + bounds=bounds, + center=center, + data=data, + description=description, + name=name, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + **kwds, + ) class LayerSpec(Spec, NonNormalizedSpec): """LayerSpec schema wrapper - Mapping(required=[layer]) + :class:`LayerSpec`, Dict[required=[layer]] A full layered plot specification, which may contains ``encoding`` and ``projection`` properties that will be applied to underlying unit (single-view) specifications. Parameters ---------- - layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + layer : Sequence[:class:`LayerSpec`, Dict[required=[layer]], :class:`UnitSpec`, Dict[required=[mark]]] Layer or single view specifications to be layered. **Note** : Specifications inside ``layer`` cannot use ``row`` and ``column`` channels as layering facet specifications is not allowed. Instead, use the `facet operator <https://vega.github.io/vega-lite/docs/facet.html>`__ and place a layer inside a facet. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - encoding : :class:`SharedEncoding` + encoding : :class:`SharedEncoding`, Dict A shared key-value mapping between encoding channels and definition of fields in the underlying layers. - height : anyOf(float, string, :class:`Step`) + height : :class:`Step`, Dict[required=[step]], float, str The height of a visualization. @@ -17160,22 +44166,22 @@ class LayerSpec(Spec, NonNormalizedSpec): **See also:** `height <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. - name : string + name : str Name of the visualization for later reference. - projection : :class:`Projection` + projection : :class:`Projection`, Dict An object defining properties of the geographic projection shared by underlying layers. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - view : :class:`ViewBackground` + view : :class:`ViewBackground`, Dict An object defining the view background's fill and stroke. **Default value:** none (transparent) - width : anyOf(float, string, :class:`Step`) + width : :class:`Step`, Dict[required=[step]], float, str The width of a visualization. @@ -17196,23 +44202,104 @@ class LayerSpec(Spec, NonNormalizedSpec): **See also:** `width <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/LayerSpec'} - def __init__(self, layer=Undefined, data=Undefined, description=Undefined, encoding=Undefined, - height=Undefined, name=Undefined, projection=Undefined, resolve=Undefined, - title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): - super(LayerSpec, self).__init__(layer=layer, data=data, description=description, - encoding=encoding, height=height, name=name, - projection=projection, resolve=resolve, title=title, - transform=transform, view=view, width=width, **kwds) + _schema = {"$ref": "#/definitions/LayerSpec"} + + def __init__( + self, + layer: Union[ + Sequence[Union[Union["LayerSpec", dict], Union["UnitSpec", dict]]], + UndefinedType, + ] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + encoding: Union[Union["SharedEncoding", dict], UndefinedType] = Undefined, + height: Union[ + Union[Union["Step", dict], float, str], UndefinedType + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + projection: Union[Union["Projection", dict], UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + view: Union[Union["ViewBackground", dict], UndefinedType] = Undefined, + width: Union[Union[Union["Step", dict], float, str], UndefinedType] = Undefined, + **kwds, + ): + super(LayerSpec, self).__init__( + layer=layer, + data=data, + description=description, + encoding=encoding, + height=height, + name=name, + projection=projection, + resolve=resolve, + title=title, + transform=transform, + view=view, + width=width, + **kwds, + ) class RepeatSpec(Spec, NonNormalizedSpec): """RepeatSpec schema wrapper - anyOf(:class:`NonLayerRepeatSpec`, :class:`LayerRepeatSpec`) + :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, + Dict[required=[repeat, spec]], :class:`RepeatSpec` """ - _schema = {'$ref': '#/definitions/RepeatSpec'} + + _schema = {"$ref": "#/definitions/RepeatSpec"} def __init__(self, *args, **kwds): super(RepeatSpec, self).__init__(*args, **kwds) @@ -17221,12 +44308,12 @@ def __init__(self, *args, **kwds): class LayerRepeatSpec(RepeatSpec): """LayerRepeatSpec schema wrapper - Mapping(required=[repeat, spec]) + :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]] Parameters ---------- - repeat : :class:`LayerRepeatMapping` + repeat : :class:`LayerRepeatMapping`, Dict[required=[layer]] Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If ``"repeat"`` is an array, the field can be referred to as ``{"repeat": "repeat"}``. The repeated views are laid out in a wrapped row. You can set the @@ -17234,9 +44321,9 @@ class LayerRepeatSpec(RepeatSpec): ``"column"`` to the listed fields to be repeated along the particular orientations. The objects ``{"repeat": "row"}`` and ``{"repeat": "column"}`` can be used to refer to the repeated field respectively. - spec : anyOf(:class:`LayerSpec`, :class:`UnitSpecWithFrame`) + spec : :class:`LayerSpec`, Dict[required=[layer]], :class:`UnitSpecWithFrame`, Dict[required=[mark]] A specification of the view that gets repeated. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -17253,7 +44340,7 @@ class LayerRepeatSpec(RepeatSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -17265,7 +44352,7 @@ class LayerRepeatSpec(RepeatSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -17291,16 +44378,16 @@ class LayerRepeatSpec(RepeatSpec): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -17308,33 +44395,121 @@ class LayerRepeatSpec(RepeatSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/LayerRepeatSpec'} - def __init__(self, repeat=Undefined, spec=Undefined, align=Undefined, bounds=Undefined, - center=Undefined, columns=Undefined, data=Undefined, description=Undefined, - name=Undefined, resolve=Undefined, spacing=Undefined, title=Undefined, - transform=Undefined, **kwds): - super(LayerRepeatSpec, self).__init__(repeat=repeat, spec=spec, align=align, bounds=bounds, - center=center, columns=columns, data=data, - description=description, name=name, resolve=resolve, - spacing=spacing, title=title, transform=transform, **kwds) + _schema = {"$ref": "#/definitions/LayerRepeatSpec"} + + def __init__( + self, + repeat: Union[Union["LayerRepeatMapping", dict], UndefinedType] = Undefined, + spec: Union[ + Union[Union["LayerSpec", dict], Union["UnitSpecWithFrame", dict]], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(LayerRepeatSpec, self).__init__( + repeat=repeat, + spec=spec, + align=align, + bounds=bounds, + center=center, + columns=columns, + data=data, + description=description, + name=name, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + **kwds, + ) class NonLayerRepeatSpec(RepeatSpec): """NonLayerRepeatSpec schema wrapper - Mapping(required=[repeat, spec]) + :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]] Base interface for a repeat specification. Parameters ---------- - repeat : anyOf(List(string), :class:`RepeatMapping`) + repeat : :class:`RepeatMapping`, Dict, Sequence[str] Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If ``"repeat"`` is an array, the field can be referred to as ``{"repeat": "repeat"}``. The repeated views are laid out in a wrapped row. You can set the @@ -17342,9 +44517,9 @@ class NonLayerRepeatSpec(RepeatSpec): ``"column"`` to the listed fields to be repeated along the particular orientations. The objects ``{"repeat": "row"}`` and ``{"repeat": "column"}`` can be used to refer to the repeated field respectively. - spec : :class:`NonNormalizedSpec` + spec : :class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`NonNormalizedSpec`, :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]] A specification of the view that gets repeated. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -17361,7 +44536,7 @@ class NonLayerRepeatSpec(RepeatSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -17373,7 +44548,7 @@ class NonLayerRepeatSpec(RepeatSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -17399,16 +44574,16 @@ class NonLayerRepeatSpec(RepeatSpec): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -17416,49 +44591,158 @@ class NonLayerRepeatSpec(RepeatSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/NonLayerRepeatSpec'} - def __init__(self, repeat=Undefined, spec=Undefined, align=Undefined, bounds=Undefined, - center=Undefined, columns=Undefined, data=Undefined, description=Undefined, - name=Undefined, resolve=Undefined, spacing=Undefined, title=Undefined, - transform=Undefined, **kwds): - super(NonLayerRepeatSpec, self).__init__(repeat=repeat, spec=spec, align=align, bounds=bounds, - center=center, columns=columns, data=data, - description=description, name=name, resolve=resolve, - spacing=spacing, title=title, transform=transform, - **kwds) + _schema = {"$ref": "#/definitions/NonLayerRepeatSpec"} + + def __init__( + self, + repeat: Union[ + Union[Sequence[str], Union["RepeatMapping", dict]], UndefinedType + ] = Undefined, + spec: Union[ + Union[ + "NonNormalizedSpec", + Union["ConcatSpecGenericSpec", dict], + Union["FacetSpec", dict], + Union["FacetedUnitSpec", dict], + Union["HConcatSpecGenericSpec", dict], + Union["LayerSpec", dict], + Union[ + "RepeatSpec", + Union["LayerRepeatSpec", dict], + Union["NonLayerRepeatSpec", dict], + ], + Union["VConcatSpecGenericSpec", dict], + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(NonLayerRepeatSpec, self).__init__( + repeat=repeat, + spec=spec, + align=align, + bounds=bounds, + center=center, + columns=columns, + data=data, + description=description, + name=name, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + **kwds, + ) class SphereGenerator(Generator): """SphereGenerator schema wrapper - Mapping(required=[sphere]) + :class:`SphereGenerator`, Dict[required=[sphere]] Parameters ---------- - sphere : anyOf(boolean, Mapping(required=[])) + sphere : Dict, bool Generate sphere GeoJSON data for the full globe. - name : string + name : str Provide a placeholder name and bind data at runtime. """ - _schema = {'$ref': '#/definitions/SphereGenerator'} - def __init__(self, sphere=Undefined, name=Undefined, **kwds): + _schema = {"$ref": "#/definitions/SphereGenerator"} + + def __init__( + self, + sphere: Union[Union[bool, dict], UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + **kwds, + ): super(SphereGenerator, self).__init__(sphere=sphere, name=name, **kwds) class StackOffset(VegaLiteSchema): """StackOffset schema wrapper - enum('zero', 'center', 'normalize') + :class:`StackOffset`, Literal['zero', 'center', 'normalize'] """ - _schema = {'$ref': '#/definitions/StackOffset'} + + _schema = {"$ref": "#/definitions/StackOffset"} def __init__(self, *args): super(StackOffset, self).__init__(*args) @@ -17467,9 +44751,10 @@ def __init__(self, *args): class StandardType(VegaLiteSchema): """StandardType schema wrapper - enum('quantitative', 'ordinal', 'temporal', 'nominal') + :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] """ - _schema = {'$ref': '#/definitions/StandardType'} + + _schema = {"$ref": "#/definitions/StandardType"} def __init__(self, *args): super(StandardType, self).__init__(*args) @@ -17478,29 +44763,31 @@ def __init__(self, *args): class Step(VegaLiteSchema): """Step schema wrapper - Mapping(required=[step]) + :class:`Step`, Dict[required=[step]] Parameters ---------- step : float The size (width/height) per discrete step. - for : :class:`StepFor` + for : :class:`StepFor`, Literal['position', 'offset'] Whether to apply the step to position scale or offset scale when there are both ``x`` and ``xOffset`` or both ``y`` and ``yOffset`` encodings. """ - _schema = {'$ref': '#/definitions/Step'} - def __init__(self, step=Undefined, **kwds): + _schema = {"$ref": "#/definitions/Step"} + + def __init__(self, step: Union[float, UndefinedType] = Undefined, **kwds): super(Step, self).__init__(step=step, **kwds) class StepFor(VegaLiteSchema): """StepFor schema wrapper - enum('position', 'offset') + :class:`StepFor`, Literal['position', 'offset'] """ - _schema = {'$ref': '#/definitions/StepFor'} + + _schema = {"$ref": "#/definitions/StepFor"} def __init__(self, *args): super(StepFor, self).__init__(*args) @@ -17509,9 +44796,12 @@ def __init__(self, *args): class Stream(VegaLiteSchema): """Stream schema wrapper - anyOf(:class:`EventStream`, :class:`DerivedStream`, :class:`MergedStream`) + :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, + Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, + Dict[required=[merge]], :class:`Stream` """ - _schema = {'$ref': '#/definitions/Stream'} + + _schema = {"$ref": "#/definitions/Stream"} def __init__(self, *args, **kwds): super(Stream, self).__init__(*args, **kwds) @@ -17520,43 +44810,102 @@ def __init__(self, *args, **kwds): class DerivedStream(Stream): """DerivedStream schema wrapper - Mapping(required=[stream]) + :class:`DerivedStream`, Dict[required=[stream]] Parameters ---------- - stream : :class:`Stream` + stream : :class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream` - between : List(:class:`Stream`) + between : Sequence[:class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`] - consume : boolean + consume : bool debounce : float - filter : anyOf(:class:`Expr`, List(:class:`Expr`)) + filter : :class:`Expr`, str, Sequence[:class:`Expr`, str] - markname : string + markname : str - marktype : :class:`MarkType` + marktype : :class:`MarkType`, Literal['arc', 'area', 'image', 'group', 'line', 'path', 'rect', 'rule', 'shape', 'symbol', 'text', 'trail'] throttle : float """ - _schema = {'$ref': '#/definitions/DerivedStream'} - def __init__(self, stream=Undefined, between=Undefined, consume=Undefined, debounce=Undefined, - filter=Undefined, markname=Undefined, marktype=Undefined, throttle=Undefined, **kwds): - super(DerivedStream, self).__init__(stream=stream, between=between, consume=consume, - debounce=debounce, filter=filter, markname=markname, - marktype=marktype, throttle=throttle, **kwds) + _schema = {"$ref": "#/definitions/DerivedStream"} + + def __init__( + self, + stream: Union[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ], + UndefinedType, + ] = Undefined, + between: Union[ + Sequence[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ] + ], + UndefinedType, + ] = Undefined, + consume: Union[bool, UndefinedType] = Undefined, + debounce: Union[float, UndefinedType] = Undefined, + filter: Union[ + Union[Sequence[Union["Expr", str]], Union["Expr", str]], UndefinedType + ] = Undefined, + markname: Union[str, UndefinedType] = Undefined, + marktype: Union[ + Union[ + "MarkType", + Literal[ + "arc", + "area", + "image", + "group", + "line", + "path", + "rect", + "rule", + "shape", + "symbol", + "text", + "trail", + ], + ], + UndefinedType, + ] = Undefined, + throttle: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(DerivedStream, self).__init__( + stream=stream, + between=between, + consume=consume, + debounce=debounce, + filter=filter, + markname=markname, + marktype=marktype, + throttle=throttle, + **kwds, + ) class EventStream(Stream): """EventStream schema wrapper - anyOf(Mapping(required=[type]), Mapping(required=[source, type])) + :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]] """ - _schema = {'$ref': '#/definitions/EventStream'} + + _schema = {"$ref": "#/definitions/EventStream"} def __init__(self, *args, **kwds): super(EventStream, self).__init__(*args, **kwds) @@ -17565,46 +44914,106 @@ def __init__(self, *args, **kwds): class MergedStream(Stream): """MergedStream schema wrapper - Mapping(required=[merge]) + :class:`MergedStream`, Dict[required=[merge]] Parameters ---------- - merge : List(:class:`Stream`) + merge : Sequence[:class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`] - between : List(:class:`Stream`) + between : Sequence[:class:`DerivedStream`, Dict[required=[stream]], :class:`EventStream`, Dict[required=[source, type]], Dict[required=[type]], :class:`MergedStream`, Dict[required=[merge]], :class:`Stream`] - consume : boolean + consume : bool debounce : float - filter : anyOf(:class:`Expr`, List(:class:`Expr`)) + filter : :class:`Expr`, str, Sequence[:class:`Expr`, str] - markname : string + markname : str - marktype : :class:`MarkType` + marktype : :class:`MarkType`, Literal['arc', 'area', 'image', 'group', 'line', 'path', 'rect', 'rule', 'shape', 'symbol', 'text', 'trail'] throttle : float """ - _schema = {'$ref': '#/definitions/MergedStream'} - def __init__(self, merge=Undefined, between=Undefined, consume=Undefined, debounce=Undefined, - filter=Undefined, markname=Undefined, marktype=Undefined, throttle=Undefined, **kwds): - super(MergedStream, self).__init__(merge=merge, between=between, consume=consume, - debounce=debounce, filter=filter, markname=markname, - marktype=marktype, throttle=throttle, **kwds) + _schema = {"$ref": "#/definitions/MergedStream"} + + def __init__( + self, + merge: Union[ + Sequence[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ] + ], + UndefinedType, + ] = Undefined, + between: Union[ + Sequence[ + Union[ + "Stream", + Union["DerivedStream", dict], + Union["EventStream", dict], + Union["MergedStream", dict], + ] + ], + UndefinedType, + ] = Undefined, + consume: Union[bool, UndefinedType] = Undefined, + debounce: Union[float, UndefinedType] = Undefined, + filter: Union[ + Union[Sequence[Union["Expr", str]], Union["Expr", str]], UndefinedType + ] = Undefined, + markname: Union[str, UndefinedType] = Undefined, + marktype: Union[ + Union[ + "MarkType", + Literal[ + "arc", + "area", + "image", + "group", + "line", + "path", + "rect", + "rule", + "shape", + "symbol", + "text", + "trail", + ], + ], + UndefinedType, + ] = Undefined, + throttle: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(MergedStream, self).__init__( + merge=merge, + between=between, + consume=consume, + debounce=debounce, + filter=filter, + markname=markname, + marktype=marktype, + throttle=throttle, + **kwds, + ) class StringFieldDef(VegaLiteSchema): """StringFieldDef schema wrapper - Mapping(required=[]) + :class:`StringFieldDef`, Dict Parameters ---------- - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -17616,7 +45025,7 @@ class StringFieldDef(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -17637,7 +45046,7 @@ class StringFieldDef(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -17652,7 +45061,7 @@ class StringFieldDef(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -17675,7 +45084,7 @@ class StringFieldDef(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -17686,7 +45095,7 @@ class StringFieldDef(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -17695,7 +45104,7 @@ class StringFieldDef(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -17715,7 +45124,7 @@ class StringFieldDef(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -17785,25 +45194,242 @@ class StringFieldDef(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/StringFieldDef'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - format=Undefined, formatType=Undefined, timeUnit=Undefined, title=Undefined, - type=Undefined, **kwds): - super(StringFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, - field=field, format=format, formatType=formatType, - timeUnit=timeUnit, title=title, type=type, **kwds) + _schema = {"$ref": "#/definitions/StringFieldDef"} + + def __init__( + self, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StringFieldDef, self).__init__( + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class StringFieldDefWithCondition(VegaLiteSchema): """StringFieldDefWithCondition schema wrapper - Mapping(required=[]) + :class:`StringFieldDefWithCondition`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -17815,7 +45441,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -17836,14 +45462,14 @@ class StringFieldDefWithCondition(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefstringExprRef`, List(:class:`ConditionalValueDefstringExprRef`)) + condition : :class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`, Sequence[:class:`ConditionalParameterValueDefstringExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -17858,7 +45484,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -17881,7 +45507,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -17892,7 +45518,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -17901,7 +45527,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -17921,7 +45547,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -17991,46 +45617,312 @@ class StringFieldDefWithCondition(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/StringFieldDefWithCondition'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(StringFieldDefWithCondition, self).__init__(aggregate=aggregate, - bandPosition=bandPosition, bin=bin, - condition=condition, field=field, - format=format, formatType=formatType, - timeUnit=timeUnit, title=title, type=type, - **kwds) + _schema = {"$ref": "#/definitions/StringFieldDefWithCondition"} + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefstringExprRef", + Union["ConditionalParameterValueDefstringExprRef", dict], + Union["ConditionalPredicateValueDefstringExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefstringExprRef", + Union["ConditionalParameterValueDefstringExprRef", dict], + Union["ConditionalPredicateValueDefstringExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(StringFieldDefWithCondition, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class StringValueDefWithCondition(VegaLiteSchema): """StringValueDefWithCondition schema wrapper - Mapping(required=[]) + :class:`StringValueDefWithCondition`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/StringValueDefWithCondition'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(StringValueDefWithCondition, self).__init__(condition=condition, value=value, **kwds) + _schema = {"$ref": "#/definitions/StringValueDefWithCondition"} + + def __init__( + self, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ] + ], + Union[ + "ConditionalMarkPropFieldOrDatumDef", + Union["ConditionalParameterMarkPropFieldOrDatumDef", dict], + Union["ConditionalPredicateMarkPropFieldOrDatumDef", dict], + ], + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + **kwds, + ): + super(StringValueDefWithCondition, self).__init__( + condition=condition, value=value, **kwds + ) class StrokeCap(VegaLiteSchema): """StrokeCap schema wrapper - enum('butt', 'round', 'square') + :class:`StrokeCap`, Literal['butt', 'round', 'square'] """ - _schema = {'$ref': '#/definitions/StrokeCap'} + + _schema = {"$ref": "#/definitions/StrokeCap"} def __init__(self, *args): super(StrokeCap, self).__init__(*args) @@ -18039,9 +45931,10 @@ def __init__(self, *args): class StrokeJoin(VegaLiteSchema): """StrokeJoin schema wrapper - enum('miter', 'round', 'bevel') + :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] """ - _schema = {'$ref': '#/definitions/StrokeJoin'} + + _schema = {"$ref": "#/definitions/StrokeJoin"} def __init__(self, *args): super(StrokeJoin, self).__init__(*args) @@ -18050,68 +45943,99 @@ def __init__(self, *args): class StyleConfigIndex(VegaLiteSchema): """StyleConfigIndex schema wrapper - Mapping(required=[]) + :class:`StyleConfigIndex`, Dict Parameters ---------- - arc : :class:`RectConfig` + arc : :class:`RectConfig`, Dict Arc-specific Config - area : :class:`AreaConfig` + area : :class:`AreaConfig`, Dict Area-Specific Config - bar : :class:`BarConfig` + bar : :class:`BarConfig`, Dict Bar-Specific Config - circle : :class:`MarkConfig` + circle : :class:`MarkConfig`, Dict Circle-Specific Config - geoshape : :class:`MarkConfig` + geoshape : :class:`MarkConfig`, Dict Geoshape-Specific Config - image : :class:`RectConfig` + image : :class:`RectConfig`, Dict Image-specific Config - line : :class:`LineConfig` + line : :class:`LineConfig`, Dict Line-Specific Config - mark : :class:`MarkConfig` + mark : :class:`MarkConfig`, Dict Mark Config - point : :class:`MarkConfig` + point : :class:`MarkConfig`, Dict Point-Specific Config - rect : :class:`RectConfig` + rect : :class:`RectConfig`, Dict Rect-Specific Config - rule : :class:`MarkConfig` + rule : :class:`MarkConfig`, Dict Rule-Specific Config - square : :class:`MarkConfig` + square : :class:`MarkConfig`, Dict Square-Specific Config - text : :class:`MarkConfig` + text : :class:`MarkConfig`, Dict Text-Specific Config - tick : :class:`TickConfig` + tick : :class:`TickConfig`, Dict Tick-Specific Config - trail : :class:`LineConfig` + trail : :class:`LineConfig`, Dict Trail-Specific Config - group-subtitle : :class:`MarkConfig` + group-subtitle : :class:`MarkConfig`, Dict Default style for chart subtitles - group-title : :class:`MarkConfig` + group-title : :class:`MarkConfig`, Dict Default style for chart titles - guide-label : :class:`MarkConfig` + guide-label : :class:`MarkConfig`, Dict Default style for axis, legend, and header labels. - guide-title : :class:`MarkConfig` + guide-title : :class:`MarkConfig`, Dict Default style for axis, legend, and header titles. """ - _schema = {'$ref': '#/definitions/StyleConfigIndex'} - def __init__(self, arc=Undefined, area=Undefined, bar=Undefined, circle=Undefined, - geoshape=Undefined, image=Undefined, line=Undefined, mark=Undefined, point=Undefined, - rect=Undefined, rule=Undefined, square=Undefined, text=Undefined, tick=Undefined, - trail=Undefined, **kwds): - super(StyleConfigIndex, self).__init__(arc=arc, area=area, bar=bar, circle=circle, - geoshape=geoshape, image=image, line=line, mark=mark, - point=point, rect=rect, rule=rule, square=square, - text=text, tick=tick, trail=trail, **kwds) + _schema = {"$ref": "#/definitions/StyleConfigIndex"} + + def __init__( + self, + arc: Union[Union["RectConfig", dict], UndefinedType] = Undefined, + area: Union[Union["AreaConfig", dict], UndefinedType] = Undefined, + bar: Union[Union["BarConfig", dict], UndefinedType] = Undefined, + circle: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + geoshape: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + image: Union[Union["RectConfig", dict], UndefinedType] = Undefined, + line: Union[Union["LineConfig", dict], UndefinedType] = Undefined, + mark: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + point: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + rect: Union[Union["RectConfig", dict], UndefinedType] = Undefined, + rule: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + square: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + text: Union[Union["MarkConfig", dict], UndefinedType] = Undefined, + tick: Union[Union["TickConfig", dict], UndefinedType] = Undefined, + trail: Union[Union["LineConfig", dict], UndefinedType] = Undefined, + **kwds, + ): + super(StyleConfigIndex, self).__init__( + arc=arc, + area=area, + bar=bar, + circle=circle, + geoshape=geoshape, + image=image, + line=line, + mark=mark, + point=point, + rect=rect, + rule=rule, + square=square, + text=text, + tick=tick, + trail=trail, + **kwds, + ) class SymbolShape(VegaLiteSchema): """SymbolShape schema wrapper - string + :class:`SymbolShape`, str """ - _schema = {'$ref': '#/definitions/SymbolShape'} + + _schema = {"$ref": "#/definitions/SymbolShape"} def __init__(self, *args): super(SymbolShape, self).__init__(*args) @@ -18120,9 +46044,10 @@ def __init__(self, *args): class Text(VegaLiteSchema): """Text schema wrapper - anyOf(string, List(string)) + :class:`Text`, Sequence[str], str """ - _schema = {'$ref': '#/definitions/Text'} + + _schema = {"$ref": "#/definitions/Text"} def __init__(self, *args, **kwds): super(Text, self).__init__(*args, **kwds) @@ -18131,9 +46056,10 @@ def __init__(self, *args, **kwds): class TextBaseline(VegaLiteSchema): """TextBaseline schema wrapper - anyOf(string, :class:`Baseline`, string, string) + :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str """ - _schema = {'$ref': '#/definitions/TextBaseline'} + + _schema = {"$ref": "#/definitions/TextBaseline"} def __init__(self, *args, **kwds): super(TextBaseline, self).__init__(*args, **kwds) @@ -18142,9 +46068,10 @@ def __init__(self, *args, **kwds): class Baseline(TextBaseline): """Baseline schema wrapper - enum('top', 'middle', 'bottom') + :class:`Baseline`, Literal['top', 'middle', 'bottom'] """ - _schema = {'$ref': '#/definitions/Baseline'} + + _schema = {"$ref": "#/definitions/Baseline"} def __init__(self, *args): super(Baseline, self).__init__(*args) @@ -18153,11 +46080,12 @@ def __init__(self, *args): class TextDef(VegaLiteSchema): """TextDef schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionStringFieldDefText`, - :class:`FieldOrDatumDefWithConditionStringDatumDefText`, - :class:`ValueDefWithConditionStringFieldDefText`) + :class:`FieldOrDatumDefWithConditionStringDatumDefText`, Dict, + :class:`FieldOrDatumDefWithConditionStringFieldDefText`, Dict[required=[shorthand]], + :class:`TextDef`, :class:`ValueDefWithConditionStringFieldDefText`, Dict """ - _schema = {'$ref': '#/definitions/TextDef'} + + _schema = {"$ref": "#/definitions/TextDef"} def __init__(self, *args, **kwds): super(TextDef, self).__init__(*args, **kwds) @@ -18166,7 +46094,7 @@ def __init__(self, *args, **kwds): class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): """FieldOrDatumDefWithConditionStringDatumDefText schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionStringDatumDefText`, Dict Parameters ---------- @@ -18175,16 +46103,16 @@ class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - condition : anyOf(:class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + condition : :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`, Sequence[:class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, :class:`RepeatRef`) + datum : :class:`DateTime`, Dict, :class:`ExprRef`, Dict[required=[expr]], :class:`PrimitiveValue`, None, bool, float, str, :class:`RepeatRef`, Dict[required=[repeat]] A constant value in data domain. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -18207,7 +46135,7 @@ class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -18218,7 +46146,7 @@ class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -18238,7 +46166,7 @@ class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`Type` + type : :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -18308,27 +46236,77 @@ class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<StringDatumDef,Text>'} - def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, format=Undefined, - formatType=Undefined, title=Undefined, type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionStringDatumDefText, self).__init__(bandPosition=bandPosition, - condition=condition, - datum=datum, format=format, - formatType=formatType, - title=title, type=type, - **kwds) + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<StringDatumDef,Text>" + } + + def __init__( + self, + bandPosition: Union[float, UndefinedType] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefTextExprRef", + Union["ConditionalParameterValueDefTextExprRef", dict], + Union["ConditionalPredicateValueDefTextExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefTextExprRef", + Union["ConditionalParameterValueDefTextExprRef", dict], + Union["ConditionalPredicateValueDefTextExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + datum: Union[ + Union[ + Union["DateTime", dict], + Union["ExprRef", "_Parameter", dict], + Union["PrimitiveValue", None, bool, float, str], + Union["RepeatRef", dict], + ], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "Type", + Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionStringDatumDefText, self).__init__( + bandPosition=bandPosition, + condition=condition, + datum=datum, + format=format, + formatType=formatType, + title=title, + type=type, + **kwds, + ) class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): """FieldOrDatumDefWithConditionStringFieldDefText schema wrapper - Mapping(required=[]) + :class:`FieldOrDatumDefWithConditionStringFieldDefText`, Dict[required=[shorthand]] Parameters ---------- - aggregate : :class:`Aggregate` + shorthand : :class:`RepeatRef`, Dict[required=[repeat]], Sequence[str], str + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -18340,7 +46318,7 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -18361,14 +46339,14 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - condition : anyOf(:class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + condition : :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`, Sequence[:class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`] One or more value definition(s) with `a parameter or a test predicate <https://vega.github.io/vega-lite/docs/condition.html>`__. **Note:** A field definition's ``condition`` property can only contain `conditional value definitions <https://vega.github.io/vega-lite/docs/condition.html#value>`__ since Vega-Lite only allows at most one encoded field per encoding channel. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -18383,7 +46361,7 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : anyOf(string, :class:`Dict`) + format : :class:`Dict`, Dict, str When used with the default ``"number"`` and ``"time"`` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks. @@ -18406,7 +46384,7 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): format and from `timeFormat <https://vega.github.io/vega-lite/docs/config.html#format>`__ config for time format. - formatType : string + formatType : str The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom format type <https://vega.github.io/vega-lite/docs/config.html#custom-format-type>`__. @@ -18417,7 +46395,7 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. * ``"number"`` for quantitative fields as well as ordinal and nominal fields without ``timeUnit``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -18426,7 +46404,7 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -18446,7 +46424,7 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -18516,28 +46494,262 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition<StringFieldDef,Text>'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(FieldOrDatumDefWithConditionStringFieldDefText, self).__init__(aggregate=aggregate, - bandPosition=bandPosition, - bin=bin, - condition=condition, - field=field, format=format, - formatType=formatType, - timeUnit=timeUnit, - title=title, type=type, - **kwds) + _schema = { + "$ref": "#/definitions/FieldOrDatumDefWithCondition<StringFieldDef,Text>" + } + + def __init__( + self, + shorthand: Union[ + Union[Sequence[str], Union["RepeatRef", dict], str], UndefinedType + ] = Undefined, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefTextExprRef", + Union["ConditionalParameterValueDefTextExprRef", dict], + Union["ConditionalPredicateValueDefTextExprRef", dict], + ] + ], + Union[ + "ConditionalValueDefTextExprRef", + Union["ConditionalParameterValueDefTextExprRef", dict], + Union["ConditionalPredicateValueDefTextExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + format: Union[Union[Union["Dict", dict], str], UndefinedType] = Undefined, + formatType: Union[str, UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(FieldOrDatumDefWithConditionStringFieldDefText, self).__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class TextDirection(VegaLiteSchema): """TextDirection schema wrapper - enum('ltr', 'rtl') + :class:`TextDirection`, Literal['ltr', 'rtl'] """ - _schema = {'$ref': '#/definitions/TextDirection'} + + _schema = {"$ref": "#/definitions/TextDirection"} def __init__(self, *args): super(TextDirection, self).__init__(*args) @@ -18546,42 +46758,42 @@ def __init__(self, *args): class TickConfig(AnyMarkConfig): """TickConfig schema wrapper - Mapping(required=[]) + :class:`TickConfig`, Dict Parameters ---------- - align : anyOf(:class:`Align`, :class:`ExprRef`) + align : :class:`Align`, Literal['left', 'center', 'right'], :class:`ExprRef`, Dict[required=[expr]] The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of ``"left"``, ``"right"``, ``"center"``. **Note:** Expression reference is *not* supported for range marks. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float The rotation angle of the text, in degrees. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree. - ariaRole : anyOf(string, :class:`ExprRef`) + ariaRole : :class:`ExprRef`, Dict[required=[expr]], str Sets the type of user interface element of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "role" attribute. Warning: this property is experimental and may be changed in the future. - ariaRoleDescription : anyOf(string, :class:`ExprRef`) + ariaRoleDescription : :class:`ExprRef`, Dict[required=[expr]], str A human-readable, author-localized description for the role of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the "aria-roledescription" attribute. Warning: this property is experimental and may be changed in the future. - aspect : anyOf(boolean, :class:`ExprRef`) + aspect : :class:`ExprRef`, Dict[required=[expr]], bool Whether to keep aspect ratio of image marks. bandSize : float The width of the ticks. **Default value:** 3/4 of step (width step for horizontal ticks and height step for vertical ticks). - baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str, :class:`ExprRef`, Dict[required=[expr]] For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an expression reference that provides one of the valid values. The ``"line-top"`` and @@ -18592,13 +46804,13 @@ class TickConfig(AnyMarkConfig): ``"middle"``, ``"bottom"``. **Note:** Expression reference is *not* supported for range marks. - blend : anyOf(:class:`Blend`, :class:`ExprRef`) + blend : :class:`Blend`, Literal[None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'], :class:`ExprRef`, Dict[required=[expr]] The color blend mode for drawing an item on its current background. Any valid `CSS mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__ value can be used. __Default value:__ ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]] Default color. **Default value:** :raw-html:`<span style="color: #4682b4;">&#9632;</span>` @@ -18611,63 +46823,63 @@ class TickConfig(AnyMarkConfig): <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and will override ``color``. - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom left corner. **Default value:** ``0`` - cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + cornerRadiusBottomRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' bottom right corner. **Default value:** ``0`` - cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + cornerRadiusTopLeft : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top right corner. **Default value:** ``0`` - cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + cornerRadiusTopRight : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles' top left corner. **Default value:** ``0`` - cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'], :class:`ExprRef`, Dict[required=[expr]] The mouse cursor used over the mark. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - description : anyOf(string, :class:`ExprRef`) + description : :class:`ExprRef`, Dict[required=[expr]], str A text description of the mark item for `ARIA accessibility <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ (SVG output only). If specified, this property determines the `"aria-label" attribute <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute>`__. - dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + dir : :class:`ExprRef`, Dict[required=[expr]], :class:`TextDirection`, Literal['ltr', 'rtl'] The direction of the text. One of ``"ltr"`` (left-to-right) or ``"rtl"`` (right-to-left). This property determines on which side is truncated in response to the limit parameter. **Default value:** ``"ltr"`` - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the *angle* property. - ellipsis : anyOf(string, :class:`ExprRef`) + ellipsis : :class:`ExprRef`, Dict[required=[expr]], str The ellipsis string for text truncated in response to the limit parameter. **Default value:** ``"…"`` - endAngle : anyOf(float, :class:`ExprRef`) + endAngle : :class:`ExprRef`, Dict[required=[expr]], float The end angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default fill color. This property has higher precedence than ``config.color``. Set to ``null`` to remove fill. **Default value:** (None) - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - filled : boolean + filled : bool Whether the mark's color should be used as fill color instead of stroke color. **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well @@ -18677,28 +46889,28 @@ class TickConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config <https://vega.github.io/vega-lite/docs/mark.html#style-config>`__. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float The font size, in pixels. **Default value:** ``11`` - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str The font style (e.g., ``"italic"`` ). - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] The font weight. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - height : anyOf(float, :class:`ExprRef`) + height : :class:`ExprRef`, Dict[required=[expr]], float Height of the marks. - href : anyOf(:class:`URI`, :class:`ExprRef`) + href : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - innerRadius : anyOf(float, :class:`ExprRef`) + innerRadius : :class:`ExprRef`, Dict[required=[expr]], float The inner radius in pixels of arc marks. ``innerRadius`` is an alias for ``radius2``. **Default value:** ``0`` - interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + interpolate : :class:`ExprRef`, Dict[required=[expr]], :class:`Interpolate`, Literal['basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', 'step-before', 'step-after'] The line interpolation method to use for line and area marks. One of the following: @@ -18720,7 +46932,7 @@ class TickConfig(AnyMarkConfig): * ``"bundle"`` : equivalent to basis, except the tension parameter is used to straighten the spline. * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. - invalid : enum('filter', None) + invalid : Literal['filter', None] Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` ). @@ -18729,26 +46941,26 @@ class TickConfig(AnyMarkConfig): (for line, trail, and area marks) or filtered (for other marks). * If ``null``, all data items are included. In this case, invalid values will be interpreted as zeroes. - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit. **Default value:** ``0`` -- indicating no limit - lineBreak : anyOf(string, :class:`ExprRef`) + lineBreak : :class:`ExprRef`, Dict[required=[expr]], str A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks. - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - order : anyOf(None, boolean) + order : None, bool For line and trail marks, this ``order`` property can be set to ``null`` or ``false`` to make the lines use the original order in the data sources. - orient : :class:`Orientation` + orient : :class:`Orientation`, Literal['horizontal', 'vertical'] The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. @@ -18760,24 +46972,24 @@ class TickConfig(AnyMarkConfig): the line if ``config.sortLineBy`` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored. - outerRadius : anyOf(float, :class:`ExprRef`) + outerRadius : :class:`ExprRef`, Dict[required=[expr]], float The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. **Default value:** ``0`` - padAngle : anyOf(float, :class:`ExprRef`) + padAngle : :class:`ExprRef`, Dict[required=[expr]], float The angular padding applied to sides of the arc, in radians. - radius : anyOf(float, :class:`ExprRef`) + radius : :class:`ExprRef`, Dict[required=[expr]], float For arc mark, the primary (outer) radius in pixels. For text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the ``x`` and ``y`` properties. **Default value:** ``min(plot_width, plot_height)/2`` - radius2 : anyOf(float, :class:`ExprRef`) + radius2 : :class:`ExprRef`, Dict[required=[expr]], float The secondary (inner) radius in pixels of arc marks. **Default value:** ``0`` - shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + shape : :class:`ExprRef`, Dict[required=[expr]], :class:`SymbolShape`, str, str Shape of the point marks. Supported values include: @@ -18792,7 +47004,7 @@ class TickConfig(AnyMarkConfig): coordinates ranging from -1 to 1 along both the x and y dimensions.) **Default value:** ``"circle"`` - size : anyOf(float, :class:`ExprRef`) + size : :class:`ExprRef`, Dict[required=[expr]], float Default size for marks. @@ -18809,56 +47021,56 @@ class TickConfig(AnyMarkConfig): * ``2`` for bar marks with discrete dimensions; * ``5`` for bar marks with continuous dimensions; * ``11`` for text marks. - smooth : anyOf(boolean, :class:`ExprRef`) + smooth : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization. - startAngle : anyOf(float, :class:`ExprRef`) + startAngle : :class:`ExprRef`, Dict[required=[expr]], float The start angle in radians for arc marks. A value of ``0`` indicates up (north), increasing values proceed clockwise. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None Default stroke color. This property has higher precedence than ``config.color``. Set to ``null`` to remove stroke. **Default value:** (None) - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOffset : anyOf(float, :class:`ExprRef`) + strokeOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - tension : anyOf(float, :class:`ExprRef`) + tension : :class:`ExprRef`, Dict[required=[expr]], float Depending on the interpolation type, sets the tension parameter (for line and area marks). - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str Placeholder text if the ``text`` channel is not specified - theta : anyOf(float, :class:`ExprRef`) + theta : :class:`ExprRef`, Dict[required=[expr]], float For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.) For text marks, polar coordinate angle in radians. - theta2 : anyOf(float, :class:`ExprRef`) + theta2 : :class:`ExprRef`, Dict[required=[expr]], float The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. thickness : float @@ -18873,7 +47085,7 @@ class TickConfig(AnyMarkConfig): Default relative band size for a time unit. If set to ``1``, the bandwidth of the marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the marks will be half of the time unit band step. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + tooltip : :class:`ExprRef`, Dict[required=[expr]], :class:`TooltipContent`, Dict[required=[content]], None, bool, float, str The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from. @@ -18888,88 +47100,978 @@ class TickConfig(AnyMarkConfig): documentation for a detailed discussion about tooltip in Vega-Lite. **Default value:** ``null`` - url : anyOf(:class:`URI`, :class:`ExprRef`) + url : :class:`ExprRef`, Dict[required=[expr]], :class:`URI`, str The URL of the image file for image marks. - width : anyOf(float, :class:`ExprRef`) + width : :class:`ExprRef`, Dict[required=[expr]], float Width of the marks. - x : anyOf(float, string, :class:`ExprRef`) + x : :class:`ExprRef`, Dict[required=[expr]], float, str X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without specified ``x2`` or ``width``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - x2 : anyOf(float, string, :class:`ExprRef`) + x2 : :class:`ExprRef`, Dict[required=[expr]], float, str X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"width"`` for the width of the plot. - y : anyOf(float, string, :class:`ExprRef`) + y : :class:`ExprRef`, Dict[required=[expr]], float, str Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without specified ``y2`` or ``height``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. - y2 : anyOf(float, string, :class:`ExprRef`) + y2 : :class:`ExprRef`, Dict[required=[expr]], float, str Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. The ``value`` of this channel can be a number or a string ``"height"`` for the height of the plot. """ - _schema = {'$ref': '#/definitions/TickConfig'} - - def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, blend=Undefined, color=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - description=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, - endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, - opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, - padAngle=Undefined, radius=Undefined, radius2=Undefined, shape=Undefined, - size=Undefined, smooth=Undefined, startAngle=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, tension=Undefined, text=Undefined, - theta=Undefined, theta2=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, **kwds): - super(TickConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, - bandSize=bandSize, baseline=baseline, blend=blend, color=color, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - description=description, dir=dir, dx=dx, dy=dy, - ellipsis=ellipsis, endAngle=endAngle, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, - interpolate=interpolate, invalid=invalid, limit=limit, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, - order=order, orient=orient, outerRadius=outerRadius, - padAngle=padAngle, radius=radius, radius2=radius2, shape=shape, - size=size, smooth=smooth, startAngle=startAngle, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - tension=tension, text=text, theta=theta, theta2=theta2, - thickness=thickness, timeUnitBandPosition=timeUnitBandPosition, - timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + _schema = {"$ref": "#/definitions/TickConfig"} + + def __init__( + self, + align: Union[ + Union[ + Union["Align", Literal["left", "center", "right"]], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + ], + UndefinedType, + ] = Undefined, + blend: Union[ + Union[ + Union[ + "Blend", + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TextDirection", Literal["ltr", "rtl"]], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + endAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + href: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "Interpolate", + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + ], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union["Orientation", Literal["horizontal", "vertical"]], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["SymbolShape", str], str], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + startAngle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + tension: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union["TooltipContent", dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["URI", str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + x: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): + super(TickConfig, self).__init__( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + blend=blend, + color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + dx=dx, + dy=dy, + ellipsis=ellipsis, + endAngle=endAngle, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + lineBreak=lineBreak, + lineHeight=lineHeight, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + radius=radius, + radius2=radius2, + shape=shape, + size=size, + smooth=smooth, + startAngle=startAngle, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + y=y, + y2=y2, + **kwds, + ) class TickCount(VegaLiteSchema): """TickCount schema wrapper - anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`) + :class:`TickCount`, :class:`TimeIntervalStep`, Dict[required=[interval, step]], + :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', + 'month', 'year'], float """ - _schema = {'$ref': '#/definitions/TickCount'} + + _schema = {"$ref": "#/definitions/TickCount"} def __init__(self, *args, **kwds): super(TickCount, self).__init__(*args, **kwds) @@ -18978,9 +48080,11 @@ def __init__(self, *args, **kwds): class TimeInterval(TickCount): """TimeInterval schema wrapper - enum('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year') + :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', + 'month', 'year'] """ - _schema = {'$ref': '#/definitions/TimeInterval'} + + _schema = {"$ref": "#/definitions/TimeInterval"} def __init__(self, *args): super(TimeInterval, self).__init__(*args) @@ -18989,63 +48093,134 @@ def __init__(self, *args): class TimeIntervalStep(TickCount): """TimeIntervalStep schema wrapper - Mapping(required=[interval, step]) + :class:`TimeIntervalStep`, Dict[required=[interval, step]] Parameters ---------- - interval : :class:`TimeInterval` + interval : :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'] step : float """ - _schema = {'$ref': '#/definitions/TimeIntervalStep'} - def __init__(self, interval=Undefined, step=Undefined, **kwds): + _schema = {"$ref": "#/definitions/TimeIntervalStep"} + + def __init__( + self, + interval: Union[ + Union[ + "TimeInterval", + Literal[ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year", + ], + ], + UndefinedType, + ] = Undefined, + step: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(TimeIntervalStep, self).__init__(interval=interval, step=step, **kwds) class TimeLocale(VegaLiteSchema): """TimeLocale schema wrapper - Mapping(required=[dateTime, date, time, periods, days, shortDays, months, shortMonths]) + :class:`TimeLocale`, Dict[required=[dateTime, date, time, periods, days, shortDays, months, + shortMonths]] Locale definition for formatting dates and times. Parameters ---------- - date : string + date : str The date (%x) format specifier (e.g., "%m/%d/%Y"). - dateTime : string + dateTime : str The date and time (%c) format specifier (e.g., "%a %b %e %X %Y"). - days : :class:`Vector7string` + days : :class:`Vector7string`, Sequence[str] The full names of the weekdays, starting with Sunday. - months : :class:`Vector12string` + months : :class:`Vector12string`, Sequence[str] The full names of the months (starting with January). - periods : :class:`Vector2string` + periods : :class:`Vector2string`, Sequence[str] The A.M. and P.M. equivalents (e.g., ["AM", "PM"]). - shortDays : :class:`Vector7string` + shortDays : :class:`Vector7string`, Sequence[str] The abbreviated names of the weekdays, starting with Sunday. - shortMonths : :class:`Vector12string` + shortMonths : :class:`Vector12string`, Sequence[str] The abbreviated names of the months (starting with January). - time : string + time : str The time (%X) format specifier (e.g., "%H:%M:%S"). """ - _schema = {'$ref': '#/definitions/TimeLocale'} - def __init__(self, date=Undefined, dateTime=Undefined, days=Undefined, months=Undefined, - periods=Undefined, shortDays=Undefined, shortMonths=Undefined, time=Undefined, **kwds): - super(TimeLocale, self).__init__(date=date, dateTime=dateTime, days=days, months=months, - periods=periods, shortDays=shortDays, shortMonths=shortMonths, - time=time, **kwds) + _schema = {"$ref": "#/definitions/TimeLocale"} + + def __init__( + self, + date: Union[str, UndefinedType] = Undefined, + dateTime: Union[str, UndefinedType] = Undefined, + days: Union[Union["Vector7string", Sequence[str]], UndefinedType] = Undefined, + months: Union[ + Union["Vector12string", Sequence[str]], UndefinedType + ] = Undefined, + periods: Union[ + Union["Vector2string", Sequence[str]], UndefinedType + ] = Undefined, + shortDays: Union[ + Union["Vector7string", Sequence[str]], UndefinedType + ] = Undefined, + shortMonths: Union[ + Union["Vector12string", Sequence[str]], UndefinedType + ] = Undefined, + time: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(TimeLocale, self).__init__( + date=date, + dateTime=dateTime, + days=days, + months=months, + periods=periods, + shortDays=shortDays, + shortMonths=shortMonths, + time=time, + **kwds, + ) class TimeUnit(VegaLiteSchema): """TimeUnit schema wrapper - anyOf(:class:`SingleTimeUnit`, :class:`MultiTimeUnit`) + :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', + 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', + 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', + 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', + 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', + 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', + 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', + 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], + :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', + 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', + 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', + 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', + 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', + 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', + 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', + 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', + 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], + :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', + 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], + :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', + 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', + 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit` """ - _schema = {'$ref': '#/definitions/TimeUnit'} + + _schema = {"$ref": "#/definitions/TimeUnit"} def __init__(self, *args, **kwds): super(TimeUnit, self).__init__(*args, **kwds) @@ -19054,9 +48229,26 @@ def __init__(self, *args, **kwds): class MultiTimeUnit(TimeUnit): """MultiTimeUnit schema wrapper - anyOf(:class:`LocalMultiTimeUnit`, :class:`UtcMultiTimeUnit`) + :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', + 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', + 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', + 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', + 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', + 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', + 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', + 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], + :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', + 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', + 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', + 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', + 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', + 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', + 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', + 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', + 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'] """ - _schema = {'$ref': '#/definitions/MultiTimeUnit'} + + _schema = {"$ref": "#/definitions/MultiTimeUnit"} def __init__(self, *args, **kwds): super(MultiTimeUnit, self).__init__(*args, **kwds) @@ -19065,15 +48257,17 @@ def __init__(self, *args, **kwds): class LocalMultiTimeUnit(MultiTimeUnit): """LocalMultiTimeUnit schema wrapper - enum('yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', - 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', - 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', - 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', + :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', + 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', + 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', + 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', + 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', - 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds') + 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'] """ - _schema = {'$ref': '#/definitions/LocalMultiTimeUnit'} + + _schema = {"$ref": "#/definitions/LocalMultiTimeUnit"} def __init__(self, *args): super(LocalMultiTimeUnit, self).__init__(*args) @@ -19082,9 +48276,14 @@ def __init__(self, *args): class SingleTimeUnit(TimeUnit): """SingleTimeUnit schema wrapper - anyOf(:class:`LocalSingleTimeUnit`, :class:`UtcSingleTimeUnit`) + :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', + 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], + :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', + 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', + 'utcseconds', 'utcmilliseconds'] """ - _schema = {'$ref': '#/definitions/SingleTimeUnit'} + + _schema = {"$ref": "#/definitions/SingleTimeUnit"} def __init__(self, *args, **kwds): super(SingleTimeUnit, self).__init__(*args, **kwds) @@ -19093,10 +48292,11 @@ def __init__(self, *args, **kwds): class LocalSingleTimeUnit(SingleTimeUnit): """LocalSingleTimeUnit schema wrapper - enum('year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', - 'seconds', 'milliseconds') + :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', + 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'] """ - _schema = {'$ref': '#/definitions/LocalSingleTimeUnit'} + + _schema = {"$ref": "#/definitions/LocalSingleTimeUnit"} def __init__(self, *args): super(LocalSingleTimeUnit, self).__init__(*args) @@ -19105,14 +48305,14 @@ def __init__(self, *args): class TimeUnitParams(VegaLiteSchema): """TimeUnitParams schema wrapper - Mapping(required=[]) + :class:`TimeUnitParams`, Dict Time Unit Params for encoding predicate, which can specified if the data is already "binned". Parameters ---------- - binned : boolean + binned : bool Whether the data has already been binned to this time unit. If true, Vega-Lite will only format the data, marks, and guides, without applying the timeUnit transform to re-bin the data again. @@ -19120,23 +48320,143 @@ class TimeUnitParams(VegaLiteSchema): If no ``unit`` is specified, maxbins is used to infer time units. step : float The number of steps between bins, in terms of the least significant unit provided. - unit : :class:`TimeUnit` + unit : :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit` Defines how date-time values should be binned. - utc : boolean + utc : bool True to use UTC timezone. Equivalent to using a ``utc`` prefixed ``TimeUnit``. """ - _schema = {'$ref': '#/definitions/TimeUnitParams'} - def __init__(self, binned=Undefined, maxbins=Undefined, step=Undefined, unit=Undefined, - utc=Undefined, **kwds): - super(TimeUnitParams, self).__init__(binned=binned, maxbins=maxbins, step=step, unit=unit, - utc=utc, **kwds) + _schema = {"$ref": "#/definitions/TimeUnitParams"} + + def __init__( + self, + binned: Union[bool, UndefinedType] = Undefined, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(TimeUnitParams, self).__init__( + binned=binned, maxbins=maxbins, step=step, unit=unit, utc=utc, **kwds + ) class TimeUnitTransformParams(VegaLiteSchema): """TimeUnitTransformParams schema wrapper - Mapping(required=[]) + :class:`TimeUnitTransformParams`, Dict Parameters ---------- @@ -19145,24 +48465,145 @@ class TimeUnitTransformParams(VegaLiteSchema): If no ``unit`` is specified, maxbins is used to infer time units. step : float The number of steps between bins, in terms of the least significant unit provided. - unit : :class:`TimeUnit` + unit : :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit` Defines how date-time values should be binned. - utc : boolean + utc : bool True to use UTC timezone. Equivalent to using a ``utc`` prefixed ``TimeUnit``. """ - _schema = {'$ref': '#/definitions/TimeUnitTransformParams'} - def __init__(self, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds): - super(TimeUnitTransformParams, self).__init__(maxbins=maxbins, step=step, unit=unit, utc=utc, - **kwds) + _schema = {"$ref": "#/definitions/TimeUnitTransformParams"} + + def __init__( + self, + maxbins: Union[float, UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + unit: Union[ + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + UndefinedType, + ] = Undefined, + utc: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(TimeUnitTransformParams, self).__init__( + maxbins=maxbins, step=step, unit=unit, utc=utc, **kwds + ) class TitleAnchor(VegaLiteSchema): """TitleAnchor schema wrapper - enum(None, 'start', 'middle', 'end') + :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] """ - _schema = {'$ref': '#/definitions/TitleAnchor'} + + _schema = {"$ref": "#/definitions/TitleAnchor"} def __init__(self, *args): super(TitleAnchor, self).__init__(*args) @@ -19171,112 +48612,593 @@ def __init__(self, *args): class TitleConfig(VegaLiteSchema): """TitleConfig schema wrapper - Mapping(required=[]) + :class:`TitleConfig`, Dict Parameters ---------- - align : :class:`Align` + align : :class:`Align`, Literal['left', 'center', 'right'] Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or ``"right"``. - anchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + anchor : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] The anchor position for placing the title and subtitle text. One of ``"start"``, ``"middle"``, or ``"end"``. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float Angle in degrees of title and subtitle text. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree. **Default value:** ``true`` - baseline : :class:`TextBaseline` + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str Vertical text baseline for title and subtitle text. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* rather than *fontSize* alone. - color : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Text color for title text. - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float Delta offset for title and subtitle text x-coordinate. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float Delta offset for title and subtitle text y-coordinate. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str Font name for title text. - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size in pixels for title text. - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style for title text. - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight for title text. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + frame : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleFrame`, Literal['bounds', 'group'], str The reference frame for the anchor position, one of ``"bounds"`` (to anchor relative to the full bounding box) or ``"group"`` (to anchor relative to the group width or height). - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum allowed length in pixels of title and subtitle text. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - offset : anyOf(float, :class:`ExprRef`) + offset : :class:`ExprRef`, Dict[required=[expr]], float The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart. - orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + orient : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleOrient`, Literal['none', 'left', 'right', 'top', 'bottom'] Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) - subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + subtitleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Text color for subtitle text. - subtitleFont : anyOf(string, :class:`ExprRef`) + subtitleFont : :class:`ExprRef`, Dict[required=[expr]], str Font name for subtitle text. - subtitleFontSize : anyOf(float, :class:`ExprRef`) + subtitleFontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size in pixels for subtitle text. - subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + subtitleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style for subtitle text. - subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + subtitleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight for subtitle text. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - subtitleLineHeight : anyOf(float, :class:`ExprRef`) + subtitleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line subtitle text. - subtitlePadding : anyOf(float, :class:`ExprRef`) + subtitlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding in pixels between title and subtitle text. - zindex : anyOf(float, :class:`ExprRef`) + zindex : :class:`ExprRef`, Dict[required=[expr]], float The integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups. **Default value:** ``0``. """ - _schema = {'$ref': '#/definitions/TitleConfig'} - - def __init__(self, align=Undefined, anchor=Undefined, angle=Undefined, aria=Undefined, - baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, - fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, - limit=Undefined, lineHeight=Undefined, offset=Undefined, orient=Undefined, - subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, - subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, - subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds): - super(TitleConfig, self).__init__(align=align, anchor=anchor, angle=angle, aria=aria, - baseline=baseline, color=color, dx=dx, dy=dy, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - frame=frame, limit=limit, lineHeight=lineHeight, - offset=offset, orient=orient, subtitleColor=subtitleColor, - subtitleFont=subtitleFont, subtitleFontSize=subtitleFontSize, - subtitleFontStyle=subtitleFontStyle, - subtitleFontWeight=subtitleFontWeight, - subtitleLineHeight=subtitleLineHeight, - subtitlePadding=subtitlePadding, zindex=zindex, **kwds) + + _schema = {"$ref": "#/definitions/TitleConfig"} + + def __init__( + self, + align: Union[ + Union["Align", Literal["left", "center", "right"]], UndefinedType + ] = Undefined, + anchor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + frame: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["TitleFrame", Literal["bounds", "group"]], str], + ], + UndefinedType, + ] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleOrient", Literal["none", "left", "right", "top", "bottom"]], + ], + UndefinedType, + ] = Undefined, + subtitleColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + subtitleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + subtitleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + subtitleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + subtitleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + subtitleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + subtitlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + zindex: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(TitleConfig, self).__init__( + align=align, + anchor=anchor, + angle=angle, + aria=aria, + baseline=baseline, + color=color, + dx=dx, + dy=dy, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + frame=frame, + limit=limit, + lineHeight=lineHeight, + offset=offset, + orient=orient, + subtitleColor=subtitleColor, + subtitleFont=subtitleFont, + subtitleFontSize=subtitleFontSize, + subtitleFontStyle=subtitleFontStyle, + subtitleFontWeight=subtitleFontWeight, + subtitleLineHeight=subtitleLineHeight, + subtitlePadding=subtitlePadding, + zindex=zindex, + **kwds, + ) class TitleFrame(VegaLiteSchema): """TitleFrame schema wrapper - enum('bounds', 'group') + :class:`TitleFrame`, Literal['bounds', 'group'] """ - _schema = {'$ref': '#/definitions/TitleFrame'} + + _schema = {"$ref": "#/definitions/TitleFrame"} def __init__(self, *args): super(TitleFrame, self).__init__(*args) @@ -19285,9 +49207,10 @@ def __init__(self, *args): class TitleOrient(VegaLiteSchema): """TitleOrient schema wrapper - enum('none', 'left', 'right', 'top', 'bottom') + :class:`TitleOrient`, Literal['none', 'left', 'right', 'top', 'bottom'] """ - _schema = {'$ref': '#/definitions/TitleOrient'} + + _schema = {"$ref": "#/definitions/TitleOrient"} def __init__(self, *args): super(TitleOrient, self).__init__(*args) @@ -19296,17 +49219,17 @@ def __init__(self, *args): class TitleParams(VegaLiteSchema): """TitleParams schema wrapper - Mapping(required=[text]) + :class:`TitleParams`, Dict[required=[text]] Parameters ---------- - text : anyOf(:class:`Text`, :class:`ExprRef`) + text : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str The title text. - align : :class:`Align` + align : :class:`Align`, Literal['left', 'center', 'right'] Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or ``"right"``. - anchor : :class:`TitleAnchor` + anchor : :class:`TitleAnchor`, Literal[None, 'start', 'middle', 'end'] The anchor position for placing the title. One of ``"start"``, ``"middle"``, or ``"end"``. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title. @@ -19321,73 +49244,73 @@ class TitleParams(VegaLiteSchema): <https://vega.github.io/vega-lite/docs/spec.html>`__ and `layered <https://vega.github.io/vega-lite/docs/layer.html>`__ views. For other composite views, ``anchor`` is always ``"start"``. - angle : anyOf(float, :class:`ExprRef`) + angle : :class:`ExprRef`, Dict[required=[expr]], float Angle in degrees of title and subtitle text. - aria : anyOf(boolean, :class:`ExprRef`) + aria : :class:`ExprRef`, Dict[required=[expr]], bool A boolean flag indicating if `ARIA attributes <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA>`__ should be included (SVG output only). If ``false``, the "aria-hidden" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree. **Default value:** ``true`` - baseline : :class:`TextBaseline` + baseline : :class:`Baseline`, Literal['top', 'middle', 'bottom'], :class:`TextBaseline`, str Vertical text baseline for title and subtitle text. One of ``"alphabetic"`` (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* rather than *fontSize* alone. - color : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + color : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Text color for title text. - dx : anyOf(float, :class:`ExprRef`) + dx : :class:`ExprRef`, Dict[required=[expr]], float Delta offset for title and subtitle text x-coordinate. - dy : anyOf(float, :class:`ExprRef`) + dy : :class:`ExprRef`, Dict[required=[expr]], float Delta offset for title and subtitle text y-coordinate. - font : anyOf(string, :class:`ExprRef`) + font : :class:`ExprRef`, Dict[required=[expr]], str Font name for title text. - fontSize : anyOf(float, :class:`ExprRef`) + fontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size in pixels for title text. - fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + fontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style for title text. - fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + fontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight for title text. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + frame : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleFrame`, Literal['bounds', 'group'], str The reference frame for the anchor position, one of ``"bounds"`` (to anchor relative to the full bounding box) or ``"group"`` (to anchor relative to the group width or height). - limit : anyOf(float, :class:`ExprRef`) + limit : :class:`ExprRef`, Dict[required=[expr]], float The maximum allowed length in pixels of title and subtitle text. - lineHeight : anyOf(float, :class:`ExprRef`) + lineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line title text or title text with ``"line-top"`` or ``"line-bottom"`` baseline. - offset : anyOf(float, :class:`ExprRef`) + offset : :class:`ExprRef`, Dict[required=[expr]], float The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart. - orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + orient : :class:`ExprRef`, Dict[required=[expr]], :class:`TitleOrient`, Literal['none', 'left', 'right', 'top', 'bottom'] Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) - style : anyOf(string, List(string)) + style : Sequence[str], str A `mark style property <https://vega.github.io/vega-lite/docs/config.html#style>`__ to apply to the title text mark. **Default value:** ``"group-title"``. - subtitle : :class:`Text` + subtitle : :class:`Text`, Sequence[str], str The subtitle Text. - subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + subtitleColor : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, None, :class:`ExprRef`, Dict[required=[expr]] Text color for subtitle text. - subtitleFont : anyOf(string, :class:`ExprRef`) + subtitleFont : :class:`ExprRef`, Dict[required=[expr]], str Font name for subtitle text. - subtitleFontSize : anyOf(float, :class:`ExprRef`) + subtitleFontSize : :class:`ExprRef`, Dict[required=[expr]], float Font size in pixels for subtitle text. - subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + subtitleFontStyle : :class:`ExprRef`, Dict[required=[expr]], :class:`FontStyle`, str Font style for subtitle text. - subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + subtitleFontWeight : :class:`ExprRef`, Dict[required=[expr]], :class:`FontWeight`, Literal['normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight for subtitle text. This can be either a string (e.g ``"bold"``, ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). - subtitleLineHeight : anyOf(float, :class:`ExprRef`) + subtitleLineHeight : :class:`ExprRef`, Dict[required=[expr]], float Line height in pixels for multi-line subtitle text. - subtitlePadding : anyOf(float, :class:`ExprRef`) + subtitlePadding : :class:`ExprRef`, Dict[required=[expr]], float The padding in pixels between title and subtitle text. zindex : float The integer z-index indicating the layering of the title group relative to other @@ -19395,52 +49318,542 @@ class TitleParams(VegaLiteSchema): **Default value:** ``0``. """ - _schema = {'$ref': '#/definitions/TitleParams'} - - def __init__(self, text=Undefined, align=Undefined, anchor=Undefined, angle=Undefined, - aria=Undefined, baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - frame=Undefined, limit=Undefined, lineHeight=Undefined, offset=Undefined, - orient=Undefined, style=Undefined, subtitle=Undefined, subtitleColor=Undefined, - subtitleFont=Undefined, subtitleFontSize=Undefined, subtitleFontStyle=Undefined, - subtitleFontWeight=Undefined, subtitleLineHeight=Undefined, subtitlePadding=Undefined, - zindex=Undefined, **kwds): - super(TitleParams, self).__init__(text=text, align=align, anchor=anchor, angle=angle, aria=aria, - baseline=baseline, color=color, dx=dx, dy=dy, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - frame=frame, limit=limit, lineHeight=lineHeight, - offset=offset, orient=orient, style=style, subtitle=subtitle, - subtitleColor=subtitleColor, subtitleFont=subtitleFont, - subtitleFontSize=subtitleFontSize, - subtitleFontStyle=subtitleFontStyle, - subtitleFontWeight=subtitleFontWeight, - subtitleLineHeight=subtitleLineHeight, - subtitlePadding=subtitlePadding, zindex=zindex, **kwds) + + _schema = {"$ref": "#/definitions/TitleParams"} + + def __init__( + self, + text: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union["Align", Literal["left", "center", "right"]], UndefinedType + ] = Undefined, + anchor: Union[ + Union["TitleAnchor", Literal[None, "start", "middle", "end"]], UndefinedType + ] = Undefined, + angle: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union["ExprRef", "_Parameter", dict], bool], UndefinedType + ] = Undefined, + baseline: Union[ + Union[ + "TextBaseline", + Union["Baseline", Literal["top", "middle", "bottom"]], + str, + ], + UndefinedType, + ] = Undefined, + color: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + dx: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + font: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + frame: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[Union["TitleFrame", Literal["bounds", "group"]], str], + ], + UndefinedType, + ] = Undefined, + limit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + offset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + orient: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["TitleOrient", Literal["none", "left", "right", "top", "bottom"]], + ], + UndefinedType, + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + subtitle: Union[Union["Text", Sequence[str], str], UndefinedType] = Undefined, + subtitleColor: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + ], + ], + UndefinedType, + ] = Undefined, + subtitleFont: Union[ + Union[Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + subtitleFontSize: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + subtitleFontStyle: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["FontStyle", str]], + UndefinedType, + ] = Undefined, + subtitleFontWeight: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union[ + "FontWeight", + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + ], + ], + UndefinedType, + ] = Undefined, + subtitleLineHeight: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + subtitlePadding: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + zindex: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(TitleParams, self).__init__( + text=text, + align=align, + anchor=anchor, + angle=angle, + aria=aria, + baseline=baseline, + color=color, + dx=dx, + dy=dy, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + frame=frame, + limit=limit, + lineHeight=lineHeight, + offset=offset, + orient=orient, + style=style, + subtitle=subtitle, + subtitleColor=subtitleColor, + subtitleFont=subtitleFont, + subtitleFontSize=subtitleFontSize, + subtitleFontStyle=subtitleFontStyle, + subtitleFontWeight=subtitleFontWeight, + subtitleLineHeight=subtitleLineHeight, + subtitlePadding=subtitlePadding, + zindex=zindex, + **kwds, + ) class TooltipContent(VegaLiteSchema): """TooltipContent schema wrapper - Mapping(required=[content]) + :class:`TooltipContent`, Dict[required=[content]] Parameters ---------- - content : enum('encoding', 'data') + content : Literal['encoding', 'data'] """ - _schema = {'$ref': '#/definitions/TooltipContent'} - def __init__(self, content=Undefined, **kwds): + _schema = {"$ref": "#/definitions/TooltipContent"} + + def __init__( + self, + content: Union[Literal["encoding", "data"], UndefinedType] = Undefined, + **kwds, + ): super(TooltipContent, self).__init__(content=content, **kwds) class TopLevelParameter(VegaLiteSchema): """TopLevelParameter schema wrapper - anyOf(:class:`VariableParameter`, :class:`TopLevelSelectionParameter`) + :class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, + select]], :class:`VariableParameter`, Dict[required=[name]] """ - _schema = {'$ref': '#/definitions/TopLevelParameter'} + + _schema = {"$ref": "#/definitions/TopLevelParameter"} def __init__(self, *args, **kwds): super(TopLevelParameter, self).__init__(*args, **kwds) @@ -19449,17 +49862,17 @@ def __init__(self, *args, **kwds): class TopLevelSelectionParameter(TopLevelParameter): """TopLevelSelectionParameter schema wrapper - Mapping(required=[name, select]) + :class:`TopLevelSelectionParameter`, Dict[required=[name, select]] Parameters ---------- - name : :class:`ParameterName` + name : :class:`ParameterName`, str Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are "datum", "event", "item", and "parent". - select : anyOf(:class:`SelectionType`, :class:`PointSelectionConfig`, :class:`IntervalSelectionConfig`) + select : :class:`IntervalSelectionConfig`, Dict[required=[type]], :class:`PointSelectionConfig`, Dict[required=[type]], :class:`SelectionType`, Literal['point', 'interval'] Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types: @@ -19467,7 +49880,7 @@ class TopLevelSelectionParameter(TopLevelParameter): * ``"point"`` -- to select multiple discrete data values; the first value is selected on ``click`` and additional values toggled on shift-click. * ``"interval"`` -- to select a continuous range of data values on ``drag``. - bind : anyOf(:class:`Binding`, Mapping(required=[]), :class:`LegendBinding`, string) + bind : :class:`BindCheckbox`, Dict[required=[input]], :class:`BindDirect`, Dict[required=[element]], :class:`BindInput`, Dict, :class:`BindRadioSelect`, Dict[required=[input, options]], :class:`BindRange`, Dict[required=[input]], :class:`Binding`, :class:`LegendBinding`, :class:`LegendStreamBinding`, Dict[required=[legend]], str, Dict, str When set, a selection is populated by input elements (also known as dynamic query widgets) or by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's `on @@ -19483,36 +49896,81 @@ class TopLevelSelectionParameter(TopLevelParameter): **See also:** `bind <https://vega.github.io/vega-lite/docs/bind.html>`__ documentation. - value : anyOf(:class:`SelectionInit`, List(:class:`SelectionInitMapping`), :class:`SelectionInitIntervalMapping`) + value : :class:`DateTime`, Dict, :class:`PrimitiveValue`, None, bool, float, str, :class:`SelectionInit`, :class:`SelectionInitIntervalMapping`, Dict, Sequence[:class:`SelectionInitMapping`, Dict] Initialize the selection with a mapping between `projected channels or field names <https://vega.github.io/vega-lite/docs/selection.html#project>`__ and initial values. **See also:** `init <https://vega.github.io/vega-lite/docs/value.html>`__ documentation. - views : List(string) + views : Sequence[str] By default, top-level selections are applied to every view in the visualization. If this property is specified, selections will only be applied to views with the given names. """ - _schema = {'$ref': '#/definitions/TopLevelSelectionParameter'} - def __init__(self, name=Undefined, select=Undefined, bind=Undefined, value=Undefined, - views=Undefined, **kwds): - super(TopLevelSelectionParameter, self).__init__(name=name, select=select, bind=bind, - value=value, views=views, **kwds) + _schema = {"$ref": "#/definitions/TopLevelSelectionParameter"} + + def __init__( + self, + name: Union[Union["ParameterName", str], UndefinedType] = Undefined, + select: Union[ + Union[ + Union["IntervalSelectionConfig", dict], + Union["PointSelectionConfig", dict], + Union["SelectionType", Literal["point", "interval"]], + ], + UndefinedType, + ] = Undefined, + bind: Union[ + Union[ + Union[ + "Binding", + Union["BindCheckbox", dict], + Union["BindDirect", dict], + Union["BindInput", dict], + Union["BindRadioSelect", dict], + Union["BindRange", dict], + ], + Union["LegendBinding", Union["LegendStreamBinding", dict], str], + dict, + str, + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + Sequence[Union["SelectionInitMapping", dict]], + Union[ + "SelectionInit", + Union["DateTime", dict], + Union["PrimitiveValue", None, bool, float, str], + ], + Union["SelectionInitIntervalMapping", dict], + ], + UndefinedType, + ] = Undefined, + views: Union[Sequence[str], UndefinedType] = Undefined, + **kwds, + ): + super(TopLevelSelectionParameter, self).__init__( + name=name, select=select, bind=bind, value=value, views=views, **kwds + ) class TopLevelSpec(VegaLiteSchema): """TopLevelSpec schema wrapper - anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, - :class:`TopLevelRepeatSpec`, :class:`TopLevelConcatSpec`, :class:`TopLevelVConcatSpec`, - :class:`TopLevelHConcatSpec`) + :class:`TopLevelConcatSpec`, Dict[required=[concat]], :class:`TopLevelFacetSpec`, + Dict[required=[data, facet, spec]], :class:`TopLevelHConcatSpec`, Dict[required=[hconcat]], + :class:`TopLevelLayerSpec`, Dict[required=[layer]], :class:`TopLevelRepeatSpec`, + Dict[required=[repeat, spec]], :class:`TopLevelSpec`, :class:`TopLevelUnitSpec`, + Dict[required=[data, mark]], :class:`TopLevelVConcatSpec`, Dict[required=[vconcat]] A Vega-Lite top-level specification. This is the root class for all Vega-Lite specifications. (The json schema is generated from this type.) """ - _schema = {'$ref': '#/definitions/TopLevelSpec'} + + _schema = {"$ref": "#/definitions/TopLevelSpec"} def __init__(self, *args, **kwds): super(TopLevelSpec, self).__init__(*args, **kwds) @@ -19521,14 +49979,14 @@ def __init__(self, *args, **kwds): class TopLevelConcatSpec(TopLevelSpec): """TopLevelConcatSpec schema wrapper - Mapping(required=[concat]) + :class:`TopLevelConcatSpec`, Dict[required=[concat]] Parameters ---------- - concat : List(:class:`NonNormalizedSpec`) + concat : Sequence[:class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`NonNormalizedSpec`, :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]]] A list of views to be concatenated. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -19545,17 +50003,17 @@ class TopLevelConcatSpec(TopLevelSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + autosize : :class:`AutoSizeParams`, Dict, :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] How the visualization size should be determined. If a string, should be one of ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : anyOf(:class:`Color`, :class:`ExprRef`) + background : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] CSS color property to use as the background of the entire view. **Default value:** ``"white"`` - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -19567,7 +50025,7 @@ class TopLevelConcatSpec(TopLevelSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -19593,32 +50051,32 @@ class TopLevelConcatSpec(TopLevelSpec): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - config : :class:`Config` + config : :class:`Config`, Dict Vega-Lite configuration object. This property can only be defined at the top-level of a specification. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - datasets : :class:`Datasets` + datasets : :class:`Datasets`, Dict A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a ``data`` property. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - padding : anyOf(:class:`Padding`, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], :class:`Padding`, Dict, float The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format ``{"left": 5, "top": 5, "right": 5, "bottom": 5}`` to specify padding for each side of the visualization. **Default value** : ``5`` - params : List(:class:`TopLevelParameter`) + params : Sequence[:class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, select]], :class:`VariableParameter`, Dict[required=[name]]] Dynamic variables or selections that parameterize a visualization. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -19626,56 +50084,348 @@ class TopLevelConcatSpec(TopLevelSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - usermeta : :class:`Dict` + usermeta : :class:`Dict`, Dict Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. - $schema : string + $schema : str URL to `JSON schema <http://json-schema.org/>`__ for a Vega-Lite specification. Unless you have a reason to change this, use ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelConcatSpec'} - def __init__(self, concat=Undefined, align=Undefined, autosize=Undefined, background=Undefined, - bounds=Undefined, center=Undefined, columns=Undefined, config=Undefined, - data=Undefined, datasets=Undefined, description=Undefined, name=Undefined, - padding=Undefined, params=Undefined, resolve=Undefined, spacing=Undefined, - title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): - super(TopLevelConcatSpec, self).__init__(concat=concat, align=align, autosize=autosize, - background=background, bounds=bounds, center=center, - columns=columns, config=config, data=data, - datasets=datasets, description=description, name=name, - padding=padding, params=params, resolve=resolve, - spacing=spacing, title=title, transform=transform, - usermeta=usermeta, **kwds) + _schema = {"$ref": "#/definitions/TopLevelConcatSpec"} + + def __init__( + self, + concat: Union[ + Sequence[ + Union[ + "NonNormalizedSpec", + Union["ConcatSpecGenericSpec", dict], + Union["FacetSpec", dict], + Union["FacetedUnitSpec", dict], + Union["HConcatSpecGenericSpec", dict], + Union["LayerSpec", dict], + Union[ + "RepeatSpec", + Union["LayerRepeatSpec", dict], + Union["NonLayerRepeatSpec", dict], + ], + Union["VConcatSpecGenericSpec", dict], + ] + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + autosize: Union[ + Union[ + Union["AutoSizeParams", dict], + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + ], + UndefinedType, + ] = Undefined, + background: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + config: Union[Union["Config", dict], UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + datasets: Union[Union["Datasets", dict], UndefinedType] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["Padding", dict, float]], + UndefinedType, + ] = Undefined, + params: Union[ + Sequence[ + Union[ + "TopLevelParameter", + Union["TopLevelSelectionParameter", dict], + Union["VariableParameter", dict], + ] + ], + UndefinedType, + ] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + usermeta: Union[Union["Dict", dict], UndefinedType] = Undefined, + **kwds, + ): + super(TopLevelConcatSpec, self).__init__( + concat=concat, + align=align, + autosize=autosize, + background=background, + bounds=bounds, + center=center, + columns=columns, + config=config, + data=data, + datasets=datasets, + description=description, + name=name, + padding=padding, + params=params, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + usermeta=usermeta, + **kwds, + ) class TopLevelFacetSpec(TopLevelSpec): """TopLevelFacetSpec schema wrapper - Mapping(required=[data, facet, spec]) + :class:`TopLevelFacetSpec`, Dict[required=[data, facet, spec]] Parameters ---------- - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - facet : anyOf(:class:`FacetFieldDef`, :class:`FacetMapping`) + facet : :class:`FacetFieldDef`, Dict, :class:`FacetMapping`, Dict Definition for how to facet the data. One of: 1) `a field definition for faceting the plot by one field <https://vega.github.io/vega-lite/docs/facet.html#field-def>`__ 2) `An object that maps row and column channels to their field definitions <https://vega.github.io/vega-lite/docs/facet.html#mapping>`__ - spec : anyOf(:class:`LayerSpec`, :class:`UnitSpecWithFrame`) + spec : :class:`LayerSpec`, Dict[required=[layer]], :class:`UnitSpecWithFrame`, Dict[required=[mark]] A specification of the view that gets faceted. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -19692,17 +50442,17 @@ class TopLevelFacetSpec(TopLevelSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + autosize : :class:`AutoSizeParams`, Dict, :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] How the visualization size should be determined. If a string, should be one of ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : anyOf(:class:`Color`, :class:`ExprRef`) + background : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] CSS color property to use as the background of the entire view. **Default value:** ``"white"`` - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -19714,7 +50464,7 @@ class TopLevelFacetSpec(TopLevelSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -19740,29 +50490,29 @@ class TopLevelFacetSpec(TopLevelSpec): 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) and to using the ``row`` channel (for ``facet`` and ``repeat`` ). - config : :class:`Config` + config : :class:`Config`, Dict Vega-Lite configuration object. This property can only be defined at the top-level of a specification. - datasets : :class:`Datasets` + datasets : :class:`Datasets`, Dict A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a ``data`` property. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - padding : anyOf(:class:`Padding`, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], :class:`Padding`, Dict, float The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format ``{"left": 5, "top": 5, "right": 5, "bottom": 5}`` to specify padding for each side of the visualization. **Default value** : ``5`` - params : List(:class:`TopLevelParameter`) + params : Sequence[:class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, select]], :class:`VariableParameter`, Dict[required=[name]]] Dynamic variables or selections that parameterize a visualization. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -19770,57 +50520,339 @@ class TopLevelFacetSpec(TopLevelSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - usermeta : :class:`Dict` + usermeta : :class:`Dict`, Dict Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. - $schema : string + $schema : str URL to `JSON schema <http://json-schema.org/>`__ for a Vega-Lite specification. Unless you have a reason to change this, use ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelFacetSpec'} - def __init__(self, data=Undefined, facet=Undefined, spec=Undefined, align=Undefined, - autosize=Undefined, background=Undefined, bounds=Undefined, center=Undefined, - columns=Undefined, config=Undefined, datasets=Undefined, description=Undefined, - name=Undefined, padding=Undefined, params=Undefined, resolve=Undefined, - spacing=Undefined, title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): - super(TopLevelFacetSpec, self).__init__(data=data, facet=facet, spec=spec, align=align, - autosize=autosize, background=background, bounds=bounds, - center=center, columns=columns, config=config, - datasets=datasets, description=description, name=name, - padding=padding, params=params, resolve=resolve, - spacing=spacing, title=title, transform=transform, - usermeta=usermeta, **kwds) + _schema = {"$ref": "#/definitions/TopLevelFacetSpec"} + + def __init__( + self, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + facet: Union[ + Union[Union["FacetFieldDef", dict], Union["FacetMapping", dict]], + UndefinedType, + ] = Undefined, + spec: Union[ + Union[Union["LayerSpec", dict], Union["UnitSpecWithFrame", dict]], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + autosize: Union[ + Union[ + Union["AutoSizeParams", dict], + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + ], + UndefinedType, + ] = Undefined, + background: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + columns: Union[float, UndefinedType] = Undefined, + config: Union[Union["Config", dict], UndefinedType] = Undefined, + datasets: Union[Union["Datasets", dict], UndefinedType] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["Padding", dict, float]], + UndefinedType, + ] = Undefined, + params: Union[ + Sequence[ + Union[ + "TopLevelParameter", + Union["TopLevelSelectionParameter", dict], + Union["VariableParameter", dict], + ] + ], + UndefinedType, + ] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + usermeta: Union[Union["Dict", dict], UndefinedType] = Undefined, + **kwds, + ): + super(TopLevelFacetSpec, self).__init__( + data=data, + facet=facet, + spec=spec, + align=align, + autosize=autosize, + background=background, + bounds=bounds, + center=center, + columns=columns, + config=config, + datasets=datasets, + description=description, + name=name, + padding=padding, + params=params, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + usermeta=usermeta, + **kwds, + ) class TopLevelHConcatSpec(TopLevelSpec): """TopLevelHConcatSpec schema wrapper - Mapping(required=[hconcat]) + :class:`TopLevelHConcatSpec`, Dict[required=[hconcat]] Parameters ---------- - hconcat : List(:class:`NonNormalizedSpec`) + hconcat : Sequence[:class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`NonNormalizedSpec`, :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]]] A list of views to be concatenated and put into a row. - autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + autosize : :class:`AutoSizeParams`, Dict, :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] How the visualization size should be determined. If a string, should be one of ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : anyOf(:class:`Color`, :class:`ExprRef`) + background : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] CSS color property to use as the background of the entire view. **Default value:** ``"white"`` - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -19832,111 +50864,389 @@ class TopLevelHConcatSpec(TopLevelSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : boolean + center : bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. **Default value:** ``false`` - config : :class:`Config` + config : :class:`Config`, Dict Vega-Lite configuration object. This property can only be defined at the top-level of a specification. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - datasets : :class:`Datasets` + datasets : :class:`Datasets`, Dict A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a ``data`` property. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - padding : anyOf(:class:`Padding`, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], :class:`Padding`, Dict, float The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format ``{"left": 5, "top": 5, "right": 5, "bottom": 5}`` to specify padding for each side of the visualization. **Default value** : ``5`` - params : List(:class:`TopLevelParameter`) + params : Sequence[:class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, select]], :class:`VariableParameter`, Dict[required=[name]]] Dynamic variables or selections that parameterize a visualization. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. spacing : float The spacing in pixels between sub-views of the concat operator. **Default value** : ``10`` - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - usermeta : :class:`Dict` + usermeta : :class:`Dict`, Dict Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. - $schema : string + $schema : str URL to `JSON schema <http://json-schema.org/>`__ for a Vega-Lite specification. Unless you have a reason to change this, use ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelHConcatSpec'} - def __init__(self, hconcat=Undefined, autosize=Undefined, background=Undefined, bounds=Undefined, - center=Undefined, config=Undefined, data=Undefined, datasets=Undefined, - description=Undefined, name=Undefined, padding=Undefined, params=Undefined, - resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, - usermeta=Undefined, **kwds): - super(TopLevelHConcatSpec, self).__init__(hconcat=hconcat, autosize=autosize, - background=background, bounds=bounds, center=center, - config=config, data=data, datasets=datasets, - description=description, name=name, padding=padding, - params=params, resolve=resolve, spacing=spacing, - title=title, transform=transform, usermeta=usermeta, - **kwds) + _schema = {"$ref": "#/definitions/TopLevelHConcatSpec"} + + def __init__( + self, + hconcat: Union[ + Sequence[ + Union[ + "NonNormalizedSpec", + Union["ConcatSpecGenericSpec", dict], + Union["FacetSpec", dict], + Union["FacetedUnitSpec", dict], + Union["HConcatSpecGenericSpec", dict], + Union["LayerSpec", dict], + Union[ + "RepeatSpec", + Union["LayerRepeatSpec", dict], + Union["NonLayerRepeatSpec", dict], + ], + Union["VConcatSpecGenericSpec", dict], + ] + ], + UndefinedType, + ] = Undefined, + autosize: Union[ + Union[ + Union["AutoSizeParams", dict], + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + ], + UndefinedType, + ] = Undefined, + background: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[bool, UndefinedType] = Undefined, + config: Union[Union["Config", dict], UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + datasets: Union[Union["Datasets", dict], UndefinedType] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["Padding", dict, float]], + UndefinedType, + ] = Undefined, + params: Union[ + Sequence[ + Union[ + "TopLevelParameter", + Union["TopLevelSelectionParameter", dict], + Union["VariableParameter", dict], + ] + ], + UndefinedType, + ] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + usermeta: Union[Union["Dict", dict], UndefinedType] = Undefined, + **kwds, + ): + super(TopLevelHConcatSpec, self).__init__( + hconcat=hconcat, + autosize=autosize, + background=background, + bounds=bounds, + center=center, + config=config, + data=data, + datasets=datasets, + description=description, + name=name, + padding=padding, + params=params, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + usermeta=usermeta, + **kwds, + ) class TopLevelLayerSpec(TopLevelSpec): """TopLevelLayerSpec schema wrapper - Mapping(required=[layer]) + :class:`TopLevelLayerSpec`, Dict[required=[layer]] Parameters ---------- - layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + layer : Sequence[:class:`LayerSpec`, Dict[required=[layer]], :class:`UnitSpec`, Dict[required=[mark]]] Layer or single view specifications to be layered. **Note** : Specifications inside ``layer`` cannot use ``row`` and ``column`` channels as layering facet specifications is not allowed. Instead, use the `facet operator <https://vega.github.io/vega-lite/docs/facet.html>`__ and place a layer inside a facet. - autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + autosize : :class:`AutoSizeParams`, Dict, :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] How the visualization size should be determined. If a string, should be one of ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : anyOf(:class:`Color`, :class:`ExprRef`) + background : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] CSS color property to use as the background of the entire view. **Default value:** ``"white"`` - config : :class:`Config` + config : :class:`Config`, Dict Vega-Lite configuration object. This property can only be defined at the top-level of a specification. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - datasets : :class:`Datasets` + datasets : :class:`Datasets`, Dict A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a ``data`` property. - description : string + description : str Description of this mark for commenting purpose. - encoding : :class:`SharedEncoding` + encoding : :class:`SharedEncoding`, Dict A shared key-value mapping between encoding channels and definition of fields in the underlying layers. - height : anyOf(float, string, :class:`Step`) + height : :class:`Step`, Dict[required=[step]], float, str The height of a visualization. @@ -19956,34 +51266,34 @@ class TopLevelLayerSpec(TopLevelSpec): **See also:** `height <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. - name : string + name : str Name of the visualization for later reference. - padding : anyOf(:class:`Padding`, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], :class:`Padding`, Dict, float The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format ``{"left": 5, "top": 5, "right": 5, "bottom": 5}`` to specify padding for each side of the visualization. **Default value** : ``5`` - params : List(:class:`TopLevelParameter`) + params : Sequence[:class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, select]], :class:`VariableParameter`, Dict[required=[name]]] Dynamic variables or selections that parameterize a visualization. - projection : :class:`Projection` + projection : :class:`Projection`, Dict An object defining properties of the geographic projection shared by underlying layers. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - usermeta : :class:`Dict` + usermeta : :class:`Dict`, Dict Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. - view : :class:`ViewBackground` + view : :class:`ViewBackground`, Dict An object defining the view background's fill and stroke. **Default value:** none (transparent) - width : anyOf(float, string, :class:`Step`) + width : :class:`Step`, Dict[required=[step]], float, str The width of a visualization. @@ -20003,35 +51313,305 @@ class TopLevelLayerSpec(TopLevelSpec): **See also:** `width <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. - $schema : string + $schema : str URL to `JSON schema <http://json-schema.org/>`__ for a Vega-Lite specification. Unless you have a reason to change this, use ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelLayerSpec'} - def __init__(self, layer=Undefined, autosize=Undefined, background=Undefined, config=Undefined, - data=Undefined, datasets=Undefined, description=Undefined, encoding=Undefined, - height=Undefined, name=Undefined, padding=Undefined, params=Undefined, - projection=Undefined, resolve=Undefined, title=Undefined, transform=Undefined, - usermeta=Undefined, view=Undefined, width=Undefined, **kwds): - super(TopLevelLayerSpec, self).__init__(layer=layer, autosize=autosize, background=background, - config=config, data=data, datasets=datasets, - description=description, encoding=encoding, - height=height, name=name, padding=padding, - params=params, projection=projection, resolve=resolve, - title=title, transform=transform, usermeta=usermeta, - view=view, width=width, **kwds) + _schema = {"$ref": "#/definitions/TopLevelLayerSpec"} + + def __init__( + self, + layer: Union[ + Sequence[Union[Union["LayerSpec", dict], Union["UnitSpec", dict]]], + UndefinedType, + ] = Undefined, + autosize: Union[ + Union[ + Union["AutoSizeParams", dict], + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + ], + UndefinedType, + ] = Undefined, + background: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + config: Union[Union["Config", dict], UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + datasets: Union[Union["Datasets", dict], UndefinedType] = Undefined, + description: Union[str, UndefinedType] = Undefined, + encoding: Union[Union["SharedEncoding", dict], UndefinedType] = Undefined, + height: Union[ + Union[Union["Step", dict], float, str], UndefinedType + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["Padding", dict, float]], + UndefinedType, + ] = Undefined, + params: Union[ + Sequence[ + Union[ + "TopLevelParameter", + Union["TopLevelSelectionParameter", dict], + Union["VariableParameter", dict], + ] + ], + UndefinedType, + ] = Undefined, + projection: Union[Union["Projection", dict], UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + usermeta: Union[Union["Dict", dict], UndefinedType] = Undefined, + view: Union[Union["ViewBackground", dict], UndefinedType] = Undefined, + width: Union[Union[Union["Step", dict], float, str], UndefinedType] = Undefined, + **kwds, + ): + super(TopLevelLayerSpec, self).__init__( + layer=layer, + autosize=autosize, + background=background, + config=config, + data=data, + datasets=datasets, + description=description, + encoding=encoding, + height=height, + name=name, + padding=padding, + params=params, + projection=projection, + resolve=resolve, + title=title, + transform=transform, + usermeta=usermeta, + view=view, + width=width, + **kwds, + ) class TopLevelRepeatSpec(TopLevelSpec): """TopLevelRepeatSpec schema wrapper - anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) + :class:`TopLevelRepeatSpec`, Dict[required=[repeat, spec]] """ - _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} + + _schema = {"$ref": "#/definitions/TopLevelRepeatSpec"} def __init__(self, *args, **kwds): super(TopLevelRepeatSpec, self).__init__(*args, **kwds) @@ -20040,20 +51620,20 @@ def __init__(self, *args, **kwds): class TopLevelUnitSpec(TopLevelSpec): """TopLevelUnitSpec schema wrapper - Mapping(required=[data, mark]) + :class:`TopLevelUnitSpec`, Dict[required=[data, mark]] Parameters ---------- - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - mark : :class:`AnyMark` + mark : :class:`AnyMark`, :class:`BoxPlotDef`, Dict[required=[type]], :class:`CompositeMarkDef`, :class:`ErrorBandDef`, Dict[required=[type]], :class:`ErrorBarDef`, Dict[required=[type]], :class:`BoxPlot`, str, :class:`CompositeMark`, :class:`ErrorBand`, str, :class:`ErrorBar`, str, :class:`MarkDef`, Dict[required=[type]], :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark definition object <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. - align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + align : :class:`LayoutAlign`, Literal['all', 'each', 'none'], :class:`RowColLayoutAlign`, Dict The alignment to apply to grid rows and columns. The supported string values are ``"all"``, ``"each"``, and ``"none"``. @@ -20070,17 +51650,17 @@ class TopLevelUnitSpec(TopLevelSpec): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. - autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + autosize : :class:`AutoSizeParams`, Dict, :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] How the visualization size should be determined. If a string, should be one of ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : anyOf(:class:`Color`, :class:`ExprRef`) + background : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] CSS color property to use as the background of the entire view. **Default value:** ``"white"`` - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -20092,7 +51672,7 @@ class TopLevelUnitSpec(TopLevelSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : anyOf(boolean, :class:`RowColboolean`) + center : :class:`RowColboolean`, Dict, bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. @@ -20100,18 +51680,18 @@ class TopLevelUnitSpec(TopLevelSpec): supply different centering values for rows and columns. **Default value:** ``false`` - config : :class:`Config` + config : :class:`Config`, Dict Vega-Lite configuration object. This property can only be defined at the top-level of a specification. - datasets : :class:`Datasets` + datasets : :class:`Datasets`, Dict A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a ``data`` property. - description : string + description : str Description of this mark for commenting purpose. - encoding : :class:`FacetedEncoding` + encoding : :class:`FacetedEncoding`, Dict A key-value mapping between encoding channels and definition of fields. - height : anyOf(float, string, :class:`Step`) + height : :class:`Step`, Dict[required=[step]], float, str The height of a visualization. @@ -20131,25 +51711,25 @@ class TopLevelUnitSpec(TopLevelSpec): **See also:** `height <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. - name : string + name : str Name of the visualization for later reference. - padding : anyOf(:class:`Padding`, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], :class:`Padding`, Dict, float The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format ``{"left": 5, "top": 5, "right": 5, "bottom": 5}`` to specify padding for each side of the visualization. **Default value** : ``5`` - params : List(:class:`TopLevelParameter`) + params : Sequence[:class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, select]], :class:`VariableParameter`, Dict[required=[name]]] An array of parameters that may either be simple variables, or more complex selections that map user input to data queries. - projection : :class:`Projection` + projection : :class:`Projection`, Dict An object defining properties of geographic projection, which will be applied to ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` channels for other marks. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. - spacing : anyOf(float, :class:`RowColnumber`) + spacing : :class:`RowColnumber`, Dict, float The spacing in pixels between sub-views of the composition operator. An object of the form ``{"row": number, "column": number}`` can be used to set different spacing values for rows and columns. @@ -20157,18 +51737,18 @@ class TopLevelUnitSpec(TopLevelSpec): **Default value** : Depends on ``"spacing"`` property of `the view composition configuration <https://vega.github.io/vega-lite/docs/config.html#view-config>`__ ( ``20`` by default) - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - usermeta : :class:`Dict` + usermeta : :class:`Dict`, Dict Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. - view : :class:`ViewBackground` + view : :class:`ViewBackground`, Dict An object defining the view background's fill and stroke. **Default value:** none (transparent) - width : anyOf(float, string, :class:`Step`) + width : :class:`Step`, Dict[required=[step]], float, str The width of a visualization. @@ -20188,52 +51768,371 @@ class TopLevelUnitSpec(TopLevelSpec): **See also:** `width <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. - $schema : string + $schema : str URL to `JSON schema <http://json-schema.org/>`__ for a Vega-Lite specification. Unless you have a reason to change this, use ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelUnitSpec'} - def __init__(self, data=Undefined, mark=Undefined, align=Undefined, autosize=Undefined, - background=Undefined, bounds=Undefined, center=Undefined, config=Undefined, - datasets=Undefined, description=Undefined, encoding=Undefined, height=Undefined, - name=Undefined, padding=Undefined, params=Undefined, projection=Undefined, - resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, - usermeta=Undefined, view=Undefined, width=Undefined, **kwds): - super(TopLevelUnitSpec, self).__init__(data=data, mark=mark, align=align, autosize=autosize, - background=background, bounds=bounds, center=center, - config=config, datasets=datasets, - description=description, encoding=encoding, - height=height, name=name, padding=padding, params=params, - projection=projection, resolve=resolve, spacing=spacing, - title=title, transform=transform, usermeta=usermeta, - view=view, width=width, **kwds) + _schema = {"$ref": "#/definitions/TopLevelUnitSpec"} + + def __init__( + self, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + mark: Union[ + Union[ + "AnyMark", + Union[ + "CompositeMark", + Union["BoxPlot", str], + Union["ErrorBand", str], + Union["ErrorBar", str], + ], + Union[ + "CompositeMarkDef", + Union["BoxPlotDef", dict], + Union["ErrorBandDef", dict], + Union["ErrorBarDef", dict], + ], + Union[ + "Mark", + Literal[ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape", + ], + ], + Union["MarkDef", dict], + ], + UndefinedType, + ] = Undefined, + align: Union[ + Union[ + Union["LayoutAlign", Literal["all", "each", "none"]], + Union["RowColLayoutAlign", dict], + ], + UndefinedType, + ] = Undefined, + autosize: Union[ + Union[ + Union["AutoSizeParams", dict], + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + ], + UndefinedType, + ] = Undefined, + background: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[ + Union[Union["RowColboolean", dict], bool], UndefinedType + ] = Undefined, + config: Union[Union["Config", dict], UndefinedType] = Undefined, + datasets: Union[Union["Datasets", dict], UndefinedType] = Undefined, + description: Union[str, UndefinedType] = Undefined, + encoding: Union[Union["FacetedEncoding", dict], UndefinedType] = Undefined, + height: Union[ + Union[Union["Step", dict], float, str], UndefinedType + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["Padding", dict, float]], + UndefinedType, + ] = Undefined, + params: Union[ + Sequence[ + Union[ + "TopLevelParameter", + Union["TopLevelSelectionParameter", dict], + Union["VariableParameter", dict], + ] + ], + UndefinedType, + ] = Undefined, + projection: Union[Union["Projection", dict], UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[ + Union[Union["RowColnumber", dict], float], UndefinedType + ] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + usermeta: Union[Union["Dict", dict], UndefinedType] = Undefined, + view: Union[Union["ViewBackground", dict], UndefinedType] = Undefined, + width: Union[Union[Union["Step", dict], float, str], UndefinedType] = Undefined, + **kwds, + ): + super(TopLevelUnitSpec, self).__init__( + data=data, + mark=mark, + align=align, + autosize=autosize, + background=background, + bounds=bounds, + center=center, + config=config, + datasets=datasets, + description=description, + encoding=encoding, + height=height, + name=name, + padding=padding, + params=params, + projection=projection, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + usermeta=usermeta, + view=view, + width=width, + **kwds, + ) class TopLevelVConcatSpec(TopLevelSpec): """TopLevelVConcatSpec schema wrapper - Mapping(required=[vconcat]) + :class:`TopLevelVConcatSpec`, Dict[required=[vconcat]] Parameters ---------- - vconcat : List(:class:`NonNormalizedSpec`) + vconcat : Sequence[:class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`NonNormalizedSpec`, :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]]] A list of views to be concatenated and put into a column. - autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + autosize : :class:`AutoSizeParams`, Dict, :class:`AutosizeType`, Literal['pad', 'none', 'fit', 'fit-x', 'fit-y'] How the visualization size should be determined. If a string, should be one of ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : anyOf(:class:`Color`, :class:`ExprRef`) + background : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]] CSS color property to use as the background of the entire view. **Default value:** ``"white"`` - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -20245,91 +52144,369 @@ class TopLevelVConcatSpec(TopLevelSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : boolean + center : bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. **Default value:** ``false`` - config : :class:`Config` + config : :class:`Config`, Dict Vega-Lite configuration object. This property can only be defined at the top-level of a specification. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - datasets : :class:`Datasets` + datasets : :class:`Datasets`, Dict A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a ``data`` property. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - padding : anyOf(:class:`Padding`, :class:`ExprRef`) + padding : :class:`ExprRef`, Dict[required=[expr]], :class:`Padding`, Dict, float The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format ``{"left": 5, "top": 5, "right": 5, "bottom": 5}`` to specify padding for each side of the visualization. **Default value** : ``5`` - params : List(:class:`TopLevelParameter`) + params : Sequence[:class:`TopLevelParameter`, :class:`TopLevelSelectionParameter`, Dict[required=[name, select]], :class:`VariableParameter`, Dict[required=[name]]] Dynamic variables or selections that parameterize a visualization. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. spacing : float The spacing in pixels between sub-views of the concat operator. **Default value** : ``10`` - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - usermeta : :class:`Dict` + usermeta : :class:`Dict`, Dict Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. - $schema : string + $schema : str URL to `JSON schema <http://json-schema.org/>`__ for a Vega-Lite specification. Unless you have a reason to change this, use ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelVConcatSpec'} - def __init__(self, vconcat=Undefined, autosize=Undefined, background=Undefined, bounds=Undefined, - center=Undefined, config=Undefined, data=Undefined, datasets=Undefined, - description=Undefined, name=Undefined, padding=Undefined, params=Undefined, - resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, - usermeta=Undefined, **kwds): - super(TopLevelVConcatSpec, self).__init__(vconcat=vconcat, autosize=autosize, - background=background, bounds=bounds, center=center, - config=config, data=data, datasets=datasets, - description=description, name=name, padding=padding, - params=params, resolve=resolve, spacing=spacing, - title=title, transform=transform, usermeta=usermeta, - **kwds) + _schema = {"$ref": "#/definitions/TopLevelVConcatSpec"} + + def __init__( + self, + vconcat: Union[ + Sequence[ + Union[ + "NonNormalizedSpec", + Union["ConcatSpecGenericSpec", dict], + Union["FacetSpec", dict], + Union["FacetedUnitSpec", dict], + Union["HConcatSpecGenericSpec", dict], + Union["LayerSpec", dict], + Union[ + "RepeatSpec", + Union["LayerRepeatSpec", dict], + Union["NonLayerRepeatSpec", dict], + ], + Union["VConcatSpecGenericSpec", dict], + ] + ], + UndefinedType, + ] = Undefined, + autosize: Union[ + Union[ + Union["AutoSizeParams", dict], + Union["AutosizeType", Literal["pad", "none", "fit", "fit-x", "fit-y"]], + ], + UndefinedType, + ] = Undefined, + background: Union[ + Union[ + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[bool, UndefinedType] = Undefined, + config: Union[Union["Config", dict], UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + datasets: Union[Union["Datasets", dict], UndefinedType] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + padding: Union[ + Union[Union["ExprRef", "_Parameter", dict], Union["Padding", dict, float]], + UndefinedType, + ] = Undefined, + params: Union[ + Sequence[ + Union[ + "TopLevelParameter", + Union["TopLevelSelectionParameter", dict], + Union["VariableParameter", dict], + ] + ], + UndefinedType, + ] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + usermeta: Union[Union["Dict", dict], UndefinedType] = Undefined, + **kwds, + ): + super(TopLevelVConcatSpec, self).__init__( + vconcat=vconcat, + autosize=autosize, + background=background, + bounds=bounds, + center=center, + config=config, + data=data, + datasets=datasets, + description=description, + name=name, + padding=padding, + params=params, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + usermeta=usermeta, + **kwds, + ) class TopoDataFormat(DataFormat): """TopoDataFormat schema wrapper - Mapping(required=[]) + :class:`TopoDataFormat`, Dict Parameters ---------- - feature : string + feature : str The name of the TopoJSON object set to convert to a GeoJSON feature collection. For example, in a map of the world, there may be an object set named ``"countries"``. Using the feature property, we can extract this set and generate a GeoJSON feature object for each country. - mesh : string + mesh : str The name of the TopoJSON object set to convert to mesh. Similar to the ``feature`` option, ``mesh`` extracts a named TopoJSON object set. Unlike the ``feature`` option, the corresponding geo data is returned as a single, unified mesh instance, not as individual GeoJSON features. Extracting a mesh is useful for more efficiently drawing borders or other geographic elements that you do not need to associate with specific regions such as individual countries, states or counties. - parse : anyOf(:class:`Parse`, None) + parse : :class:`Parse`, Dict, None If set to ``null``, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field @@ -20345,30 +52522,47 @@ class TopoDataFormat(DataFormat): UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). See more about `UTC time <https://vega.github.io/vega-lite/docs/timeunit.html#utc>`__ - type : string + type : str Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. **Default value:** The default format type is determined by the extension of the file URL. If no extension is detected, ``"json"`` will be used by default. """ - _schema = {'$ref': '#/definitions/TopoDataFormat'} - def __init__(self, feature=Undefined, mesh=Undefined, parse=Undefined, type=Undefined, **kwds): - super(TopoDataFormat, self).__init__(feature=feature, mesh=mesh, parse=parse, type=type, **kwds) + _schema = {"$ref": "#/definitions/TopoDataFormat"} + + def __init__( + self, + feature: Union[str, UndefinedType] = Undefined, + mesh: Union[str, UndefinedType] = Undefined, + parse: Union[Union[None, Union["Parse", dict]], UndefinedType] = Undefined, + type: Union[str, UndefinedType] = Undefined, + **kwds, + ): + super(TopoDataFormat, self).__init__( + feature=feature, mesh=mesh, parse=parse, type=type, **kwds + ) class Transform(VegaLiteSchema): """Transform schema wrapper - anyOf(:class:`AggregateTransform`, :class:`BinTransform`, :class:`CalculateTransform`, - :class:`DensityTransform`, :class:`ExtentTransform`, :class:`FilterTransform`, - :class:`FlattenTransform`, :class:`FoldTransform`, :class:`ImputeTransform`, - :class:`JoinAggregateTransform`, :class:`LoessTransform`, :class:`LookupTransform`, - :class:`QuantileTransform`, :class:`RegressionTransform`, :class:`TimeUnitTransform`, - :class:`SampleTransform`, :class:`StackTransform`, :class:`WindowTransform`, - :class:`PivotTransform`) + :class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, + Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, + as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, + Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], + :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, + Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], + :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, + Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], + :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, + Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], + :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, + Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, + field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]] """ - _schema = {'$ref': '#/definitions/Transform'} + + _schema = {"$ref": "#/definitions/Transform"} def __init__(self, *args, **kwds): super(Transform, self).__init__(*args, **kwds) @@ -20377,97 +52571,114 @@ def __init__(self, *args, **kwds): class AggregateTransform(Transform): """AggregateTransform schema wrapper - Mapping(required=[aggregate]) + :class:`AggregateTransform`, Dict[required=[aggregate]] Parameters ---------- - aggregate : List(:class:`AggregatedFieldDef`) + aggregate : Sequence[:class:`AggregatedFieldDef`, Dict[required=[op, as]]] Array of objects that define fields to aggregate. - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields to group by. If not specified, a single group containing all data objects will be used. """ - _schema = {'$ref': '#/definitions/AggregateTransform'} - def __init__(self, aggregate=Undefined, groupby=Undefined, **kwds): - super(AggregateTransform, self).__init__(aggregate=aggregate, groupby=groupby, **kwds) + _schema = {"$ref": "#/definitions/AggregateTransform"} + + def __init__( + self, + aggregate: Union[ + Sequence[Union["AggregatedFieldDef", dict]], UndefinedType + ] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + **kwds, + ): + super(AggregateTransform, self).__init__( + aggregate=aggregate, groupby=groupby, **kwds + ) class BinTransform(Transform): """BinTransform schema wrapper - Mapping(required=[bin, field, as]) + :class:`BinTransform`, Dict[required=[bin, field, as]] Parameters ---------- - bin : anyOf(boolean, :class:`BinParams`) + bin : :class:`BinParams`, Dict, bool An object indicating bin properties, or simply ``true`` for using default bin parameters. - field : :class:`FieldName` + field : :class:`FieldName`, str The data field to bin. - as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + as : :class:`FieldName`, str, Sequence[:class:`FieldName`, str] The output fields at which to write the start and end bin values. This can be either a string or an array of strings with two elements denoting the name for the fields for bin start and bin end respectively. If a single string (e.g., ``"val"`` ) is provided, the end field will be ``"val_end"``. """ - _schema = {'$ref': '#/definitions/BinTransform'} - def __init__(self, bin=Undefined, field=Undefined, **kwds): + _schema = {"$ref": "#/definitions/BinTransform"} + + def __init__( + self, + bin: Union[Union[Union["BinParams", dict], bool], UndefinedType] = Undefined, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + **kwds, + ): super(BinTransform, self).__init__(bin=bin, field=field, **kwds) class CalculateTransform(Transform): """CalculateTransform schema wrapper - Mapping(required=[calculate, as]) + :class:`CalculateTransform`, Dict[required=[calculate, as]] Parameters ---------- - calculate : string + calculate : str A `expression <https://vega.github.io/vega-lite/docs/types.html#expression>`__ string. Use the variable ``datum`` to refer to the current data object. - as : :class:`FieldName` + as : :class:`FieldName`, str The field for storing the computed formula value. """ - _schema = {'$ref': '#/definitions/CalculateTransform'} - def __init__(self, calculate=Undefined, **kwds): + _schema = {"$ref": "#/definitions/CalculateTransform"} + + def __init__(self, calculate: Union[str, UndefinedType] = Undefined, **kwds): super(CalculateTransform, self).__init__(calculate=calculate, **kwds) class DensityTransform(Transform): """DensityTransform schema wrapper - Mapping(required=[density]) + :class:`DensityTransform`, Dict[required=[density]] Parameters ---------- - density : :class:`FieldName` + density : :class:`FieldName`, str The data field for which to perform density estimation. bandwidth : float The bandwidth (standard deviation) of the Gaussian kernel. If unspecified or set to zero, the bandwidth value is automatically estimated from the input data using Scott’s rule. - counts : boolean + counts : bool A boolean flag indicating if the output values should be probability estimates (false) or smoothed counts (true). **Default value:** ``false`` - cumulative : boolean + cumulative : bool A boolean flag indicating whether to produce density estimates (false) or cumulative density estimates (true). **Default value:** ``false`` - extent : List(float) + extent : Sequence[float] A [min, max] domain from which to sample the distribution. If unspecified, the extent will be determined by the observed minimum and maximum values of the density value field. - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields to group by. If not specified, a single group containing all data objects will be used. maxsteps : float @@ -20485,49 +52696,75 @@ class DensityTransform(Transform): density. If specified, overrides both minsteps and maxsteps to set an exact number of uniform samples. Potentially useful in conjunction with a fixed extent to ensure consistent sample points for stacked densities. - as : List(:class:`FieldName`) + as : Sequence[:class:`FieldName`, str] The output fields for the sample value and corresponding density estimate. **Default value:** ``["value", "density"]`` """ - _schema = {'$ref': '#/definitions/DensityTransform'} - def __init__(self, density=Undefined, bandwidth=Undefined, counts=Undefined, cumulative=Undefined, - extent=Undefined, groupby=Undefined, maxsteps=Undefined, minsteps=Undefined, - steps=Undefined, **kwds): - super(DensityTransform, self).__init__(density=density, bandwidth=bandwidth, counts=counts, - cumulative=cumulative, extent=extent, groupby=groupby, - maxsteps=maxsteps, minsteps=minsteps, steps=steps, **kwds) + _schema = {"$ref": "#/definitions/DensityTransform"} + + def __init__( + self, + density: Union[Union["FieldName", str], UndefinedType] = Undefined, + bandwidth: Union[float, UndefinedType] = Undefined, + counts: Union[bool, UndefinedType] = Undefined, + cumulative: Union[bool, UndefinedType] = Undefined, + extent: Union[Sequence[float], UndefinedType] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + maxsteps: Union[float, UndefinedType] = Undefined, + minsteps: Union[float, UndefinedType] = Undefined, + steps: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(DensityTransform, self).__init__( + density=density, + bandwidth=bandwidth, + counts=counts, + cumulative=cumulative, + extent=extent, + groupby=groupby, + maxsteps=maxsteps, + minsteps=minsteps, + steps=steps, + **kwds, + ) class ExtentTransform(Transform): """ExtentTransform schema wrapper - Mapping(required=[extent, param]) + :class:`ExtentTransform`, Dict[required=[extent, param]] Parameters ---------- - extent : :class:`FieldName` + extent : :class:`FieldName`, str The field of which to get the extent. - param : :class:`ParameterName` + param : :class:`ParameterName`, str The output parameter produced by the extent transform. """ - _schema = {'$ref': '#/definitions/ExtentTransform'} - def __init__(self, extent=Undefined, param=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ExtentTransform"} + + def __init__( + self, + extent: Union[Union["FieldName", str], UndefinedType] = Undefined, + param: Union[Union["ParameterName", str], UndefinedType] = Undefined, + **kwds, + ): super(ExtentTransform, self).__init__(extent=extent, param=param, **kwds) class FilterTransform(Transform): """FilterTransform schema wrapper - Mapping(required=[filter]) + :class:`FilterTransform`, Dict[required=[filter]] Parameters ---------- - filter : :class:`PredicateComposition` + filter : :class:`FieldEqualPredicate`, Dict[required=[equal, field]], :class:`FieldGTEPredicate`, Dict[required=[field, gte]], :class:`FieldGTPredicate`, Dict[required=[field, gt]], :class:`FieldLTEPredicate`, Dict[required=[field, lte]], :class:`FieldLTPredicate`, Dict[required=[field, lt]], :class:`FieldOneOfPredicate`, Dict[required=[field, oneOf]], :class:`FieldRangePredicate`, Dict[required=[field, range]], :class:`FieldValidPredicate`, Dict[required=[field, valid]], :class:`ParameterPredicate`, Dict[required=[param]], :class:`Predicate`, str, :class:`LogicalAndPredicate`, Dict[required=[and]], :class:`LogicalNotPredicate`, Dict[required=[not]], :class:`LogicalOrPredicate`, Dict[required=[or]], :class:`PredicateComposition` The ``filter`` property must be a predication definition, which can take one of the following forms: @@ -20556,70 +52793,106 @@ class FilterTransform(Transform): <https://vega.github.io/vega-lite/docs/predicate.html#composition>`__ of (1), (2), or (3). """ - _schema = {'$ref': '#/definitions/FilterTransform'} - def __init__(self, filter=Undefined, **kwds): + _schema = {"$ref": "#/definitions/FilterTransform"} + + def __init__( + self, + filter: Union[ + Union[ + "PredicateComposition", + Union["LogicalAndPredicate", dict], + Union["LogicalNotPredicate", dict], + Union["LogicalOrPredicate", dict], + Union[ + "Predicate", + Union["FieldEqualPredicate", dict], + Union["FieldGTEPredicate", dict], + Union["FieldGTPredicate", dict], + Union["FieldLTEPredicate", dict], + Union["FieldLTPredicate", dict], + Union["FieldOneOfPredicate", dict], + Union["FieldRangePredicate", dict], + Union["FieldValidPredicate", dict], + Union["ParameterPredicate", dict], + str, + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(FilterTransform, self).__init__(filter=filter, **kwds) class FlattenTransform(Transform): """FlattenTransform schema wrapper - Mapping(required=[flatten]) + :class:`FlattenTransform`, Dict[required=[flatten]] Parameters ---------- - flatten : List(:class:`FieldName`) + flatten : Sequence[:class:`FieldName`, str] An array of one or more data fields containing arrays to flatten. If multiple fields are specified, their array values should have a parallel structure, ideally with the same length. If the lengths of parallel arrays do not match, the longest array will be used with ``null`` values added for missing entries. - as : List(:class:`FieldName`) + as : Sequence[:class:`FieldName`, str] The output field names for extracted array values. **Default value:** The field name of the corresponding array field """ - _schema = {'$ref': '#/definitions/FlattenTransform'} - def __init__(self, flatten=Undefined, **kwds): + _schema = {"$ref": "#/definitions/FlattenTransform"} + + def __init__( + self, + flatten: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + **kwds, + ): super(FlattenTransform, self).__init__(flatten=flatten, **kwds) class FoldTransform(Transform): """FoldTransform schema wrapper - Mapping(required=[fold]) + :class:`FoldTransform`, Dict[required=[fold]] Parameters ---------- - fold : List(:class:`FieldName`) + fold : Sequence[:class:`FieldName`, str] An array of data fields indicating the properties to fold. - as : List(:class:`FieldName`) + as : Sequence[:class:`FieldName`, str] The output field names for the key and value properties produced by the fold transform. **Default value:** ``["key", "value"]`` """ - _schema = {'$ref': '#/definitions/FoldTransform'} - def __init__(self, fold=Undefined, **kwds): + _schema = {"$ref": "#/definitions/FoldTransform"} + + def __init__( + self, + fold: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + **kwds, + ): super(FoldTransform, self).__init__(fold=fold, **kwds) class ImputeTransform(Transform): """ImputeTransform schema wrapper - Mapping(required=[impute, key]) + :class:`ImputeTransform`, Dict[required=[impute, key]] Parameters ---------- - impute : :class:`FieldName` + impute : :class:`FieldName`, str The data field for which the missing values should be imputed. - key : :class:`FieldName` + key : :class:`FieldName`, str A key field that uniquely identifies data objects within a group. Missing key values (those occurring in the data but not in the current group) will be imputed. - frame : List(anyOf(None, float)) + frame : Sequence[None, float] A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded @@ -20629,10 +52902,10 @@ class ImputeTransform(Transform): **Default value:** : ``[null, null]`` indicating that the window includes all objects. - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] An optional array of fields by which to group the values. Imputation will then be performed on a per-group basis. - keyvals : anyOf(List(Any), :class:`ImputeSequence`) + keyvals : :class:`ImputeSequence`, Dict[required=[stop]], Sequence[Any] Defines the key values that should be considered for imputation. An array of key values or an object defining a `number sequence <https://vega.github.io/vega-lite/docs/impute.html#sequence-def>`__. @@ -20643,7 +52916,7 @@ class ImputeTransform(Transform): the y-field is imputed, or vice versa. If there is no impute grouping, this property *must* be specified. - method : :class:`ImputeMethod` + method : :class:`ImputeMethod`, Literal['value', 'median', 'max', 'min', 'mean'] The imputation method to use for the field value of imputed data objects. One of ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. @@ -20651,82 +52924,123 @@ class ImputeTransform(Transform): value : Any The field value to use when the imputation ``method`` is ``"value"``. """ - _schema = {'$ref': '#/definitions/ImputeTransform'} - def __init__(self, impute=Undefined, key=Undefined, frame=Undefined, groupby=Undefined, - keyvals=Undefined, method=Undefined, value=Undefined, **kwds): - super(ImputeTransform, self).__init__(impute=impute, key=key, frame=frame, groupby=groupby, - keyvals=keyvals, method=method, value=value, **kwds) + _schema = {"$ref": "#/definitions/ImputeTransform"} + + def __init__( + self, + impute: Union[Union["FieldName", str], UndefinedType] = Undefined, + key: Union[Union["FieldName", str], UndefinedType] = Undefined, + frame: Union[Sequence[Union[None, float]], UndefinedType] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + keyvals: Union[ + Union[Sequence[Any], Union["ImputeSequence", dict]], UndefinedType + ] = Undefined, + method: Union[ + Union["ImputeMethod", Literal["value", "median", "max", "min", "mean"]], + UndefinedType, + ] = Undefined, + value: Union[Any, UndefinedType] = Undefined, + **kwds, + ): + super(ImputeTransform, self).__init__( + impute=impute, + key=key, + frame=frame, + groupby=groupby, + keyvals=keyvals, + method=method, + value=value, + **kwds, + ) class JoinAggregateTransform(Transform): """JoinAggregateTransform schema wrapper - Mapping(required=[joinaggregate]) + :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]] Parameters ---------- - joinaggregate : List(:class:`JoinAggregateFieldDef`) + joinaggregate : Sequence[:class:`JoinAggregateFieldDef`, Dict[required=[op, as]]] The definition of the fields in the join aggregate, and what calculations to use. - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields for partitioning the data objects into separate groups. If unspecified, all data points will be in a single group. """ - _schema = {'$ref': '#/definitions/JoinAggregateTransform'} - def __init__(self, joinaggregate=Undefined, groupby=Undefined, **kwds): - super(JoinAggregateTransform, self).__init__(joinaggregate=joinaggregate, groupby=groupby, - **kwds) + _schema = {"$ref": "#/definitions/JoinAggregateTransform"} + + def __init__( + self, + joinaggregate: Union[ + Sequence[Union["JoinAggregateFieldDef", dict]], UndefinedType + ] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + **kwds, + ): + super(JoinAggregateTransform, self).__init__( + joinaggregate=joinaggregate, groupby=groupby, **kwds + ) class LoessTransform(Transform): """LoessTransform schema wrapper - Mapping(required=[loess, on]) + :class:`LoessTransform`, Dict[required=[loess, on]] Parameters ---------- - loess : :class:`FieldName` + loess : :class:`FieldName`, str The data field of the dependent variable to smooth. - on : :class:`FieldName` + on : :class:`FieldName`, str The data field of the independent variable to use a predictor. bandwidth : float A bandwidth parameter in the range ``[0, 1]`` that determines the amount of smoothing. **Default value:** ``0.3`` - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields to group by. If not specified, a single group containing all data objects will be used. - as : List(:class:`FieldName`) + as : Sequence[:class:`FieldName`, str] The output field names for the smoothed points generated by the loess transform. **Default value:** The field names of the input x and y values. """ - _schema = {'$ref': '#/definitions/LoessTransform'} - def __init__(self, loess=Undefined, on=Undefined, bandwidth=Undefined, groupby=Undefined, **kwds): - super(LoessTransform, self).__init__(loess=loess, on=on, bandwidth=bandwidth, groupby=groupby, - **kwds) + _schema = {"$ref": "#/definitions/LoessTransform"} + + def __init__( + self, + loess: Union[Union["FieldName", str], UndefinedType] = Undefined, + on: Union[Union["FieldName", str], UndefinedType] = Undefined, + bandwidth: Union[float, UndefinedType] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + **kwds, + ): + super(LoessTransform, self).__init__( + loess=loess, on=on, bandwidth=bandwidth, groupby=groupby, **kwds + ) class LookupTransform(Transform): """LookupTransform schema wrapper - Mapping(required=[lookup, from]) + :class:`LookupTransform`, Dict[required=[lookup, from]] Parameters ---------- - lookup : string + lookup : str Key in primary data source. default : Any The default value to use if lookup fails. **Default value:** ``null`` - as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + as : :class:`FieldName`, str, Sequence[:class:`FieldName`, str] The output fields on which to store the looked up data values. For data lookups, this property may be left blank if ``from.fields`` has been @@ -20736,99 +53050,153 @@ class LookupTransform(Transform): For selection lookups, this property is optional: if unspecified, looked up values will be stored under a property named for the selection; and if specified, it must correspond to ``from.fields``. - from : anyOf(:class:`LookupData`, :class:`LookupSelection`) + from : :class:`LookupData`, Dict[required=[data, key]], :class:`LookupSelection`, Dict[required=[key, param]] Data source or selection for secondary data reference. """ - _schema = {'$ref': '#/definitions/LookupTransform'} - def __init__(self, lookup=Undefined, default=Undefined, **kwds): + _schema = {"$ref": "#/definitions/LookupTransform"} + + def __init__( + self, + lookup: Union[str, UndefinedType] = Undefined, + default: Union[Any, UndefinedType] = Undefined, + **kwds, + ): super(LookupTransform, self).__init__(lookup=lookup, default=default, **kwds) class PivotTransform(Transform): """PivotTransform schema wrapper - Mapping(required=[pivot, value]) + :class:`PivotTransform`, Dict[required=[pivot, value]] Parameters ---------- - pivot : :class:`FieldName` + pivot : :class:`FieldName`, str The data field to pivot on. The unique values of this field become new field names in the output stream. - value : :class:`FieldName` + value : :class:`FieldName`, str The data field to populate pivoted fields. The aggregate values of this field become the values of the new pivoted fields. - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The optional data fields to group by. If not specified, a single group containing all data objects will be used. limit : float An optional parameter indicating the maximum number of pivoted fields to generate. The default ( ``0`` ) applies no limit. The pivoted ``pivot`` names are sorted in ascending order prior to enforcing the limit. **Default value:** ``0`` - op : :class:`AggregateOp` + op : :class:`AggregateOp`, Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] The aggregation operation to apply to grouped ``value`` field values. **Default value:** ``sum`` """ - _schema = {'$ref': '#/definitions/PivotTransform'} - def __init__(self, pivot=Undefined, value=Undefined, groupby=Undefined, limit=Undefined, - op=Undefined, **kwds): - super(PivotTransform, self).__init__(pivot=pivot, value=value, groupby=groupby, limit=limit, - op=op, **kwds) + _schema = {"$ref": "#/definitions/PivotTransform"} + + def __init__( + self, + pivot: Union[Union["FieldName", str], UndefinedType] = Undefined, + value: Union[Union["FieldName", str], UndefinedType] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + limit: Union[float, UndefinedType] = Undefined, + op: Union[ + Union[ + "AggregateOp", + Literal[ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(PivotTransform, self).__init__( + pivot=pivot, value=value, groupby=groupby, limit=limit, op=op, **kwds + ) class QuantileTransform(Transform): """QuantileTransform schema wrapper - Mapping(required=[quantile]) + :class:`QuantileTransform`, Dict[required=[quantile]] Parameters ---------- - quantile : :class:`FieldName` + quantile : :class:`FieldName`, str The data field for which to perform quantile estimation. - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields to group by. If not specified, a single group containing all data objects will be used. - probs : List(float) + probs : Sequence[float] An array of probabilities in the range (0, 1) for which to compute quantile values. If not specified, the *step* parameter will be used. step : float A probability step size (default 0.01) for sampling quantile values. All values from one-half the step size up to 1 (exclusive) will be sampled. This parameter is only used if the *probs* parameter is not provided. - as : List(:class:`FieldName`) + as : Sequence[:class:`FieldName`, str] The output field names for the probability and quantile values. **Default value:** ``["prob", "value"]`` """ - _schema = {'$ref': '#/definitions/QuantileTransform'} - def __init__(self, quantile=Undefined, groupby=Undefined, probs=Undefined, step=Undefined, **kwds): - super(QuantileTransform, self).__init__(quantile=quantile, groupby=groupby, probs=probs, - step=step, **kwds) + _schema = {"$ref": "#/definitions/QuantileTransform"} + + def __init__( + self, + quantile: Union[Union["FieldName", str], UndefinedType] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + probs: Union[Sequence[float], UndefinedType] = Undefined, + step: Union[float, UndefinedType] = Undefined, + **kwds, + ): + super(QuantileTransform, self).__init__( + quantile=quantile, groupby=groupby, probs=probs, step=step, **kwds + ) class RegressionTransform(Transform): """RegressionTransform schema wrapper - Mapping(required=[regression, on]) + :class:`RegressionTransform`, Dict[required=[regression, on]] Parameters ---------- - on : :class:`FieldName` + on : :class:`FieldName`, str The data field of the independent variable to use a predictor. - regression : :class:`FieldName` + regression : :class:`FieldName`, str The data field of the dependent variable to predict. - extent : List(float) + extent : Sequence[float] A [min, max] domain over the independent (x) field for the starting and ending points of the generated trend line. - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields to group by. If not specified, a single group containing all data objects will be used. - method : enum('linear', 'log', 'exp', 'pow', 'quad', 'poly') + method : Literal['linear', 'log', 'exp', 'pow', 'quad', 'poly'] The functional form of the regression model. One of ``"linear"``, ``"log"``, ``"exp"``, ``"pow"``, ``"quad"``, or ``"poly"``. @@ -20837,7 +53205,7 @@ class RegressionTransform(Transform): The polynomial order (number of coefficients) for the 'poly' method. **Default value:** ``3`` - params : boolean + params : bool A boolean flag indicating if the transform should return the regression model parameters (one object per group), rather than trend line points. The resulting objects include a ``coef`` array of fitted coefficient values (starting with the @@ -20845,25 +53213,44 @@ class RegressionTransform(Transform): value (indicating the total variance explained by the model). **Default value:** ``false`` - as : List(:class:`FieldName`) + as : Sequence[:class:`FieldName`, str] The output field names for the smoothed points generated by the regression transform. **Default value:** The field names of the input x and y values. """ - _schema = {'$ref': '#/definitions/RegressionTransform'} - def __init__(self, on=Undefined, regression=Undefined, extent=Undefined, groupby=Undefined, - method=Undefined, order=Undefined, params=Undefined, **kwds): - super(RegressionTransform, self).__init__(on=on, regression=regression, extent=extent, - groupby=groupby, method=method, order=order, - params=params, **kwds) + _schema = {"$ref": "#/definitions/RegressionTransform"} + + def __init__( + self, + on: Union[Union["FieldName", str], UndefinedType] = Undefined, + regression: Union[Union["FieldName", str], UndefinedType] = Undefined, + extent: Union[Sequence[float], UndefinedType] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + method: Union[ + Literal["linear", "log", "exp", "pow", "quad", "poly"], UndefinedType + ] = Undefined, + order: Union[float, UndefinedType] = Undefined, + params: Union[bool, UndefinedType] = Undefined, + **kwds, + ): + super(RegressionTransform, self).__init__( + on=on, + regression=regression, + extent=extent, + groupby=groupby, + method=method, + order=order, + params=params, + **kwds, + ) class SampleTransform(Transform): """SampleTransform schema wrapper - Mapping(required=[sample]) + :class:`SampleTransform`, Dict[required=[sample]] Parameters ---------- @@ -20873,74 +53260,207 @@ class SampleTransform(Transform): **Default value:** ``1000`` """ - _schema = {'$ref': '#/definitions/SampleTransform'} - def __init__(self, sample=Undefined, **kwds): + _schema = {"$ref": "#/definitions/SampleTransform"} + + def __init__(self, sample: Union[float, UndefinedType] = Undefined, **kwds): super(SampleTransform, self).__init__(sample=sample, **kwds) class StackTransform(Transform): """StackTransform schema wrapper - Mapping(required=[stack, groupby, as]) + :class:`StackTransform`, Dict[required=[stack, groupby, as]] Parameters ---------- - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields to group by. - stack : :class:`FieldName` + stack : :class:`FieldName`, str The field which is stacked. - offset : enum('zero', 'center', 'normalize') + offset : Literal['zero', 'center', 'normalize'] Mode for stacking marks. One of ``"zero"`` (default), ``"center"``, or ``"normalize"``. The ``"zero"`` offset will stack starting at ``0``. The ``"center"`` offset will center the stacks. The ``"normalize"`` offset will compute percentage values for each stack point, with output values in the range ``[0,1]``. **Default value:** ``"zero"`` - sort : List(:class:`SortField`) + sort : Sequence[:class:`SortField`, Dict[required=[field]]] Field that determines the order of leaves in the stacked charts. - as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + as : :class:`FieldName`, str, Sequence[:class:`FieldName`, str] Output field names. This can be either a string or an array of strings with two elements denoting the name for the fields for stack start and stack end respectively. If a single string(e.g., ``"val"`` ) is provided, the end field will be ``"val_end"``. """ - _schema = {'$ref': '#/definitions/StackTransform'} - def __init__(self, groupby=Undefined, stack=Undefined, offset=Undefined, sort=Undefined, **kwds): - super(StackTransform, self).__init__(groupby=groupby, stack=stack, offset=offset, sort=sort, - **kwds) + _schema = {"$ref": "#/definitions/StackTransform"} + + def __init__( + self, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + stack: Union[Union["FieldName", str], UndefinedType] = Undefined, + offset: Union[ + Literal["zero", "center", "normalize"], UndefinedType + ] = Undefined, + sort: Union[Sequence[Union["SortField", dict]], UndefinedType] = Undefined, + **kwds, + ): + super(StackTransform, self).__init__( + groupby=groupby, stack=stack, offset=offset, sort=sort, **kwds + ) class TimeUnitTransform(Transform): """TimeUnitTransform schema wrapper - Mapping(required=[timeUnit, field, as]) + :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]] Parameters ---------- - field : :class:`FieldName` + field : :class:`FieldName`, str The data field to apply time unit. - timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitTransformParams`) + timeUnit : :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitTransformParams`, Dict The timeUnit. - as : :class:`FieldName` + as : :class:`FieldName`, str The output field to write the timeUnit value. """ - _schema = {'$ref': '#/definitions/TimeUnitTransform'} - def __init__(self, field=Undefined, timeUnit=Undefined, **kwds): + _schema = {"$ref": "#/definitions/TimeUnitTransform"} + + def __init__( + self, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitTransformParams", dict], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): super(TimeUnitTransform, self).__init__(field=field, timeUnit=timeUnit, **kwds) class Type(VegaLiteSchema): """Type schema wrapper - enum('quantitative', 'ordinal', 'temporal', 'nominal', 'geojson') + :class:`Type`, Literal['quantitative', 'ordinal', 'temporal', 'nominal', 'geojson'] Data type based on level of measurement """ - _schema = {'$ref': '#/definitions/Type'} + + _schema = {"$ref": "#/definitions/Type"} def __init__(self, *args): super(Type, self).__init__(*args) @@ -20949,9 +53469,10 @@ def __init__(self, *args): class TypeForShape(VegaLiteSchema): """TypeForShape schema wrapper - enum('nominal', 'ordinal', 'geojson') + :class:`TypeForShape`, Literal['nominal', 'ordinal', 'geojson'] """ - _schema = {'$ref': '#/definitions/TypeForShape'} + + _schema = {"$ref": "#/definitions/TypeForShape"} def __init__(self, *args): super(TypeForShape, self).__init__(*args) @@ -20960,13 +53481,13 @@ def __init__(self, *args): class TypedFieldDef(VegaLiteSchema): """TypedFieldDef schema wrapper - Mapping(required=[]) + :class:`TypedFieldDef`, Dict Definition object for a data field, its type and transformation of an encoding channel. Parameters ---------- - aggregate : :class:`Aggregate` + aggregate : :class:`Aggregate`, :class:`ArgmaxDef`, Dict[required=[argmax]], :class:`ArgminDef`, Dict[required=[argmin]], :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'] Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). @@ -20978,7 +53499,7 @@ class TypedFieldDef(VegaLiteSchema): Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to ``0``, and at the middle of the band if set to ``0.5``. - bin : anyOf(boolean, :class:`BinParams`, string, None) + bin : :class:`BinParams`, Dict, None, bool, str A flag for binning a ``quantitative`` field, `an object defining binning parameters <https://vega.github.io/vega-lite/docs/bin.html#bin-parameters>`__, or indicating that the data for ``x`` or ``y`` channel are binned before they are imported into @@ -20999,7 +53520,7 @@ class TypedFieldDef(VegaLiteSchema): **See also:** `bin <https://vega.github.io/vega-lite/docs/bin.html>`__ documentation. - field : :class:`Field` + field : :class:`FieldName`, str, :class:`Field`, :class:`RepeatRef`, Dict[required=[repeat]] **Required.** A string defining the name of the field from which to pull a data value or an object defining iterated values from the `repeat <https://vega.github.io/vega-lite/docs/repeat.html>`__ operator. @@ -21014,7 +53535,7 @@ class TypedFieldDef(VegaLiteSchema): about escaping in the `field documentation <https://vega.github.io/vega-lite/docs/field.html>`__. 2) ``field`` is not required if ``aggregate`` is ``count``. - timeUnit : anyOf(:class:`TimeUnit`, :class:`BinnedTimeUnit`, :class:`TimeUnitParams`) + timeUnit : :class:`BinnedTimeUnit`, Literal['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'], Literal['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'], :class:`LocalMultiTimeUnit`, Literal['yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'], :class:`MultiTimeUnit`, :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'], :class:`LocalSingleTimeUnit`, Literal['year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds'], :class:`SingleTimeUnit`, :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'], :class:`TimeUnit`, :class:`TimeUnitParams`, Dict Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal field. or `a temporal field that gets casted as ordinal <https://vega.github.io/vega-lite/docs/type.html#cast>`__. @@ -21023,7 +53544,7 @@ class TypedFieldDef(VegaLiteSchema): **See also:** `timeUnit <https://vega.github.io/vega-lite/docs/timeunit.html>`__ documentation. - title : anyOf(:class:`Text`, None) + title : :class:`Text`, Sequence[str], str, None A title for the field. If ``null``, the title will be removed. **Default value:** derived from the field's name and transformation function ( @@ -21043,7 +53564,7 @@ class TypedFieldDef(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : :class:`StandardType` + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] The type of measurement ( ``"quantitative"``, ``"temporal"``, ``"ordinal"``, or ``"nominal"`` ) for the encoded field or constant value ( ``datum`` ). It can also be a ``"geojson"`` type for encoding `'geoshape' @@ -21113,21 +53634,234 @@ class TypedFieldDef(VegaLiteSchema): **See also:** `type <https://vega.github.io/vega-lite/docs/type.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/TypedFieldDef'} - def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(TypedFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, - field=field, timeUnit=timeUnit, title=title, type=type, - **kwds) + _schema = {"$ref": "#/definitions/TypedFieldDef"} + + def __init__( + self, + aggregate: Union[ + Union[ + "Aggregate", + Union["ArgmaxDef", dict], + Union["ArgminDef", dict], + Union[ + "NonArgAggregateOp", + Literal[ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + ], + UndefinedType, + ] = Undefined, + bandPosition: Union[float, UndefinedType] = Undefined, + bin: Union[ + Union[None, Union["BinParams", dict], bool, str], UndefinedType + ] = Undefined, + field: Union[ + Union["Field", Union["FieldName", str], Union["RepeatRef", dict]], + UndefinedType, + ] = Undefined, + timeUnit: Union[ + Union[ + Union[ + "BinnedTimeUnit", + Literal[ + "binnedutcyear", + "binnedutcyearquarter", + "binnedutcyearquartermonth", + "binnedutcyearmonth", + "binnedutcyearmonthdate", + "binnedutcyearmonthdatehours", + "binnedutcyearmonthdatehoursminutes", + "binnedutcyearmonthdatehoursminutesseconds", + "binnedutcyearweek", + "binnedutcyearweekday", + "binnedutcyearweekdayhours", + "binnedutcyearweekdayhoursminutes", + "binnedutcyearweekdayhoursminutesseconds", + "binnedutcyeardayofyear", + ], + Literal[ + "binnedyear", + "binnedyearquarter", + "binnedyearquartermonth", + "binnedyearmonth", + "binnedyearmonthdate", + "binnedyearmonthdatehours", + "binnedyearmonthdatehoursminutes", + "binnedyearmonthdatehoursminutesseconds", + "binnedyearweek", + "binnedyearweekday", + "binnedyearweekdayhours", + "binnedyearweekdayhoursminutes", + "binnedyearweekdayhoursminutesseconds", + "binnedyeardayofyear", + ], + ], + Union[ + "TimeUnit", + Union[ + "MultiTimeUnit", + Union[ + "LocalMultiTimeUnit", + Literal[ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + ], + ], + Union[ + "UtcMultiTimeUnit", + Literal[ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", + ], + ], + ], + Union[ + "SingleTimeUnit", + Union[ + "LocalSingleTimeUnit", + Literal[ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + ], + ], + Union[ + "UtcSingleTimeUnit", + Literal[ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + ], + ], + ], + ], + Union["TimeUnitParams", dict], + ], + UndefinedType, + ] = Undefined, + title: Union[ + Union[None, Union["Text", Sequence[str], str]], UndefinedType + ] = Undefined, + type: Union[ + Union[ + "StandardType", + Literal["quantitative", "ordinal", "temporal", "nominal"], + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(TypedFieldDef, self).__init__( + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) class URI(VegaLiteSchema): """URI schema wrapper - string + :class:`URI`, str """ - _schema = {'$ref': '#/definitions/URI'} + + _schema = {"$ref": "#/definitions/URI"} def __init__(self, *args): super(URI, self).__init__(*args) @@ -21136,69 +53870,177 @@ def __init__(self, *args): class UnitSpec(VegaLiteSchema): """UnitSpec schema wrapper - Mapping(required=[mark]) + :class:`UnitSpec`, Dict[required=[mark]] Base interface for a unit (single-view) specification. Parameters ---------- - mark : :class:`AnyMark` + mark : :class:`AnyMark`, :class:`BoxPlotDef`, Dict[required=[type]], :class:`CompositeMarkDef`, :class:`ErrorBandDef`, Dict[required=[type]], :class:`ErrorBarDef`, Dict[required=[type]], :class:`BoxPlot`, str, :class:`CompositeMark`, :class:`ErrorBand`, str, :class:`ErrorBar`, str, :class:`MarkDef`, Dict[required=[type]], :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark definition object <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - encoding : :class:`Encoding` + encoding : :class:`Encoding`, Dict A key-value mapping between encoding channels and definition of fields. - name : string + name : str Name of the visualization for later reference. - params : List(:class:`SelectionParameter`) + params : Sequence[:class:`SelectionParameter`, Dict[required=[name, select]]] An array of parameters that may either be simple variables, or more complex selections that map user input to data queries. - projection : :class:`Projection` + projection : :class:`Projection`, Dict An object defining properties of geographic projection, which will be applied to ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` channels for other marks. - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/UnitSpec'} - def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, - name=Undefined, params=Undefined, projection=Undefined, title=Undefined, - transform=Undefined, **kwds): - super(UnitSpec, self).__init__(mark=mark, data=data, description=description, encoding=encoding, - name=name, params=params, projection=projection, title=title, - transform=transform, **kwds) + _schema = {"$ref": "#/definitions/UnitSpec"} + + def __init__( + self, + mark: Union[ + Union[ + "AnyMark", + Union[ + "CompositeMark", + Union["BoxPlot", str], + Union["ErrorBand", str], + Union["ErrorBar", str], + ], + Union[ + "CompositeMarkDef", + Union["BoxPlotDef", dict], + Union["ErrorBandDef", dict], + Union["ErrorBarDef", dict], + ], + Union[ + "Mark", + Literal[ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape", + ], + ], + Union["MarkDef", dict], + ], + UndefinedType, + ] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + encoding: Union[Union["Encoding", dict], UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + params: Union[ + Sequence[Union["SelectionParameter", dict]], UndefinedType + ] = Undefined, + projection: Union[Union["Projection", dict], UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(UnitSpec, self).__init__( + mark=mark, + data=data, + description=description, + encoding=encoding, + name=name, + params=params, + projection=projection, + title=title, + transform=transform, + **kwds, + ) class UnitSpecWithFrame(VegaLiteSchema): """UnitSpecWithFrame schema wrapper - Mapping(required=[mark]) + :class:`UnitSpecWithFrame`, Dict[required=[mark]] Parameters ---------- - mark : :class:`AnyMark` + mark : :class:`AnyMark`, :class:`BoxPlotDef`, Dict[required=[type]], :class:`CompositeMarkDef`, :class:`ErrorBandDef`, Dict[required=[type]], :class:`ErrorBarDef`, Dict[required=[type]], :class:`BoxPlot`, str, :class:`CompositeMark`, :class:`ErrorBand`, str, :class:`ErrorBar`, str, :class:`MarkDef`, Dict[required=[type]], :class:`Mark`, Literal['arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', 'trail', 'circle', 'square', 'geoshape'] A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark definition object <https://vega.github.io/vega-lite/docs/mark.html#mark-def>`__. - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - encoding : :class:`Encoding` + encoding : :class:`Encoding`, Dict A key-value mapping between encoding channels and definition of fields. - height : anyOf(float, string, :class:`Step`) + height : :class:`Step`, Dict[required=[step]], float, str The height of a visualization. @@ -21218,24 +54060,24 @@ class UnitSpecWithFrame(VegaLiteSchema): **See also:** `height <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. - name : string + name : str Name of the visualization for later reference. - params : List(:class:`SelectionParameter`) + params : Sequence[:class:`SelectionParameter`, Dict[required=[name, select]]] An array of parameters that may either be simple variables, or more complex selections that map user input to data queries. - projection : :class:`Projection` + projection : :class:`Projection`, Dict An object defining properties of geographic projection, which will be applied to ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` channels for other marks. - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. - view : :class:`ViewBackground` + view : :class:`ViewBackground`, Dict An object defining the view background's fill and stroke. **Default value:** none (transparent) - width : anyOf(float, string, :class:`Step`) + width : :class:`Step`, Dict[required=[step]], float, str The width of a visualization. @@ -21256,53 +54098,185 @@ class UnitSpecWithFrame(VegaLiteSchema): **See also:** `width <https://vega.github.io/vega-lite/docs/size.html>`__ documentation. """ - _schema = {'$ref': '#/definitions/UnitSpecWithFrame'} - def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, - height=Undefined, name=Undefined, params=Undefined, projection=Undefined, - title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): - super(UnitSpecWithFrame, self).__init__(mark=mark, data=data, description=description, - encoding=encoding, height=height, name=name, - params=params, projection=projection, title=title, - transform=transform, view=view, width=width, **kwds) + _schema = {"$ref": "#/definitions/UnitSpecWithFrame"} + + def __init__( + self, + mark: Union[ + Union[ + "AnyMark", + Union[ + "CompositeMark", + Union["BoxPlot", str], + Union["ErrorBand", str], + Union["ErrorBar", str], + ], + Union[ + "CompositeMarkDef", + Union["BoxPlotDef", dict], + Union["ErrorBandDef", dict], + Union["ErrorBarDef", dict], + ], + Union[ + "Mark", + Literal[ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape", + ], + ], + Union["MarkDef", dict], + ], + UndefinedType, + ] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + encoding: Union[Union["Encoding", dict], UndefinedType] = Undefined, + height: Union[ + Union[Union["Step", dict], float, str], UndefinedType + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + params: Union[ + Sequence[Union["SelectionParameter", dict]], UndefinedType + ] = Undefined, + projection: Union[Union["Projection", dict], UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + view: Union[Union["ViewBackground", dict], UndefinedType] = Undefined, + width: Union[Union[Union["Step", dict], float, str], UndefinedType] = Undefined, + **kwds, + ): + super(UnitSpecWithFrame, self).__init__( + mark=mark, + data=data, + description=description, + encoding=encoding, + height=height, + name=name, + params=params, + projection=projection, + title=title, + transform=transform, + view=view, + width=width, + **kwds, + ) class UrlData(DataSource): """UrlData schema wrapper - Mapping(required=[url]) + :class:`UrlData`, Dict[required=[url]] Parameters ---------- - url : string + url : str An URL from which to load the data set. Use the ``format.type`` property to ensure the loaded data is correctly parsed. - format : :class:`DataFormat` + format : :class:`CsvDataFormat`, Dict, :class:`DataFormat`, :class:`DsvDataFormat`, Dict[required=[delimiter]], :class:`JsonDataFormat`, Dict, :class:`TopoDataFormat`, Dict An object that specifies the format for parsing the data. - name : string + name : str Provide a placeholder name and bind data at runtime. """ - _schema = {'$ref': '#/definitions/UrlData'} - def __init__(self, url=Undefined, format=Undefined, name=Undefined, **kwds): + _schema = {"$ref": "#/definitions/UrlData"} + + def __init__( + self, + url: Union[str, UndefinedType] = Undefined, + format: Union[ + Union[ + "DataFormat", + Union["CsvDataFormat", dict], + Union["DsvDataFormat", dict], + Union["JsonDataFormat", dict], + Union["TopoDataFormat", dict], + ], + UndefinedType, + ] = Undefined, + name: Union[str, UndefinedType] = Undefined, + **kwds, + ): super(UrlData, self).__init__(url=url, format=format, name=name, **kwds) class UtcMultiTimeUnit(MultiTimeUnit): """UtcMultiTimeUnit schema wrapper - enum('utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', - 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', + :class:`UtcMultiTimeUnit`, Literal['utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', + 'utcyearmonthdate', 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', - 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds') + 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds'] """ - _schema = {'$ref': '#/definitions/UtcMultiTimeUnit'} + + _schema = {"$ref": "#/definitions/UtcMultiTimeUnit"} def __init__(self, *args): super(UtcMultiTimeUnit, self).__init__(*args) @@ -21311,10 +54285,12 @@ def __init__(self, *args): class UtcSingleTimeUnit(SingleTimeUnit): """UtcSingleTimeUnit schema wrapper - enum('utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', - 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds') + :class:`UtcSingleTimeUnit`, Literal['utcyear', 'utcquarter', 'utcmonth', 'utcweek', + 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', + 'utcmilliseconds'] """ - _schema = {'$ref': '#/definitions/UtcSingleTimeUnit'} + + _schema = {"$ref": "#/definitions/UtcSingleTimeUnit"} def __init__(self, *args): super(UtcSingleTimeUnit, self).__init__(*args) @@ -21323,15 +54299,15 @@ def __init__(self, *args): class VConcatSpecGenericSpec(Spec, NonNormalizedSpec): """VConcatSpecGenericSpec schema wrapper - Mapping(required=[vconcat]) + :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]] Base interface for a vertical concatenation specification. Parameters ---------- - vconcat : List(:class:`Spec`) + vconcat : Sequence[:class:`ConcatSpecGenericSpec`, Dict[required=[concat]], :class:`FacetSpec`, Dict[required=[facet, spec]], :class:`FacetedUnitSpec`, Dict[required=[mark]], :class:`HConcatSpecGenericSpec`, Dict[required=[hconcat]], :class:`LayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`NonLayerRepeatSpec`, Dict[required=[repeat, spec]], :class:`RepeatSpec`, :class:`LayerSpec`, Dict[required=[layer]], :class:`Spec`, :class:`VConcatSpecGenericSpec`, Dict[required=[vconcat]]] A list of views to be concatenated and put into a column. - bounds : enum('full', 'flush') + bounds : Literal['full', 'flush'] The bounds calculation method to use for determining the extent of a sub-plot. One of ``full`` (the default) or ``flush``. @@ -21343,179 +54319,489 @@ class VConcatSpecGenericSpec(Spec, NonNormalizedSpec): sub-plots without axes or legends into a uniform grid structure. **Default value:** ``"full"`` - center : boolean + center : bool Boolean flag indicating if subviews should be centered relative to their respective rows or columns. **Default value:** ``false`` - data : anyOf(:class:`Data`, None) + data : :class:`DataSource`, :class:`InlineData`, Dict[required=[values]], :class:`NamedData`, Dict[required=[name]], :class:`UrlData`, Dict[required=[url]], :class:`Data`, :class:`Generator`, :class:`GraticuleGenerator`, Dict[required=[graticule]], :class:`SequenceGenerator`, Dict[required=[sequence]], :class:`SphereGenerator`, Dict[required=[sphere]], None An object describing the data source. Set to ``null`` to ignore the parent's data source. If no data is set, it is derived from the parent. - description : string + description : str Description of this mark for commenting purpose. - name : string + name : str Name of the visualization for later reference. - resolve : :class:`Resolve` + resolve : :class:`Resolve`, Dict Scale, axis, and legend resolutions for view composition specifications. spacing : float The spacing in pixels between sub-views of the concat operator. **Default value** : ``10`` - title : anyOf(:class:`Text`, :class:`TitleParams`) + title : :class:`Text`, Sequence[str], str, :class:`TitleParams`, Dict[required=[text]] Title for the plot. - transform : List(:class:`Transform`) + transform : Sequence[:class:`AggregateTransform`, Dict[required=[aggregate]], :class:`BinTransform`, Dict[required=[bin, field, as]], :class:`CalculateTransform`, Dict[required=[calculate, as]], :class:`DensityTransform`, Dict[required=[density]], :class:`ExtentTransform`, Dict[required=[extent, param]], :class:`FilterTransform`, Dict[required=[filter]], :class:`FlattenTransform`, Dict[required=[flatten]], :class:`FoldTransform`, Dict[required=[fold]], :class:`ImputeTransform`, Dict[required=[impute, key]], :class:`JoinAggregateTransform`, Dict[required=[joinaggregate]], :class:`LoessTransform`, Dict[required=[loess, on]], :class:`LookupTransform`, Dict[required=[lookup, from]], :class:`PivotTransform`, Dict[required=[pivot, value]], :class:`QuantileTransform`, Dict[required=[quantile]], :class:`RegressionTransform`, Dict[required=[regression, on]], :class:`SampleTransform`, Dict[required=[sample]], :class:`StackTransform`, Dict[required=[stack, groupby, as]], :class:`TimeUnitTransform`, Dict[required=[timeUnit, field, as]], :class:`Transform`, :class:`WindowTransform`, Dict[required=[window]]] An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/VConcatSpec<GenericSpec>'} - - def __init__(self, vconcat=Undefined, bounds=Undefined, center=Undefined, data=Undefined, - description=Undefined, name=Undefined, resolve=Undefined, spacing=Undefined, - title=Undefined, transform=Undefined, **kwds): - super(VConcatSpecGenericSpec, self).__init__(vconcat=vconcat, bounds=bounds, center=center, - data=data, description=description, name=name, - resolve=resolve, spacing=spacing, title=title, - transform=transform, **kwds) - -class ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + _schema = {"$ref": "#/definitions/VConcatSpec<GenericSpec>"} + + def __init__( + self, + vconcat: Union[ + Sequence[ + Union[ + "Spec", + Union["ConcatSpecGenericSpec", dict], + Union["FacetSpec", dict], + Union["FacetedUnitSpec", dict], + Union["HConcatSpecGenericSpec", dict], + Union["LayerSpec", dict], + Union[ + "RepeatSpec", + Union["LayerRepeatSpec", dict], + Union["NonLayerRepeatSpec", dict], + ], + Union["VConcatSpecGenericSpec", dict], + ] + ], + UndefinedType, + ] = Undefined, + bounds: Union[Literal["full", "flush"], UndefinedType] = Undefined, + center: Union[bool, UndefinedType] = Undefined, + data: Union[ + Union[ + None, + Union[ + "Data", + Union[ + "DataSource", + Union["InlineData", dict], + Union["NamedData", dict], + Union["UrlData", dict], + ], + Union[ + "Generator", + Union["GraticuleGenerator", dict], + Union["SequenceGenerator", dict], + Union["SphereGenerator", dict], + ], + ], + ], + UndefinedType, + ] = Undefined, + description: Union[str, UndefinedType] = Undefined, + name: Union[str, UndefinedType] = Undefined, + resolve: Union[Union["Resolve", dict], UndefinedType] = Undefined, + spacing: Union[float, UndefinedType] = Undefined, + title: Union[ + Union[Union["Text", Sequence[str], str], Union["TitleParams", dict]], + UndefinedType, + ] = Undefined, + transform: Union[ + Sequence[ + Union[ + "Transform", + Union["AggregateTransform", dict], + Union["BinTransform", dict], + Union["CalculateTransform", dict], + Union["DensityTransform", dict], + Union["ExtentTransform", dict], + Union["FilterTransform", dict], + Union["FlattenTransform", dict], + Union["FoldTransform", dict], + Union["ImputeTransform", dict], + Union["JoinAggregateTransform", dict], + Union["LoessTransform", dict], + Union["LookupTransform", dict], + Union["PivotTransform", dict], + Union["QuantileTransform", dict], + Union["RegressionTransform", dict], + Union["SampleTransform", dict], + Union["StackTransform", dict], + Union["TimeUnitTransform", dict], + Union["WindowTransform", dict], + ] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(VConcatSpecGenericSpec, self).__init__( + vconcat=vconcat, + bounds=bounds, + center=center, + data=data, + description=description, + name=name, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + **kwds, + ) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull( + ColorDef, MarkPropDefGradientstringnull +): """ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefGradientstringnullExprRef`, List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefGradientstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefGradientstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefGradientstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Gradient`, :class:`LinearGradient`, Dict[required=[gradient, stops]], :class:`RadialGradient`, Dict[required=[gradient, stops]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,(Gradient|string|null)>'} - - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, self).__init__(condition=condition, - value=value, - **kwds) - -class ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + _schema = { + "$ref": "#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,(Gradient|string|null)>" + } + + def __init__( + self, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefGradientstringnullExprRef", + Union[ + "ConditionalParameterValueDefGradientstringnullExprRef", + dict, + ], + Union[ + "ConditionalPredicateValueDefGradientstringnullExprRef", + dict, + ], + ] + ], + Union[ + "ConditionalMarkPropFieldOrDatumDef", + Union["ConditionalParameterMarkPropFieldOrDatumDef", dict], + Union["ConditionalPredicateMarkPropFieldOrDatumDef", dict], + ], + Union[ + "ConditionalValueDefGradientstringnullExprRef", + Union[ + "ConditionalParameterValueDefGradientstringnullExprRef", dict + ], + Union[ + "ConditionalPredicateValueDefGradientstringnullExprRef", dict + ], + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + None, + Union["ExprRef", "_Parameter", dict], + Union[ + "Gradient", + Union["LinearGradient", dict], + Union["RadialGradient", dict], + ], + str, + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super( + ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, self + ).__init__(condition=condition, value=value, **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull( + MarkPropDefstringnullTypeForShape, ShapeDef +): """ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef<TypeForShape>,(string|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull, self).__init__(condition=condition, - value=value, - **kwds) - - -class ValueDefWithConditionMarkPropFieldOrDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): + _schema = { + "$ref": "#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef<TypeForShape>,(string|null)>" + } + + def __init__( + self, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ] + ], + Union[ + "ConditionalMarkPropFieldOrDatumDefTypeForShape", + Union[ + "ConditionalParameterMarkPropFieldOrDatumDefTypeForShape", dict + ], + Union[ + "ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape", dict + ], + ], + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + **kwds, + ): + super( + ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull, self + ).__init__(condition=condition, value=value, **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefnumber( + MarkPropDefnumber, NumericMarkPropDef +): """ValueDefWithConditionMarkPropFieldOrDatumDefnumber schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(float, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,number>'} - - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldOrDatumDefnumber, self).__init__(condition=condition, - value=value, **kwds) - -class ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + _schema = { + "$ref": "#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,number>" + } + + def __init__( + self, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefnumberExprRef", + Union["ConditionalParameterValueDefnumberExprRef", dict], + Union["ConditionalPredicateValueDefnumberExprRef", dict], + ] + ], + Union[ + "ConditionalMarkPropFieldOrDatumDef", + Union["ConditionalParameterMarkPropFieldOrDatumDef", dict], + Union["ConditionalPredicateMarkPropFieldOrDatumDef", dict], + ], + Union[ + "ConditionalValueDefnumberExprRef", + Union["ConditionalParameterValueDefnumberExprRef", dict], + Union["ConditionalPredicateValueDefnumberExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(ValueDefWithConditionMarkPropFieldOrDatumDefnumber, self).__init__( + condition=condition, value=value, **kwds + ) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray( + MarkPropDefnumberArray, NumericArrayMarkPropDef +): """ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberArrayExprRef`, List(:class:`ConditionalValueDefnumberArrayExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`, Sequence[:class:`ConditionalParameterValueDefnumberArrayExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefnumberArrayExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefnumberArrayExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(List(float), :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,number[]>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray, self).__init__(condition=condition, - value=value, - **kwds) + _schema = { + "$ref": "#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,number[]>" + } + + def __init__( + self, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefnumberArrayExprRef", + Union["ConditionalParameterValueDefnumberArrayExprRef", dict], + Union["ConditionalPredicateValueDefnumberArrayExprRef", dict], + ] + ], + Union[ + "ConditionalMarkPropFieldOrDatumDef", + Union["ConditionalParameterMarkPropFieldOrDatumDef", dict], + Union["ConditionalPredicateMarkPropFieldOrDatumDef", dict], + ], + Union[ + "ConditionalValueDefnumberArrayExprRef", + Union["ConditionalParameterValueDefnumberArrayExprRef", dict], + Union["ConditionalPredicateValueDefnumberArrayExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + **kwds, + ): + super(ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray, self).__init__( + condition=condition, value=value, **kwds + ) class ValueDefWithConditionMarkPropFieldOrDatumDefstringnull(VegaLiteSchema): """ValueDefWithConditionMarkPropFieldOrDatumDefstringnull schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefstringnull`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefstringnullExprRef`, List(:class:`ConditionalValueDefstringnullExprRef`)) + condition : :class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalParameterMarkPropFieldOrDatumDef`, Dict[required=[param]], :class:`ConditionalPredicateMarkPropFieldOrDatumDef`, Dict[required=[test]], :class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`, Sequence[:class:`ConditionalParameterValueDefstringnullExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefstringnullExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefstringnullExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(string, None, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], None, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,(string|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldOrDatumDefstringnull, self).__init__(condition=condition, - value=value, **kwds) + _schema = { + "$ref": "#/definitions/ValueDefWithCondition<MarkPropFieldOrDatumDef,(string|null)>" + } + + def __init__( + self, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ] + ], + Union[ + "ConditionalMarkPropFieldOrDatumDef", + Union["ConditionalParameterMarkPropFieldOrDatumDef", dict], + Union["ConditionalPredicateMarkPropFieldOrDatumDef", dict], + ], + Union[ + "ConditionalValueDefstringnullExprRef", + Union["ConditionalParameterValueDefstringnullExprRef", dict], + Union["ConditionalPredicateValueDefstringnullExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[None, Union["ExprRef", "_Parameter", dict], str], UndefinedType + ] = Undefined, + **kwds, + ): + super(ValueDefWithConditionMarkPropFieldOrDatumDefstringnull, self).__init__( + condition=condition, value=value, **kwds + ) class ValueDefWithConditionStringFieldDefText(TextDef): """ValueDefWithConditionStringFieldDefText schema wrapper - Mapping(required=[]) + :class:`ValueDefWithConditionStringFieldDefText`, Dict Parameters ---------- - condition : anyOf(:class:`ConditionalStringFieldDef`, :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + condition : :class:`ConditionalParameterStringFieldDef`, Dict[required=[param]], :class:`ConditionalPredicateStringFieldDef`, Dict[required=[test]], :class:`ConditionalStringFieldDef`, :class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`, Sequence[:class:`ConditionalParameterValueDefTextExprRef`, Dict[required=[param, value]], :class:`ConditionalPredicateValueDefTextExprRef`, Dict[required=[test, value]], :class:`ConditionalValueDefTextExprRef`] A field definition or one or more value definition(s) with a parameter predicate. - value : anyOf(:class:`Text`, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], :class:`Text`, Sequence[str], str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDefWithCondition<StringFieldDef,Text>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionStringFieldDefText, self).__init__(condition=condition, value=value, - **kwds) + _schema = {"$ref": "#/definitions/ValueDefWithCondition<StringFieldDef,Text>"} + + def __init__( + self, + condition: Union[ + Union[ + Sequence[ + Union[ + "ConditionalValueDefTextExprRef", + Union["ConditionalParameterValueDefTextExprRef", dict], + Union["ConditionalPredicateValueDefTextExprRef", dict], + ] + ], + Union[ + "ConditionalStringFieldDef", + Union["ConditionalParameterStringFieldDef", dict], + Union["ConditionalPredicateStringFieldDef", dict], + ], + Union[ + "ConditionalValueDefTextExprRef", + Union["ConditionalParameterValueDefTextExprRef", dict], + Union["ConditionalPredicateValueDefTextExprRef", dict], + ], + ], + UndefinedType, + ] = Undefined, + value: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], Union["Text", Sequence[str], str] + ], + UndefinedType, + ] = Undefined, + **kwds, + ): + super(ValueDefWithConditionStringFieldDefText, self).__init__( + condition=condition, value=value, **kwds + ) class ValueDefnumber(OffsetDef): """ValueDefnumber schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumber`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. @@ -21527,50 +54813,58 @@ class ValueDefnumber(OffsetDef): definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDef<number>'} - def __init__(self, value=Undefined, **kwds): + _schema = {"$ref": "#/definitions/ValueDef<number>"} + + def __init__(self, value: Union[float, UndefinedType] = Undefined, **kwds): super(ValueDefnumber, self).__init__(value=value, **kwds) class ValueDefnumberwidthheightExprRef(VegaLiteSchema): """ValueDefnumberwidthheightExprRef schema wrapper - Mapping(required=[value]) + :class:`ValueDefnumberwidthheightExprRef`, Dict[required=[value]] Definition object for a constant value (primitive value or gradient definition) of an encoding channel. Parameters ---------- - value : anyOf(float, string, string, :class:`ExprRef`) + value : :class:`ExprRef`, Dict[required=[expr]], float, str A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient definition <https://vega.github.io/vega-lite/docs/types.html#gradient>`__ for color, values between ``0`` to ``1`` for opacity). """ - _schema = {'$ref': '#/definitions/ValueDef<(number|"width"|"height"|ExprRef)>'} - def __init__(self, value=Undefined, **kwds): + _schema = {"$ref": '#/definitions/ValueDef<(number|"width"|"height"|ExprRef)>'} + + def __init__( + self, + value: Union[ + Union[Union["ExprRef", "_Parameter", dict], float, str], UndefinedType + ] = Undefined, + **kwds, + ): super(ValueDefnumberwidthheightExprRef, self).__init__(value=value, **kwds) class VariableParameter(TopLevelParameter): """VariableParameter schema wrapper - Mapping(required=[name]) + :class:`VariableParameter`, Dict[required=[name]] Parameters ---------- - name : :class:`ParameterName` + name : :class:`ParameterName`, str A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are "datum", "event", "item", and "parent". - bind : :class:`Binding` + bind : :class:`BindCheckbox`, Dict[required=[input]], :class:`BindDirect`, Dict[required=[element]], :class:`BindInput`, Dict, :class:`BindRadioSelect`, Dict[required=[input, options]], :class:`BindRange`, Dict[required=[input]], :class:`Binding` Binds the parameter to an external input element such as a slider, selection list or radio button group. - expr : :class:`Expr` + expr : :class:`Expr`, str An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes. @@ -21580,18 +54874,39 @@ class VariableParameter(TopLevelParameter): **Default value:** ``undefined`` """ - _schema = {'$ref': '#/definitions/VariableParameter'} - def __init__(self, name=Undefined, bind=Undefined, expr=Undefined, value=Undefined, **kwds): - super(VariableParameter, self).__init__(name=name, bind=bind, expr=expr, value=value, **kwds) + _schema = {"$ref": "#/definitions/VariableParameter"} + + def __init__( + self, + name: Union[Union["ParameterName", str], UndefinedType] = Undefined, + bind: Union[ + Union[ + "Binding", + Union["BindCheckbox", dict], + Union["BindDirect", dict], + Union["BindInput", dict], + Union["BindRadioSelect", dict], + Union["BindRange", dict], + ], + UndefinedType, + ] = Undefined, + expr: Union[Union["Expr", str], UndefinedType] = Undefined, + value: Union[Any, UndefinedType] = Undefined, + **kwds, + ): + super(VariableParameter, self).__init__( + name=name, bind=bind, expr=expr, value=value, **kwds + ) class Vector10string(VegaLiteSchema): """Vector10string schema wrapper - List(string) + :class:`Vector10string`, Sequence[str] """ - _schema = {'$ref': '#/definitions/Vector10<string>'} + + _schema = {"$ref": "#/definitions/Vector10<string>"} def __init__(self, *args): super(Vector10string, self).__init__(*args) @@ -21600,9 +54915,10 @@ def __init__(self, *args): class Vector12string(VegaLiteSchema): """Vector12string schema wrapper - List(string) + :class:`Vector12string`, Sequence[str] """ - _schema = {'$ref': '#/definitions/Vector12<string>'} + + _schema = {"$ref": "#/definitions/Vector12<string>"} def __init__(self, *args): super(Vector12string, self).__init__(*args) @@ -21611,9 +54927,10 @@ def __init__(self, *args): class Vector2DateTime(SelectionInitInterval): """Vector2DateTime schema wrapper - List(:class:`DateTime`) + :class:`Vector2DateTime`, Sequence[:class:`DateTime`, Dict] """ - _schema = {'$ref': '#/definitions/Vector2<DateTime>'} + + _schema = {"$ref": "#/definitions/Vector2<DateTime>"} def __init__(self, *args): super(Vector2DateTime, self).__init__(*args) @@ -21622,9 +54939,10 @@ def __init__(self, *args): class Vector2Vector2number(VegaLiteSchema): """Vector2Vector2number schema wrapper - List(:class:`Vector2number`) + :class:`Vector2Vector2number`, Sequence[:class:`Vector2number`, Sequence[float]] """ - _schema = {'$ref': '#/definitions/Vector2<Vector2<number>>'} + + _schema = {"$ref": "#/definitions/Vector2<Vector2<number>>"} def __init__(self, *args): super(Vector2Vector2number, self).__init__(*args) @@ -21633,9 +54951,10 @@ def __init__(self, *args): class Vector2boolean(SelectionInitInterval): """Vector2boolean schema wrapper - List(boolean) + :class:`Vector2boolean`, Sequence[bool] """ - _schema = {'$ref': '#/definitions/Vector2<boolean>'} + + _schema = {"$ref": "#/definitions/Vector2<boolean>"} def __init__(self, *args): super(Vector2boolean, self).__init__(*args) @@ -21644,9 +54963,10 @@ def __init__(self, *args): class Vector2number(SelectionInitInterval): """Vector2number schema wrapper - List(float) + :class:`Vector2number`, Sequence[float] """ - _schema = {'$ref': '#/definitions/Vector2<number>'} + + _schema = {"$ref": "#/definitions/Vector2<number>"} def __init__(self, *args): super(Vector2number, self).__init__(*args) @@ -21655,9 +54975,10 @@ def __init__(self, *args): class Vector2string(SelectionInitInterval): """Vector2string schema wrapper - List(string) + :class:`Vector2string`, Sequence[str] """ - _schema = {'$ref': '#/definitions/Vector2<string>'} + + _schema = {"$ref": "#/definitions/Vector2<string>"} def __init__(self, *args): super(Vector2string, self).__init__(*args) @@ -21666,9 +54987,10 @@ def __init__(self, *args): class Vector3number(VegaLiteSchema): """Vector3number schema wrapper - List(float) + :class:`Vector3number`, Sequence[float] """ - _schema = {'$ref': '#/definitions/Vector3<number>'} + + _schema = {"$ref": "#/definitions/Vector3<number>"} def __init__(self, *args): super(Vector3number, self).__init__(*args) @@ -21677,9 +54999,10 @@ def __init__(self, *args): class Vector7string(VegaLiteSchema): """Vector7string schema wrapper - List(string) + :class:`Vector7string`, Sequence[str] """ - _schema = {'$ref': '#/definitions/Vector7<string>'} + + _schema = {"$ref": "#/definitions/Vector7<string>"} def __init__(self, *args): super(Vector7string, self).__init__(*args) @@ -21688,57 +55011,57 @@ def __init__(self, *args): class ViewBackground(VegaLiteSchema): """ViewBackground schema wrapper - Mapping(required=[]) + :class:`ViewBackground`, Dict Parameters ---------- - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cursor : :class:`Cursor` + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'] The mouse cursor used over the view. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - fill : anyOf(:class:`Color`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], None The fill color. **Default value:** ``undefined`` - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. - stroke : anyOf(:class:`Color`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], None The stroke color. **Default value:** ``"#ddd"`` - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. - style : anyOf(string, List(string)) + style : Sequence[str], str A string or array of strings indicating the name of custom styles to apply to the view background. A style is a named collection of mark property defaults defined within the `style configuration @@ -21748,30 +55071,454 @@ class ViewBackground(VegaLiteSchema): **Default value:** ``"cell"`` **Note:** Any specified view background properties will augment the default style. """ - _schema = {'$ref': '#/definitions/ViewBackground'} - def __init__(self, cornerRadius=Undefined, cursor=Undefined, fill=Undefined, fillOpacity=Undefined, - opacity=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, **kwds): - super(ViewBackground, self).__init__(cornerRadius=cornerRadius, cursor=cursor, fill=fill, - fillOpacity=fillOpacity, opacity=opacity, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - style=style, **kwds) + _schema = {"$ref": "#/definitions/ViewBackground"} + + def __init__( + self, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + UndefinedType, + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + **kwds, + ): + super(ViewBackground, self).__init__( + cornerRadius=cornerRadius, + cursor=cursor, + fill=fill, + fillOpacity=fillOpacity, + opacity=opacity, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + **kwds, + ) class ViewConfig(VegaLiteSchema): """ViewConfig schema wrapper - Mapping(required=[]) + :class:`ViewConfig`, Dict Parameters ---------- - clip : boolean + clip : bool Whether the view should be clipped. continuousHeight : float The default height when the plot has a continuous y-field for x or latitude, or has @@ -21783,91 +55530,526 @@ class ViewConfig(VegaLiteSchema): arc marks. **Default value:** ``200`` - cornerRadius : anyOf(float, :class:`ExprRef`) + cornerRadius : :class:`ExprRef`, Dict[required=[expr]], float The radius in pixels of rounded rectangles or arcs' corners. **Default value:** ``0`` - cursor : :class:`Cursor` + cursor : :class:`Cursor`, Literal['auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing'] The mouse cursor used over the view. Any valid `CSS cursor type <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values>`__ can be used. - discreteHeight : anyOf(float, Mapping(required=[step])) + discreteHeight : Dict[required=[step]], float The default height when the plot has non arc marks and either a discrete y-field or no y-field. The height can be either a number indicating a fixed height or an object in the form of ``{step: number}`` defining the height per discrete step. **Default value:** a step size based on ``config.view.step``. - discreteWidth : anyOf(float, Mapping(required=[step])) + discreteWidth : Dict[required=[step]], float The default width when the plot has non-arc marks and either a discrete x-field or no x-field. The width can be either a number indicating a fixed width or an object in the form of ``{step: number}`` defining the width per discrete step. **Default value:** a step size based on ``config.view.step``. - fill : anyOf(:class:`Color`, None, :class:`ExprRef`) + fill : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], None The fill color. **Default value:** ``undefined`` - fillOpacity : anyOf(float, :class:`ExprRef`) + fillOpacity : :class:`ExprRef`, Dict[required=[expr]], float The fill opacity (value between [0,1]). **Default value:** ``1`` - opacity : anyOf(float, :class:`ExprRef`) + opacity : :class:`ExprRef`, Dict[required=[expr]], float The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. step : float Default step size for x-/y- discrete fields. - stroke : anyOf(:class:`Color`, None, :class:`ExprRef`) + stroke : :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], :class:`Color`, :class:`HexColor`, str, str, :class:`ExprRef`, Dict[required=[expr]], None The stroke color. **Default value:** ``"#ddd"`` - strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + strokeCap : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeCap`, Literal['butt', 'round', 'square'] The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or ``"square"``. **Default value:** ``"butt"`` - strokeDash : anyOf(List(float), :class:`ExprRef`) + strokeDash : :class:`ExprRef`, Dict[required=[expr]], Sequence[float] An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeDashOffset : :class:`ExprRef`, Dict[required=[expr]], float The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeJoin : :class:`ExprRef`, Dict[required=[expr]], :class:`StrokeJoin`, Literal['miter', 'round', 'bevel'] The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. **Default value:** ``"miter"`` - strokeMiterLimit : anyOf(float, :class:`ExprRef`) + strokeMiterLimit : :class:`ExprRef`, Dict[required=[expr]], float The miter limit at which to bevel a line join. - strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeOpacity : :class:`ExprRef`, Dict[required=[expr]], float The stroke opacity (value between [0,1]). **Default value:** ``1`` - strokeWidth : anyOf(float, :class:`ExprRef`) + strokeWidth : :class:`ExprRef`, Dict[required=[expr]], float The stroke width, in pixels. """ - _schema = {'$ref': '#/definitions/ViewConfig'} - - def __init__(self, clip=Undefined, continuousHeight=Undefined, continuousWidth=Undefined, - cornerRadius=Undefined, cursor=Undefined, discreteHeight=Undefined, - discreteWidth=Undefined, fill=Undefined, fillOpacity=Undefined, opacity=Undefined, - step=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, **kwds): - super(ViewConfig, self).__init__(clip=clip, continuousHeight=continuousHeight, - continuousWidth=continuousWidth, cornerRadius=cornerRadius, - cursor=cursor, discreteHeight=discreteHeight, - discreteWidth=discreteWidth, fill=fill, - fillOpacity=fillOpacity, opacity=opacity, step=step, - stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, - strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, **kwds) + + _schema = {"$ref": "#/definitions/ViewConfig"} + + def __init__( + self, + clip: Union[bool, UndefinedType] = Undefined, + continuousHeight: Union[float, UndefinedType] = Undefined, + continuousWidth: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + "Cursor", + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + ], + UndefinedType, + ] = Undefined, + discreteHeight: Union[Union[dict, float], UndefinedType] = Undefined, + discreteWidth: Union[Union[dict, float], UndefinedType] = Undefined, + fill: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + step: Union[float, UndefinedType] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + "Color", + Union[ + "ColorName", + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + ], + Union["HexColor", str], + str, + ], + Union["ExprRef", "_Parameter", dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeCap", Literal["butt", "round", "square"]], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union["ExprRef", "_Parameter", dict]], UndefinedType + ] = Undefined, + strokeDashOffset: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union["ExprRef", "_Parameter", dict], + Union["StrokeJoin", Literal["miter", "round", "bevel"]], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union["ExprRef", "_Parameter", dict], float], UndefinedType + ] = Undefined, + **kwds, + ): + super(ViewConfig, self).__init__( + clip=clip, + continuousHeight=continuousHeight, + continuousWidth=continuousWidth, + cornerRadius=cornerRadius, + cursor=cursor, + discreteHeight=discreteHeight, + discreteWidth=discreteWidth, + fill=fill, + fillOpacity=fillOpacity, + opacity=opacity, + step=step, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + **kwds, + ) class WindowEventType(VegaLiteSchema): """WindowEventType schema wrapper - anyOf(:class:`EventType`, string) + :class:`EventType`, Literal['click', 'dblclick', 'dragenter', 'dragleave', 'dragover', + 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', + 'mouseup', 'mousewheel', 'pointerdown', 'pointermove', 'pointerout', 'pointerover', + 'pointerup', 'timer', 'touchend', 'touchmove', 'touchstart', 'wheel'], + :class:`WindowEventType`, str """ - _schema = {'$ref': '#/definitions/WindowEventType'} + + _schema = {"$ref": "#/definitions/WindowEventType"} def __init__(self, *args, **kwds): super(WindowEventType, self).__init__(*args, **kwds) @@ -21876,12 +56058,13 @@ def __init__(self, *args, **kwds): class EventType(WindowEventType): """EventType schema wrapper - enum('click', 'dblclick', 'dragenter', 'dragleave', 'dragover', 'keydown', 'keypress', - 'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'mousewheel', - 'pointerdown', 'pointermove', 'pointerout', 'pointerover', 'pointerup', 'timer', 'touchend', - 'touchmove', 'touchstart', 'wheel') + :class:`EventType`, Literal['click', 'dblclick', 'dragenter', 'dragleave', 'dragover', + 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', + 'mouseup', 'mousewheel', 'pointerdown', 'pointermove', 'pointerout', 'pointerover', + 'pointerup', 'timer', 'touchend', 'touchmove', 'touchstart', 'wheel'] """ - _schema = {'$ref': '#/definitions/EventType'} + + _schema = {"$ref": "#/definitions/EventType"} def __init__(self, *args): super(EventType, self).__init__(*args) @@ -21890,16 +56073,16 @@ def __init__(self, *args): class WindowFieldDef(VegaLiteSchema): """WindowFieldDef schema wrapper - Mapping(required=[op, as]) + :class:`WindowFieldDef`, Dict[required=[op, as]] Parameters ---------- - op : anyOf(:class:`AggregateOp`, :class:`WindowOnlyOp`) + op : :class:`AggregateOp`, Literal['argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep'], :class:`WindowOnlyOp`, Literal['row_number', 'rank', 'dense_rank', 'percent_rank', 'cume_dist', 'ntile', 'lag', 'lead', 'first_value', 'last_value', 'nth_value'] The window or aggregation operation to apply within a window (e.g., ``"rank"``, ``"lead"``, ``"sum"``, ``"average"`` or ``"count"`` ). See the list of all supported operations `here <https://vega.github.io/vega-lite/docs/window.html#ops>`__. - field : :class:`FieldName` + field : :class:`FieldName`, str The data field for which to compute the aggregate or window function. This can be omitted for window functions that do not operate over a field such as ``"count"``, ``"rank"``, ``"dense_rank"``. @@ -21909,22 +56092,78 @@ class WindowFieldDef(VegaLiteSchema): See the list of all supported operations and their parameters `here <https://vega.github.io/vega-lite/docs/transforms/window.html>`__. - as : :class:`FieldName` + as : :class:`FieldName`, str The output name for the window operation. """ - _schema = {'$ref': '#/definitions/WindowFieldDef'} - def __init__(self, op=Undefined, field=Undefined, param=Undefined, **kwds): + _schema = {"$ref": "#/definitions/WindowFieldDef"} + + def __init__( + self, + op: Union[ + Union[ + Union[ + "AggregateOp", + Literal[ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", + ], + ], + Union[ + "WindowOnlyOp", + Literal[ + "row_number", + "rank", + "dense_rank", + "percent_rank", + "cume_dist", + "ntile", + "lag", + "lead", + "first_value", + "last_value", + "nth_value", + ], + ], + ], + UndefinedType, + ] = Undefined, + field: Union[Union["FieldName", str], UndefinedType] = Undefined, + param: Union[float, UndefinedType] = Undefined, + **kwds, + ): super(WindowFieldDef, self).__init__(op=op, field=field, param=param, **kwds) class WindowOnlyOp(VegaLiteSchema): """WindowOnlyOp schema wrapper - enum('row_number', 'rank', 'dense_rank', 'percent_rank', 'cume_dist', 'ntile', 'lag', - 'lead', 'first_value', 'last_value', 'nth_value') + :class:`WindowOnlyOp`, Literal['row_number', 'rank', 'dense_rank', 'percent_rank', + 'cume_dist', 'ntile', 'lag', 'lead', 'first_value', 'last_value', 'nth_value'] """ - _schema = {'$ref': '#/definitions/WindowOnlyOp'} + + _schema = {"$ref": "#/definitions/WindowOnlyOp"} def __init__(self, *args): super(WindowOnlyOp, self).__init__(*args) @@ -21933,14 +56172,14 @@ def __init__(self, *args): class WindowTransform(Transform): """WindowTransform schema wrapper - Mapping(required=[window]) + :class:`WindowTransform`, Dict[required=[window]] Parameters ---------- - window : List(:class:`WindowFieldDef`) + window : Sequence[:class:`WindowFieldDef`, Dict[required=[op, as]]] The definition of the fields in the window, and what calculations to use. - frame : List(anyOf(None, float)) + frame : Sequence[None, float] A frame specification as a two-element array indicating how the sliding window should proceed. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or @@ -21957,10 +56196,10 @@ class WindowTransform(Transform): **Default value:** : ``[null, 0]`` (includes the current object and all preceding objects) - groupby : List(:class:`FieldName`) + groupby : Sequence[:class:`FieldName`, str] The data fields for partitioning the data objects into separate windows. If unspecified, all data points will be in a single window. - ignorePeers : boolean + ignorePeers : bool Indicates if the sliding window frame should ignore peer values (data that are considered identical by the sort criteria). The default is false, causing the window frame to expand to include all peer values. If set to true, the window frame will be @@ -21969,17 +56208,32 @@ class WindowTransform(Transform): last_value, and nth_value window operations. **Default value:** ``false`` - sort : List(:class:`SortField`) + sort : Sequence[:class:`SortField`, Dict[required=[field]]] A sort field definition for sorting data objects within a window. If two data objects are considered equal by the comparator, they are considered "peer" values of equal rank. If sort is not specified, the order is undefined: data objects are processed in the order they are observed and none are considered peers (the ignorePeers parameter is ignored and treated as if set to ``true`` ). """ - _schema = {'$ref': '#/definitions/WindowTransform'} - - def __init__(self, window=Undefined, frame=Undefined, groupby=Undefined, ignorePeers=Undefined, - sort=Undefined, **kwds): - super(WindowTransform, self).__init__(window=window, frame=frame, groupby=groupby, - ignorePeers=ignorePeers, sort=sort, **kwds) + _schema = {"$ref": "#/definitions/WindowTransform"} + + def __init__( + self, + window: Union[ + Sequence[Union["WindowFieldDef", dict]], UndefinedType + ] = Undefined, + frame: Union[Sequence[Union[None, float]], UndefinedType] = Undefined, + groupby: Union[Sequence[Union["FieldName", str]], UndefinedType] = Undefined, + ignorePeers: Union[bool, UndefinedType] = Undefined, + sort: Union[Sequence[Union["SortField", dict]], UndefinedType] = Undefined, + **kwds, + ): + super(WindowTransform, self).__init__( + window=window, + frame=frame, + groupby=groupby, + ignorePeers=ignorePeers, + sort=sort, + **kwds, + ) diff --git a/altair/vegalite/v5/schema/mixins.py b/altair/vegalite/v5/schema/mixins.py --- a/altair/vegalite/v5/schema/mixins.py +++ b/altair/vegalite/v5/schema/mixins.py @@ -1,10 +1,14 @@ # The contents of this file are automatically written by # tools/generate_schema_wrapper.py. Do not modify directly. + import sys + from . import core from altair.utils import use_signature -from altair.utils.schemapi import Undefined +from altair.utils.schemapi import Undefined, UndefinedType +from typing import Any, Sequence, List, Literal, Union + if sys.version_info >= (3, 11): from typing import Self @@ -15,844 +19,14839 @@ class MarkMethodMixin: """A mixin class that defines mark methods""" - def mark_arc(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, - discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, - fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, - fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, - href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, - limit=Undefined, line=Undefined, lineBreak=Undefined, lineHeight=Undefined, - minBandSize=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, - radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, - size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, - strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, - strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, - strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, - theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, - thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, - tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, - x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, - yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'arc' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_arc( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'arc' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="arc", **kwds) else: copy.mark = "arc" return copy - def mark_area(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'area' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_area( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'area' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="area", **kwds) else: copy.mark = "area" return copy - def mark_bar(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, - discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, - fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, - fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, - href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, - limit=Undefined, line=Undefined, lineBreak=Undefined, lineHeight=Undefined, - minBandSize=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, - radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, - size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, - strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, - strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, - strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, - theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, - thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, - tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, - x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, - yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'bar' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_bar( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'bar' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="bar", **kwds) else: copy.mark = "bar" return copy - def mark_image(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'image' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_image( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'image' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="image", **kwds) else: copy.mark = "image" return copy - def mark_line(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'line' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_line( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'line' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="line", **kwds) else: copy.mark = "line" return copy - def mark_point(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'point' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_point( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'point' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="point", **kwds) else: copy.mark = "point" return copy - def mark_rect(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'rect' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_rect( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'rect' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="rect", **kwds) else: copy.mark = "rect" return copy - def mark_rule(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'rule' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_rule( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'rule' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="rule", **kwds) else: copy.mark = "rule" return copy - def mark_text(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'text' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_text( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'text' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="text", **kwds) else: copy.mark = "text" return copy - def mark_tick(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'tick' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_tick( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'tick' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="tick", **kwds) else: copy.mark = "tick" return copy - def mark_trail(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, - shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, - strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, - strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, - text=Undefined, theta=Undefined, theta2=Undefined, theta2Offset=Undefined, - thetaOffset=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, - timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, - x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, - y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'trail' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_trail( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'trail' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="trail", **kwds) else: copy.mark = "trail" return copy - def mark_circle(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, - radiusOffset=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, - stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, - theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, - thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, - tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, - x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, - y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'circle' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_circle( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'circle' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="circle", **kwds) else: copy.mark = "circle" return copy - def mark_square(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, - radiusOffset=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, - stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, - theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, - thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, - tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, - x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, - y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'square' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_square( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'square' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="square", **kwds) else: copy.mark = "square" return copy - def mark_geoshape(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, - ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, - cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, - dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, - ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, - font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, - height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, - invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, - lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, - radius=Undefined, radius2=Undefined, radius2Offset=Undefined, - radiusOffset=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, - stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, - strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, - strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, - theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, - thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, - tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, - x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, - y2Offset=Undefined, yOffset=Undefined, **kwds) -> Self: - """Set the chart's mark to 'geoshape' (see :class:`MarkDef`) - """ - kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, - ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, - continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, - cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, - cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, - font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, - minBandSize=minBandSize, opacity=opacity, order=order, orient=orient, - outerRadius=outerRadius, padAngle=padAngle, point=point, radius=radius, - radius2=radius2, radius2Offset=radius2Offset, radiusOffset=radiusOffset, - shape=shape, size=size, smooth=smooth, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, - strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, - text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, - thetaOffset=thetaOffset, thickness=thickness, - timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, - tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) - copy = self.copy(deep=False) + def mark_geoshape( + self, + align: Union[ + Union[ + Union[Literal["left", "center", "right"], core.Align], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + angle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + aria: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + ariaRole: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + ariaRoleDescription: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + aspect: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + bandSize: Union[float, UndefinedType] = Undefined, + baseline: Union[ + Union[ + Union[ + Union[Literal["top", "middle", "bottom"], core.Baseline], + core.TextBaseline, + str, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + binSpacing: Union[float, UndefinedType] = Undefined, + blend: Union[ + Union[ + Union[ + Literal[ + None, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity", + ], + core.Blend, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + continuousBandSize: Union[float, UndefinedType] = Undefined, + cornerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusBottomRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusEnd: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopLeft: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cornerRadiusTopRight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + cursor: Union[ + Union[ + Union[ + Literal[ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing", + ], + core.Cursor, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + description: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + dir: Union[ + Union[ + Union[Literal["ltr", "rtl"], core.TextDirection], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + discreteBandSize: Union[ + Union[Union[core.RelativeBandSize, dict], float], UndefinedType + ] = Undefined, + dx: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + dy: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + ellipsis: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fill: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + fillOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + filled: Union[bool, UndefinedType] = Undefined, + font: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + fontSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + fontStyle: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], Union[core.FontStyle, str] + ], + UndefinedType, + ] = Undefined, + fontWeight: Union[ + Union[ + Union[ + Literal[ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900, + ], + core.FontWeight, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + height: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + href: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + innerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + interpolate: Union[ + Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + limit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + line: Union[ + Union[Union[core.OverlayMarkDef, dict], bool], UndefinedType + ] = Undefined, + lineBreak: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], str], UndefinedType + ] = Undefined, + lineHeight: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + minBandSize: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + opacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + order: Union[Union[None, bool], UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outerRadius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + padAngle: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + point: Union[ + Union[Union[core.OverlayMarkDef, dict], bool, str], UndefinedType + ] = Undefined, + radius: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radius2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + radiusOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + shape: Union[ + Union[ + Union[Union[core.SymbolShape, str], str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + size: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + smooth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], bool], UndefinedType + ] = Undefined, + stroke: Union[ + Union[ + None, + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeCap: Union[ + Union[ + Union[Literal["butt", "round", "square"], core.StrokeCap], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeDash: Union[ + Union[Sequence[float], Union[core.ExprRef, core._Parameter, dict]], + UndefinedType, + ] = Undefined, + strokeDashOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeJoin: Union[ + Union[ + Union[Literal["miter", "round", "bevel"], core.StrokeJoin], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + strokeMiterLimit: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeOpacity: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + strokeWidth: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + style: Union[Union[Sequence[str], str], UndefinedType] = Undefined, + tension: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + text: Union[ + Union[ + Union[Sequence[str], core.Text, str], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + theta: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + theta2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thetaOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + timeUnitBandPosition: Union[float, UndefinedType] = Undefined, + timeUnitBandSize: Union[float, UndefinedType] = Undefined, + tooltip: Union[ + Union[ + None, + Union[core.ExprRef, core._Parameter, dict], + Union[core.TooltipContent, dict], + bool, + float, + str, + ], + UndefinedType, + ] = Undefined, + url: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], Union[core.URI, str]], + UndefinedType, + ] = Undefined, + width: Union[ + Union[ + Union[core.ExprRef, core._Parameter, dict], + Union[core.RelativeBandSize, dict], + float, + ], + UndefinedType, + ] = Undefined, + x: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + x2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + xOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + y: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float, str], UndefinedType + ] = Undefined, + y2Offset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + yOffset: Union[ + Union[Union[core.ExprRef, core._Parameter, dict], float], UndefinedType + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'geoshape' (see :class:`MarkDef`)""" + kwds = dict( + align=align, + angle=angle, + aria=aria, + ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, + aspect=aspect, + bandSize=bandSize, + baseline=baseline, + binSpacing=binSpacing, + blend=blend, + clip=clip, + color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, + description=description, + dir=dir, + discreteBandSize=discreteBandSize, + dx=dx, + dy=dy, + ellipsis=ellipsis, + fill=fill, + fillOpacity=fillOpacity, + filled=filled, + font=font, + fontSize=fontSize, + fontStyle=fontStyle, + fontWeight=fontWeight, + height=height, + href=href, + innerRadius=innerRadius, + interpolate=interpolate, + invalid=invalid, + limit=limit, + line=line, + lineBreak=lineBreak, + lineHeight=lineHeight, + minBandSize=minBandSize, + opacity=opacity, + order=order, + orient=orient, + outerRadius=outerRadius, + padAngle=padAngle, + point=point, + radius=radius, + radius2=radius2, + radius2Offset=radius2Offset, + radiusOffset=radiusOffset, + shape=shape, + size=size, + smooth=smooth, + stroke=stroke, + strokeCap=strokeCap, + strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, + style=style, + tension=tension, + text=text, + theta=theta, + theta2=theta2, + theta2Offset=theta2Offset, + thetaOffset=thetaOffset, + thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, + url=url, + width=width, + x=x, + x2=x2, + x2Offset=x2Offset, + xOffset=xOffset, + y=y, + y2=y2, + y2Offset=y2Offset, + yOffset=yOffset, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.MarkDef(type="geoshape", **kwds) else: copy.mark = "geoshape" return copy - def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, - invalid=Undefined, median=Undefined, opacity=Undefined, orient=Undefined, - outliers=Undefined, rule=Undefined, size=Undefined, ticks=Undefined, **kwds) -> Self: - """Set the chart's mark to 'boxplot' (see :class:`BoxPlotDef`) - """ - kwds = dict(box=box, clip=clip, color=color, extent=extent, invalid=invalid, median=median, - opacity=opacity, orient=orient, outliers=outliers, rule=rule, size=size, - ticks=ticks, **kwds) - copy = self.copy(deep=False) + def mark_boxplot( + self, + box: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + extent: Union[Union[float, str], UndefinedType] = Undefined, + invalid: Union[Literal["filter", None], UndefinedType] = Undefined, + median: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + opacity: Union[float, UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + outliers: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + rule: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + size: Union[float, UndefinedType] = Undefined, + ticks: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'boxplot' (see :class:`BoxPlotDef`)""" + kwds = dict( + box=box, + clip=clip, + color=color, + extent=extent, + invalid=invalid, + median=median, + opacity=opacity, + orient=orient, + outliers=outliers, + rule=rule, + size=size, + ticks=ticks, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.BoxPlotDef(type="boxplot", **kwds) else: copy.mark = "boxplot" return copy - def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opacity=Undefined, - orient=Undefined, rule=Undefined, size=Undefined, thickness=Undefined, - ticks=Undefined, **kwds) -> Self: - """Set the chart's mark to 'errorbar' (see :class:`ErrorBarDef`) - """ - kwds = dict(clip=clip, color=color, extent=extent, opacity=opacity, orient=orient, rule=rule, - size=size, thickness=thickness, ticks=ticks, **kwds) - copy = self.copy(deep=False) + def mark_errorbar( + self, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + extent: Union[ + Union[Literal["ci", "iqr", "stderr", "stdev"], core.ErrorBarExtent], + UndefinedType, + ] = Undefined, + opacity: Union[float, UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + rule: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + size: Union[float, UndefinedType] = Undefined, + thickness: Union[float, UndefinedType] = Undefined, + ticks: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'errorbar' (see :class:`ErrorBarDef`)""" + kwds = dict( + clip=clip, + color=color, + extent=extent, + opacity=opacity, + orient=orient, + rule=rule, + size=size, + thickness=thickness, + ticks=ticks, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.ErrorBarDef(type="errorbar", **kwds) else: copy.mark = "errorbar" return copy - def mark_errorband(self, band=Undefined, borders=Undefined, clip=Undefined, color=Undefined, - extent=Undefined, interpolate=Undefined, opacity=Undefined, orient=Undefined, - tension=Undefined, **kwds) -> Self: - """Set the chart's mark to 'errorband' (see :class:`ErrorBandDef`) - """ - kwds = dict(band=band, borders=borders, clip=clip, color=color, extent=extent, - interpolate=interpolate, opacity=opacity, orient=orient, tension=tension, **kwds) - copy = self.copy(deep=False) + def mark_errorband( + self, + band: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + borders: Union[ + Union[ + Union[ + Union[core.AreaConfig, dict], + Union[core.BarConfig, dict], + Union[core.LineConfig, dict], + Union[core.MarkConfig, dict], + Union[core.RectConfig, dict], + Union[core.TickConfig, dict], + core.AnyMarkConfig, + ], + bool, + ], + UndefinedType, + ] = Undefined, + clip: Union[bool, UndefinedType] = Undefined, + color: Union[ + Union[ + Union[ + Union[ + Literal[ + "black", + "silver", + "gray", + "white", + "maroon", + "red", + "purple", + "fuchsia", + "green", + "lime", + "olive", + "yellow", + "navy", + "blue", + "teal", + "aqua", + "orange", + "aliceblue", + "antiquewhite", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple", + ], + core.ColorName, + ], + Union[core.HexColor, str], + core.Color, + str, + ], + Union[ + Union[core.LinearGradient, dict], + Union[core.RadialGradient, dict], + core.Gradient, + ], + Union[core.ExprRef, core._Parameter, dict], + ], + UndefinedType, + ] = Undefined, + extent: Union[ + Union[Literal["ci", "iqr", "stderr", "stdev"], core.ErrorBarExtent], + UndefinedType, + ] = Undefined, + interpolate: Union[ + Union[ + Literal[ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after", + ], + core.Interpolate, + ], + UndefinedType, + ] = Undefined, + opacity: Union[float, UndefinedType] = Undefined, + orient: Union[ + Union[Literal["horizontal", "vertical"], core.Orientation], UndefinedType + ] = Undefined, + tension: Union[float, UndefinedType] = Undefined, + **kwds, + ) -> Self: + """Set the chart's mark to 'errorband' (see :class:`ErrorBandDef`)""" + kwds = dict( + band=band, + borders=borders, + clip=clip, + color=color, + extent=extent, + interpolate=interpolate, + opacity=opacity, + orient=orient, + tension=tension, + **kwds, + ) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.ErrorBandDef(type="errorband", **kwds) else: @@ -865,13 +14864,13 @@ class ConfigMethodMixin: @use_signature(core.Config) def configure(self, *args, **kwargs) -> Self: - copy = self.copy(deep=False) + copy = self.copy(deep=False) # type: ignore[attr-defined] copy.config = core.Config(*args, **kwargs) return copy @use_signature(core.RectConfig) def configure_arc(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["arc"] = core.RectConfig(*args, **kwargs) @@ -879,7 +14878,7 @@ def configure_arc(self, *args, **kwargs) -> Self: @use_signature(core.AreaConfig) def configure_area(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["area"] = core.AreaConfig(*args, **kwargs) @@ -887,7 +14886,7 @@ def configure_area(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axis(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axis"] = core.AxisConfig(*args, **kwargs) @@ -895,7 +14894,7 @@ def configure_axis(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisBand(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisBand"] = core.AxisConfig(*args, **kwargs) @@ -903,7 +14902,7 @@ def configure_axisBand(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisBottom(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisBottom"] = core.AxisConfig(*args, **kwargs) @@ -911,7 +14910,7 @@ def configure_axisBottom(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisDiscrete(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisDiscrete"] = core.AxisConfig(*args, **kwargs) @@ -919,7 +14918,7 @@ def configure_axisDiscrete(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisLeft(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisLeft"] = core.AxisConfig(*args, **kwargs) @@ -927,7 +14926,7 @@ def configure_axisLeft(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisPoint(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisPoint"] = core.AxisConfig(*args, **kwargs) @@ -935,7 +14934,7 @@ def configure_axisPoint(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisQuantitative(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisQuantitative"] = core.AxisConfig(*args, **kwargs) @@ -943,7 +14942,7 @@ def configure_axisQuantitative(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisRight(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisRight"] = core.AxisConfig(*args, **kwargs) @@ -951,7 +14950,7 @@ def configure_axisRight(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisTemporal(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisTemporal"] = core.AxisConfig(*args, **kwargs) @@ -959,7 +14958,7 @@ def configure_axisTemporal(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisTop(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisTop"] = core.AxisConfig(*args, **kwargs) @@ -967,7 +14966,7 @@ def configure_axisTop(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisX(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisX"] = core.AxisConfig(*args, **kwargs) @@ -975,7 +14974,7 @@ def configure_axisX(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisXBand(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisXBand"] = core.AxisConfig(*args, **kwargs) @@ -983,7 +14982,7 @@ def configure_axisXBand(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisXDiscrete(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisXDiscrete"] = core.AxisConfig(*args, **kwargs) @@ -991,7 +14990,7 @@ def configure_axisXDiscrete(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisXPoint(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisXPoint"] = core.AxisConfig(*args, **kwargs) @@ -999,7 +14998,7 @@ def configure_axisXPoint(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisXQuantitative(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisXQuantitative"] = core.AxisConfig(*args, **kwargs) @@ -1007,7 +15006,7 @@ def configure_axisXQuantitative(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisXTemporal(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisXTemporal"] = core.AxisConfig(*args, **kwargs) @@ -1015,7 +15014,7 @@ def configure_axisXTemporal(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisY(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisY"] = core.AxisConfig(*args, **kwargs) @@ -1023,7 +15022,7 @@ def configure_axisY(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisYBand(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisYBand"] = core.AxisConfig(*args, **kwargs) @@ -1031,7 +15030,7 @@ def configure_axisYBand(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisYDiscrete(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisYDiscrete"] = core.AxisConfig(*args, **kwargs) @@ -1039,7 +15038,7 @@ def configure_axisYDiscrete(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisYPoint(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisYPoint"] = core.AxisConfig(*args, **kwargs) @@ -1047,7 +15046,7 @@ def configure_axisYPoint(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisYQuantitative(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisYQuantitative"] = core.AxisConfig(*args, **kwargs) @@ -1055,7 +15054,7 @@ def configure_axisYQuantitative(self, *args, **kwargs) -> Self: @use_signature(core.AxisConfig) def configure_axisYTemporal(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["axisYTemporal"] = core.AxisConfig(*args, **kwargs) @@ -1063,7 +15062,7 @@ def configure_axisYTemporal(self, *args, **kwargs) -> Self: @use_signature(core.BarConfig) def configure_bar(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["bar"] = core.BarConfig(*args, **kwargs) @@ -1071,7 +15070,7 @@ def configure_bar(self, *args, **kwargs) -> Self: @use_signature(core.BoxPlotConfig) def configure_boxplot(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["boxplot"] = core.BoxPlotConfig(*args, **kwargs) @@ -1079,7 +15078,7 @@ def configure_boxplot(self, *args, **kwargs) -> Self: @use_signature(core.MarkConfig) def configure_circle(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["circle"] = core.MarkConfig(*args, **kwargs) @@ -1087,7 +15086,7 @@ def configure_circle(self, *args, **kwargs) -> Self: @use_signature(core.CompositionConfig) def configure_concat(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["concat"] = core.CompositionConfig(*args, **kwargs) @@ -1095,7 +15094,7 @@ def configure_concat(self, *args, **kwargs) -> Self: @use_signature(core.ErrorBandConfig) def configure_errorband(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["errorband"] = core.ErrorBandConfig(*args, **kwargs) @@ -1103,7 +15102,7 @@ def configure_errorband(self, *args, **kwargs) -> Self: @use_signature(core.ErrorBarConfig) def configure_errorbar(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["errorbar"] = core.ErrorBarConfig(*args, **kwargs) @@ -1111,7 +15110,7 @@ def configure_errorbar(self, *args, **kwargs) -> Self: @use_signature(core.CompositionConfig) def configure_facet(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["facet"] = core.CompositionConfig(*args, **kwargs) @@ -1119,7 +15118,7 @@ def configure_facet(self, *args, **kwargs) -> Self: @use_signature(core.MarkConfig) def configure_geoshape(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["geoshape"] = core.MarkConfig(*args, **kwargs) @@ -1127,7 +15126,7 @@ def configure_geoshape(self, *args, **kwargs) -> Self: @use_signature(core.HeaderConfig) def configure_header(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["header"] = core.HeaderConfig(*args, **kwargs) @@ -1135,7 +15134,7 @@ def configure_header(self, *args, **kwargs) -> Self: @use_signature(core.HeaderConfig) def configure_headerColumn(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["headerColumn"] = core.HeaderConfig(*args, **kwargs) @@ -1143,7 +15142,7 @@ def configure_headerColumn(self, *args, **kwargs) -> Self: @use_signature(core.HeaderConfig) def configure_headerFacet(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["headerFacet"] = core.HeaderConfig(*args, **kwargs) @@ -1151,7 +15150,7 @@ def configure_headerFacet(self, *args, **kwargs) -> Self: @use_signature(core.HeaderConfig) def configure_headerRow(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["headerRow"] = core.HeaderConfig(*args, **kwargs) @@ -1159,7 +15158,7 @@ def configure_headerRow(self, *args, **kwargs) -> Self: @use_signature(core.RectConfig) def configure_image(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["image"] = core.RectConfig(*args, **kwargs) @@ -1167,7 +15166,7 @@ def configure_image(self, *args, **kwargs) -> Self: @use_signature(core.LegendConfig) def configure_legend(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["legend"] = core.LegendConfig(*args, **kwargs) @@ -1175,7 +15174,7 @@ def configure_legend(self, *args, **kwargs) -> Self: @use_signature(core.LineConfig) def configure_line(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["line"] = core.LineConfig(*args, **kwargs) @@ -1183,7 +15182,7 @@ def configure_line(self, *args, **kwargs) -> Self: @use_signature(core.MarkConfig) def configure_mark(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["mark"] = core.MarkConfig(*args, **kwargs) @@ -1191,7 +15190,7 @@ def configure_mark(self, *args, **kwargs) -> Self: @use_signature(core.MarkConfig) def configure_point(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["point"] = core.MarkConfig(*args, **kwargs) @@ -1199,7 +15198,7 @@ def configure_point(self, *args, **kwargs) -> Self: @use_signature(core.ProjectionConfig) def configure_projection(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["projection"] = core.ProjectionConfig(*args, **kwargs) @@ -1207,7 +15206,7 @@ def configure_projection(self, *args, **kwargs) -> Self: @use_signature(core.RangeConfig) def configure_range(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["range"] = core.RangeConfig(*args, **kwargs) @@ -1215,7 +15214,7 @@ def configure_range(self, *args, **kwargs) -> Self: @use_signature(core.RectConfig) def configure_rect(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["rect"] = core.RectConfig(*args, **kwargs) @@ -1223,7 +15222,7 @@ def configure_rect(self, *args, **kwargs) -> Self: @use_signature(core.MarkConfig) def configure_rule(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["rule"] = core.MarkConfig(*args, **kwargs) @@ -1231,7 +15230,7 @@ def configure_rule(self, *args, **kwargs) -> Self: @use_signature(core.ScaleConfig) def configure_scale(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["scale"] = core.ScaleConfig(*args, **kwargs) @@ -1239,7 +15238,7 @@ def configure_scale(self, *args, **kwargs) -> Self: @use_signature(core.SelectionConfig) def configure_selection(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["selection"] = core.SelectionConfig(*args, **kwargs) @@ -1247,7 +15246,7 @@ def configure_selection(self, *args, **kwargs) -> Self: @use_signature(core.MarkConfig) def configure_square(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["square"] = core.MarkConfig(*args, **kwargs) @@ -1255,7 +15254,7 @@ def configure_square(self, *args, **kwargs) -> Self: @use_signature(core.MarkConfig) def configure_text(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["text"] = core.MarkConfig(*args, **kwargs) @@ -1263,7 +15262,7 @@ def configure_text(self, *args, **kwargs) -> Self: @use_signature(core.TickConfig) def configure_tick(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["tick"] = core.TickConfig(*args, **kwargs) @@ -1271,7 +15270,7 @@ def configure_tick(self, *args, **kwargs) -> Self: @use_signature(core.TitleConfig) def configure_title(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["title"] = core.TitleConfig(*args, **kwargs) @@ -1279,7 +15278,7 @@ def configure_title(self, *args, **kwargs) -> Self: @use_signature(core.FormatConfig) def configure_tooltipFormat(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["tooltipFormat"] = core.FormatConfig(*args, **kwargs) @@ -1287,7 +15286,7 @@ def configure_tooltipFormat(self, *args, **kwargs) -> Self: @use_signature(core.LineConfig) def configure_trail(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["trail"] = core.LineConfig(*args, **kwargs) @@ -1295,8 +15294,8 @@ def configure_trail(self, *args, **kwargs) -> Self: @use_signature(core.ViewConfig) def configure_view(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=["config"]) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["view"] = core.ViewConfig(*args, **kwargs) - return copy \ No newline at end of file + return copy diff --git a/doc/conf.py b/doc/conf.py --- a/doc/conf.py +++ b/doc/conf.py @@ -49,6 +49,8 @@ autodoc_member_order = "groupwise" +autodoc_typehints = "none" + # generate autosummary even if no references autosummary_generate = True diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -1,19 +1,18 @@ """Generate a schema wrapper from a schema""" import argparse import copy -import os -import sys import json +import os import re -from os.path import abspath, join, dirname -from typing import Final, Optional, List, Dict, Tuple, Literal, Union, Type - +import sys import textwrap +from dataclasses import dataclass +from os.path import abspath, dirname, join +from typing import Dict, Final, List, Literal, Optional, Tuple, Type, Union from urllib import request import m2r - # Add path so that schemapi can be imported from the tools folder current_dir = dirname(__file__) sys.path.insert(0, abspath(current_dir)) @@ -23,10 +22,12 @@ from schemapi import codegen # noqa: E402 from schemapi.codegen import CodeSnippet # noqa: E402 from schemapi.utils import ( # noqa: E402 - get_valid_identifier, SchemaInfo, - indent_arglist, + get_valid_identifier, resolve_references, + ruff_format_str, + rst_syntax_for_class, + indent_docstring, ) SCHEMA_VERSION: Final = "v5.15.1" @@ -41,11 +42,42 @@ SCHEMA_URL_TEMPLATE: Final = "https://vega.github.io/schema/" "{library}/{version}.json" +CHANNEL_MYPY_IGNORE_STATEMENTS: Final = """\ +# These errors need to be ignored as they come from the overload methods +# which trigger two kind of errors in mypy: +# * all of them do not have an implementation in this file +# * some of them are the only overload methods -> overloads usually only make +# sense if there are multiple ones +# However, we need these overloads due to how the propertysetter works +# mypy: disable-error-code="no-overload-impl, empty-body, misc" +""" + +PARAMETER_PROTOCOL: Final = """ +class _Parameter(Protocol): + # This protocol represents a Parameter as defined in api.py + # It would be better if we could directly use the Parameter class, + # but that would create a circular import. + # The protocol does not need to have all the attributes and methods of this + # class but the actual api.Parameter just needs to pass a type check + # as a core._Parameter. + + _counter: int + + def _get_name(cls) -> str: + ... + + def to_dict(self) -> TypingDict[str, Union[str, dict]]: + ... + + def _to_expr(self) -> str: + ... +""" + BASE_SCHEMA: Final = """ class {basename}(SchemaBase): _rootschema = load_schema() @classmethod - def _default_wrapper_classes(cls): + def _default_wrapper_classes(cls) -> TypingGenerator[type, None, None]: return _subclasses({basename}) """ @@ -53,95 +85,126 @@ def _default_wrapper_classes(cls): import pkgutil import json -def load_schema(): +def load_schema() -> dict: """Load the json schema associated with this module's functions""" - return json.loads(pkgutil.get_data(__name__, '{schemafile}').decode('utf-8')) + schema_bytes = pkgutil.get_data(__name__, "{schemafile}") + if schema_bytes is None: + raise ValueError("Unable to load {schemafile}") + return json.loads( + schema_bytes.decode("utf-8") + ) ''' CHANNEL_MIXINS: Final = """ class FieldChannelMixin: - def to_dict(self, validate=True, ignore=(), context=None): + def to_dict( + self, + validate: bool = True, + ignore: Optional[List[str]] = None, + context: Optional[TypingDict[str, Any]] = None, + ) -> Union[dict, List[dict]]: context = context or {} - shorthand = self._get('shorthand') - field = self._get('field') + ignore = ignore or [] + shorthand = self._get("shorthand") # type: ignore[attr-defined] + field = self._get("field") # type: ignore[attr-defined] if shorthand is not Undefined and field is not Undefined: - raise ValueError("{} specifies both shorthand={} and field={}. " - "".format(self.__class__.__name__, shorthand, field)) + raise ValueError( + "{} specifies both shorthand={} and field={}. " + "".format(self.__class__.__name__, shorthand, field) + ) if isinstance(shorthand, (tuple, list)): # If given a list of shorthands, then transform it to a list of classes - kwds = self._kwds.copy() - kwds.pop('shorthand') - return [self.__class__(sh, **kwds).to_dict(validate=validate, ignore=ignore, context=context) - for sh in shorthand] + kwds = self._kwds.copy() # type: ignore[attr-defined] + kwds.pop("shorthand") + return [ + self.__class__(sh, **kwds).to_dict( # type: ignore[call-arg] + validate=validate, ignore=ignore, context=context + ) + for sh in shorthand + ] if shorthand is Undefined: parsed = {} elif isinstance(shorthand, str): - parsed = parse_shorthand(shorthand, data=context.get('data', None)) - type_required = 'type' in self._kwds - type_in_shorthand = 'type' in parsed - type_defined_explicitly = self._get('type') is not Undefined + parsed = parse_shorthand(shorthand, data=context.get("data", None)) + type_required = "type" in self._kwds # type: ignore[attr-defined] + type_in_shorthand = "type" in parsed + type_defined_explicitly = self._get("type") is not Undefined # type: ignore[attr-defined] if not type_required: # Secondary field names don't require a type argument in VegaLite 3+. # We still parse it out of the shorthand, but drop it here. - parsed.pop('type', None) + parsed.pop("type", None) elif not (type_in_shorthand or type_defined_explicitly): - if isinstance(context.get('data', None), pd.DataFrame): + if isinstance(context.get("data", None), pd.DataFrame): raise ValueError( 'Unable to determine data type for the field "{}";' " verify that the field name is not misspelled." " If you are referencing a field from a transform," - " also confirm that the data type is specified correctly.".format(shorthand) + " also confirm that the data type is specified correctly.".format( + shorthand + ) ) else: - raise ValueError("{} encoding field is specified without a type; " - "the type cannot be automatically inferred because " - "the data is not specified as a pandas.DataFrame." - "".format(shorthand)) + raise ValueError( + "{} encoding field is specified without a type; " + "the type cannot be automatically inferred because " + "the data is not specified as a pandas.DataFrame." + "".format(shorthand) + ) else: # Shorthand is not a string; we pass the definition to field, # and do not do any parsing. - parsed = {'field': shorthand} + parsed = {"field": shorthand} context["parsed_shorthand"] = parsed return super(FieldChannelMixin, self).to_dict( - validate=validate, - ignore=ignore, - context=context + validate=validate, ignore=ignore, context=context ) class ValueChannelMixin: - def to_dict(self, validate=True, ignore=(), context=None): + def to_dict( + self, + validate: bool = True, + ignore: Optional[List[str]] = None, + context: Optional[TypingDict[str, Any]] = None, + ) -> dict: context = context or {} - condition = self._get('condition', Undefined) + ignore = ignore or [] + condition = self._get("condition", Undefined) # type: ignore[attr-defined] copy = self # don't copy unless we need to if condition is not Undefined: if isinstance(condition, core.SchemaBase): pass - elif 'field' in condition and 'type' not in condition: - kwds = parse_shorthand(condition['field'], context.get('data', None)) - copy = self.copy(deep=['condition']) - copy['condition'].update(kwds) - return super(ValueChannelMixin, copy).to_dict(validate=validate, - ignore=ignore, - context=context) + elif "field" in condition and "type" not in condition: + kwds = parse_shorthand(condition["field"], context.get("data", None)) + copy = self.copy(deep=["condition"]) # type: ignore[attr-defined] + copy["condition"].update(kwds) # type: ignore[index] + return super(ValueChannelMixin, copy).to_dict( + validate=validate, ignore=ignore, context=context + ) class DatumChannelMixin: - def to_dict(self, validate=True, ignore=(), context=None): + def to_dict( + self, + validate: bool = True, + ignore: Optional[List[str]] = None, + context: Optional[TypingDict[str, Any]] = None, + ) -> dict: context = context or {} - datum = self._get('datum', Undefined) + ignore = ignore or [] + datum = self._get("datum", Undefined) # type: ignore[attr-defined] copy = self # don't copy unless we need to if datum is not Undefined: if isinstance(datum, core.SchemaBase): pass - return super(DatumChannelMixin, copy).to_dict(validate=validate, - ignore=ignore, - context=context) + return super(DatumChannelMixin, copy).to_dict( + validate=validate, ignore=ignore, context=context + ) """ MARK_METHOD: Final = ''' @@ -149,7 +212,7 @@ def mark_{mark}({def_arglist}) -> Self: """Set the chart's mark to '{mark}' (see :class:`{mark_def}`) """ kwds = dict({dict_arglist}) - copy = self.copy(deep=False) + copy = self.copy(deep=False) # type: ignore[attr-defined] if any(val is not Undefined for val in kwds.values()): copy.mark = core.{mark_def}(type="{mark}", **kwds) else: @@ -160,7 +223,7 @@ def mark_{mark}({def_arglist}) -> Self: CONFIG_METHOD: Final = """ @use_signature(core.{classname}) def {method}(self, *args, **kwargs) -> Self: - copy = self.copy(deep=False) + copy = self.copy(deep=False) # type: ignore[attr-defined] copy.config = core.{classname}(*args, **kwargs) return copy """ @@ -168,13 +231,19 @@ def {method}(self, *args, **kwargs) -> Self: CONFIG_PROP_METHOD: Final = """ @use_signature(core.{classname}) def configure_{prop}(self, *args, **kwargs) -> Self: - copy = self.copy(deep=['config']) + copy = self.copy(deep=['config']) # type: ignore[attr-defined] if copy.config is Undefined: copy.config = core.Config() copy.config["{prop}"] = core.{classname}(*args, **kwargs) return copy """ +ENCODE_SIGNATURE: Final = ''' +def _encode_signature({encode_method_args}): + """{docstring}""" + ... +''' + class SchemaGenerator(codegen.SchemaGenerator): schema_class_template = textwrap.dedent( @@ -187,24 +256,28 @@ class {classname}({basename}): ''' ) - def _process_description(self, description: str): - description = "".join( - [ - reSpecial.sub("", d) if i % 2 else d - for i, d in enumerate(reLink.split(description)) - ] - ) # remove formatting from links - description = m2r.convert(description) - description = description.replace(m2r.prolog, "") - description = description.replace(":raw-html-m2r:", ":raw-html:") - description = description.replace(r"\ ,", ",") - description = description.replace(r"\ ", " ") - # turn explicit references into anonymous references - description = description.replace(">`_", ">`__") - # Some entries in the Vega-Lite schema miss the second occurence of '__' - description = description.replace("__Default value: ", "__Default value:__ ") - description += "\n" - return description.strip() + def _process_description(self, description: str) -> str: + return process_description(description) + + +def process_description(description: str) -> str: + description = "".join( + [ + reSpecial.sub("", d) if i % 2 else d + for i, d in enumerate(reLink.split(description)) + ] + ) # remove formatting from links + description = m2r.convert(description) + description = description.replace(m2r.prolog, "") + description = description.replace(":raw-html-m2r:", ":raw-html:") + description = description.replace(r"\ ,", ",") + description = description.replace(r"\ ", " ") + # turn explicit references into anonymous references + description = description.replace(">`_", ">`__") + # Some entries in the Vega-Lite schema miss the second occurence of '__' + description = description.replace("__Default value: ", "__Default value:__ ") + description += "\n" + return description.strip() class FieldSchemaGenerator(SchemaGenerator): @@ -277,6 +350,45 @@ def download_schemafile( return filename +def load_schema_with_shorthand_properties(schemapath: str) -> dict: + with open(schemapath, encoding="utf8") as f: + schema = json.load(f) + + schema = _add_shorthand_property_to_field_encodings(schema) + return schema + + +def _add_shorthand_property_to_field_encodings(schema: dict) -> dict: + encoding_def = "FacetedEncoding" + + encoding = SchemaInfo(schema["definitions"][encoding_def], rootschema=schema) + + for _, propschema in encoding.properties.items(): + def_dict = get_field_datum_value_defs(propschema, schema) + + field_ref = def_dict.get("field") + if field_ref is not None: + defschema = {"$ref": field_ref} + defschema = copy.deepcopy(resolve_references(defschema, schema)) + # For Encoding field definitions, we patch the schema by adding the + # shorthand property. + defschema["properties"]["shorthand"] = { + "anyOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}}, + {"$ref": "#/definitions/RepeatRef"}, + ], + "description": "shorthand for field, aggregate, and type", + } + if "required" not in defschema: + defschema["required"] = ["shorthand"] + else: + if "shorthand" not in defschema["required"]: + defschema["required"].append("shorthand") + schema["definitions"][field_ref.split("/")[-1]] = defschema + return schema + + def copy_schemapi_util() -> None: """ Copy the schemapi utility into altair/utils/ and its test file to tests/utils/ @@ -359,8 +471,7 @@ def generate_vegalite_schema_wrapper(schema_file: str) -> str: # TODO: generate simple tests for each wrapper basename = "VegaLiteSchema" - with open(schema_file, encoding="utf8") as f: - rootschema = json.load(f) + rootschema = load_schema_with_shorthand_properties(schema_file) definitions: Dict[str, SchemaGenerator] = {} @@ -393,9 +504,13 @@ def generate_vegalite_schema_wrapper(schema_file: str) -> str: contents = [ HEADER, + "from typing import Any, Literal, Union, Protocol, Sequence, List", + "from typing import Dict as TypingDict", + "from typing import Generator as TypingGenerator" "", "from altair.utils.schemapi import SchemaBase, Undefined, UndefinedType, _subclasses", LOAD_SCHEMA.format(schemafile="vega-lite-schema.json"), ] + contents.append(PARAMETER_PROTOCOL) contents.append(BASE_SCHEMA.format(basename=basename)) contents.append( schema_class( @@ -413,39 +528,54 @@ def generate_vegalite_schema_wrapper(schema_file: str) -> str: return "\n".join(contents) +@dataclass +class ChannelInfo: + supports_arrays: bool + deep_description: str + field_class_name: Optional[str] = None + datum_class_name: Optional[str] = None + value_class_name: Optional[str] = None + + def generate_vegalite_channel_wrappers( schemafile: str, version: str, imports: Optional[List[str]] = None ) -> str: # TODO: generate __all__ for top of file - with open(schemafile, encoding="utf8") as f: - schema = json.load(f) + schema = load_schema_with_shorthand_properties(schemafile) if imports is None: imports = [ "import sys", "from . import core", "import pandas as pd", - "from altair.utils.schemapi import Undefined, with_property_setters", + "from altair.utils.schemapi import Undefined, UndefinedType, with_property_setters", "from altair.utils import parse_shorthand", - "from typing import overload, List", - "", - "from typing import Literal", + "from typing import Any, overload, Sequence, List, Literal, Union, Optional", + "from typing import Dict as TypingDict", ] contents = [HEADER] + contents.append(CHANNEL_MYPY_IGNORE_STATEMENTS) contents.extend(imports) contents.append("") contents.append(CHANNEL_MIXINS) - if version == "v2": - encoding_def = "EncodingWithFacet" - else: - encoding_def = "FacetedEncoding" + encoding_def = "FacetedEncoding" encoding = SchemaInfo(schema["definitions"][encoding_def], rootschema=schema) + channel_infos: dict[str, ChannelInfo] = {} + for prop, propschema in encoding.properties.items(): def_dict = get_field_datum_value_defs(propschema, schema) + supports_arrays = any( + schema_info.is_array() for schema_info in propschema.anyOf + ) + channel_info = ChannelInfo( + supports_arrays=supports_arrays, + deep_description=propschema.deep_description, + ) + for encoding_spec, definition in def_dict.items(): classname = prop[0].upper() + prop[1:] basename = definition.split("/")[-1] @@ -461,25 +591,19 @@ def generate_vegalite_channel_wrappers( if encoding_spec == "field": Generator = FieldSchemaGenerator nodefault = [] - defschema = copy.deepcopy(resolve_references(defschema, schema)) - - # For Encoding field definitions, we patch the schema by adding the - # shorthand property. - defschema["properties"]["shorthand"] = { - "type": "string", - "description": "shorthand for field, aggregate, and type", - } - defschema["required"] = ["shorthand"] + channel_info.field_class_name = classname elif encoding_spec == "datum": Generator = DatumSchemaGenerator classname += "Datum" nodefault = ["datum"] + channel_info.datum_class_name = classname elif encoding_spec == "value": Generator = ValueSchemaGenerator classname += "Value" nodefault = ["value"] + channel_info.value_class_name = classname gen = Generator( classname=classname, @@ -489,8 +613,15 @@ def generate_vegalite_channel_wrappers( encodingname=prop, nodefault=nodefault, haspropsetters=True, + altair_classes_prefix="core", ) contents.append(gen.schema_class()) + + channel_infos[prop] = channel_info + + # Generate the type signature for the encode method + encode_signature = _create_encode_signature(channel_infos) + contents.append(encode_signature) return "\n".join(contents) @@ -503,7 +634,9 @@ def generate_vegalite_mark_mixin( class_name = "MarkMethodMixin" imports = [ - "from altair.utils.schemapi import Undefined", + "from typing import Any, Sequence, List, Literal, Union", + "", + "from altair.utils.schemapi import Undefined, UndefinedType", "from . import core", ] @@ -525,7 +658,11 @@ def generate_vegalite_mark_mixin( arg_info.kwds -= {"type"} def_args = ["self"] + [ - "{}=Undefined".format(p) + f"{p}: Union[" + + info.properties[p].get_python_type_representation( + for_type_hints=True, altair_classes_prefix="core" + ) + + ", UndefinedType] = Undefined" for p in (sorted(arg_info.required) + sorted(arg_info.kwds)) ] dict_args = [ @@ -542,8 +679,8 @@ def generate_vegalite_mark_mixin( mark_method = MARK_METHOD.format( mark=mark, mark_def=mark_def, - def_arglist=indent_arglist(def_args, indent_level=10 + len(mark)), - dict_arglist=indent_arglist(dict_args, indent_level=16), + def_arglist=", ".join(def_args), + dict_arglist=", ".join(dict_args), ) code.append("\n ".join(mark_method.splitlines())) @@ -591,25 +728,28 @@ def vegalite_main(skip_download: bool = False) -> None: # Generate __init__.py file outfile = join(schemapath, "__init__.py") print("Writing {}".format(outfile)) + content = [ + "# ruff: noqa\n", + "from .core import *\nfrom .channels import * # type: ignore[assignment]\n", + f"SCHEMA_VERSION = '{version}'\n", + "SCHEMA_URL = {!r}\n" "".format(schema_url(version)), + ] with open(outfile, "w", encoding="utf8") as f: - f.write("# ruff: noqa\n") - f.write("from .core import *\nfrom .channels import *\n") - f.write(f"SCHEMA_VERSION = '{version}'\n") - f.write("SCHEMA_URL = {!r}\n" "".format(schema_url(version))) + f.write(ruff_format_str(content)) # Generate the core schema wrappers outfile = join(schemapath, "core.py") print("Generating\n {}\n ->{}".format(schemafile, outfile)) file_contents = generate_vegalite_schema_wrapper(schemafile) with open(outfile, "w", encoding="utf8") as f: - f.write(file_contents) + f.write(ruff_format_str(file_contents)) # Generate the channel wrappers outfile = join(schemapath, "channels.py") print("Generating\n {}\n ->{}".format(schemafile, outfile)) code = generate_vegalite_channel_wrappers(schemafile, version=version) with open(outfile, "w", encoding="utf8") as f: - f.write(code) + f.write(ruff_format_str(code)) # generate the mark mixin markdefs = {k: k + "Def" for k in ["Mark", "BoxPlot", "ErrorBar", "ErrorBand"]} @@ -625,17 +765,71 @@ def vegalite_main(skip_download: bool = False) -> None: ] stdlib_imports = ["import sys"] imports = sorted(set(mark_imports + config_imports)) + content = [ + HEADER, + "\n".join(stdlib_imports), + "\n\n", + "\n".join(imports), + "\n\n", + "\n".join(try_except_imports), + "\n\n\n", + mark_mixin, + "\n\n\n", + config_mixin, + ] with open(outfile, "w", encoding="utf8") as f: - f.write(HEADER) - f.write("\n".join(stdlib_imports)) - f.write("\n\n") - f.write("\n".join(imports)) - f.write("\n\n") - f.write("\n".join(try_except_imports)) - f.write("\n\n\n") - f.write(mark_mixin) - f.write("\n\n\n") - f.write(config_mixin) + f.write(ruff_format_str(content)) + + +def _create_encode_signature( + channel_infos: Dict[str, ChannelInfo], +) -> str: + signature_args: list[str] = ["self"] + docstring_parameters: list[str] = ["", "Parameters", "----------", ""] + for channel, info in channel_infos.items(): + field_class_name = info.field_class_name + assert ( + field_class_name is not None + ), "All channels are expected to have a field class" + datum_and_value_class_names = [] + if info.datum_class_name is not None: + datum_and_value_class_names.append(info.datum_class_name) + + if info.value_class_name is not None: + datum_and_value_class_names.append(info.value_class_name) + + # dict stands for the return types of alt.datum, alt.value as well as + # the dictionary representation of an encoding channel class. See + # discussions in https://github.com/altair-viz/altair/pull/3208 + # for more background. + union_types = ["str", field_class_name, "dict"] + docstring_union_types = ["str", rst_syntax_for_class(field_class_name), "Dict"] + if info.supports_arrays: + # We could be more specific about what types are accepted in the list + # but then the signatures would get rather long and less useful + # to a user when it shows up in their IDE. + union_types.append("list") + docstring_union_types.append("List") + + union_types = union_types + datum_and_value_class_names + ["UndefinedType"] + docstring_union_types = docstring_union_types + [ + rst_syntax_for_class(c) for c in datum_and_value_class_names + ] + + signature_args.append(f"{channel}: Union[{', '.join(union_types)}] = Undefined") + + docstring_parameters.append(f"{channel} : {', '.join(docstring_union_types)}") + docstring_parameters.append( + " {}".format(process_description(info.deep_description)) + ) + if len(docstring_parameters) > 1: + docstring_parameters += [""] + docstring = indent_docstring( + docstring_parameters, indent_level=4, width=100, lstrip=True + ) + return ENCODE_SIGNATURE.format( + encode_method_args=", ".join(signature_args), docstring=docstring + ) def main() -> None: diff --git a/tools/schemapi/codegen.py b/tools/schemapi/codegen.py --- a/tools/schemapi/codegen.py +++ b/tools/schemapi/codegen.py @@ -1,15 +1,15 @@ """Code generation utilities""" import re import textwrap -from typing import Set, Final, Optional, List, Iterable, Union +from typing import Set, Final, Optional, List, Union, Dict, Tuple from dataclasses import dataclass from .utils import ( SchemaInfo, is_valid_identifier, indent_docstring, - indent_arglist, - SchemaProperties, + jsonschema_to_python_types, + flatten, ) @@ -100,6 +100,7 @@ class SchemaGenerator: rootschemarepr : CodeSnippet or object, optional An object whose repr will be used in the place of the explicit root schema. + altair_classes_prefix : string, optional **kwargs : dict Additional keywords for derived classes. """ @@ -135,6 +136,7 @@ def __init__( rootschemarepr: Optional[object] = None, nodefault: Optional[List[str]] = None, haspropsetters: bool = False, + altair_classes_prefix: Optional[str] = None, **kwargs, ) -> None: self.classname = classname @@ -146,6 +148,7 @@ def __init__( self.nodefault = nodefault or () self.haspropsetters = haspropsetters self.kwargs = kwargs + self.altair_classes_prefix = altair_classes_prefix def subclasses(self) -> List[str]: """Return a list of subclass names, if any.""" @@ -181,13 +184,23 @@ def schema_class(self) -> str: **self.kwargs, ) + @property + def info(self) -> SchemaInfo: + return SchemaInfo(self.schema, self.rootschema) + + @property + def arg_info(self) -> ArgInfo: + return get_args(self.info) + def docstring(self, indent: int = 0) -> str: - # TODO: add a general description at the top, derived from the schema. - # for example, a non-object definition should list valid type, enum - # values, etc. - # TODO: use get_args here for more information on allOf objects - info = SchemaInfo(self.schema, self.rootschema) - doc = ["{} schema wrapper".format(self.classname), "", info.medium_description] + info = self.info + doc = [ + "{} schema wrapper".format(self.classname), + "", + info.get_python_type_representation( + altair_classes_prefix=self.altair_classes_prefix + ), + ] if info.description: doc += self._process_description( # remove condition description re.sub(r"\n\{\n(\n|.)*\n\}", "", info.description) @@ -199,7 +212,7 @@ def docstring(self, indent: int = 0) -> str: doc = [line for line in doc if ":raw-html:" not in line] if info.properties: - arg_info = get_args(info) + arg_info = self.arg_info doc += ["", "Parameters", "----------", ""] for prop in ( sorted(arg_info.required) @@ -208,7 +221,12 @@ def docstring(self, indent: int = 0) -> str: ): propinfo = info.properties[prop] doc += [ - "{} : {}".format(prop, propinfo.short_description), + "{} : {}".format( + prop, + propinfo.get_python_type_representation( + altair_classes_prefix=self.altair_classes_prefix, + ), + ), " {}".format( self._process_description(propinfo.deep_description) ), @@ -219,8 +237,23 @@ def docstring(self, indent: int = 0) -> str: def init_code(self, indent: int = 0) -> str: """Return code suitable for the __init__ function of a Schema class""" - info = SchemaInfo(self.schema, rootschema=self.rootschema) - arg_info = get_args(info) + args, super_args = self.init_args() + + initfunc = self.init_template.format( + classname=self.classname, + arglist=", ".join(args), + super_arglist=", ".join(super_args), + ) + if indent: + initfunc = ("\n" + indent * " ").join(initfunc.splitlines()) + return initfunc + + def init_args( + self, additional_types: Optional[List[str]] = None + ) -> Tuple[List[str], List[str]]: + additional_types = additional_types or [] + info = self.info + arg_info = self.arg_info nodefault = set(self.nodefault) arg_info.required -= nodefault @@ -238,7 +271,18 @@ def init_code(self, indent: int = 0) -> str: super_args.append("*args") args.extend( - "{}=Undefined".format(p) + f"{p}: Union[" + + ", ".join( + [ + *additional_types, + info.properties[p].get_python_type_representation( + for_type_hints=True, + altair_classes_prefix=self.altair_classes_prefix, + ), + "UndefinedType", + ] + ) + + "] = Undefined" for p in sorted(arg_info.required) + sorted(arg_info.kwds) ) super_args.extend( @@ -251,49 +295,38 @@ def init_code(self, indent: int = 0) -> str: if arg_info.additional: args.append("**kwds") super_args.append("**kwds") - - arg_indent_level = 9 + indent - super_arg_indent_level = 23 + len(self.classname) + indent - - initfunc = self.init_template.format( - classname=self.classname, - arglist=indent_arglist(args, indent_level=arg_indent_level), - super_arglist=indent_arglist( - super_args, indent_level=super_arg_indent_level - ), - ) - if indent: - initfunc = ("\n" + indent * " ").join(initfunc.splitlines()) - return initfunc - - _equiv_python_types = { - "string": "str", - "number": "float", - "integer": "int", - "object": "dict", - "boolean": "bool", - "array": "list", - "null": "None", - } + return args, super_args def get_args(self, si: SchemaInfo) -> List[str]: contents = ["self"] - props: Union[List[str], SchemaProperties] = [] + prop_infos: Dict[str, SchemaInfo] = {} if si.is_anyOf(): - props = sorted({p for si_sub in si.anyOf for p in si_sub.properties}) + prop_infos = {} + for si_sub in si.anyOf: + prop_infos.update(si_sub.properties) elif si.properties: - props = si.properties - - if props: - contents.extend([p + "=Undefined" for p in props]) + prop_infos = dict(si.properties.items()) + + if prop_infos: + contents.extend( + [ + f"{p}: Union[" + + info.get_python_type_representation( + for_type_hints=True, + altair_classes_prefix=self.altair_classes_prefix, + ) + + ", UndefinedType] = Undefined" + for p, info in prop_infos.items() + ] + ) elif si.type: - py_type = self._equiv_python_types[si.type] + py_type = jsonschema_to_python_types[si.type] if py_type == "list": # Try to get a type hint like "List[str]" which is more specific # then just "list" item_vl_type = si.items.get("type", None) if item_vl_type is not None: - item_type = self._equiv_python_types[item_vl_type] + item_type = jsonschema_to_python_types[item_vl_type] else: item_si = SchemaInfo(si.items, self.rootschema) assert item_si.is_reference() @@ -316,7 +349,7 @@ def get_signature( ) -> List[str]: lines = [] if has_overload: - lines.append("@overload # type: ignore[no-overload-impl]") + lines.append("@overload") args = ", ".join(self.get_args(sub_si)) lines.append(f"def {attr}({args}) -> '{self.classname}':") lines.append(indent * " " + "...\n") @@ -327,7 +360,7 @@ def setter_hint(self, attr: str, indent: int) -> List[str]: if si.is_anyOf(): return self._get_signature_any_of(si, attr, indent) else: - return self.get_signature(attr, si, indent) + return self.get_signature(attr, si, indent, has_overload=True) def _get_signature_any_of( self, si: SchemaInfo, attr: str, indent: int @@ -351,16 +384,3 @@ def method_code(self, indent: int = 0) -> Optional[str]: type_hints = [hint for a in args for hint in self.setter_hint(a, indent)] return ("\n" + indent * " ").join(type_hints) - - -def flatten(container: Iterable) -> Iterable: - """Flatten arbitrarily flattened list - - From https://stackoverflow.com/a/10824420 - """ - for i in container: - if isinstance(i, (list, tuple)): - for j in flatten(i): - yield j - else: - yield i diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -42,7 +42,7 @@ else: from typing_extensions import Self -_TSchemaBase = TypeVar("_TSchemaBase", bound="SchemaBase") +_TSchemaBase = TypeVar("_TSchemaBase", bound=Type["SchemaBase"]) ValidationErrorList = List[jsonschema.exceptions.ValidationError] GroupedValidationErrors = Dict[str, ValidationErrorList] diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -2,15 +2,25 @@ import keyword import re +import subprocess import textwrap import urllib -from typing import Final, Optional, List, Dict, Any +from typing import Any, Dict, Final, Iterable, List, Optional, Union from .schemapi import _resolve_references as resolve_references - EXCLUDE_KEYS: Final = ("definitions", "title", "description", "$schema", "id") +jsonschema_to_python_types = { + "string": "str", + "number": "float", + "integer": "int", + "object": "dict", + "boolean": "bool", + "array": "list", + "null": "None", +} + def get_valid_identifier( prop: str, @@ -169,69 +179,121 @@ def title(self) -> str: else: return "" - @property - def short_description(self) -> str: + def get_python_type_representation( + self, + for_type_hints: bool = False, + altair_classes_prefix: Optional[str] = None, + ) -> str: + # This is a list of all types which can be used for the current SchemaInfo. + # This includes Altair classes, standard Python types, etc. + type_representations: List[str] = [] if self.title: - # use RST syntax for generated sphinx docs - return ":class:`{}`".format(self.title) - else: - return self.medium_description - - _simple_types: Dict[str, str] = { - "string": "string", - "number": "float", - "integer": "integer", - "object": "mapping", - "boolean": "boolean", - "array": "list", - "null": "None", - } + # Add the name of the current Altair class + if for_type_hints: + class_names = [self.title] + if self.title == "ExprRef": + # In these cases, a value parameter is also always accepted. + # We use the _Parameter to indicate this although this + # protocol would also pass for selection parameters but + # due to how the Parameter class is defined, it would be quite + # complex to further differentiate between a value and + # a selection parameter based on the type system (one could + # try to check for the type of the Parameter.param attribute + # but then we would need to write some overload signatures for + # api.param). + class_names.append("_Parameter") + if self.title == "ParameterExtent": + class_names.append("_Parameter") + + prefix = ( + "" if not altair_classes_prefix else altair_classes_prefix + "." + ) + # If there is no prefix, it might be that the class is defined + # in the same script and potentially after this line -> We use + # deferred type annotations using quotation marks. + if not prefix: + class_names = [f'"{n}"' for n in class_names] + else: + class_names = [f"{prefix}{n}" for n in class_names] + type_representations.extend(class_names) + else: + # use RST syntax for generated sphinx docs + type_representations.append(rst_syntax_for_class(self.title)) - @property - def medium_description(self) -> str: if self.is_empty(): - return "Any" + type_representations.append("Any") elif self.is_enum(): - return "enum({})".format(", ".join(map(repr, self.enum))) - elif self.is_anyOf(): - return "anyOf({})".format( - ", ".join(s.short_description for s in self.anyOf) - ) - elif self.is_oneOf(): - return "oneOf({})".format( - ", ".join(s.short_description for s in self.oneOf) + type_representations.append( + "Literal[{}]".format(", ".join(map(repr, self.enum))) ) - elif self.is_allOf(): - return "allOf({})".format( - ", ".join(s.short_description for s in self.allOf) + elif self.is_anyOf(): + type_representations.extend( + [ + s.get_python_type_representation( + for_type_hints=for_type_hints, + altair_classes_prefix=altair_classes_prefix, + ) + for s in self.anyOf + ] ) - elif self.is_not(): - return "not {}".format(self.not_.short_description) elif isinstance(self.type, list): options = [] subschema = SchemaInfo(dict(**self.schema)) for typ_ in self.type: subschema.schema["type"] = typ_ - options.append(subschema.short_description) - return "anyOf({})".format(", ".join(options)) + options.append( + subschema.get_python_type_representation( + # We always use title if possible for nested objects + for_type_hints=for_type_hints, + altair_classes_prefix=altair_classes_prefix, + ) + ) + type_representations.extend(options) elif self.is_object(): - return "Mapping(required=[{}])".format(", ".join(self.required)) + if for_type_hints: + type_representations.append("dict") + else: + type_r = "Dict" + if self.required: + type_r += "[required=[{}]]".format(", ".join(self.required)) + type_representations.append(type_r) elif self.is_array(): - return "List({})".format(self.child(self.items).short_description) - elif self.type in self._simple_types: - return self._simple_types[self.type] - elif not self.type: - import warnings - - warnings.warn( - "no short_description for schema\n{}" "".format(self.schema), - stacklevel=1, + # A list is invariant in its type parameter. This means that e.g. + # List[str] is not a subtype of List[Union[core.FieldName, str]] + # and hence we would need to explicitly write out the combinations, + # so in this case: + # List[core.FieldName], List[str], List[core.FieldName, str] + # However, this can easily explode to too many combinations. + # Furthermore, we would also need to add additional entries + # for e.g. int wherever a float is accepted which would lead to very + # long code. + # As suggested in the mypy docs, + # https://mypy.readthedocs.io/en/stable/common_issues.html#variance, + # we revert to using Sequence which works as well for lists and also + # includes tuples which are also supported by the SchemaBase.to_dict + # method. However, it is not entirely accurate as some sequences + # such as e.g. a range are not supported by SchemaBase.to_dict but + # this tradeoff seems worth it. + type_representations.append( + "Sequence[{}]".format( + self.child(self.items).get_python_type_representation( + for_type_hints=for_type_hints, + altair_classes_prefix=altair_classes_prefix, + ) + ) ) - return "any" + elif self.type in jsonschema_to_python_types: + type_representations.append(jsonschema_to_python_types[self.type]) else: - raise ValueError( - "No medium_description available for this schema for schema" - ) + raise ValueError("No Python type representation available for this schema") + + type_representations = sorted(set(flatten(type_representations))) + type_representations_str = ", ".join(type_representations) + # If it's not for_type_hints but instead for the docstrings, we don't want + # to include Union as it just clutters the docstrings. + if len(type_representations) > 1 and for_type_hints: + type_representations_str = f"Union[{type_representations_str}]" + return type_representations_str @property def properties(self) -> SchemaProperties: @@ -363,22 +425,6 @@ def is_array(self) -> bool: return self.type == "array" -def indent_arglist( - args: List[str], indent_level: int, width: int = 100, lstrip: bool = True -) -> str: - """Indent an argument list for use in generated code""" - wrapper = textwrap.TextWrapper( - width=width, - initial_indent=indent_level * " ", - subsequent_indent=indent_level * " ", - break_long_words=False, - ) - wrapped = "\n".join(wrapper.wrap(", ".join(args))) - if lstrip: - wrapped = wrapped.lstrip() - return wrapped - - def indent_docstring( lines: List[str], indent_level: int, width: int = 100, lstrip=True ) -> str: @@ -468,3 +514,34 @@ def fix_docstring_issues(docstring: str) -> str: "types#datetime", "https://vega.github.io/vega-lite/docs/datetime.html" ) return docstring + + +def rst_syntax_for_class(class_name: str) -> str: + return f":class:`{class_name}`" + + +def flatten(container: Iterable) -> Iterable: + """Flatten arbitrarily flattened list + + From https://stackoverflow.com/a/10824420 + """ + for i in container: + if isinstance(i, (list, tuple)): + for j in flatten(i): + yield j + else: + yield i + + +def ruff_format_str(code: Union[str, List[str]]) -> str: + if isinstance(code, list): + code = "\n".join(code) + + r = subprocess.run( + # Name of the file does not seem to matter but ruff requires one + ["ruff", "format", "--stdin-filename", "placeholder.py"], + input=code.encode(), + check=True, + capture_output=True, + ) + return r.stdout.decode() diff --git a/tools/update_init_file.py b/tools/update_init_file.py --- a/tools/update_init_file.py +++ b/tools/update_init_file.py @@ -4,20 +4,34 @@ """ import inspect import sys -import subprocess -from pathlib import Path from os.path import abspath, dirname, join -from typing import TypeVar, Type, cast, List, Any, Optional, Iterable, Union, IO +from pathlib import Path +from typing import ( + IO, + Any, + Iterable, + List, + Optional, + Protocol, + Sequence, + Type, + TypeVar, + Union, + cast, +) if sys.version_info >= (3, 11): from typing import Self else: from typing_extensions import Self -from typing import Literal, Final +from typing import Final, Literal -# Import Altair from head ROOT_DIR: Final = abspath(join(dirname(__file__), "..")) +sys.path.insert(0, abspath(dirname(__file__))) +from schemapi.utils import ruff_format_str # noqa: E402 + +# Import Altair from head sys.path.insert(0, ROOT_DIR) import altair as alt # noqa: E402 @@ -64,17 +78,6 @@ def update__all__variable() -> None: f.write(new_file_content) -def ruff_format_str(code: str) -> str: - r = subprocess.run( - # Name of the file does not seem to matter but ruff requires one - ["ruff", "format", "--stdin-filename", "placeholder.py"], - input=code.encode(), - check=True, - capture_output=True, - ) - return r.stdout.decode() - - def _is_relevant_attribute(attr_name: str) -> bool: attr = getattr(alt, attr_name) if ( @@ -90,8 +93,12 @@ def _is_relevant_attribute(attr_name: str) -> bool: or attr is Optional or attr is Iterable or attr is Union + or attr is Protocol + or attr is Sequence or attr is IO or attr_name == "TypingDict" + or attr_name == "TypingGenerator" + or attr_name == "ValueOrDatum" ): return False else:
diff --git a/tests/examples_arguments_syntax/scatter_marginal_hist.py b/tests/examples_arguments_syntax/scatter_marginal_hist.py --- a/tests/examples_arguments_syntax/scatter_marginal_hist.py +++ b/tests/examples_arguments_syntax/scatter_marginal_hist.py @@ -11,12 +11,11 @@ source = data.iris() base = alt.Chart(source) +base_bar = base.mark_bar(opacity=0.3, binSpacing=0) xscale = alt.Scale(domain=(4.0, 8.0)) yscale = alt.Scale(domain=(1.9, 4.55)) -bar_args = {"opacity": 0.3, "binSpacing": 0} - points = base.mark_circle().encode( alt.X("sepalLength", scale=xscale), alt.Y("sepalWidth", scale=yscale), @@ -24,7 +23,7 @@ ) top_hist = ( - base.mark_bar(**bar_args) + base_bar .encode( alt.X( "sepalLength:Q", @@ -42,7 +41,7 @@ ) right_hist = ( - base.mark_bar(**bar_args) + base_bar .encode( alt.Y( "sepalWidth:Q", diff --git a/tests/examples_methods_syntax/scatter_marginal_hist.py b/tests/examples_methods_syntax/scatter_marginal_hist.py --- a/tests/examples_methods_syntax/scatter_marginal_hist.py +++ b/tests/examples_methods_syntax/scatter_marginal_hist.py @@ -11,12 +11,11 @@ source = data.iris() base = alt.Chart(source) +base_bar = base.mark_bar(opacity=0.3, binSpacing=0) xscale = alt.Scale(domain=(4.0, 8.0)) yscale = alt.Scale(domain=(1.9, 4.55)) -bar_args = {"opacity": 0.3, "binSpacing": 0} - points = base.mark_circle().encode( alt.X("sepalLength").scale(xscale), alt.Y("sepalWidth").scale(yscale), @@ -24,7 +23,7 @@ ) top_hist = ( - base.mark_bar(**bar_args) + base_bar .encode( alt.X("sepalLength:Q") # when using bins, the axis scale is set through @@ -38,7 +37,7 @@ ) right_hist = ( - base.mark_bar(**bar_args) + base_bar .encode( alt.Y("sepalWidth:Q") .bin(maxbins=20, extent=yscale.domain)
infer argument types from vegalite schema Based on these two comments in this PR https://github.com/altair-viz/altair/pull/2846: > _Originally posted by @mattijn in https://github.com/altair-viz/altair/issues/2846#issuecomment-1401606735_ > > I understand that adding another dependency just to reduce 5 lines of code is probably not worth it. I also agree that there may be other recent type-related changes in the core of Python that makes it something to consider if we look a bit broader than this PR alone. > > We previously had two types of discussions about types in Altair. > > - One is about improving the existing Python code in the /tools folder in the Altair repository, such as this issue (https://github.com/altair-viz/altair/issues/2493) and related PR (https://github.com/altair-viz/altair/pull/2614, btw I now notice that this PR also uses the `TypeVar` bound approach). > > - The other is about including types in the generated Python code of Altair, originally (https://github.com/altair-viz/altair/pull/2670) adapted to (https://github.com/altair-viz/altair/pull/2681) and then reverted back to the original in (https://github.com/altair-viz/altair/issues/2714). > > Especially the result of the second bullet has set the type `Any` to anything that is `Undefined` finishing this discussion on, 'what is the type of `Undefined`?'. > > However, with your impressive PRs regarding jsonschema and types, I was wondering, since types are included in the vega-lite jsonschema, if these types can also be inferred for each argument? Maybe recent type-related changes in the core of Python can make this easier? It is merely an open question from which I don't know enough if it is worthwhile to consider. and > _Originally posted by @binste in https://github.com/altair-viz/altair/issues/2846#issuecomment-1404066238_ > > Thanks for writing this down! This is very helpful. It should be possible to create Python type hints based on the vl schema, especially given that this parsing is already done for the docstrings, see e.g. https://github.com/altair-viz/altair/blob/master/altair/vegalite/v5/schema/channels.py#L12509 where the `stack` argument to `alt.X` is documented as: > ``` > stack : anyOf(:class:`StackOffset`, None, boolean) > ``` > > There are probably also synergies with replacing the vega-lite types with Python types in all error messages (suggested by you in https://github.com/altair-viz/altair/pull/2842#issuecomment-1400813951) and docstrings. > > As more type hints shouldn't break anyones code, I don't think we would need to necessarily include it in the release candidate but I'm definitely intrigued in giving this a try. I really like the development experience you get for a library with well-defined type hints such as better autocompletion as well as early warnings if you pass a wrong value to an argument before even executing the code, for example if you'd pass an integer to `stack`. The same linters could then of course be used in CI/CD pipelines. > > I'll try to get a draft PR going in the coming weeks so we can further explore how well it works.
Type checking from the jsonschema is interesting, but it is likely that the flexibility of python does not always match with the schema. See e.g. https://github.com/altair-viz/altair/issues/2877 For reference, the Pydantic docs have a mapping of Python types to json schema types: https://docs.pydantic.dev/1.10/usage/schema/#json-schema-types
2023-09-29T19:57:30Z
[]
[]
vega/altair
3,210
vega__altair-3210
[ "3205" ]
19bd5a5cb7286007d61ad8f2693254beac22496f
diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -588,8 +588,10 @@ def parse_shorthand( column = dfi.get_column_by_name(unescaped_field) try: attrs["type"] = infer_vegalite_type_for_dfi_column(column) - except NotImplementedError: - # Fall back to pandas-based inference + except (NotImplementedError, AttributeError): + # Fall back to pandas-based inference. + # Note: The AttributeError catch is a workaround for + # https://github.com/pandas-dev/pandas/issues/55332 if isinstance(data, pd.DataFrame): attrs["type"] = infer_vegalite_type(data[unescaped_field]) else:
diff --git a/tests/utils/test_core.py b/tests/utils/test_core.py --- a/tests/utils/test_core.py +++ b/tests/utils/test_core.py @@ -1,4 +1,6 @@ import types +from packaging.version import Version +from importlib.metadata import version as importlib_version import numpy as np import pandas as pd @@ -16,6 +18,8 @@ except ImportError: pa = None +PANDAS_VERSION = Version(importlib_version("pandas")) + FAKE_CHANNELS_MODULE = f''' """Fake channels module for utility tests.""" @@ -160,6 +164,10 @@ def check(s, data, **kwargs): check("month(z)", data, timeUnit="month", field="z", type="temporal") check("month(t)", data, timeUnit="month", field="t", type="temporal") + if PANDAS_VERSION >= Version("1.0.0"): + data["b"] = pd.Series([True, False, True, False, None], dtype="boolean") + check("b", data, field="b", type="nominal") + @pytest.mark.skipif(pa is None, reason="pyarrow not installed") def test_parse_shorthand_for_arrow_timestamp():
Boolean numpy-backed type fails when pyarrow is installed in env I am using altair with `pandas `dataframe with numpy-backed types and I using `streamlit `to visualize it. `streamlit` has `pyarrow ` as dependency and it turns out that datatype inference using pyarrow fails for nullable boolean of pandas dtype. Small (unrealistic) example reproduces the error: ```python import altair as alt import pandas as pd data = pd.DataFrame( { "x": pd.Series([1, 3, 5, 1, 3, 5]), "y": pd.Series([2, 4, 6, 2, 4, 6]), "flag": pd.Series([True, False, True, False, True, None], dtype="boolean"), } ) chart = alt.Chart(data).mark_circle().encode(x="x", y="y", color="flag") ``` Traceback: ``` Traceback (most recent call last): File "C:\Users\ad\AppData\Local\Programs\Python\Python311\Lib\runpy.py", line 198, in _run_module_as_main return _run_code(code, main_globals, None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\Programs\Python\Python311\Lib\runpy.py", line 88, in _run_code exec(code, run_globals) File "c:\Users\ad\.vscode\extensions\ms-python.python-2023.16.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__main__.py", line 39, in <module> cli.main() File "c:\Users\ad\.vscode\extensions\ms-python.python-2023.16.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\Users\ad\.vscode\extensions\ms-python.python-2023.16.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file runpy.run_path(target, run_name="__main__") File "c:\Users\ad\.vscode\extensions\ms-python.python-2023.16.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path return _run_module_code(code, init_globals, run_name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\ad\.vscode\extensions\ms-python.python-2023.16.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code _run_code(code, mod_globals, init_globals, File "c:\Users\ad\.vscode\extensions\ms-python.python-2023.16.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "test.py", line 18, in <module> chart.save(file, format="html") File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\vegalite\v5\api.py", line 1066, in save result = save(**kwds) ^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\save.py", line 189, in save perform_save() File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\save.py", line 127, in perform_save spec = chart.to_dict(context={"pre_transform": False}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\vegalite\v5\api.py", line 2695, in to_dict return super().to_dict( ^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\vegalite\v5\api.py", line 903, in to_dict vegalite_spec = super(TopLevelMixin, copy).to_dict( # type: ignore[misc] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 965, in to_dict result = _todict( ^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 477, in _todict return {k: _todict(v, context) for k, v in obj.items() if v is not Undefined} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 477, in <dictcomp> return {k: _todict(v, context) for k, v in obj.items() if v is not Undefined} ^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 473, in _todict return obj.to_dict(validate=False, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 965, in to_dict result = _todict( ^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 477, in _todict return {k: _todict(v, context) for k, v in obj.items() if v is not Undefined} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 477, in <dictcomp> return {k: _todict(v, context) for k, v in obj.items() if v is not Undefined} ^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\schemapi.py", line 473, in _todict return obj.to_dict(validate=False, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\vegalite\v5\schema\channels.py", line 34, in to_dict parsed = parse_shorthand(shorthand, data=context.get('data', None)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\core.py", line 590, in parse_shorthand attrs["type"] = infer_vegalite_type_for_dfi_column(column) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\altair\utils\core.py", line 639, in infer_vegalite_type_for_dfi_column kind = column.dtype[0] ^^^^^^^^^^^^ File "properties.pyx", line 36, in pandas._libs.properties.CachedProperty.__get__ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\pandas\core\interchange\column.py", line 128, in dtype return self._dtype_from_pandasdtype(dtype) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ad\AppData\Local\pypoetry\Cache\virtualenvs\ero-bIEndBiR-py3.11\Lib\site-packages\pandas\core\interchange\column.py", line 147, in _dtype_from_pandasdtype byteorder = dtype.byteorder ^^^^^^^^^^^^^^^ AttributeError: 'BooleanDtype' object has no attribute 'byteorder' ``` And my environment: ``` altair 5.1.1 Vega-Altair: A declarative statistical visualization library for Python. astroid 2.15.8 An abstract syntax tree for Python with inference support. flake8 6.1.0 the modular source code checker: pep8 pyflakes and co packaging 23.1 Core utilities for Python packages pandas 2.1.1 Powerful data structures for data analysis, time series, and statistics pathspec 0.11.2 Utility library for gitignore style pattern matching of file paths. pillow 9.5.0 Python Imaging Library (Fork) platformdirs 3.10.0 A small Python package for determining appropriate platform-specific dirs, e.g. a "user data dir". pluggy 1.3.0 plugin and hook calling mechanisms for python protobuf 4.24.3 pyarrow 13.0.0 Python library for Apache Arrow requests 2.31.0 Python HTTP for Humans. rich 13.5.3 Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal rpds-py 0.10.3 Python bindings to Rust's persistent data structures (rpds) ruff 0.0.291 An extremely fast Python linter, written in Rust. scipy 1.11.2 Fundamental algorithms for scientific computing in Python six 1.16.0 Python 2 and 3 compatibility utilities smmap 5.0.1 A pure Python implementation of a sliding window memory map manager snakeviz 2.2.0 A web-based viewer for Python profiler output sqlalchemy 2.0.21 Database Abstraction Library streamlit 1.27.0 A faster way to build and share data apps tabulate 0.9.0 Pretty-print tabular data yamllint 1.32.0 A linter for YAML files. zipp 3.17.0 Backport of pathlib-compatible object wrapper for zip files ``` Thank you for taking a looking and for making such a great tool!
Thanks for the report @pavlomuts. This looks like something we'll need to report upstream to pandas and work around in Altair. I'll try to take a closer look soon.
2023-09-30T10:54:59Z
[]
[]
vega/altair
3,377
vega__altair-3377
[ "3280" ]
71eea06f8c6116ce5919349ea8f99d547083a0fc
diff --git a/altair/utils/__init__.py b/altair/utils/__init__.py --- a/altair/utils/__init__.py +++ b/altair/utils/__init__.py @@ -2,6 +2,7 @@ infer_vegalite_type, infer_encoding_types, sanitize_dataframe, + sanitize_arrow_table, parse_shorthand, use_signature, update_nested, @@ -18,6 +19,7 @@ "infer_vegalite_type", "infer_encoding_types", "sanitize_dataframe", + "sanitize_arrow_table", "spec_to_html", "parse_shorthand", "use_signature", diff --git a/altair/utils/_vegafusion_data.py b/altair/utils/_vegafusion_data.py --- a/altair/utils/_vegafusion_data.py +++ b/altair/utils/_vegafusion_data.py @@ -45,7 +45,7 @@ def vegafusion_data_transformer( # Use default transformer for geo interface objects # # (e.g. a geopandas GeoDataFrame) return default_data_transformer(data) - elif hasattr(data, "__dataframe__"): + elif isinstance(data, DataFrameLike): table_name = f"table_{uuid.uuid4()}".replace("-", "_") extracted_inline_tables[table_name] = data return {"url": VEGAFUSION_PREFIX + table_name} diff --git a/altair/utils/core.py b/altair/utils/core.py --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -37,7 +37,7 @@ else: from typing_extensions import ParamSpec -from typing import Literal, Protocol, TYPE_CHECKING +from typing import Literal, Protocol, TYPE_CHECKING, runtime_checkable if TYPE_CHECKING: from pandas.core.interchange.dataframe_protocol import Column as PandasColumn @@ -46,6 +46,7 @@ P = ParamSpec("P") +@runtime_checkable class DataFrameLike(Protocol): def __dataframe__( self, nan_as_null: bool = False, allow_copy: bool = True @@ -429,15 +430,15 @@ def sanitize_arrow_table(pa_table): schema = pa_table.schema for name in schema.names: array = pa_table[name] - dtype = schema.field(name).type - if str(dtype).startswith("timestamp"): + dtype_name = str(schema.field(name).type) + if dtype_name.startswith("timestamp") or dtype_name.startswith("date"): arrays.append(pc.strftime(array)) - elif str(dtype).startswith("duration"): + elif dtype_name.startswith("duration"): raise ValueError( 'Field "{col_name}" has type "{dtype}" which is ' "not supported by Altair. Please convert to " "either a timestamp or a numerical value." - "".format(col_name=name, dtype=dtype) + "".format(col_name=name, dtype=dtype_name) ) else: arrays.append(array) @@ -588,7 +589,7 @@ def parse_shorthand( # if data is specified and type is not, infer type from data if "type" not in attrs: - if pyarrow_available() and data is not None and hasattr(data, "__dataframe__"): + if pyarrow_available() and data is not None and isinstance(data, DataFrameLike): dfi = data.__dataframe__() if "field" in attrs: unescaped_field = attrs["field"].replace("\\", "") diff --git a/altair/utils/data.py b/altair/utils/data.py --- a/altair/utils/data.py +++ b/altair/utils/data.py @@ -105,13 +105,12 @@ def raise_max_rows_error(): # mypy gets confused as it doesn't see Dict[Any, Any] # as equivalent to TDataType return data # type: ignore[return-value] - elif hasattr(data, "__dataframe__"): - pi = import_pyarrow_interchange() - pa_table = pi.from_dataframe(data) + elif isinstance(data, DataFrameLike): + pa_table = arrow_table_from_dfi_dataframe(data) if max_rows is not None and pa_table.num_rows > max_rows: raise_max_rows_error() # Return pyarrow Table instead of input since the - # `from_dataframe` call may be expensive + # `arrow_table_from_dfi_dataframe` call above may be expensive return pa_table if max_rows is not None and len(values) > max_rows: @@ -142,10 +141,8 @@ def sample( else: # Maybe this should raise an error or return something useful? return None - elif hasattr(data, "__dataframe__"): - # experimental interchange dataframe support - pi = import_pyarrow_interchange() - pa_table = pi.from_dataframe(data) + elif isinstance(data, DataFrameLike): + pa_table = arrow_table_from_dfi_dataframe(data) if not n: if frac is None: raise ValueError( @@ -232,10 +229,8 @@ def to_values(data: DataType) -> ToValuesReturnType: if "values" not in data: raise KeyError("values expected in data dict, but not present.") return data - elif hasattr(data, "__dataframe__"): - # experimental interchange dataframe support - pi = import_pyarrow_interchange() - pa_table = sanitize_arrow_table(pi.from_dataframe(data)) + elif isinstance(data, DataFrameLike): + pa_table = sanitize_arrow_table(arrow_table_from_dfi_dataframe(data)) return {"values": pa_table.to_pylist()} else: # Should never reach this state as tested by check_data_type @@ -243,8 +238,8 @@ def to_values(data: DataType) -> ToValuesReturnType: def check_data_type(data: DataType) -> None: - if not isinstance(data, (dict, pd.DataFrame)) and not any( - hasattr(data, attr) for attr in ["__geo_interface__", "__dataframe__"] + if not isinstance(data, (dict, pd.DataFrame, DataFrameLike)) and not any( + hasattr(data, attr) for attr in ["__geo_interface__"] ): raise TypeError( "Expected dict, DataFrame or a __geo_interface__ attribute, got: {}".format( @@ -277,10 +272,8 @@ def _data_to_json_string(data: DataType) -> str: if "values" not in data: raise KeyError("values expected in data dict, but not present.") return json.dumps(data["values"], sort_keys=True) - elif hasattr(data, "__dataframe__"): - # experimental interchange dataframe support - pi = import_pyarrow_interchange() - pa_table = pi.from_dataframe(data) + elif isinstance(data, DataFrameLike): + pa_table = arrow_table_from_dfi_dataframe(data) return json.dumps(pa_table.to_pylist()) else: raise NotImplementedError( @@ -303,13 +296,12 @@ def _data_to_csv_string(data: Union[dict, pd.DataFrame, DataFrameLike]) -> str: if "values" not in data: raise KeyError("values expected in data dict, but not present") return pd.DataFrame.from_dict(data["values"]).to_csv(index=False) - elif hasattr(data, "__dataframe__"): + elif isinstance(data, DataFrameLike): # experimental interchange dataframe support - pi = import_pyarrow_interchange() import pyarrow as pa import pyarrow.csv as pa_csv - pa_table = pi.from_dataframe(data) + pa_table = arrow_table_from_dfi_dataframe(data) csv_buffer = pa.BufferOutputStream() pa_csv.write_csv(pa_table, csv_buffer) return csv_buffer.getvalue().to_pybytes().decode() @@ -346,3 +338,23 @@ def curry(*args, **kwargs): stacklevel=1, ) return curried.curry(*args, **kwargs) + + +def arrow_table_from_dfi_dataframe(dfi_df: DataFrameLike) -> "pyarrow.lib.Table": + """Convert a DataFrame Interchange Protocol compatible object to an Arrow Table""" + import pyarrow as pa + + # First check if the dataframe object has a method to convert to arrow. + # Give this preference over the pyarrow from_dataframe function since the object + # has more control over the conversion, and may have broader compatibility. + # This is the case for Polars, which supports Date32 columns in direct conversion + # while pyarrow does not yet support this type in from_dataframe + for convert_method_name in ("arrow", "to_arrow", "to_arrow_table"): + convert_method = getattr(dfi_df, convert_method_name, None) + if callable(convert_method): + result = convert_method() + if isinstance(result, pa.Table): + return result + + pi = import_pyarrow_interchange() + return pi.from_dataframe(dfi_df) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -56,7 +56,7 @@ def _dataset_name(values: Union[dict, list, core.InlineDataset]) -> str: values = values.to_dict() if values == [{}]: return "empty" - values_json = json.dumps(values, sort_keys=True) + values_json = json.dumps(values, sort_keys=True, default=str) hsh = hashlib.sha256(values_json.encode()).hexdigest()[:32] return "data-" + hsh @@ -114,7 +114,7 @@ def _prepare_data(data, context=None): elif isinstance(data, str): data = core.UrlData(data) - elif hasattr(data, "__dataframe__"): + elif isinstance(data, DataFrameLike): data = _pipe(data, data_transformers.get()) # consolidate inline data to top-level datasets
diff --git a/tests/utils/test_mimebundle.py b/tests/utils/test_mimebundle.py --- a/tests/utils/test_mimebundle.py +++ b/tests/utils/test_mimebundle.py @@ -241,7 +241,7 @@ def check_pre_transformed_vega_spec(vega_spec): # Check that the bin transform has been applied row0 = data_0["values"][0] - assert row0 == {"a": "A", "b": 28, "b_end": 28.0, "b_start": 0.0} + assert row0 == {"a": "A", "b_end": 28.0, "b_start": 0.0} # And no transforms remain assert len(data_0.get("transform", [])) == 0 diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -6,7 +6,7 @@ import pandas as pd import pytest -from altair.utils import infer_vegalite_type, sanitize_dataframe +from altair.utils import infer_vegalite_type, sanitize_dataframe, sanitize_arrow_table try: import pyarrow as pa @@ -120,6 +120,53 @@ def test_sanitize_dataframe_arrow_columns(): json.dumps(records) [email protected](pa is None, reason="pyarrow not installed") +def test_sanitize_pyarrow_table_columns(): + # create a dataframe with various types + df = pd.DataFrame( + { + "s": list("abcde"), + "f": np.arange(5, dtype=float), + "i": np.arange(5, dtype=int), + "b": np.array([True, False, True, True, False]), + "d": pd.date_range("2012-01-01", periods=5, freq="H"), + "c": pd.Series(list("ababc"), dtype="category"), + "p": pd.date_range("2012-01-01", periods=5, freq="H").tz_localize("UTC"), + } + ) + + # Create pyarrow table with explicit schema so that date32 type is preserved + pa_table = pa.Table.from_pandas( + df, + pa.schema( + [ + pa.field("s", pa.string()), + pa.field("f", pa.float64()), + pa.field("i", pa.int64()), + pa.field("b", pa.bool_()), + pa.field("d", pa.date32()), + pa.field("c", pa.dictionary(pa.int8(), pa.string())), + pa.field("p", pa.timestamp("ns", tz="UTC")), + ] + ), + ) + sanitized = sanitize_arrow_table(pa_table) + values = sanitized.to_pylist() + + assert values[0] == { + "s": "a", + "f": 0.0, + "i": 0, + "b": True, + "d": "2012-01-01T00:00:00", + "c": "a", + "p": "2012-01-01T00:00:00.000000000", + } + + # Make sure we can serialize to JSON without error + json.dumps(values) + + def test_sanitize_dataframe_colnames(): df = pd.DataFrame(np.arange(12).reshape(4, 3))
Polars Dataframe with "date" dtype would not be rendered by Altair. Two workarounds (with and without pandas) are proposed. ## Issue when altair (version 5.2.0) chart would not render if **any of the column** is in ["**date**" temporal data type](https://pola-rs.github.io/polars/user-guide/transformations/time-series/parsing/). I found that whenever there is a `date` data type column in the polars dataframe, the altair would not render the chart properly. Only when there is no `date` column, either by removing it completely, or by casting it to pandas or different data type as below. ### Code to reproduce issue ```python import polars as pl import altair as alt # Importing data from vegadataset via url dfx = pl.read_csv( "https://raw.githubusercontent.com/vega/vega-datasets/main/data/seattle-weather.csv", try_parse_dates=True) dfx ``` ![CleanShot 2023-12-10 at 18 43 55@2x](https://github.com/altair-viz/altair/assets/73975333/9e6ab7d0-6495-41f4-8a75-a29b71a0811e) As shown above, `try_parse_dates=True` the date column will be "`date`" format. Using altair 5.2.0 version, if plotted using `rect` encoding the output will not be rendered. ```python import altair as alt alt.Chart(dfx).mark_rect().encode( alt.X("date(date):O").axis(labelAngle=0, format="%e").title("Day"), alt.Y("month(date):O").title("Month"), alt.Color("max(temp_max):Q", scale=alt.Scale(scheme="redblue")).title("Max Temp"), ) ``` ![CleanShot 2023-12-10 at 14 17 58@2x](https://github.com/altair-viz/altair/assets/73975333/e06fef56-baa0-4c40-b10e-03363b80281a) There are two workarounds to avoid this issue: ### 1. Convert to pandas dataframe using `to_pandas()` before using altair. This means the altair will use the familiar format (pandas dataframe) instead of polars, however that means we wouldn't get the benefit of using polars dataframe later on (e.g. speed, etc.). Perhaps works best if we are not planning to do any data wrangling with polars later on. ```python dfx = ( pl.read_csv( "https://raw.githubusercontent.com/vega/vega-datasets/main/data/seattle-weather.csv", try_parse_dates=True ) .to_pandas() ) dfx ``` ![CleanShot 2023-12-10 at 18 44 23@2x](https://github.com/altair-viz/altair/assets/73975333/d47ec193-3f1f-4467-be72-a47ee6f5a75d) Using the same code to make a chart from altair would work: ![CleanShot 2023-12-10 at 18 44 57@2x](https://github.com/altair-viz/altair/assets/73975333/b88e4398-1b83-4b62-b134-edf6c488fecf) However, if we plan to use polars as the main dataframe library, then the second method is better. ### 2. Parse the date column to `datetime` type instead of `date` data type. Casting the str type to `datetime[μs]` before we make the plot in altair. > This works when the `try_parse_dates=False` (which is the default setting in `read_csv`) ```python dfx = ( pl.read_csv( "https://raw.githubusercontent.com/vega/vega-datasets/main/data/seattle-weather.csv") .with_columns(pl.col("date").str.to_datetime()) ) dfx.head() ``` ![CleanShot 2023-12-10 at 18 50 40@2x](https://github.com/altair-viz/altair/assets/73975333/adde060c-93ed-4b51-948b-00ec815b1c54) Then just do the same chart plotting using altair would then work. ![CleanShot 2023-12-10 at 18 51 22@2x](https://github.com/altair-viz/altair/assets/73975333/26293768-9116-4753-8571-1e04ed7429bc)
Thanks for the report @ariewjy, and apologies for the slow response. I'll have to look more closely, but this looks like a limitation in pyarrow's implementation of the DataFrame interchange protocol. We should be able to work around it, but will take some experimentation to see where it makes sense to do this. So I looked into this a bit more, and found that pyarrow doesn't support loading Date32 columns through the dataframe interchange protocol. https://github.com/apache/arrow/issues/39539. I posted a repro of this error in that thread and asked what the best path forward is. We could work around this by introducing an optional dependency on polars, but we were hoping we could avoid this and focus only on supporting the dataframe interchange protocol. But I would very much like Altair to work smoothly with Polars, so depending on how likely this is to be resolved in pyarrow, we may need to do this in the short term. cc @mattijn in case you have thoughts
2024-03-22T12:50:31Z
[]
[]
openmc-dev/openmc
477
openmc-dev__openmc-477
[ "164" ]
3ffc466083ee999bdc64ba9b2ae6ba379cc163a7
diff --git a/openmc/summary.py b/openmc/summary.py --- a/openmc/summary.py +++ b/openmc/summary.py @@ -179,6 +179,11 @@ def _read_surfaces(self): if surf_type == 'z-cone': surface = openmc.ZCone(surface_id, bc, x0, y0, z0, R2, name) + elif surf_type == 'quadric': + a, b, c, d, e, f, g, h, j, k = coeffs + surface = openmc.Quadric(surface_id, bc, a, b, c, d, e, f, + g, h, j, k, name) + # Add Surface to global dictionary of all Surfaces self.surfaces[index] = surface diff --git a/openmc/surface.py b/openmc/surface.py --- a/openmc/surface.py +++ b/openmc/surface.py @@ -949,6 +949,152 @@ def __init__(self, surface_id=None, boundary_type='transmission', self._type = 'z-cone' +class Quadric(Surface): + """A sphere of the form :math:`Ax^2 + By^2 + Cz^2 + Dxy + Eyz + Fxz + Gx + Hy + + Jz + K`. + + Parameters + ---------- + surface_id : int + Unique identifier for the surface. If not specified, an identifier will + automatically be assigned. + boundary_type : {'transmission, 'vacuum', 'reflective', 'periodic'} + Boundary condition that defines the behavior for particles hitting the + surface. Defaults to transmissive boundary condition where particles + freely pass through the surface. + a, b, c, d, e, f, g, h, j, k : float + coefficients for the surface + name : str + Name of the sphere. If not specified, the name will be the empty string. + + Attributes + ---------- + a, b, c, d, e, f, g, h, j, k : float + coefficients for the surface + + """ + + def __init__(self, surface_id=None, boundary_type='transmission', + a=None, b=None, c=None, d=None, e=None, f=None, g=None, + h=None, j=None, k=None, name=''): + # Initialize Quadric class attributes + super(Quadric, self).__init__(surface_id, boundary_type, name=name) + + self._type = 'quadric' + self._coeff_keys = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k'] + + if a is not None: + self.a = a + if b is not None: + self.b = b + if c is not None: + self.c = c + if d is not None: + self.d = d + if e is not None: + self.e = e + if f is not None: + self.f = f + if g is not None: + self.g = g + if h is not None: + self.h = h + if j is not None: + self.j = j + if k is not None: + self.k = k + + @property + def a(self): + return self.coeffs['a'] + + @property + def b(self): + return self.coeffs['b'] + + @property + def c(self): + return self.coeffs['c'] + + @property + def d(self): + return self.coeffs['d'] + + @property + def e(self): + return self.coeffs['e'] + + @property + def f(self): + return self.coeffs['f'] + + @property + def g(self): + return self.coeffs['g'] + + @property + def h(self): + return self.coeffs['h'] + + @property + def j(self): + return self.coeffs['j'] + + @property + def k(self): + return self.coeffs['k'] + + @a.setter + def a(self, a): + check_type('a coefficient', a, Real) + self._coeffs['a'] = a + + @b.setter + def b(self, b): + check_type('b coefficient', b, Real) + self._coeffs['b'] = b + + @c.setter + def c(self, c): + check_type('c coefficient', c, Real) + self._coeffs['c'] = c + + @d.setter + def d(self, d): + check_type('d coefficient', d, Real) + self._coeffs['d'] = d + + @e.setter + def e(self, e): + check_type('e coefficient', e, Real) + self._coeffs['e'] = e + + @f.setter + def f(self, f): + check_type('f coefficient', f, Real) + self._coeffs['f'] = f + + @g.setter + def g(self, g): + check_type('g coefficient', g, Real) + self._coeffs['g'] = g + + @h.setter + def h(self, h): + check_type('h coefficient', h, Real) + self._coeffs['h'] = h + + @j.setter + def j(self, j): + check_type('j coefficient', j, Real) + self._coeffs['j'] = j + + @k.setter + def k(self, k): + check_type('k coefficient', k, Real) + self._coeffs['k'] = k + + class Halfspace(Region): """A positive or negative half-space region.
diff --git a/tests/test_quadric_surfaces/geometry.xml b/tests/test_quadric_surfaces/geometry.xml new file mode 100644 --- /dev/null +++ b/tests/test_quadric_surfaces/geometry.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<geometry> + + <surface id="1" type="sphere" coeffs="0. 0. 5. 5." boundary="reflective" /> + <surface id="2" type="quadric" coeffs="1. 1. 1. 0. 0. 0. 0. 0. 0. -81." boundary="reflective" /> + <surface id="3" type="z-plane" coeffs="5." /> + <surface id="4" type="z-cylinder" coeffs="0. 0. 5." boundary="reflective" /> + <surface id="5" type="z-cone" coeffs="0. 0. -10. 1." boundary="reflective" /> + <surface id="6" type="plane" coeffs="0.2 0.2 1.0 -8." boundary="reflective" /> + + <cell id="1" material="1" region="-1 -2 3" /> + <cell id="2" material="1" region="-3 -4 -5 6" /> + +</geometry> diff --git a/tests/test_reflective_sphere/materials.xml b/tests/test_quadric_surfaces/materials.xml similarity index 56% rename from tests/test_reflective_sphere/materials.xml rename to tests/test_quadric_surfaces/materials.xml --- a/tests/test_reflective_sphere/materials.xml +++ b/tests/test_quadric_surfaces/materials.xml @@ -3,7 +3,8 @@ <material id="1"> <density value="4.5" units="g/cc" /> - <nuclide name="U-235" xs="71c" ao="1.0" /> + <nuclide name="U-238" xs="71c" ao="1.0" /> + <nuclide name="U-235" xs="71c" ao="0.06" /> </material> </materials> diff --git a/tests/test_quadric_surfaces/results_true.dat b/tests/test_quadric_surfaces/results_true.dat new file mode 100644 --- /dev/null +++ b/tests/test_quadric_surfaces/results_true.dat @@ -0,0 +1,2 @@ +k-combined: +9.706301E-01 4.351374E-02 diff --git a/tests/test_reflective_cone/settings.xml b/tests/test_quadric_surfaces/settings.xml similarity index 79% rename from tests/test_reflective_cone/settings.xml rename to tests/test_quadric_surfaces/settings.xml --- a/tests/test_reflective_cone/settings.xml +++ b/tests/test_quadric_surfaces/settings.xml @@ -8,7 +8,7 @@ </eigenvalue> <source> - <space type="point" parameters="0 0 -5" /> + <space type="point" parameters="0. 0. 0." /> </source> </settings> diff --git a/tests/test_reflective_cone/test_reflective_cone.py b/tests/test_quadric_surfaces/test_quadric_surfaces.py old mode 100644 new mode 100755 similarity index 100% rename from tests/test_reflective_cone/test_reflective_cone.py rename to tests/test_quadric_surfaces/test_quadric_surfaces.py diff --git a/tests/test_reflective_cone/geometry.xml b/tests/test_reflective_cone/geometry.xml deleted file mode 100644 --- a/tests/test_reflective_cone/geometry.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0"?> -<geometry> - - <surface id="1" type="z-cone" coeffs="0 0 0 5" boundary="reflective"/> - <cell id="1" material="1" region="-1" /> - -</geometry> diff --git a/tests/test_reflective_cone/materials.xml b/tests/test_reflective_cone/materials.xml deleted file mode 100644 --- a/tests/test_reflective_cone/materials.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<materials> - - <material id="1"> - <density value="4.5" units="g/cc" /> - <nuclide name="U-235" xs="71c" ao="1.0" /> - </material> - -</materials> diff --git a/tests/test_reflective_cone/results_true.dat b/tests/test_reflective_cone/results_true.dat deleted file mode 100644 --- a/tests/test_reflective_cone/results_true.dat +++ /dev/null @@ -1,2 +0,0 @@ -k-combined: -2.269987E+00 4.469683E-03 diff --git a/tests/test_reflective_cylinder/geometry.xml b/tests/test_reflective_cylinder/geometry.xml deleted file mode 100644 --- a/tests/test_reflective_cylinder/geometry.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0"?> -<geometry> - - <!-- cylinder with radius 10 --> - <surface id="1" type="z-cylinder" coeffs="0 0 10" boundary="reflective"/> - <cell id="1" material="1" region="-1" /> - -</geometry> diff --git a/tests/test_reflective_cylinder/materials.xml b/tests/test_reflective_cylinder/materials.xml deleted file mode 100644 --- a/tests/test_reflective_cylinder/materials.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<materials> - - <material id="1"> - <density value="4.5" units="g/cc" /> - <nuclide name="U-235" xs="71c" ao="1.0" /> - </material> - -</materials> diff --git a/tests/test_reflective_cylinder/results_true.dat b/tests/test_reflective_cylinder/results_true.dat deleted file mode 100644 --- a/tests/test_reflective_cylinder/results_true.dat +++ /dev/null @@ -1,2 +0,0 @@ -k-combined: -2.272436E+00 7.831006E-04 diff --git a/tests/test_reflective_cylinder/settings.xml b/tests/test_reflective_cylinder/settings.xml deleted file mode 100644 --- a/tests/test_reflective_cylinder/settings.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<settings> - - <eigenvalue> - <batches>10</batches> - <inactive>5</inactive> - <particles>1000</particles> - </eigenvalue> - - <source> - <space type="box"> - <parameters>-4 -4 -4 4 4 4</parameters> - </space> - </source> - -</settings> diff --git a/tests/test_reflective_cylinder/test_reflective_cylinder.py b/tests/test_reflective_cylinder/test_reflective_cylinder.py deleted file mode 100644 --- a/tests/test_reflective_cylinder/test_reflective_cylinder.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -sys.path.insert(0, os.pardir) -from testing_harness import TestHarness - - -if __name__ == '__main__': - harness = TestHarness('statepoint.10.*') - harness.main() diff --git a/tests/test_reflective_sphere/geometry.xml b/tests/test_reflective_sphere/geometry.xml deleted file mode 100644 --- a/tests/test_reflective_sphere/geometry.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0"?> -<geometry> - - <!-- Sphere with radius 10 --> - <surface id="1" type="sphere" coeffs="0 0 0 10" boundary="reflective"/> - <cell id="1" material="1" region="-1" /> - -</geometry> diff --git a/tests/test_reflective_sphere/results_true.dat b/tests/test_reflective_sphere/results_true.dat deleted file mode 100644 --- a/tests/test_reflective_sphere/results_true.dat +++ /dev/null @@ -1,2 +0,0 @@ -k-combined: -2.271012E+00 3.466351E-03 diff --git a/tests/test_reflective_sphere/settings.xml b/tests/test_reflective_sphere/settings.xml deleted file mode 100644 --- a/tests/test_reflective_sphere/settings.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<settings> - - <eigenvalue> - <batches>10</batches> - <inactive>5</inactive> - <particles>1000</particles> - </eigenvalue> - - <source> - <space type="box"> - <parameters>-4 -4 -4 4 4 4</parameters> - </space> - </source> - -</settings> diff --git a/tests/test_reflective_sphere/test_reflective_sphere.py b/tests/test_reflective_sphere/test_reflective_sphere.py deleted file mode 100644 --- a/tests/test_reflective_sphere/test_reflective_sphere.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -sys.path.insert(0, os.pardir) -from testing_harness import TestHarness - - -if __name__ == '__main__': - harness = TestHarness('statepoint.10.*') - harness.main()
Ellipse and ellipsoid surfaces It is not possible to model ellipses or ellipsoids currently. This would be a fairly simple addition. Just need to go through the derivations for distance to surface and reflective boundary conditions.
2015-10-09T14:42:32Z
[]
[]
openmc-dev/openmc
678
openmc-dev__openmc-678
[ "484" ]
4bfc714d5bc2844b683b72a2319f6c193657264a
diff --git a/openmc/filter.py b/openmc/filter.py --- a/openmc/filter.py +++ b/openmc/filter.py @@ -162,6 +162,11 @@ def bins(self, bins): if not isinstance(bins, Iterable): bins = [bins] + # If the bin is 0D numpy array, promote to 1D + elif isinstance(bins, np.ndarray): + if bins.shape == (): + bins.shape = (1,) + # If the bins are in a collection, convert it to a list else: bins = list(bins)
diff --git a/tests/test_score_current/results_true.dat b/tests/test_score_current/results_true.dat --- a/tests/test_score_current/results_true.dat +++ b/tests/test_score_current/results_true.dat @@ -1 +1 @@ -a9310752363eb059ff40f16ac9716b41ccab6ec6607d29f498069318745e485d18d784264304cc2586865bd58cef7587203cc22a1d485c58ddd63c14c0defdb9 \ No newline at end of file +bafab1921a12146abb2bb29603b52b9cc28a5a950a7a6bb1e3f012c05891c310fad643760d4f148b04d0fef3d1f3e141d146e3a278d81cc6fc8187c37717c5e7 \ No newline at end of file diff --git a/tests/test_tallies/inputs_true.dat b/tests/test_tallies/inputs_true.dat --- a/tests/test_tallies/inputs_true.dat +++ b/tests/test_tallies/inputs_true.dat @@ -1 +1 @@ -ca47172a42f6c13b244a763c990cbe4811662708ee03307d810a4542ee34bb5db7cc29d66aea313dad95b9f38a4ff7943ded527cfd0c7c8825372fec40cfc0d0 \ No newline at end of file +930af242a043f2676a000dbc5a2db6b148edcb31ed8c87dbaa35a8efb37a3be8cff30cdf4dc03f9c5c7eb4021f7e4c3327e64681cdd8fd8722c95c69db850227 \ No newline at end of file diff --git a/tests/test_tallies/results_true.dat b/tests/test_tallies/results_true.dat --- a/tests/test_tallies/results_true.dat +++ b/tests/test_tallies/results_true.dat @@ -1 +1 @@ -7d085e38f331083a8c3f7814eb6025f9457a1a8e3899e7d9a65af1ba92ea75c0182fcc605d4eadd3eb7edfc0949df688d39a3f45683e10cbdcfb6d7954f34129 \ No newline at end of file +a51db2a4efc681805f85968e04411dc33beee0532c202f5179b9a82880ab60a75e53fa9141c81045ea1d2842372f2d8da900326f09382ea61dd80a3c9b43bba1 \ No newline at end of file diff --git a/tests/test_tallies/test_tallies.py b/tests/test_tallies/test_tallies.py --- a/tests/test_tallies/test_tallies.py +++ b/tests/test_tallies/test_tallies.py @@ -113,10 +113,11 @@ def _build_inputs(self): polar_tally4.estimator = 'tracklength' universe_tally = Tally() - universe_tally.filters = [Filter(type='universe', bins=(1, 2, 3, 4))] + universe_tally.filters = [ + Filter(type='universe', bins=(1, 2, 3, 4, 6, 8))] universe_tally.scores = ['total'] - cell_filter = Filter(type='cell', bins=(10, 21, 22, 23)) + cell_filter = Filter(type='cell', bins=(10, 21, 22, 23, 60)) score_tallies = [Tally(), Tally(), Tally()] for t in score_tallies: t.filters = [cell_filter] @@ -128,7 +129,7 @@ def _build_inputs(self): score_tallies[1].estimator = 'analog' score_tallies[2].estimator = 'collision' - cell_filter2 = Filter(type='cell', bins=(21, 22, 23, 27, 28, 29)) + cell_filter2 = Filter(type='cell', bins=(21, 22, 23, 27, 28, 29, 60)) flux_tallies = [Tally() for i in range(4)] for t in flux_tallies: t.filters = [cell_filter2]
Tally with cell filter assumes the cells tallied to are mutually exclusive If a tally is created with a cell filter, the bins (i.e. cells) are assumed to be mutually exclusive. For instance, we can modify the `examples/xml/lattice/simple/tallies.xml` file for a 4x4 lattice of pin cells to only have the following tally: ``` <tally id="1"> <filter type="cell" bins="1 101" /> <scores>total</scores> </tally> ``` Where cell `1` is the cell filled with the lattice and cell `101` is a the fuel region of one of the pins. The `tallies.out` file would be: ``` ============================> TALLY 1 <============================ Cell 1 Total Material Total Reaction Rate 1.09346 +/- 6.47323E-03 Cell 101 Total Material Total Reaction Rate 0.0 +/- 0.0 ``` The tallies over the two cells can be put into separate tallies as follows: ``` <tally id="1"> <filter type="cell" bins="1" /> <scores>total</scores> </tally> <tally id="2"> <filter type="cell" bins="101" /> <scores>total</scores> </tally> ``` Yielding the desired results: ``` ============================> TALLY 1 <============================ Cell 1 Total Material Total Reaction Rate 1.09346 +/- 6.47323E-03 ============================> TALLY 2 <============================ Cell 101 Total Material Total Reaction Rate 4.99603E-02 +/- 4.27083E-04 ``` The openmc API will merge tallies with cell filters assuming that the cells are mutually exclusive so this issue should be addressed in both the Fortran code and Python API. As far as I can see, the documentation does not indicate that bins for the cell filter must be mutually exclusive. Fixing this issue seems like it might be difficult and waiting for the tally module to be refactored could be the best option.
I agree that a fix for this might wait until the tally module has been refactored...whenever that will be. To adjust the Python API to check for this would require a large extension of the geometric capabilities in the API; in particular, detection of overlapping cells in this case. Althoigh this might be desirable, I think that a more realistic solution is to embed the error checking in the back end. On Oct 23, 2015 12:56 PM, "sam" [email protected] wrote: > If a tally is created with a cell filter, the bins (i.e. cells) are > assumed to be mutually exclusive. For instance, we can modify the > examples/xml/lattice/simple/tallies.xml file for a 4x4 lattice of pin > cells to only have the following tally: > > <tally id="1"> > <filter type="cell" bins="1 101" /> > <scores>total</scores> > </tally> > > Where cell 1 is the cell filled with the lattice and cell 101 is a the > fuel region of one of the pins. The tallies.out file would be: > > ============================> TALLY 1 <============================ > > Cell 1 > Total Material > Total Reaction Rate 1.09346 +/- 6.47323E-03 > Cell 101 > Total Material > Total Reaction Rate 0.0 +/- 0.0 > > The tallies over the two cells can be put into separate tallies as follows: > > <tally id="1"> > <filter type="cell" bins="1" /> > <scores>total</scores> > </tally> > <tally id="2"> > <filter type="cell" bins="101" /> > <scores>total</scores> > </tally> > > Yielding the desired results: > > ============================> TALLY 1 <============================ > > Cell 1 > Total Material > Total Reaction Rate 1.09346 +/- 6.47323E-03 > > ============================> TALLY 2 <============================ > > Cell 101 > Total Material > Total Reaction Rate 4.99603E-02 +/- 4.27083E-04 > > The openmc API will merge tallies with cell filters assuming that the > cells are mutually exclusive so this issue should be addressed in both the > Fortran code and Python API. > > As far as I can see, the documentation does not indicate that bins for the > cell filter must be mutually exclusive. Fixing this issue seems like it > might be difficult and waiting for the tally module to be refactored could > be the best option. > > — > Reply to this email directly or view it on GitHub > https://github.com/mit-crpg/openmc/issues/484. Yeah, this is going to take an algorithmic change that might require data structure changes as well, so I also agree that it makes sense to do this as part of a refactor.
2016-07-01T18:08:24Z
[]
[]
openmc-dev/openmc
698
openmc-dev__openmc-698
[ "690" ]
4edede450ec60c040104023d2abf397a556ca0fe
diff --git a/data/get_nndc_data.py b/data/get_nndc_data.py --- a/data/get_nndc_data.py +++ b/data/get_nndc_data.py @@ -151,5 +151,6 @@ env = os.environ.copy() env['PYTHONPATH'] = os.path.join(cwd, '..') - subprocess.call(['../scripts/openmc-ace-to-hdf5', '-d', 'nndc_hdf5'] + subprocess.call(['../scripts/openmc-ace-to-hdf5', '-d', 'nndc_hdf5', + '--fission_energy_release', 'fission_Q_data_endfb71.h5'] + ace_files, env=env) diff --git a/docs/source/conf.py b/docs/source/conf.py --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,6 +28,9 @@ 'h5py', 'pandas', 'opencg'] sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES) +import numpy as np +np.polynomial.Polynomial = MagicMock + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/openmc/data/__init__.py b/openmc/data/__init__.py --- a/openmc/data/__init__.py +++ b/openmc/data/__init__.py @@ -14,3 +14,4 @@ from .thermal import * from .urr import * from .library import * +from .fission_energy import * diff --git a/openmc/data/endf_utils.py b/openmc/data/endf_utils.py new file mode 100644 --- /dev/null +++ b/openmc/data/endf_utils.py @@ -0,0 +1,44 @@ +"""This module contains a few utility functions for reading ENDF_ data. It is by +no means enough to read an entire ENDF file. For a more complete ENDF reader, +see Pyne_. + +.. _ENDF: http://www.nndc.bnl.gov/endf +.. _Pyne: http://www.pyne.io + +""" + +import re + +def read_float(float_string): + """Parse ENDF 6E11.0 formatted string into a float.""" + assert len(float_string) == 11 + pattern = r'([\s\-]\d+\.\d+)([\+\-]\d+)' + return float(re.sub(pattern, r'\1e\2', float_string)) + + +def read_CONT_line(line): + """Parse 80-column line from ENDF CONT record into floats and ints.""" + return (read_float(line[0:11]), read_float(line[11:22]), int(line[22:33]), + int(line[33:44]), int(line[44:55]), int(line[55:66]), + int(line[66:70]), int(line[70:72]), int(line[72:75]), + int(line[75:80])) + + +def identify_nuclide(fname): + """Read the header of an ENDF file and extract identifying information.""" + with open(fname, 'r') as fh: + # Skip the tape id (TPID). + line = fh.readline() + + # Read the first HEAD and CONT info. + line = fh.readline() + ZA, AW, LRP, LFI, NLIB, NMOD, MAT, MF, MT, NS = read_CONT_line(line) + line = fh.readline() + ELIS, STA, LIS, LISO, junk, NFOR, MAT, MF, MT, NS = read_CONT_line(line) + + # Return dictionary of the most important identifying information. + return {'Z': int(ZA) // 1000, + 'A': int(ZA) % 1000, + 'LFI': bool(LFI), + 'LIS': LIS, + 'LISO': LISO} diff --git a/openmc/data/fission_energy.py b/openmc/data/fission_energy.py new file mode 100644 --- /dev/null +++ b/openmc/data/fission_energy.py @@ -0,0 +1,592 @@ +from collections import Callable +from copy import deepcopy +import sys + +import h5py +import numpy as np + +from .data import ATOMIC_SYMBOL +from .endf_utils import read_float, read_CONT_line, identify_nuclide +from .function import Function1D, Tabulated1D, Polynomial, Sum +import openmc.checkvalue as cv + +if sys.version_info[0] >= 3: + basestring = str + + +def _extract_458_data(filename): + """Read an ENDF file and extract the MF=1, MT=458 values. + + Parameters + ---------- + filename : str + Path to and ENDF file + + Returns + ------- + value : dict of str to list of float + Dictionary that gives lists of coefficients for each energy component. + The keys are the 2-3 letter strings used in ENDF-102, e.g. 'EFR' and + 'ET'. The list will have a length of 1 for Sher-Beck data, more for + polynomial data. + uncertainty : dict of str to list of float + A dictionary with the same format as above. This is probably a + one-standard deviation value, but that is not specified explicitly in + ENDF-102. Also, some evaluations will give zero uncertainty. Use with + caution. + + """ + ident = identify_nuclide(filename) + + if not ident['LFI']: + # This nuclide isn't fissionable. + return None + + # Extract the MF=1, MT=458 section. + lines = [] + with open(filename, 'r') as fh: + line = fh.readline() + while line != '': + if line[70:75] == ' 1458': + lines.append(line) + line = fh.readline() + + if len(lines) == 0: + # No 458 data here. + return None + + # Read the number of coefficients in this LIST record. + NPL = read_CONT_line(lines[1])[4] + + # Parse the ENDF LIST into an array. + data = [] + for i in range(NPL): + row, column = divmod(i, 6) + data.append(read_float(lines[2 + row][11*column:11*(column+1)])) + + # Declare the coefficient names and the order they are given in. The LIST + # contains a value followed immediately by an uncertainty for each of these + # components, times the polynomial order + 1. + labels = ('EFR', 'ENP', 'END', 'EGP', 'EGD', 'EB', 'ENU', 'ER', 'ET') + + # Associate each set of values and uncertainties with its label. + value = {} + uncertainty = {} + for i, label in enumerate(labels): + value[label] = data[2*i::18] + uncertainty[label] = data[2*i + 1::18] + + # In ENDF/B-7.1, data for 2nd-order coefficients were mistakenly not + # converted from MeV to eV. Check for this error and fix it if present. + n_coeffs = len(value['EFR']) + if n_coeffs == 3: # Only check 2nd-order data. + # Check each energy component for the error. If a 1 MeV neutron + # causes a change of more than 100 MeV, we know something is wrong. + error_present = False + for coeffs in value.values(): + second_order = coeffs[2] + if abs(second_order) * 1e12 > 1e8: + error_present = True + break + + # If we found the error, reduce all 2nd-order coeffs by 10**6. + if error_present: + for coeffs in value.values(): coeffs[2] *= 1e-6 + for coeffs in uncertainty.values(): coeffs[2] *= 1e-6 + + # Convert eV to MeV. + for coeffs in value.values(): + for i in range(len(coeffs)): + coeffs[i] *= 10**(-6 + 6*i) + for coeffs in uncertainty.values(): + for i in range(len(coeffs)): + coeffs[i] *= 10**(-6 + 6*i) + + return value, uncertainty + + +def write_compact_458_library(endf_files, output_name='fission_Q_data.h5', + comment=None, verbose=False): + """Read ENDF files, strip the MF=1 MT=458 data and write to small HDF5. + + Parameters + ---------- + endf_files : Collection of str + Strings giving the paths to the ENDF files that will be parsed for data. + output_name : str + Name of the output HDF5 file. Default is 'fission_Q_data.h5'. + comment : str + Comment to write in the output HDF5 file. Defaults to no comment. + verbose : bool + If True, print the name of each isomer as it is read. Defaults to + False. + + """ + # Open the output file. + out = h5py.File(output_name, 'w', libver='latest') + + # Write comments, if given. This commented out comment is the one used for + # the library distributed with OpenMC. + #comment = ('This data is extracted from ENDF/B-VII.1 library. Thanks ' + # 'evaluators, for all your hard work :) Citation: ' + # 'M. B. Chadwick, M. Herman, P. Oblozinsky, ' + # 'M. E. Dunn, Y. Danon, A. C. Kahler, D. L. Smith, ' + # 'B. Pritychenko, G. Arbanas, R. Arcilla, R. Brewer, ' + # 'D. A. Brown, R. Capote, A. D. Carlson, Y. S. Cho, H. Derrien, ' + # 'K. Guber, G. M. Hale, S. Hoblit, S. Holloway, T. D. Johnson, ' + # 'T. Kawano, B. C. Kiedrowski, H. Kim, S. Kunieda, ' + # 'N. M. Larson, L. Leal, J. P. Lestone, R. C. Little, ' + # 'E. A. McCutchan, R. E. MacFarlane, M. MacInnes, ' + # 'C. M. Mattoon, R. D. McKnight, S. F. Mughabghab, ' + # 'G. P. A. Nobre, G. Palmiotti, A. Palumbo, M. T. Pigni, ' + # 'V. G. Pronyaev, R. O. Sayer, A. A. Sonzogni, N. C. Summers, ' + # 'P. Talou, I. J. Thompson, A. Trkov, R. L. Vogt, ' + # 'S. C. van der Marck, A. Wallner, M. C. White, D. Wiarda, ' + # 'and P. G. Young. ENDF/B-VII.1 nuclear data for science and ' + # 'technology: Cross sections, covariances, fission product ' + # 'yields and decay data", Nuclear Data Sheets, ' + # '112(12):2887-2996 (2011).') + if comment is not None: + out.attrs['comment'] = np.string_(comment) + + # Declare the order of the components. Use fixed-length numpy strings + # because they work well with h5py. + labels = np.array(('EFR', 'ENP', 'END', 'EGP', 'EGD', 'EB', 'ENU', 'ER', + 'ET'), dtype='S3') + out.attrs['component order'] = labels + + # Iterate over the given files. + if verbose: print('Reading ENDF files:') + for fname in endf_files: + if verbose: print(fname) + + ident = identify_nuclide(fname) + + # Skip non-fissionable nuclides. + if not ident['LFI']: continue + + # Get the important bits. + data = _extract_458_data(fname) + if data is None: continue + value, uncertainty = data + + # Make a group for this isomer. + name = ATOMIC_SYMBOL[ident['Z']] + str(ident['A']) + if ident['LISO'] != 0: + name += '_m' + str(ident['LISO']) + nuclide_group = out.create_group(name) + + # Write all the coefficients into one array. The first dimension gives + # the component (e.g. fragments or prompt neutrons); the second switches + # between value and uncertainty; the third gives the polynomial order. + n_coeffs = len(value['EFR']) + data_out = np.zeros((len(labels), 2, n_coeffs)) + for i, label in enumerate(labels): + data_out[i, 0, :] = value[label.decode()] + data_out[i, 1, :] = uncertainty[label.decode()] + nuclide_group.create_dataset('data', data=data_out) + + out.close() + + +class FissionEnergyRelease(object): + """Energy relased by fission reactions. + + Energy is carried away from fission reactions by many different particles. + The attributes of this class specify how much energy is released in the form + of fission fragments, neutrons, photons, etc. Each component is also (in + general) a function of the incident neutron energy. + + Following a fission reaction, most of the energy release is carried by the + daughter nuclei fragments. These fragments accelerate apart from the + Coulomb force on the time scale of ~10^-20 s [1]. Those fragments emit + prompt neutrons between ~10^-18 and ~10^-13 s after scission (although some + prompt neutrons may come directly from the scission point) [1]. Prompt + photons follow with a time scale of ~10^-14 to ~10^-7 s [1]. The fission + products then emit delayed neutrons with half lives between 0.1 and 100 s. + The remaining fission energy comes from beta decays of the fission products + which release beta particles, photons, and neutrinos (that escape the + reactor and do not produce usable heat). + + Use the class methods to instantiate this class from an HDF5 or ENDF + dataset. The :meth:`FissionEnergyRelease.from_hdf5` method builds this + class from the usual OpenMC HDF5 data files. + :meth:`FissionEnergyRelease.from_endf` uses ENDF-formatted data. + :meth:`FissionEnergyRelease.from_compact_hdf5` uses a different HDF5 format + that is meant to be compact and store the exact same data as the ENDF + format. Files with this format can be generated with the + :func:`openmc.data.write_compact_458_library` function. + + References + ---------- + [1] D. G. Madland, "Total prompt energy release in the neutron-induced + fission of ^235U, ^238U, and ^239Pu", Nuclear Physics A 772:113--137 (2006). + <http://dx.doi.org/10.1016/j.nuclphysa.2006.03.013> + + Attributes + ---------- + fragments : Callable + Function that accepts incident neutron energy value(s) and returns the + kinetic energy of the fission daughter nuclides (after prompt neutron + emission). + prompt_neutrons : Callable + Function of energy that returns the kinetic energy of prompt fission + neutrons. + delayed_neutrons : Callable + Function of energy that returns the kinetic energy of delayed neutrons + emitted from fission products. + prompt_photons : Callable + Function of energy that returns the kinetic energy of prompt fission + photons. + delayed_photons : Callable + Function of energy that returns the kinetic energy of delayed photons. + betas : Callable + Function of energy that returns the kinetic energy of delayed beta + particles. + neutrinos : Callable + Function of energy that returns the kinetic energy of neutrinos. + recoverable : Callable + Function of energy that returns the kinetic energy of all products that + can be absorbed in the reactor (all of the energy except for the + neutrinos). + total : Callable + Function of energy that returns the kinetic energy of all products. + q_prompt : Callable + Function of energy that returns the prompt fission Q-value (fragments + + prompt neutrons + prompt photons - incident neutron energy). + q_recoverable : Callable + Function of energy that returns the recoverable fission Q-value + (total release - neutrinos - incident neutron energy). This value is + sometimes referred to as the pseudo-Q-value. + q_total : Callable + Function of energy that returns the total fission Q-value (total release + - incident neutron energy). + + """ + def __init__(self): + self._fragments = None + self._prompt_neutrons = None + self._delayed_neutrons = None + self._prompt_photons = None + self._delayed_photons = None + self._betas = None + self._neutrinos = None + + @property + def fragments(self): + return self._fragments + + @property + def prompt_neutrons(self): + return self._prompt_neutrons + + @property + def delayed_neutrons(self): + return self._delayed_neutrons + + @property + def prompt_photons(self): + return self._prompt_photons + + @property + def delayed_photons(self): + return self._delayed_photons + + @property + def betas(self): + return self._betas + + @property + def neutrinos(self): + return self._neutrinos + + @property + def recoverable(self): + return Sum([self.fragments, self.prompt_neutrons, self.delayed_neutrons, + self.prompt_photons, self.delayed_photons, self.betas]) + + @property + def total(self): + return Sum([self.fragments, self.prompt_neutrons, self.delayed_neutrons, + self.prompt_photons, self.delayed_photons, self.betas, + self.neutrinos]) + + @property + def q_prompt(self): + return Sum([self.fragments, self.prompt_neutrons, self.prompt_photons, + lambda E: -E]) + + @property + def q_recoverable(self): + return Sum([self.recoverable, lambda E: -E]) + + @property + def q_total(self): + return Sum([self.total, lambda E: -E]) + + @fragments.setter + def fragments(self, energy_release): + cv.check_type('fragments', energy_release, Callable) + self._fragments = energy_release + + @prompt_neutrons.setter + def prompt_neutrons(self, energy_release): + cv.check_type('prompt_neutrons', energy_release, Callable) + self._prompt_neutrons = energy_release + + @delayed_neutrons.setter + def delayed_neutrons(self, energy_release): + cv.check_type('delayed_neutrons', energy_release, Callable) + self._delayed_neutrons = energy_release + + @prompt_photons.setter + def prompt_photons(self, energy_release): + cv.check_type('prompt_photons', energy_release, Callable) + self._prompt_photons = energy_release + + @delayed_photons.setter + def delayed_photons(self, energy_release): + cv.check_type('delayed_photons', energy_release, Callable) + self._delayed_photons = energy_release + + @betas.setter + def betas(self, energy_release): + cv.check_type('betas', energy_release, Callable) + self._betas = energy_release + + @neutrinos.setter + def neutrinos(self, energy_release): + cv.check_type('neutrinos', energy_release, Callable) + self._neutrinos = energy_release + + @classmethod + def _from_dictionary(cls, energy_release, incident_neutron): + """Generate fission energy release data from a dictionary. + + Parameters + ---------- + energy_release : dict of str to list of float + Dictionary that gives lists of coefficients for each energy + component. The keys are the 2-3 letter strings used in ENDF-102, + e.g. 'EFR' and 'ET'. The list will have a length of 1 for Sher-Beck + data, more for polynomial data. + + incident_neutron : openmc.data.IncidentNeutron + Corresponding incident neutron dataset + + Returns + ------- + openmc.data.FissionEnergyRelease + Fission energy release data + + """ + out = cls() + + # How many coefficients are given for each component? If we only find + # one value for each, then we need to use the Sher-Beck formula for + # energy dependence. Otherwise, it is a polynomial. + n_coeffs = len(energy_release['EFR']) + if n_coeffs > 1: + out.fragments = Polynomial(energy_release['EFR']) + out.prompt_neutrons = Polynomial(energy_release['ENP']) + out.delayed_neutrons = Polynomial(energy_release['END']) + out.prompt_photons = Polynomial(energy_release['EGP']) + out.delayed_photons = Polynomial(energy_release['EGD']) + out.betas = Polynomial(energy_release['EB']) + out.neutrinos = Polynomial(energy_release['ENU']) + else: + # EFR and ENP are energy independent. Use 0-order polynomials to + # make a constant function. The energy-dependence of END is + # unspecified in ENDF-102 so assume it is independent. + out.fragments = Polynomial((energy_release['EFR'][0])) + out.prompt_photons = Polynomial((energy_release['EGP'][0])) + out.delayed_neutrons = Polynomial((energy_release['END'][0])) + + # EDP, EB, and ENU are linear. + out.delayed_photons = Polynomial((energy_release['EGD'][0], -0.075)) + out.betas = Polynomial((energy_release['EB'][0], -0.075)) + out.neutrinos = Polynomial((energy_release['ENU'][0], -0.105)) + + # Prompt neutrons require nu-data. It is not clear from ENDF-102 + # whether prompt or total nu value should be used, but the delayed + # neutron fraction is so small that the difference is negligible. + # MT=18 (n, fission) might not be available so try MT=19 (n, f) as + # well. + if 18 in incident_neutron.reactions: + nu_prompt = [p for p in incident_neutron[18].products + if p.particle == 'neutron' + and p.emission_mode == 'prompt'] + elif 19 in incident_neutron.reactions: + nu_prompt = [p for p in incident_neutron[19].products + if p.particle == 'neutron' + and p.emission_mode == 'prompt'] + else: + raise ValueError('IncidentNeutron data has no fission ' + 'reaction.') + if len(nu_prompt) == 0: + raise ValueError('Nu data is needed to compute fission energy ' + 'release with the Sher-Beck format.') + if len(nu_prompt) > 1: + raise ValueError('Ambiguous prompt value.') + if not isinstance(nu_prompt[0].yield_, Tabulated1D): + raise TypeError('Sher-Beck fission energy release currently ' + 'only supports Tabulated1D nu data.') + ENP = deepcopy(nu_prompt[0].yield_) + ENP.y = (energy_release['ENP'] + 1.307 * ENP.x + - 8.07 * (ENP.y - ENP.y[0])) + out.prompt_neutrons = ENP + + return out + + @classmethod + def from_endf(cls, filename, incident_neutron): + """Generate fission energy release data from an ENDF file. + + Parameters + ---------- + filename : str + Name of the ENDF file containing fission energy release data + + incident_neutron : openmc.data.IncidentNeutron + Corresponding incident neutron dataset + + Returns + ------- + openmc.data.FissionEnergyRelease + Fission energy release data + + """ + + # Check to make sure this ENDF file matches the expected isomer. + ident = identify_nuclide(filename) + if ident['Z'] != incident_neutron.atomic_number: + raise ValueError('The atomic number of the ENDF evaluation does ' + 'not match the given IncidentNeutron.') + if ident['A'] != incident_neutron.mass_number: + raise ValueError('The atomic mass of the ENDF evaluation does ' + 'not match the given IncidentNeutron.') + if ident['LISO'] != incident_neutron.metastable: + raise ValueError('The metastable state of the ENDF evaluation does ' + 'not match the given IncidentNeutron.') + if not ident['LFI']: + raise ValueError('The ENDF evaluation is not fissionable.') + + # Read the 458 data from the ENDF file. + value, uncertainty = _extract_458_data(filename) + + # Build the object. + return cls._from_dictionary(value, incident_neutron) + + @classmethod + def from_hdf5(cls, group): + """Generate fission energy release data from an HDF5 group. + + Parameters + ---------- + group : h5py.Group + HDF5 group to read from + + Returns + ------- + openmc.data.FissionEnergyRelease + Fission energy release data + + """ + + obj = cls() + + obj.fragments = Function1D.from_hdf5(group['fragments']) + obj.prompt_neutrons = Function1D.from_hdf5(group['prompt_neutrons']) + obj.delayed_neutrons = Function1D.from_hdf5(group['delayed_neutrons']) + obj.prompt_photons = Function1D.from_hdf5(group['prompt_photons']) + obj.delayed_photons = Function1D.from_hdf5(group['delayed_photons']) + obj.betas = Function1D.from_hdf5(group['betas']) + obj.neutrinos = Function1D.from_hdf5(group['neutrinos']) + + return obj + + @classmethod + def from_compact_hdf5(cls, fname, incident_neutron): + """Generate fission energy release data from a small HDF5 library. + + Parameters + ---------- + fname : str + Path to an HDF5 file containing fission energy release data. This + file should have been generated form the + :func:`openmc.data.write_compact_458_library` function. + + incident_neutron : openmc.data.IncidentNeutron + Corresponding incident neutron dataset + + Returns + ------- + openmc.data.FissionEnergyRelease or None + Fission energy release data for the given nuclide if it is present + in the data file + + """ + + fin = h5py.File(fname, 'r') + + components = [s.decode() for s in fin.attrs['component order']] + + nuclide_name = ATOMIC_SYMBOL[incident_neutron.atomic_number] + nuclide_name += str(incident_neutron.mass_number) + if incident_neutron.metastable != 0: + nuclide_name += '_m' + str(incident_neutron.metastable) + + if nuclide_name not in fin: return None + + data = {c: fin[nuclide_name + '/data'][i, 0, :] + for i, c in enumerate(components)} + + return cls._from_dictionary(data, incident_neutron) + + def to_hdf5(self, group): + """Write energy release data to an HDF5 group + + Parameters + ---------- + group : h5py.Group + HDF5 group to write to + + """ + + self.fragments.to_hdf5(group, 'fragments') + self.prompt_neutrons.to_hdf5(group, 'prompt_neutrons') + self.delayed_neutrons.to_hdf5(group, 'delayed_neutrons') + self.prompt_photons.to_hdf5(group, 'prompt_photons') + self.delayed_photons.to_hdf5(group, 'delayed_photons') + self.betas.to_hdf5(group, 'betas') + self.neutrinos.to_hdf5(group, 'neutrinos') + + if isinstance(self.prompt_neutrons, Polynomial): + # Add the polynomials for the relevant components together. Use a + # Polynomial((0.0, -1.0)) to subtract incident energy. + q_prompt = (self.fragments + self.prompt_neutrons + + self.prompt_photons + Polynomial((0.0, -1.0))) + q_prompt.to_hdf5(group, 'q_prompt') + q_recoverable = (self.fragments + self.prompt_neutrons + + self.delayed_neutrons + self.prompt_photons + + self.delayed_photons + self.betas + + Polynomial((0.0, -1.0))) + q_recoverable.to_hdf5(group, 'q_recoverable') + + elif isinstance(self.prompt_neutrons, Tabulated1D): + # Make a Tabulated1D and evaluate the polynomial components at the + # table x points to get new y points. Subtract x from y to remove + # incident energy. + q_prompt = deepcopy(self.prompt_neutrons) + q_prompt.y += self.fragments(q_prompt.x) + q_prompt.y += self.prompt_photons(q_prompt.x) + q_prompt.y -= q_prompt.x + q_prompt.to_hdf5(group, 'q_prompt') + q_recoverable = q_prompt + q_recoverable.y += self.delayed_neutrons(q_recoverable.x) + q_recoverable.y += self.delayed_photons(q_recoverable.x) + q_recoverable.y += self.betas(q_recoverable.x) + q_recoverable.to_hdf5(group, 'q_recoverable') + + else: + raise ValueError('Unrecognized energy release format') diff --git a/openmc/data/function.py b/openmc/data/function.py --- a/openmc/data/function.py +++ b/openmc/data/function.py @@ -1,3 +1,4 @@ +from abc import ABCMeta, abstractmethod from collections import Iterable, Callable from numbers import Real, Integral @@ -9,7 +10,51 @@ 4: 'log-linear', 5: 'log-log'} -class Tabulated1D(object): +class Function1D(object): + """A function of one independent variable with HDF5 support.""" + + __metaclass__ = ABCMeta + + @abstractmethod + def __call__(self): pass + + @abstractmethod + def to_hdf5(self, group, name='xy'): + """Write function to an HDF5 group + + Parameters + ---------- + group : h5py.Group + HDF5 group to write to + name : str + Name of the dataset to create + + """ + pass + + @classmethod + def from_hdf5(cls, dataset): + """Generate function from an HDF5 dataset + + Parameters + ---------- + dataset : h5py.Dataset + Dataset to read from + + Returns + ------- + openmc.data.Function1D + Function read from dataset + + """ + for subclass in cls.__subclasses__(): + if dataset.attrs['type'].decode() == subclass.__name__: + return subclass.from_hdf5(dataset) + raise ValueError("Unrecognized Function1D class: '" + + dataset.attrs['type'].decode() + "'") + + +class Tabulated1D(Function1D): """A one-dimensional tabulated function. This class mirrors the TAB1 type from the ENDF-6 format. A tabulated @@ -239,7 +284,7 @@ def to_hdf5(self, group, name='xy'): """ dataset = group.create_dataset(name, data=np.vstack( [self.x, self.y])) - dataset.attrs['type'] = np.string_('tab1') + dataset.attrs['type'] = np.string_(type(self).__name__) dataset.attrs['breakpoints'] = self.breakpoints dataset.attrs['interpolation'] = self.interpolation @@ -258,6 +303,10 @@ def from_hdf5(cls, dataset): Function read from dataset """ + if dataset.attrs['type'].decode() != cls.__name__: + raise ValueError("Expected an HDF5 attribute 'type' equal to '" + + cls.__name__ + "'") + x = dataset.value[0, :] y = dataset.value[1, :] breakpoints = dataset.attrs['breakpoints'] @@ -304,6 +353,42 @@ def from_ace(cls, ace, idx=0): return Tabulated1D(x, y, breakpoints, interpolation) +class Polynomial(np.polynomial.Polynomial, Function1D): + def to_hdf5(self, group, name='xy'): + """Write polynomial function to an HDF5 group + + Parameters + ---------- + group : h5py.Group + HDF5 group to write to + name : str + Name of the dataset to create + + """ + dataset = group.create_dataset(name, data=self.coef) + dataset.attrs['type'] = np.string_(type(self).__name__) + + @classmethod + def from_hdf5(cls, dataset): + """Generate function from an HDF5 dataset + + Parameters + ---------- + dataset : h5py.Dataset + Dataset to read from + + Returns + ------- + openmc.data.Function1D + Function read from dataset + + """ + if dataset.attrs['type'].decode() != cls.__name__: + raise ValueError("Expected an HDF5 attribute 'type' equal to '" + + cls.__name__ + "'") + return cls(dataset.value) + + class Sum(object): """Sum of multiple functions. diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -9,6 +9,7 @@ from .data import ATOMIC_SYMBOL, SUM_RULES from .ace import Table, get_table +from .fission_energy import FissionEnergyRelease from .function import Tabulated1D, Sum from .product import Product from .reaction import Reaction, _get_photon_products @@ -51,6 +52,9 @@ class IncidentNeutron(object): Atomic weight ratio of the target nuclide. energy : numpy.ndarray The energy values (MeV) at which reaction cross-sections are tabulated. + fission_energy : None or openmc.data.FissionEnergyRelease + The energy released by fission, tabulated by component (e.g. prompt + neutrons or beta particles) and dependent on incident neutron energy mass_number : int Number of nucleons in the nucleus metastable : int @@ -81,6 +85,7 @@ def __init__(self, name, atomic_number, mass_number, metastable, self.temperature = temperature self._energy = None + self._fission_energy = None self.reactions = OrderedDict() self.summed_reactions = OrderedDict() self.urr = None @@ -126,6 +131,10 @@ def atomic_weight_ratio(self): def energy(self): return self._energy + @property + def fission_energy(self): + return self._fission_energy + @property def temperature(self): return self._temperature @@ -186,6 +195,12 @@ def energy(self, energy): cv.check_type('energy grid', energy, Iterable, Real) self._energy = energy + @fission_energy.setter + def fission_energy(self, fission_energy): + cv.check_type('fission energy release', fission_energy, + FissionEnergyRelease) + self._fission_energy = fission_energy + @reactions.setter def reactions(self, reactions): cv.check_type('reactions', reactions, Mapping) @@ -276,6 +291,11 @@ def export_to_hdf5(self, path, mode='a'): urr_group = g.create_group('urr') self.urr.to_hdf5(urr_group) + # Write fission energy release data + if self.fission_energy is not None: + fer_group = g.create_group('fission_energy_release') + self.fission_energy.to_hdf5(fer_group) + f.close() @classmethod @@ -342,6 +362,11 @@ def from_hdf5(cls, group_or_filename): urr_group = group['urr'] data.urr = ProbabilityTables.from_hdf5(urr_group) + # Read fission energy release data + if 'fission_energy_release' in group: + fer_group = group['fission_energy_release'] + data.fission_energy = FissionEnergyRelease.from_hdf5(fer_group) + return data @classmethod diff --git a/openmc/data/product.py b/openmc/data/product.py --- a/openmc/data/product.py +++ b/openmc/data/product.py @@ -3,10 +3,9 @@ import sys import numpy as np -from numpy.polynomial.polynomial import Polynomial import openmc.checkvalue as cv -from .function import Tabulated1D +from .function import Tabulated1D, Polynomial, Function1D from .angle_energy import AngleEnergy if sys.version_info[0] >= 3: @@ -36,7 +35,7 @@ class Product(object): yield represents particles from prompt and delayed sources. particle : str What particle the reaction product is. - yield_ : float or openmc.data.Tabulated1D or numpy.polynomial.Polynomial + yield_ : openmc.data.Function1D Yield of secondary particle in the reaction. """ @@ -47,7 +46,7 @@ def __init__(self, particle='neutron'): self.emission_mode = 'prompt' self.distribution = [] self.applicability = [] - self.yield_ = 1 + self.yield_ = Polynomial((1,)) # 0-order polynomial i.e. a constant def __repr__(self): if isinstance(self.yield_, Real): @@ -119,8 +118,7 @@ def particle(self, particle): @yield_.setter def yield_(self, yield_): - cv.check_type('product yield', yield_, - (Real, Tabulated1D, Polynomial)) + cv.check_type('product yield', yield_, Function1D) self._yield = yield_ def to_hdf5(self, group): @@ -138,16 +136,7 @@ def to_hdf5(self, group): group.attrs['decay_rate'] = self.decay_rate # Write yield - if isinstance(self.yield_, Tabulated1D): - self.yield_.to_hdf5(group, 'yield') - dset = group['yield'] - dset.attrs['type'] = np.string_('tabulated') - elif isinstance(self.yield_, Polynomial): - dset = group.create_dataset('yield', data=self.yield_.coef) - dset.attrs['type'] = np.string_('polynomial') - else: - dset = group.create_dataset('yield', data=float(self.yield_)) - dset.attrs['type'] = np.string_('constant') + self.yield_.to_hdf5(group, 'yield') # Write applicability/distribution group.attrs['n_distribution'] = len(self.distribution) @@ -180,13 +169,7 @@ def from_hdf5(cls, group): p.decay_rate = group.attrs['decay_rate'] # Read yield - yield_type = group['yield'].attrs['type'].decode() - if yield_type == 'constant': - p.yield_ = group['yield'].value - elif yield_type == 'polynomial': - p.yield_ = Polynomial(group['yield'].value) - elif yield_type == 'tabulated': - p.yield_ = Tabulated1D.from_hdf5(group['yield']) + p.yield_ = Function1D.from_hdf5(group['yield']) # Read applicability/distribution n_distribution = group.attrs['n_distribution'] diff --git a/openmc/data/reaction.py b/openmc/data/reaction.py --- a/openmc/data/reaction.py +++ b/openmc/data/reaction.py @@ -5,13 +5,12 @@ from warnings import warn import numpy as np -from numpy.polynomial import Polynomial import openmc.checkvalue as cv from openmc.stats import Uniform from .angle_distribution import AngleDistribution from .angle_energy import AngleEnergy -from .function import Tabulated1D +from .function import Tabulated1D, Polynomial from .data import REACTION_NAME from .product import Product from .uncorrelated import UncorrelatedAngleEnergy @@ -465,7 +464,8 @@ def from_ace(cls, ace, i_reaction): idx = ace.jxs[11] + abs(ty) - 101 yield_ = Tabulated1D.from_ace(ace, idx) else: - yield_ = abs(ty) + # 0-order polynomial i.e. a constant + yield_ = Polynomial((abs(ty),)) neutron = Product('neutron') neutron.yield_ = yield_
diff --git a/tests/test_tallies/inputs_true.dat b/tests/test_tallies/inputs_true.dat --- a/tests/test_tallies/inputs_true.dat +++ b/tests/test_tallies/inputs_true.dat @@ -1 +1 @@ -930af242a043f2676a000dbc5a2db6b148edcb31ed8c87dbaa35a8efb37a3be8cff30cdf4dc03f9c5c7eb4021f7e4c3327e64681cdd8fd8722c95c69db850227 \ No newline at end of file +1bef757d276362fdcd9405096b4cdcbd894f9215ed406493486a45193729be446c9a12242c887f89b6e209ec5beaaacb04dee2fd61e72b4f5c6a8712b776ed6e \ No newline at end of file diff --git a/tests/test_tallies/results_true.dat b/tests/test_tallies/results_true.dat --- a/tests/test_tallies/results_true.dat +++ b/tests/test_tallies/results_true.dat @@ -1 +1 @@ -a51db2a4efc681805f85968e04411dc33beee0532c202f5179b9a82880ab60a75e53fa9141c81045ea1d2842372f2d8da900326f09382ea61dd80a3c9b43bba1 \ No newline at end of file +5a0f3f1ae244ada7d8c9f444d7a98c2589a9720e78174a276cf96162df6728bab6d534f136f65cb0386c3235eb7d5db47a0dd6504636ca77e7eb375e6978a84d \ No newline at end of file diff --git a/tests/test_tallies/test_tallies.py b/tests/test_tallies/test_tallies.py --- a/tests/test_tallies/test_tallies.py +++ b/tests/test_tallies/test_tallies.py @@ -123,8 +123,9 @@ def _build_inputs(self): t.filters = [cell_filter] t.scores = ['absorption', 'delayed-nu-fission', 'events', 'fission', 'inverse-velocity', 'kappa-fission', '(n,2n)', '(n,n1)', - '(n,gamma)', 'nu-fission', 'scatter', 'elastic', 'total', - 'prompt-nu-fission'] + '(n,gamma)', 'nu-fission', 'scatter', 'elastic', + 'total', 'prompt-nu-fission', 'fission-q-prompt', + 'fission-q-recoverable'] score_tallies[0].estimator = 'tracklength' score_tallies[1].estimator = 'analog' score_tallies[2].estimator = 'collision'
Energy-dependent prompt and recoverable fission Q-value tallies. This PR allows us to use the ENDF MT=1 MF=458 data in a tally. This tells us how much of the fission energy is carried by the fragments, the prompt neutrons, the prompt gammas, the delayed neutrons etc. It is also a function of incident neutron energy. ### Example results For now, I've just added two tallies, `q-fission-prompt` and `q-fission-recoverable`, but if desired we can make a tally for each species of outgoing fission particles. It will probably be handy for the purposes of depletion to be able to separate the prompt energy production from the delayed stuff that comes from later neutron and beta decays. It's nice to have the energy dependence, but it won't matter much for reactor calculations. The Q-value decreases about one-to-one with increasing neutron energy so the difference between fast and thermal reactors is only 0--1 MeV per fission. I ran some example problems to see what the Q-values for the big three actinides look like at different energies. I used a BEAVRS pincell with some Pu sprinkled in for a thermal spectrum. For a fast spectrum, I got an SFR pincell from the nice folks here at ANL NE. I also got a high energy spectrum by voiding a BEAVRS pincell and running it with a 14.1 MeV fixed source with vacuum BC's. Here's what the Q-values look like at these different energies (the listed tally score is divided by a fission tally to get the Q-value rather than a power) ``` nuclide score LWR SFR D-T U235 kappa-fission 193.41 +/- 0.14 193.41 +/- 0.08 193.41 +/- 0.08 U235 fission-q-prompt 180.55 +/- 0.13 180.30 +/- 0.07 168.75 +/- 0.07 U235 fission-q-recoverabl 193.39 +/- 0.14 193.09 +/- 0.08 179.60 +/- 0.08 U238 kappa-fission 197.79 +/- 0.11 197.79 +/- 0.12 197.79 +/- 0.09 U238 fission-q-prompt 178.29 +/- 0.10 178.51 +/- 0.11 169.55 +/- 0.07 U238 fission-q-recoverabl 194.57 +/- 0.11 194.82 +/- 0.12 184.23 +/- 0.08 Pu239 kappa-fission 198.90 +/- 0.15 198.90 +/- 0.07 198.90 +/- 0.08 Pu239 fission-q-prompt 188.41 +/- 0.14 188.01 +/- 0.07 175.01 +/- 0.07 Pu239 fission-q-recoverabl 198.89 +/- 0.15 198.43 +/- 0.07 183.52 +/- 0.08 ``` As you can see, the difference between fast and thermal is only about 200--500 keV. Strangely, there is a huge difference between `fission-q-recoverable` and `kappa-fission` for U238. I'll try to figure out why we have that difference before the PR is merged. (As a side note, the above uncertainties show a good example of when covariances matter. Check out the values and uncertainties on the kappa-fissions across the energies.) ### The data Unfortunately, this data isn't available in ACE files. We just got a shiny new HDF5 data format so we can stick the 458 data in there. But this means that the PythonAPI needs to be able to read the data from ENDF. I added that capability and tested it with ENDF/B-VII.1 and JEFF-3.2. But I think it would be mean to make our users download an entire ENDF neutron sublibrary just for the 458 data so I packaged the relevant data from ENDF/B-VII.1 into an HDF5 file and stuck it in the data directory. The `get_nndc_data.py` script will automatically read that HDF5 file and append the 458 data to our HDF5 cross sections. Unfortunately all this data handling really ballooned the LoC in this PR beyond what you'd expect. I used two different HDF5 formats. I have reasons for doing this, but I'm not 100% convinced it's the best way to go. The "compact" format that I used to store the ENDF/B-VII.1 data is basically just a direct translation from ENDF to HDF5. It's just a set of coefficients with all of the components still separate. The cross sections HDF5, however, uses data that's been summed up into prompt and recoverable components, stripped of uncertainties, and sometimes converted into tables. The reason I think those two formats should remain separate is because the "compact" one will not have to change until the ENDF format does, whereas we might change the one in our usual HDF5 files when we decide we to add new tallies or refactor the way we represent `Function1D`s. Of course, the downside is that it's rather confusing having two different formats. One small note: some 458 data requires nu. I've only implemented this functionality for nu values that are stored as a `Tabluated1D` although they can be stored as a `Polynomial`. There are only a few evaluations in ENDF/B-VII.1 that use polynomial nu (just Ra if I remember correctly), and those nuclides don't have 458 data available. Same must be true of JEFF-3.2 since the Python API didn't error out when I tried it. @paulromano: we'll need to update the data in your box for Travis to pass this. You can be my first usability tester :)
2016-08-08T16:00:39Z
[]
[]
openmc-dev/openmc
705
openmc-dev__openmc-705
[ "693", "701" ]
b34ba8c647eca8896c3fe989cec00258a7861673
diff --git a/openmc/data/thermal.py b/openmc/data/thermal.py --- a/openmc/data/thermal.py +++ b/openmc/data/thermal.py @@ -33,6 +33,7 @@ 'orthod': 'c_ortho_D', 'dortho': 'c_ortho_D', 'orthoh': 'c_ortho_H', 'hortho': 'c_ortho_H', 'ouo2': 'c_O_in_UO2', 'o2-u': 'c_O_in_UO2', 'o2/u': 'c_O_in_UO2', + 'sio2': 'c_SiO2', 'parad': 'c_para_D', 'dpara': 'c_para_D', 'parah': 'c_para_H', 'hpara': 'c_para_H', 'sch4': 'c_solid_CH4', 'smeth': 'c_solid_CH4', diff --git a/openmc/mgxs/mdgxs.py b/openmc/mgxs/mdgxs.py --- a/openmc/mgxs/mdgxs.py +++ b/openmc/mgxs/mdgxs.py @@ -793,7 +793,8 @@ def get_pandas_dataframe(self, groups='all', nuclides='all', df.rename(columns={'energyout low [MeV]': 'group out'}, inplace=True) - out_groups = np.tile(all_groups, int(df.shape[0] / all_groups.size)) + out_groups = np.repeat(all_groups, self.xs_tally.num_scores) + out_groups = np.tile(out_groups, int(df.shape[0] / out_groups.size)) df['group out'] = out_groups del df['energyout high [MeV]'] columns = ['group in', 'group out'] diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -548,12 +548,6 @@ def get_nuclide_density(self, nuclide): float The atomic number density (atom/b-cm) for the nuclide of interest - Raises - ------- - ValueError - When the density is requested for a nuclide which is not found in - the spatial domain. - """ cv.check_type('nuclide', nuclide, basestring) @@ -561,13 +555,7 @@ def get_nuclide_density(self, nuclide): # Get list of all nuclides in the spatial domain nuclides = self.domain.get_nuclide_densities() - if nuclide not in nuclides: - msg = 'Unable to get density for nuclide "{0}" which is not in ' \ - '{1} "{2}"'.format(nuclide, self.domain_type, self.domain.id) - ValueError(msg) - - density = nuclides[nuclide][1] - return density + return nuclides[nuclide][1] if nuclide in nuclides else 0.0 def get_nuclide_densities(self, nuclides='all'): """Get an array of atomic number densities in units of atom/b-cm for all @@ -1535,7 +1523,8 @@ def get_pandas_dataframe(self, groups='all', nuclides='all', df.rename(columns={'energyout low [MeV]': 'group out'}, inplace=True) - out_groups = np.tile(all_groups, int(df.shape[0] / all_groups.size)) + out_groups = np.repeat(all_groups, self.xs_tally.num_scores) + out_groups = np.tile(out_groups, int(df.shape[0] / out_groups.size)) df['group out'] = out_groups del df['energyout high [MeV]'] columns = ['group in', 'group out'] @@ -1573,6 +1562,10 @@ def get_pandas_dataframe(self, groups='all', nuclides='all', df['mean'] /= np.tile(densities, tile_factor) df['std. dev.'] /= np.tile(densities, tile_factor) + # Replace NaNs by zeros (happens if nuclide density is zero) + df['mean'].replace(np.nan, 0.0, inplace=True) + df['std. dev.'].replace(np.nan, 0.0, inplace=True) + # Sort the dataframe by domain type id (e.g., distribcell id) and # energy groups such that data is from fast to thermal if self.domain_type == 'mesh': diff --git a/openmc/volume.py b/openmc/volume.py --- a/openmc/volume.py +++ b/openmc/volume.py @@ -1,6 +1,7 @@ from collections import Iterable, Mapping from numbers import Real, Integral from xml.etree import ElementTree as ET +from warnings import warn import numpy as np import pandas as pd @@ -68,10 +69,26 @@ def __init__(self, domains, samples, lower_left=None, self.samples = samples if lower_left is not None: - self.lower_left = lower_left if upper_right is None: raise ValueError('Both lower-left and upper-right coordinates ' 'should be specified') + + # For cell domains, try to compute bounding box and make sure + # user-specified one is valid + if self.domain_type == 'cell': + for c in domains: + if c.region is None: + continue + ll, ur = c.region.bounding_box + if np.any(np.isinf(ll)) or np.any(np.isinf(ur)): + continue + if (np.any(np.asarray(lower_left) > ll) or + np.any(np.asarray(upper_right) < ur)): + warn("Specified bounding box is smaller than computed " + "bounding box for cell {}. Volume calculation may " + "be incorrect!".format(c.id)) + + self.lower_left = lower_left self.upper_right = upper_right else: if self.domain_type == 'cell':
diff --git a/tests/test_mgxs_library_no_nuclides/results_true.dat b/tests/test_mgxs_library_no_nuclides/results_true.dat --- a/tests/test_mgxs_library_no_nuclides/results_true.dat +++ b/tests/test_mgxs_library_no_nuclides/results_true.dat @@ -29,39 +29,39 @@ 1 10000 1 total 0.385188 0.026946 0 10000 2 total 0.412389 0.015425 material group in group out nuclide moment mean std. dev. -9 10000 1 1 total P0 -0.000207 0.000149 -11 10000 1 1 total P1 0.000234 0.000128 -13 10000 1 1 total P2 0.051870 0.006983 +12 10000 1 1 total P0 0.384199 0.027001 +13 10000 1 1 total P1 0.051870 0.006983 +14 10000 1 1 total P2 0.020069 0.002846 15 10000 1 1 total P3 0.009478 0.002234 8 10000 1 2 total P0 0.000989 0.000482 -10 10000 1 2 total P1 -0.000103 0.000184 -12 10000 1 2 total P2 0.384199 0.027001 -14 10000 1 2 total P3 0.020069 0.002846 -1 10000 2 1 total P0 0.016482 0.004502 -3 10000 2 1 total P1 -0.010499 0.010438 -5 10000 2 1 total P2 -0.000768 0.000768 +9 10000 1 2 total P1 -0.000207 0.000149 +10 10000 1 2 total P2 -0.000103 0.000184 +11 10000 1 2 total P3 0.000234 0.000128 +4 10000 2 1 total P0 0.000925 0.000925 +5 10000 2 1 total P1 -0.000768 0.000768 +6 10000 2 1 total P2 0.000494 0.000494 7 10000 2 1 total P3 -0.000171 0.000172 0 10000 2 2 total P0 0.411465 0.015245 -2 10000 2 2 total P1 0.006371 0.010551 -4 10000 2 2 total P2 0.000925 0.000925 -6 10000 2 2 total P3 0.000494 0.000494 +1 10000 2 2 total P1 0.016482 0.004502 +2 10000 2 2 total P2 0.006371 0.010551 +3 10000 2 2 total P3 -0.010499 0.010438 material group in group out nuclide moment mean std. dev. -9 10000 1 1 total P0 -0.000207 0.000149 -11 10000 1 1 total P1 0.000234 0.000128 -13 10000 1 1 total P2 0.051870 0.006983 +12 10000 1 1 total P0 0.384199 0.027001 +13 10000 1 1 total P1 0.051870 0.006983 +14 10000 1 1 total P2 0.020069 0.002846 15 10000 1 1 total P3 0.009478 0.002234 8 10000 1 2 total P0 0.000989 0.000482 -10 10000 1 2 total P1 -0.000103 0.000184 -12 10000 1 2 total P2 0.384199 0.027001 -14 10000 1 2 total P3 0.020069 0.002846 -1 10000 2 1 total P0 0.016482 0.004502 -3 10000 2 1 total P1 -0.010499 0.010438 -5 10000 2 1 total P2 -0.000768 0.000768 +9 10000 1 2 total P1 -0.000207 0.000149 +10 10000 1 2 total P2 -0.000103 0.000184 +11 10000 1 2 total P3 0.000234 0.000128 +4 10000 2 1 total P0 0.000925 0.000925 +5 10000 2 1 total P1 -0.000768 0.000768 +6 10000 2 1 total P2 0.000494 0.000494 7 10000 2 1 total P3 -0.000171 0.000172 0 10000 2 2 total P0 0.411465 0.015245 -2 10000 2 2 total P1 0.006371 0.010551 -4 10000 2 2 total P2 0.000925 0.000925 -6 10000 2 2 total P3 0.000494 0.000494 +1 10000 2 2 total P1 0.016482 0.004502 +2 10000 2 2 total P2 0.006371 0.010551 +3 10000 2 2 total P3 -0.010499 0.010438 material group in group out nuclide mean std. dev. 3 10000 1 1 total 1.0 0.078516 2 10000 1 2 total 1.0 0.687184 @@ -154,39 +154,39 @@ 1 10001 1 total 0.310121 0.033788 0 10001 2 total 0.296264 0.043792 material group in group out nuclide moment mean std. dev. -9 10001 1 1 total P0 0.000000 0.000000 -11 10001 1 1 total P1 0.000000 0.000000 -13 10001 1 1 total P2 0.038230 0.008484 +12 10001 1 1 total P0 0.310121 0.033788 +13 10001 1 1 total P1 0.038230 0.008484 +14 10001 1 1 total P2 0.020745 0.004696 15 10001 1 1 total P3 0.007964 0.003732 8 10001 1 2 total P0 0.000000 0.000000 -10 10001 1 2 total P1 0.000000 0.000000 -12 10001 1 2 total P2 0.310121 0.033788 -14 10001 1 2 total P3 0.020745 0.004696 -1 10001 2 1 total P0 -0.011214 0.016180 -3 10001 2 1 total P1 -0.003270 0.007329 -5 10001 2 1 total P2 0.000000 0.000000 +9 10001 1 2 total P1 0.000000 0.000000 +10 10001 1 2 total P2 0.000000 0.000000 +11 10001 1 2 total P3 0.000000 0.000000 +4 10001 2 1 total P0 0.000000 0.000000 +5 10001 2 1 total P1 0.000000 0.000000 +6 10001 2 1 total P2 0.000000 0.000000 7 10001 2 1 total P3 0.000000 0.000000 0 10001 2 2 total P0 0.296264 0.043792 -2 10001 2 2 total P1 0.008837 0.011504 -4 10001 2 2 total P2 0.000000 0.000000 -6 10001 2 2 total P3 0.000000 0.000000 +1 10001 2 2 total P1 -0.011214 0.016180 +2 10001 2 2 total P2 0.008837 0.011504 +3 10001 2 2 total P3 -0.003270 0.007329 material group in group out nuclide moment mean std. dev. -9 10001 1 1 total P0 0.000000 0.000000 -11 10001 1 1 total P1 0.000000 0.000000 -13 10001 1 1 total P2 0.038230 0.008484 +12 10001 1 1 total P0 0.310121 0.033788 +13 10001 1 1 total P1 0.038230 0.008484 +14 10001 1 1 total P2 0.020745 0.004696 15 10001 1 1 total P3 0.007964 0.003732 8 10001 1 2 total P0 0.000000 0.000000 -10 10001 1 2 total P1 0.000000 0.000000 -12 10001 1 2 total P2 0.310121 0.033788 -14 10001 1 2 total P3 0.020745 0.004696 -1 10001 2 1 total P0 -0.011214 0.016180 -3 10001 2 1 total P1 -0.003270 0.007329 -5 10001 2 1 total P2 0.000000 0.000000 +9 10001 1 2 total P1 0.000000 0.000000 +10 10001 1 2 total P2 0.000000 0.000000 +11 10001 1 2 total P3 0.000000 0.000000 +4 10001 2 1 total P0 0.000000 0.000000 +5 10001 2 1 total P1 0.000000 0.000000 +6 10001 2 1 total P2 0.000000 0.000000 7 10001 2 1 total P3 0.000000 0.000000 0 10001 2 2 total P0 0.296264 0.043792 -2 10001 2 2 total P1 0.008837 0.011504 -4 10001 2 2 total P2 0.000000 0.000000 -6 10001 2 2 total P3 0.000000 0.000000 +1 10001 2 2 total P1 -0.011214 0.016180 +2 10001 2 2 total P2 0.008837 0.011504 +3 10001 2 2 total P3 -0.003270 0.007329 material group in group out nuclide mean std. dev. 3 10001 1 1 total 1.0 0.108779 2 10001 1 2 total 0.0 0.000000 @@ -279,39 +279,39 @@ 1 10002 1 total 0.671269 0.026186 0 10002 2 total 2.035388 0.258060 material group in group out nuclide moment mean std. dev. -9 10002 1 1 total P0 0.008758 0.000926 -11 10002 1 1 total P1 -0.003785 0.000817 -13 10002 1 1 total P2 0.381167 0.016243 +12 10002 1 1 total P0 0.639901 0.024709 +13 10002 1 1 total P1 0.381167 0.016243 +14 10002 1 1 total P2 0.152392 0.008156 15 10002 1 1 total P3 0.009148 0.003889 8 10002 1 2 total P0 0.031368 0.001728 -10 10002 1 2 total P1 -0.002568 0.001014 -12 10002 1 2 total P2 0.639901 0.024709 -14 10002 1 2 total P3 0.152392 0.008156 -1 10002 2 1 total P0 0.509941 0.051236 -3 10002 2 1 total P1 0.024988 0.008312 -5 10002 2 1 total P2 0.000400 0.000401 +9 10002 1 2 total P1 0.008758 0.000926 +10 10002 1 2 total P2 -0.002568 0.001014 +11 10002 1 2 total P3 -0.003785 0.000817 +4 10002 2 1 total P0 0.000443 0.000445 +5 10002 2 1 total P1 0.000400 0.000401 +6 10002 2 1 total P2 0.000320 0.000321 7 10002 2 1 total P3 0.000214 0.000215 0 10002 2 2 total P0 2.034945 0.257800 -2 10002 2 2 total P1 0.111175 0.013020 -4 10002 2 2 total P2 0.000443 0.000445 -6 10002 2 2 total P3 0.000320 0.000321 +1 10002 2 2 total P1 0.509941 0.051236 +2 10002 2 2 total P2 0.111175 0.013020 +3 10002 2 2 total P3 0.024988 0.008312 material group in group out nuclide moment mean std. dev. -9 10002 1 1 total P0 0.008758 0.000926 -11 10002 1 1 total P1 -0.003785 0.000817 -13 10002 1 1 total P2 0.381167 0.016243 +12 10002 1 1 total P0 0.639901 0.024709 +13 10002 1 1 total P1 0.381167 0.016243 +14 10002 1 1 total P2 0.152392 0.008156 15 10002 1 1 total P3 0.009148 0.003889 8 10002 1 2 total P0 0.031368 0.001728 -10 10002 1 2 total P1 -0.002568 0.001014 -12 10002 1 2 total P2 0.639901 0.024709 -14 10002 1 2 total P3 0.152392 0.008156 -1 10002 2 1 total P0 0.509941 0.051236 -3 10002 2 1 total P1 0.024988 0.008312 -5 10002 2 1 total P2 0.000400 0.000401 +9 10002 1 2 total P1 0.008758 0.000926 +10 10002 1 2 total P2 -0.002568 0.001014 +11 10002 1 2 total P3 -0.003785 0.000817 +4 10002 2 1 total P0 0.000443 0.000445 +5 10002 2 1 total P1 0.000400 0.000401 +6 10002 2 1 total P2 0.000320 0.000321 7 10002 2 1 total P3 0.000214 0.000215 0 10002 2 2 total P0 2.034945 0.257800 -2 10002 2 2 total P1 0.111175 0.013020 -4 10002 2 2 total P2 0.000443 0.000445 -6 10002 2 2 total P3 0.000320 0.000321 +1 10002 2 2 total P1 0.509941 0.051236 +2 10002 2 2 total P2 0.111175 0.013020 +3 10002 2 2 total P3 0.024988 0.008312 material group in group out nuclide mean std. dev. 3 10002 1 1 total 1.0 0.038609 2 10002 1 2 total 1.0 0.067667 diff --git a/tests/test_mgxs_library_nuclides/results_true.dat b/tests/test_mgxs_library_nuclides/results_true.dat --- a/tests/test_mgxs_library_nuclides/results_true.dat +++ b/tests/test_mgxs_library_nuclides/results_true.dat @@ -1 +1 @@ -8142ae4e107002a835999e4ace85c17376f262a7059fc224f3756a2de19aba6ca4c4fa14ca2085c87d7729aa8d6d6f78fdae21ac6dfe33ca303449c769076074 \ No newline at end of file +e494320a213b5704a2ac915a2ba504857be91961ceb6735b6ad05d81eb31c44c9584d5bd9d40baececf1dcb5b030e6ecec63cfbd20639baf69bcb596c5c46591 \ No newline at end of file
Source distributed over fissionable zones It is possible to create a distributed source using the flag `only_fissionable=True` over zones with no fissionable isotopes in them. In this case, OpenMC currently hangs on `Initializing source particles...` indefinitely. If enough particles are rejected, it should probably raise an error and alert the user. Building with OpenMP without defining CC I recently updated to the latest version of develop and ran into an issue building on INL's Falcon supercomputer. In particular, the issue only occurs when building with OpenMP. When I try to configure and build with the following commands: ``` bash > FC=mpif90 CC=mpicc HDF5_ROOT=/path/to/phdf5 cmake -Dopenmp=on .. > make ``` I obtain the following error at link time: ``` bash [100%] Linking Fortran executable bin/openmc CMakeFiles/openmc.dir/src/cmfd_input.F90.o: In function `__cmfd_input_MOD_read_cmfd_xml': cmfd_input.F90:(.text+0x17da): undefined reference to `GOMP_parallel' CMakeFiles/openmc.dir/src/eigenvalue.F90.o: In function `__eigenvalue_MOD_join_bank_from_threads': eigenvalue.F90:(.text+0x269): undefined reference to `GOMP_parallel' CMakeFiles/openmc.dir/src/global.F90.o: In function `__global_MOD_free_memory': global.F90:(.text+0x118d): undefined reference to `GOMP_parallel' CMakeFiles/openmc.dir/src/initialize.F90.o: In function `__initialize_MOD_allocate_banks': initialize.F90:(.text+0x1e8f): undefined reference to `GOMP_parallel' CMakeFiles/openmc.dir/src/input_xml.F90.o: In function `__input_xml_MOD_read_ce_cross_sections': input_xml.F90:(.text+0x1eb5): undefined reference to `GOMP_parallel' CMakeFiles/openmc.dir/src/mgxs_data.F90.o:mgxs_data.F90:(.text+0x5cd): more undefined references to `GOMP_parallel' follow collect2: error: ld returned 1 exit status make[2]: *** [bin/openmc] Error 1 make[1]: *** [CMakeFiles/openmc.dir/all] Error 2 make: *** [all] Error 2 ``` After some trial and error I discovered that if I prepend `CC=mpicc` to the CMake command then the code compiles and links just fine. Has anyone else run into this? Is this an issue, or something that needs to be added to the documentation? I've not followed some of the major recent PRs (multipole, `openmc.data`) so I don't know what changed in the last two months to necessitate the use of `CC` when building OpenMC.
Thanks for reporting @tjlaboss! Should be an easy fix. The Faddeeva function used for multipole is written in C, which is likely the reason. Yeah, I thought that might be the case since I ran into some other issues when trying to use different compilers. Good point, we need to update the documentation for this.
2016-08-16T02:23:45Z
[]
[]